A Chinese LLM curriculum that makes you hand-write the boring parts
Six progressive coding tasks take you from scratch-built Transformer to a mini coding agent, with automated grading and LLM tutors watching your back.

What it does
This is a self-contained, six-task tutorial for developers who already know Python and deep learning basics but want to build LLMs and agents from the ground up. Each task runs 2–4 weeks: hand-write a Transformer, build a mini-GPT with RoPE and KV cache, run SFT and DPO alignment, wire up RAG, then graduate to tool-calling and coding agents. The whole thing is designed to run on modest hardware—8GB GPUs for the first four tasks, 16GB or quantized models for the last two.
The interesting bit
The pedagogy is “hand-write first, framework second.” You implement LoRA’s low-rank injection yourself before touching PEFT, and build KV cache before you get to use it from a library. Each task ships with an auto-grading harness (eval/run.py) that imports your code by expected function signatures and tells you whether your attention math is actually correct. There’s even a tutor_prompt.md per task: paste it with your code into Claude or Qwen for structured code review.
Key highlights
- Targets 2025–2026 stack; Qwen models throughout, Chinese-first with English where data quality demands it
- Companion textbook 《大模型与智能体》 (17 chapters, 2026) provides theory; this repo provides the sweat-equity implementation
- Tasks one through four run on an RTX 3060; Mac M-series falls back to MPS / llama.cpp
- Self-grading scripts check numerical correctness, recall, and task success—not just “did it run”
- Direct lineage from the well-regarded NLP-Beginner (2019), now rebuilt for the LLM era
Caveats
- README is thorough but dense; the “standard flow” table is buried under several heading levels
- Some tasks require hunting down your own datasets (DPO preference data, for instance) or toggling HF mirrors for China access
- Task six’s SWE-bench Lite integration is optional; the default is a toy repo, so expectations of “real” software engineering should be calibrated
Verdict
Worth your weekends if you learn by breaking things and fixing them. Skip it if you want a quick API-wrapping tutorial or need everything pre-packaged with one-click notebooks.
Frequently asked
- What is nndl/llm-beginner?
- Six progressive coding tasks take you from scratch-built Transformer to a mini coding agent, with automated grading and LLM tutors watching your back.
- Is llm-beginner open source?
- Yes — nndl/llm-beginner is open source, released under the MIT license.
- What language is llm-beginner written in?
- nndl/llm-beginner is primarily written in Python.
- How popular is llm-beginner?
- nndl/llm-beginner has 6.6k stars on GitHub.
- Where can I find llm-beginner?
- nndl/llm-beginner is on GitHub at https://github.com/nndl/llm-beginner.