JavaScript
6 stars
A minimal LLM pipeline that runs on a laptop, written from scratch in PyTorch and to be read: tokenizer, pretraining, inference, fine-tuning, RLHF and RLVR, with measured results and an interactive website.
### Overview:
A minimal language model pipeline designed to run on a laptop, from raw text to a tokenizer, pretraining, inference, fine-tuning, and reinforcement learning techniques.
### Key features:
- Tokenizer
- Model
- Pretraining
- Inference
- Fine-tuning
- Reinforcement Learning for Human Preferences (RLHF) and Verifiable Rewards (RLVR)
### Tech stack:
JavaScript
### Why it matters:
The pipeline is designed to be simple and accessible, making it suitable for developers and researchers alike. It includes all stages necessary for building and fine-tuning a language model, from raw text to a trained model that can be used with other tools.
### Repository:
GitHub: changkun/minllm
### GitHub stars:
6
### GitHub description:
A minimal pipeline for making a language model, small enough to run on a laptop and written to be read. It goes from raw text to a tokenizer, a pretrained model, an inference engine, a fine-tuned chat model, and a model post-trained with reinforcement learning, first from human preferences (RLHF) and then from verifiable rewards (RLVR), and ends with that model in the format that other tools run.
### Stages:
- **Tokenizer**: Byte-level BPE: training, encoding, decoding, special tokens
- **Model**: Decoder-only transformer with RMSNorm, RoPE, SwiGLU and grouped-query attention
- **Pretraining**: Data pipeline, AdamW, learning rate schedule, checkpoints: a model that writes stories