MiniMind: A Full-Stack LLM You Can Train From Scratch in Two Hours

The open-source MiniMind project packs pre-training, RLHF, tool use, and multimodal extensions into a 64-million-parameter model that costs roughly three yuan to train on a single GPU.
The Hype Is the Price Tag
In the current landscape of open-source AI, where the best-performing models are hundred-billion-parameter behemoths requiring clusters of high-end accelerators, MiniMind arrives with a deliberately absurd proposition: a 64-million-parameter chatbot trained from absolute zero in roughly two hours on a single RTX 3090, costing about three yuan—less than a cup of coffee. The project’s tagline, “大道至简” (The Great Way is Simple), is not merely poetic. It is a mission statement against the abstraction-heavy tutorials that dominate the space, where developers learn to fine-tune existing weights with LoRA but never touch the underlying machinery. MiniMind insists that this is like teaching Newton to use a smartphone: entertaining, but fundamentally missing the physics. The hype moment is not the model’s raw capability; it is the demonstration that the entire modern LLM lifecycle can be stripped down to a scale where an individual can own every byte of the pipeline.

This ethos lands at a cultural inflection point. Industry guides and course catalogs—from Google DeepMind’s “Build Your Own Small Language Model” curriculum to enterprise surveys of SLMs—are converging on the idea that smaller, inspectable models are the next practical frontier. MiniMind sits at the extreme end of this spectrum, two orders of magnitude smaller than many other “small” models, functioning less as a commercial product and more as a minimal viable laboratory.
Pedagogy Through PyTorch
What makes MiniMind genuinely special is its architectural honesty. The repository contains no calls to high-level training abstractions from popular third-party libraries. Instead, it offers native PyTorch implementations of pre-training, supervised fine-tuning, LoRA, DPO, PPO, GRPO, CISPO, and Agentic RL. The tokenizer is custom-trained with a vocabulary of only 6,400 tokens—a deliberate shrinkage compared to the 150,000-token vocabularies of larger open models—which keeps the embedding and output layers compact and trainable on modest hardware. The dense model aligns with the Qwen3 ecosystem, using Pre-Norm, RMSNorm, SwiGLU, and RoPE with YaRN length extrapolation, while a Mixture-of-Experts variant scales to 198M total parameters with 64M active. The documentation even warns that its naive MoE implementation carries significant kernel-launch overhead, running roughly fifty percent slower than the dense equivalent without fused operators. This kind of frank engineering detail is rare in tutorial repositories. It signals that the project is not polished marketing, but working research code designed to be read, modified, and broken.
Beneath the training scripts lies a subtle but valuable pedagogical insight. The project presents a unified framework for policy optimization, arguing that algorithms like DPO, PPO, GRPO, and CISPO are not distinct beasts but variations on a single expectation objective composed of a policy term, an advantage term, and a KL-regularization term. This perspective transforms the repository from a mere collection of scripts into a curriculum. A student can trace how offline preference pairs, clipped importance ratios, and group-relative baselines are simply different instantiations of the same mathematical skeleton. For a community awash in implementations that hide these relationships behind layers of library abstraction, this clarity is the project’s quiet intellectual contribution.
Beyond the Base Model
MiniMind has metastasized into a full research ecosystem. MiniMind-V adds vision-language capabilities, while MiniMind-O pushes into speech-native omni-model territory, accepting text, speech, and image inputs and returning streaming speech. The latter is documented in a technical report, which details a 0.1B-scale system using a MiniMind backbone as a “Thinker” and an independent four-layer “Talker,” with frozen encoders feeding lightweight MLP projectors. These are not weekend hacks; they represent genuine architectural experimentation at a scale where training remains accessible. The project also packages its models for the standard inference stack—vLLM, Ollama, llama.cpp, SGLang, and mobile engines—meaning a model born on a desktop GPU can eventually run on a phone.
Brutal Honesty in the Benchmarks
The documentation is refreshingly candid about the model’s limitations. The 64M base model hallucinates with aplomb, attributing the law of universal gravitation to Einstein and occasionally spiraling into repetitive semantic loops. On standard multiple-choice benchmarks, scores often hover near random chance, and English performance is deliberately sacrificed for Chinese-centric data. Yet the project extracts signal from these constraints. In head-to-head tool-use math tests, an Agentic RL-tuned variant correctly solved 85% of problems, compared to 60% for the standard supervised fine-tuned version. This neatly demonstrates the alignment tax: reinforcement learning can sharpen a narrow, verifiable capability while degrading general conversational stability and factual recall. The project presents this trade-off not as a failure, but as a core lesson of post-training.
Why the Landscape Needs a Toy This Complete
MiniMind’s greatest impact may be proving that the full stack—from tokenizer bytes to reward-model gradients—can still belong to a single person with a single GPU and an afternoon to spare. In a field increasingly dominated by API endpoints and trillion-parameter black boxes, it offers a rebuke to the idea that understanding AI requires a corporate cloud budget. The latest iterations point toward a decoupled future, separating the parameter-update engine from the rollout engine in Agentic RL training. This is the same architectural pattern that underpins industrial frameworks, but implemented with a transparency that makes it legible to a solo developer. Whether its descendants will ever compete on leaderboards is almost beside the point. MiniMind has already succeeded by making the modern LLM training pipeline comprehensible, affordable, and entirely inspectable.
Sources
- I built my own Small Language Model (SLM) from scratch
- The Best Open-Source LLMs in 2026
- MiniMind - Train LLMs from Scratch
- 50 days building a tiny language model from scratch, what I ...
- Top 7 open source LLMs for 2026
- MiniMind download
- Small Language Models: A Beginner's Guide
- Is there a way to "train" an open-source LLM to do one type ...
- jingyaogong
- 01 Build Your Own Small Language Model
- Best Open Source LLMs in 2026: We Reviewed 7 Models
- An Open Small-Scale Speech-Native Omni Model