Glintwell
Train your own

Train your own language model, step by step

You can train a small working language model on one graphics card in an afternoon. The same steps, scaled up, make the large ones. Here is the full path.

Sizes

Three sizes of project

Tiny: 10 to 100 million parameters
One consumer graphics card, a few hours to a day, a few billion tokens. It writes simple, fluent text and can follow a basic chat format. The best way to learn every step.
Small: 0.5 to 3 billion parameters
A machine with 8 data-center chips for days to weeks, hundreds of billions to a few trillion tokens. Useful on its own, and a strong student for distillation.
Large: 7 billion and up
Hundreds to thousands of chips for weeks or months, 10 trillion tokens or more. Needs everything on our pretraining page: parallelism, stability work and a team watching it.
Steps

The steps

  1. Choose your data. Start from a public, already-filtered web dataset plus code and math. For a tiny model, a few gigabytes of clean text is enough.
  2. Train a tokenizer on a sample of that data with byte-level byte-pair encoding. 6,000 tokens is enough for a tiny model; 100,000 or more for a multilingual one.
  3. Tokenize everything once and store it as packed arrays of numbers, so training reads it fast.
  4. Write the model: a decoder-only transformer with RMS normalization, gated feed-forward layers, rotary positions and grouped-query attention. A tiny model might have 8 layers and a width of 512.
  5. Pretrain: AdamW, warmup then warmup-stable-decay or cosine schedule, 16-bit math, gradient clipping. Watch the loss fall; save checkpoints.
  6. Mid-train on your best data as the learning rate falls.
  7. Fine-tune for chat on instruction examples in a fixed chat format, counting the loss only on answers.
  8. Prefer good answers: run direct preference optimization on pairs of better and worse answers.
  9. Add reasoning: distill reasoning from a teacher whose terms allow it, then run reinforcement learning with checkable math and code rewards.
  10. Evaluate on held-out tests and by reading outputs.
  11. Quantize and run it in 4-bit or 8-bit on your own computer.
  12. Share it: publish the weights, data recipe, settings and scores.
Compute

Working out the compute

training compute ≈ 6 × parameters × tokens

  • A 100-million-parameter model on 2 billion tokens needs about 1.2 × 1018 operations: hours on one modern graphics card.
  • A 1-billion-parameter model on 1 trillion tokens needs about 6 × 1021: weeks on 8 data-center chips.
  • Real speed is roughly 35 to 55 percent of the chips' peak. Plan for it.
  • Memory for training is about 16 to 20 bytes per parameter with AdamW in mixed precision, before activations. Sharding spreads it across chips.
Checklist

Before a big run

  • Test the full pipeline end to end on a tiny model first.
  • Fit a scaling curve from 4 or 5 small runs and predict the big one.
  • Decontaminate data against every test you will report.
  • Set up automatic checkpoints, restarts and alerts for loss spikes.
  • Write down every setting before you start, and publish it after.