Skip to content

Training an LLM from Scratch: A Project Spectrum from $0.4 to 65B

Sep 6, 20261 min
TL;DROpen-source projects have pushed the cost of training an LLM from scratch absurdly low: MiniMind runs the full PreTrain-to-RL pipeline for about $0.4 (2 hours on a single RTX 3090), while at the other end OLMo 3 and LLM360 K2 publish everything — data, code, and stage-by-stage checkpoints of 65B models. This series walks the whole project spectrum from $0.4 to 65B in 11 articles, and flags where the map is biased.
Table of Contents
  1. What this series covers
  2. Why train from scratch: the learning-vs-product tradeoff
  3. The cost spectrum
  4. Coverage matrix
  5. Bias note: what this map omits
  6. The arc (11 posts)
  7. How to read this
  8. Bottom line
  9. References

🌏 中文版

Calling an LLM through an API and training one from scratch are the two ends of the same map. Everyone has tried the former; a few years ago the latter was a "big-lab-only" activity — billion-dollar budgets and thousands of GPUs. MiniMind pulled that line down to about $0.4 (the cost of renting one RTX 3090 for two hours), while at the other end LLM360 K2 shows what "fully reproducible" looks like at industrial scale: 65B parameters, 1.4T tokens. This is the introduction to the "Training an LLM from Scratch" series (11 articles): first we define what we selected and why, then lay out the cost spectrum, the coverage matrix, and the bias annotations, and finally the learning path.

What this series covers

The population definition for "training an LLM from scratch": projects that publish the complete training pipeline — code plus data or a full recipe — where the model is pretrained from random initialization. We exclude three kinds of projects commonly mistaken for "from scratch": weight-only releases (models like Llama), fine-tuning only (Llama-Factory and the like), and pure inference frameworks. In other words, this series only includes projects where "you get every button" — training hyperparameters, the data recipe, and checkpoints at each stage.

Why train from scratch: the learning-vs-product tradeoff

The same motivation, "I want to understand LLMs," grows into two very different shapes at either end of the spectrum. This is the most important classification axis of the series:

  • Learning-oriented, typified by MiniMind: 64M parameters, about $0.4 and 2 hours, 56.8k stars, with the goal that "everyone can read every line of code." Its value is not the model itself — 64M is useless for any real task — but the decision chain it lays open: why 8 layers, why a 6,400-token vocabulary, why GRPO is more stable than PPO.
  • Product-oriented, typified by LLM360 K2 (65B / 1.4T tokens): the training goal is to compete with commercial models on real tasks, and "full reproducibility" is its biggest asset — for any training decision you want to verify, you can find the original code, data, and intermediate checkpoints.

In between there is a whole pricing ladder: learn algorithms from Karpathy's minimal codebases, learn data efficiency from YuLan-Mini, learn industrial transparency from the OLMo family. The decisive question is one sentence: is your question "why is this written this way," or "can this be reproduced"? — pick the cheap tutorial project for the former, and for the latter pick the most open project, not the cheapest one.

The cost spectrum

The same goal can cost six orders of magnitude differently: budget, parameter scale, and openness all shift together.

ProjectSizeBudgetDataPositioningSeries part
MiniMind64M~$0.4 / ~2h on one 3090full-stage Qwen3-style datafull-pipeline tutorial (PreTrain→SFT→RL)1
nanochat (same lineage as llm.c)GPT-2/GPT-3-small territory~$100 / ~4h on 8×H100; $300 = GPT-2 grade; $1,000/41h ≈ GPT-3-smallpublic data + time-to-GPT-2 racingminimal, single-node2
Chinese community: baby-llama2-chinese, ChatLM-mini-Chinese, Steel-LLM0.2B–1B4GB VRAM to 8×H800mostly Chinese corporaChinese-first teaching and long-run testing3
YuLan-Mini2.4Bacademic (1.08T tokens)data recipe + full W&B logsdata-efficiency research (ACL 2025 Oral)4
OLMo 3 (2025-11)7B / 32B (incl. Think 32B reasoning model)industrialDolma 3, ~6T tokensstage checkpoints, Apache 2.05
LLM360 K265Bindustrial1.4T tokensfully reproducible5
SmolLM33B11.2T tokens (full recipe published 2025-07)testing the data ceiling of small models—(covered in parts 5–6)

A few numbers worth remembering: Karpathy spent roughly $43,000 training GPT-2 in 2019; nanochat's "time to GPT-2" speedrun has squeezed that to the ~$100 level in under 4 hours (the early-2026 official record is ~$48 / 2 hours; spot pricing varies). YuLan-Mini reaches parity or better than 7–18T-token baselines on math and code with 1.08T tokens. SmolLM3 shows a 3B model can ingest 11.2T tokens without saturating — TinyLlama's 1.1B eating 3T without saturation was the precedent.

Coverage matrix

Framed as a matrix, you can see which dimensions this series has a dedicated part for and which only get a passing mention:

DimensionPopulation representativesSeries coverage
Extremely cheap teaching (<$10)MiniMind, baby-llama2-chinese✅ parts 1, 3
Minimal engineering ($100–1,000)nanochat, llm.c✅ part 2
Chinese-data-firstbaby-llama2-chinese, ChatLM-mini-Chinese, Steel-LLM✅ part 3
Data-efficiency researchYuLan-Mini✅ part 4
Industrial full opennessOLMo 3, LLM360 K2✅ part 5
Open recipe but smaller scaleSmolLM3, MiniCPM, etc.⚠️ partially covered
Retired research toolsPythia, TinyLlama⚠️ discussed below
National / multilingual sovereigntyApertus (Switzerland), LLM-jp (Japan)✅ part 7
Efficiency / edge / multimodalOpenELM (Apple), MiniCPM (OpenBMB)✅ part 8
From-scratch training frameworkLitGPT (Lightning AI)✅ part 9
Non-Transformer architecturesRWKV, Mamba family⚠️ contrast section in part 7

Retired cases: we mention Pythia (EleutherAI's 154-checkpoint research suite) and TinyLlama (1.1B, 3T tokens), not because they broke, but because they finished their job and retired gracefully — Pythia's value lies in the intermediate checkpoints it left for research; TinyLlama proved "small models can also eat tokens to saturation." They are "past-tense tools still in use," used here only as reference points.

Bias note: what this map omits

  • GitHub-star-selected population: selection leans heavily toward English and Chinese circles (GitHub's star mechanism inherently favors large language markets), so projects from non-English, non-mainstream communities are easily missed — LLM-jp has a complete Japanese ecosystem and high openness but did not make the cut on stars and mindshare alone. This is a known gap in this survey. (Update): this gap has been closed by part 7 — the two national-scale cases, Apertus and LLM-jp, are now part of the series.
  • Retired cases are only research-oriented Pythia/TinyLlama: "retired" here means "finished the job and got overtaken," not failed. Pythia's 154 checkpoints remain tools for studying learning dynamics; TinyLlama delivered the experiment "a 1B model trained on 3T tokens." Including them shows that obsolescence in this category usually means someone did something to completion.
  • Architecturally one-sided: every selection is a Transformer. RWKV and Mamba-style non-attention sequence models were once hot alternative paths but aren't part of the "fully open pipeline" selection here (or the main toolchains didn't follow) — for alternatives, CS336: Attention, MoE, and Mamba on this site is an existing match.

The arc (11 posts)

$0.4 ─────────────────────────────→ 65B (hundreds of thousands of dollars)
teaching / readability ────────→ product / reproducibility
English → Chinese → academic data-efficiency ──→ industrial transparency
orderArticleMain thread
0This introductionselection criteria, cost spectrum, bias
1MiniMind: train an LLM from scratch for $0.4 (published)full-pipeline teaching at the $0.4 grade
2Karpathy: nanochat, nanoGPT, and llm.cminimalism and the time-to-GPT-2 race
3Chinese community small-model trainingdata-first floor experience for Chinese
4YuLan-Mini: data-efficient pretraining1.08T vs larger budgets: recipe and ablations
5OLMo 3 and LLM360: fully open pretrainingcheckpoint-grade transparency and full reproducibility
6When to train an LLM from scratchdecision framework: fine-tuning vs RAG, and when NOT to
7National-team training: Apertus and LLM-jplanguage sovereignty and the compliance route
8Efficiency and edge: OpenELM and MiniCPMper-parameter performance and multimodal deployment
9The from-scratch framework: LitGPTabstraction-free from-scratch scaffolding
10Running MiniMind on RunPodthe only hands-on post: from renting a machine to chatting

How to read this

  • Hands-on readers: parts 1 (MiniMind) → 2 (Karpathy) → 3 (Chinese community). Run the README once and you will have first-hand experience with training "your own" model from scratch.
  • Research readers: parts 4 → 5. For a solid theoretical base, first read the CS336 overview — the reference course of this series — then come back for the cost and openness reality.
  • Decision-makers / budget holders: read part 6's decision framework first, then backfill the cases you need.
  • Policy / compliance angle: part 7. How non-English communities trade national-scale collaboration and data governance for sovereignty and legitimacy, with RWKV as the architecture contrast.
  • Efficiency / deployment angle: part 8. If you want to train from scratch under tight parameter budgets or for multimodal edge scenarios, OpenELM and MiniCPM are the loadout.
  • Framework angle: part 9. If you want mature tooling for a from-scratch rewrite instead of hand-writing every line, LitGPT is the entry point.

Each part is self-contained, but the arc's order follows the graduation of cost magnitude and data complexity; following it is the least tiring path.

Bottom line

The two ends of this spectrum answer different questions: MiniMind proves "cheap can teach," OLMo 3 / LLM360 prove "expensive can verify" — the common denominator is openness, just with different objects (code vs data + logs). The first published part is MiniMind; the rest climb the cost ladder, and the last part re-examines "when not to spend this money at all." The site's CS336 series and OLMo: full openness give you the theoretical base and the previous generation's full picture; Marin's 535B hero run shows another viable route for an individual pushing the limit. Any order works, but we suggest starting with MiniMind — it's the only one you can start on tonight.

References