hans0809/MiniMind-in-Depth
A line-by-line source code analysis tutorial for building the MiniMind lightweight language model from tokenizer to training pipelines.

This repository provides in-depth explanations of the MiniMind lightweight LLM implementation. It covers every stage of building a language model: tokenizer training, transformer architecture components (RMSNorm, RoPE, attention mechanisms), model building, and advanced training techniques including pretraining, supervised fine-tuning (SFT), LoRA, and DPO. Each module includes shape annotations, formula derivations, and rationale for architectural decisions.