Happy-LLM is an open-source, free large language model learning tutorial launched by the Datawhale community, aiming to help learners deeply understand the core principles and training process of LLMs and personally implement a complete large model. Starting from basic NLP research methods, the project goes progressively deeper along the ideas and principles of LLMs, analyzing the architectural foundations and training pipeline in turn, while conducting hands-on practice with mainstream code frameworks.
The tutorial content is divided into two parts: foundational knowledge and practical application. Chapters 1 to 4 cover foundational knowledge: Chapter 1 introduces basic NLP tasks and development; Chapter 2 explains the principles and code implementation of the Transformer architecture; Chapter 3 introduces classic pretrained language models (Encoder-Only, Encoder-Decoder, Decoder-Only) and mainstream LLM architectures; Chapter 4 formally enters LLMs, introducing their characteristics, capabilities, and overall training process. Chapters 5 to 8 cover practical application: Chapter 5 builds an LLM by hand based on PyTorch and implements the full pipeline of pretraining and supervised fine-tuning; Chapter 6 introduces the Transformers framework for efficient training; Chapter 7 introduces LLM evaluation, retrieval-augmented generation (RAG), and agents (Agent); Chapter 8 further introduces GRPO, OPD, and two types of Agentic RL practice, Search-R1 and ReTool.
In terms of usage, learners can read the tutorial in chapter order and reproduce the code. The project recommends having some Python programming experience and basic knowledge of deep learning and NLP. Before reproducing the code, it is necessary to read the study and environment preparation; the repository splits dependencies by chapter, and it is recommended to use separate Python environments for different chapters to reduce version conflicts. The project provides PDF tutorials (completely open-source and free, with the Datawhale open-source logo watermark), accompanying teaching handout PPT courseware resources, and a ModelScope Studio experience link.
Applicable scenarios include university students, researchers, and LLM enthusiasts systematically learning large model principles and training, and it can also serve as course teaching or self-study material. The project encourages readers to combine theory with practice, reproduce the code, and participate in LLM-related projects and competitions. In terms of limitations, the project requires readers to have some programming and deep learning foundation; some cutting-edge content (such as more Agentic RL algorithms, training code, and experimental practice) is continuously updated in another repository, agentic-rl-lab, and this repository's update frequency is relativelylower. The project uses the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.