SuperAPIAI Directory

datawhalechina/happy-llm: 📚 从零开始的大语言模型原理与实践教程

github.com · AI learning

Happy-LLM is a systematic large language model learning tutorial open-sourced by Datawhale, designed to help readers deeply understand LLM principles and train models hands-on. Starting from NLP fundamentals, the tutorial progressively explains the Transformer architecture, pretrained language models, and the full LLM training pipeline, and implements a complete LLaMA2 model based on the PyTorch and Transformers frameworks. The content covers cutting-edge technologies such as pretraining, supervised fine-tuning, PEFT, RAG, Agent, and GRPO, and is suitable for learners with some foundation in Python and deep learning. The project is completely free, providing PDF tutorials, PPT courseware, and code practice, along with a ModelScope Studio experience link.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

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.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools