A from-scratch PyTorch walkthrough and codebase for training a transformer LLM, covering pretraining, SFT, reward modeling, DPO/PPO/GRPO and generation.
changyeyu/LLM-RL-Visualized
A bilingual collection of 100+ original diagrams explaining LLM, RL, RLHF, DPO, GRPO and related large-model algorithms.
- Stars
- 4,958
- Forks
- 478
- Open issues
- 3
- Last commit
- last month
What is it?
This repository is a visual guide to large language model and reinforcement learning techniques. It contains more than 100 original architecture diagrams covering LLM and VLM structure, decoding strategies, pre-training and post-training pipelines, and fine-tuning methods such as LoRA, Prefix-Tuning and SFT.
The second half of the material focuses on alignment and reasoning: DPO and RLHF training layouts, PPO and GRPO, reward models, chain-of-thought distillation, MCTS and Best-of-N sampling. Classic RL foundations such as Markov decision processes, Monte Carlo and TD methods, DQN, policy gradient and actor-critic are also illustrated.
Diagrams are provided as high-resolution PNG and editable SVG files, with Chinese and English versions of the text. Each section is a self-contained figure, so readers can jump directly to a topic such as LoRA or GRPO.
Key features
- 01Over 100 original diagrams covering LLM, VLM and reinforcement learning topics
- 02Covers fine-tuning methods including LoRA, Prefix-Tuning and SFT
- 03Explains alignment algorithms such as RLHF, DPO, PPO and GRPO
- 04Includes reasoning-oriented topics like chain-of-thought distillation, MCTS and Best-of-N
- 05Provides SVG vector files and high-resolution PNGs in Chinese and English
Use cases
- Building a visual mental model of how LLM training pipelines fit together
- Studying the difference between PPO, GRPO and DPO before implementing one
- Reviewing reinforcement learning fundamentals for someone entering LLM alignment work
- Preparing slides or lecture material that needs clear algorithm diagrams
Things to know
- The license could not be identified (listed as NOASSERTION), so reuse terms are unclear.
Topics
FAQ
- What is LLM-RL-Visualized?
- A bilingual collection of 100+ original diagrams explaining LLM, RL, RLHF, DPO, GRPO and related large-model algorithms. This repository is a visual guide to large language model and reinforcement learning techniques. It contains more than 100 original architecture diagrams covering LLM and VLM structure, decoding strategies, pre-training and post-training pipelines, and fine-tuning methods such as LoRA, Prefix-Tuning and SFT.
- Is LLM-RL-Visualized free to use? What license does it have?
- LLM-RL-Visualized is open source under the Other license. Check the license terms before using it in commercial products.
- Is LLM-RL-Visualized still maintained?
- Updated within 6 months. The last commit to LLM-RL-Visualized was on Sep 10, 2026.
- What can I use LLM-RL-Visualized for?
- Building a visual mental model of how LLM training pipelines fit together Studying the difference between PPO, GRPO and DPO before implementing one Reviewing reinforcement learning fundamentals for someone entering LLM alignment work Preparing slides or lecture material that needs clear algorithm diagrams
- Where can I get LLM-RL-Visualized?
- The source code and installation instructions are on GitHub: https://github.com/changyeyu/LLM-RL-Visualized
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source desktop app and web UI for running, fine-tuning and exporting LLMs and diffusion models locally, plus a code-based training library.
Unified framework for efficiently fine-tuning 100+ LLMs and VLMs with a zero-code CLI and Web UI.
A free, open-source framework for fine-tuning and post-training large language models, configured through YAML files.
A free, MIT-licensed course of 542 lessons that builds AI engineering concepts from scratch in Python, TypeScript, Rust and Julia.
A Chinese-language open tutorial that teaches LLM principles by building a small LLaMA2-style model from scratch, covering Transformer, pretraining, fine-tuning, RAG and agents.