Dive into LLMs: guided hands-on practice for learning large language models
Lordog/dive-into-llms · 55,245★ · 6,588 forks
Everything worth knowing about Lordog/dive-into-llms: a free course, mostly in Chinese, that turns large-language-model topics into notes, notebooks, and reproducible exercises.
What Dive into LLMs is
Dive into LLMs is a series of hands-on coding tutorials on large language models. The repository gathers slides, per-chapter guides, and Jupyter notebooks; its stated goal is to offer a starting reference through simple hands-on exercises for students preparing coursework or research projects.
The material comes from Shanghai Jiao Tong University’s courses on natural-language-processing technologies and AI safety. The README describes it as free and public; it isn’t a library you install as a package, nor a pretrained model.

The origin: from university notes to an open course
The repository was created on April 8, 2024. Its owner, Tongxin Yuan (Lordog), identifies on GitHub as a master’s student focused on model safety and agentic AI, affiliated with Shanghai Jiao Tong University.
Authorship is collective. The README credits a team of instructors and students from Shanghai Jiao Tong University, plus collaborators from the National University of Singapore. Among them is Zhuosheng Zhang, listed as instructor for the source courses.

The June 6, 2025 update expanded the course with topics on mathematical reasoning, GUI agents, alignment, and steganography. It also announced a companion course, built with Huawei’s Ascend community, covering the full large-language-model development cycle with materials, lab manuals, and video.
Philosophy and principles
The pitch favors practice over a purely conceptual introduction:
- Gradual entry: each topic links explanation, slides, and runnable code.
- Learn by modifying: the first chapter distinguishes a decoupled, customizable version from a more integrated one, so beginners can change data loading, architecture, and metrics.
- Lifecycle coverage: it combines fine-tuning, inference, deployment, evaluation, safety, and alignment instead of limiting itself to consuming an API.
- Open access: the course presents itself as free and accepts issues and pull requests as improvement mechanisms.

It doesn’t claim to replace academic training or guarantee results: the repository’s notice warns that content comes from contributor experience, public data, and research work, and that the techniques are for reference only.
How it works
The unit of learning is a chapter under documents/: each usually ships a PDF, a README, and a notebook. The main index covers fine-tuning and deployment; prompt engineering and chain-of-thought reasoning; knowledge editing; mathematical reasoning; watermarking; jailbreak attacks; steganography; multimodal models; GUI agents; agent safety; and alignment via reinforcement learning from human feedback.

The first chapter works with Transformers, fine-tuning, and inference, and suggests deploying demos with Gradio Spaces. The mathematical-reasoning chapter uses supervised fine-tuning to distill DeepSeek-R1 answers over the DeepMath-103K dataset and the Qwen2.5-Math-1.5B model; the notebook walks through downloading and preparing data, training, generation, and evaluation.

The GUI-agents chapter uses Qwen2-VL-7B, the OS-Kairos dataset, and LLaMA-Factory for a supervised fine-tuning exercise. The alignment chapter illustrates PPO with GPT-2, a BERT classifier as reward, and IMDB data.
Official and semi-official status
No evidence was retrieved that the repository has been accepted into an official plugin, SDK, or extension marketplace. Its verifiable standing is that of open teaching material maintained on GitHub.
The collaboration with Huawei’s Ascend community is semi-official in an educational sense: the README announces a joint course and links Ascend’s learning page. That shows support and distribution for the companion course, not a Huawei certification of everything in the repository, nor an industry standard.

The ecosystem
Material and repositories by the author
Searching Lordog’s public repositories turned up three additional projects: Lordog/R-Judge, a benchmark for evaluating security-risk awareness in agents; Lordog/agent-guardrail; and a fork of OpenDevin. Only R-Judge has a clear thematic relationship to agent safety; it isn’t presented in the sources as a dependency of Dive into LLMs.
The course also links external resources for specific exercises: Transformers and Gradio Spaces in the fine-tuning chapter, and Huawei’s Ascend course for the full-development extension.
Forks, translations, and community extensions
Searching by exact name and the fork list identified an English translation, hhprojects/dive-into-llms-en, whose description explicitly states it translates Lordog/dive-into-llms; it had 17 stars at query time. N1j1k4/llms- also turned up, described as study notes derived from the course, with 7 stars.
Among the most visible forks, cooelf/dive-into-llms describes itself as a beginner tutorial and had 27 stars. The remaining forks reviewed kept the original description or didn’t document a distinct adaptation, so they’re classified as forks, not independent ports.
There’s a proposed Turkish translation in issue 41 with an associated pull request, but no merged Turkish translation was retrieved on the main branch.
Repo numbers
Measured: August 9, 2026, GitHub API.
| Metric | Value |
|---|---|
| Stars | 48,524 |
| Forks | 5,811 |
| Subscribers | 299 |
| Open issues reported by the API | 14 |
| Primary language | Jupyter Notebook |
| License | Not declared by the API |
| Created | April 8, 2024 |
| Latest release | v1, June 12, 2025 |
| Last code push | October 10, 2025 |

The top contributors retrieved by contribution count were Lordog (31), cooelf (15), zwhe99 (8), and dongdongzhaoUP (6). The API returned updated_at as August 10, 2026, a date later than the day of this measurement; that’s transcribed as a metadata anomaly, without inferring future activity.
open_issues_count can include open pull requests. Also, watchers_count in the general response mirrors the star count; that’s why the table uses subscribers_count for real subscribers.
How to contribute
No CONTRIBUTING.md, pull-request template, or detailed branching policy was retrieved at the root or under .github/. The README does state the project is ongoing, invites issues and pull requests, and credits its contributors.
In practice, a verifiable contribution should start from a fork, modify the relevant chapter, and open a pull request; the retrieved pull-request list includes path fixes, dependency compatibility, and a Turkish translation preview. That’s a description of the usual GitHub flow backed by existing pull requests, not a formal contribution guide published by the project.
How the community received it
The strongest reception signal is GitHub adoption: 48,524 stars and 5,811 forks at the current measurement. Issues show concrete needs from people trying to run the material: broken download links, MPS incompatibility on macOS, a version conflict between pinned trl and transformers, questions about lab manuals, and a request for a Turkish translation.

No verifiable direct thread about this repository was found on Hacker News. Searching for “dive-into-llms” returns posts about Andrej Karpathy’s video and other same-named content, not about Lordog/dive-into-llms; its 582 points and 46 comments shouldn’t be attributed to the course.
Reddit blocked the automated search with a 403 response; X required authentication and Product Hunt returned 403. So no absence of posts on those platforms is claimed, only that no retrievable evidence was obtained. The YouTube search returned a results page, but it didn’t allow individually validating a video whose title or description named this repository; titles and view counts are omitted. No verifiable articles were retrieved on Dev.to, Hashnode, blogs, published packages, or podcasts specifically about the course either.
Dive into LLMs versus other approaches
| Approach | Verifiable overlap | Verifiable difference |
|---|---|---|
hhprojects/dive-into-llms-en | Declares itself the English translation of this course. | It’s a separate community translation, not the main branch. |
| Ascend’s language-model development course | Shares the hands-on training approach, and the README presents it as a joint extension. | Its distribution and materials are hosted on Ascend’s community; no evidence was retrieved that it replaces this repository’s notebooks. |
Lordog/R-Judge | Shares an agent-safety focus with some chapters. | The repository’s description defines it as a risk-evaluation benchmark, while Dive into LLMs is a multi-topic course. |
No performance comparisons are included: the retrieved sources don’t provide a common evaluation across these approaches.
Quick-start guide
Installation and first run
- Clone the repository and enter it:
git clone https://github.com/Lordog/dive-into-llms.git
cd dive-into-llms
- For the first chapter, the guide suggests creating and activating a Conda environment with Python 3.9 and installing Transformers:
conda create -n llm python=3.9
conda activate llm
pip install transformers
Afterward, the material points to downloading the files from Transformers’ text-classification example and running pip install -r requirements.txt; if GPU is needed, it recommends installing PyTorch with conda install pytorch, since a domestic mirror can install a CPU-only build.
- Open a chapter’s README and run its notebook. For example, for mathematical reasoning:
jupyter notebook sft_math.ipynb
The notebook walks through downloading data, loading and training, generation, and evaluation.
Common workflows
- Fine-tune and deploy a classifier: follow
documents/chapter1/README.md, start from the text-classification example, and adapt the data, model, and metrics modules of the decoupled version. - Test prompting and chain-of-thought reasoning: open chapter 2, get an API key from a documented provider, and run the example call with the model named in the chapter itself.
- Distill mathematical reasoning: open
documents/chapter4/sft_math.ipynb; the expected output includes training checkpoints and generation results. - Reproduce the PPO alignment example: open the chapter-11 notebook, download the models and dataset with the
huggingface-cli downloadcommands given there, and run the GPT-2 experiment with sentiment reward.
Essential configuration
documents/chapter1/README.md: guide for preparing the environment and choosing the decoupled or integrated variant.documents/chapter4/sft_math.ipynb: notebook for the mathematical-reasoning experiment.HF_ENDPOINT: chapter 11 sets it tohttps://hf-mirror.combefore usinghuggingface-cli download; it serves as a download mirror.CUDA_VISIBLE_DEVICES: the RLHF notebook shows this setting as an example for selecting a GPU.- Local data, model, and checkpoint paths: the training chapters require setting these to match your own setup; chapter 4 asks for at least 50 GB of disk space and a GPU with at least 40 GB of video memory.
Common pitfalls and fixes
- PyTorch without GPU acceleration: the guide warns that a package mirror can install a CPU-only version; use
conda install pytorchwhen you need GPU. - Insufficient resources for the math chapter: the chapter itself requires at least 40 GB of video memory and 50 GB of disk; use an environment with those resources before starting the notebook.
- Outdated links or dependencies: issues log broken download links and a version clash between
trlandtransformers. Check recent issues and pull requests before pinning versions on your own. - macOS MPS incompatibility: there’s a specific issue for this; the retrieved source confirms the problem but not a confirmed official fix.
Integrations and migration
The course integrates Transformers, Gradio Spaces, Hugging Face, Qwen, LLaMA-Factory, and the Ascend platform within specific chapters. No migration guide from another course or toward another tool was retrieved: the documented way to reuse the material is to run or adapt the notebooks and their data and model files.
Use cases and who this repository can help
- Students and instructors who need open hands-on material for a course can use the chapters as a lab foundation, since the repository connects explanation, PDF, and notebook across topics from fine-tuning to safety.
- Researchers or engineers starting with fine-tuning can use the first chapter’s decoupled variant to locate and modify data loading, architecture, and evaluation before adopting a more integrated flow.
- Teams with GPU infrastructure can run the mathematical-distillation walkthrough, with explicit video-memory and storage requirements, to observe training, generation, and evaluation in the same notebook.
- People working on safety and agents can complement the general introduction with the chapters on jailbreak attacks, agent safety, and alignment; they should still treat them as learning material and respect the project’s notice that it doesn’t guarantee accuracy.
- Developers in the Ascend ecosystem can find an additional learning path in the joint course linked by the project.

Resources
- Repository: https://github.com/Lordog/dive-into-llms
- Documentation and setup: https://github.com/Lordog/dive-into-llms/blob/main/documents/chapter1/README.md
- Chapters and notebooks: https://github.com/Lordog/dive-into-llms/tree/main/documents
- Companion Ascend course: https://www.hiascend.com/edu/growth/lm-development
- Community English translation: https://github.com/hhprojects/dive-into-llms-en
- Community and issues: https://github.com/Lordog/dive-into-llms/issues
Note: this article combines documentation and repositories by Lordog, the GitHub API, and community sources retrieved on August 9, 2026. Figures change over time.
Comments