Knowledge Base · Learning paths
Large Language Model Learning Map: From Transformer to Today's Mainstream LLMs
The entire knowledge system of large language models can be condensed into one clear "subway map". The main line traces the evolution from Transformer to GPT-2, pre-training, InstructGPT, LLaMA, MoE, and today's reasoning models, while five branch lines (reasoning, training, alignment, architecture, and applications) let learners switch topics as needed. This structured framework helps you build a complete mental model and avoid fragmented learning.
Translated from Chinese by AI. Spotted an issue? Use the feedback button.
🔗 Original link: https://x.com/antiAIvo/status/2112187842...
NanoAI · X · @antiAIvo · 2026-10-19 22:23
📌 This article is reposted. All copyrights belong to the original author. Please refer to the original link for the full text.
Many people want to learn about large language models but get stuck at the very first step: they don’t know where to begin.
When they open online resources, they find materials on Transformers, RAG, Agents, fine-tuning, vLLM, and more. Each topic seems important on its own, but when put together, they still can’t form a complete picture.
The common outcome is: saving dozens of tutorials, skimming a few popular science articles, and feeling like they understand a bit of everything—yet when asked a specific question like “What exactly is the difference between LLaMA and GPT-2?”, they can’t give a clear answer.
The problem isn’t lack of effort—it’s the absence of a map.
That’s why I’ve turned the knowledge system of large language models into a subway map: one main line and five branch lines.
Everyone should ride the main line to the end—it represents the real evolutionary path of large language models over the past few years.
The branch lines are optional transfers based on your interests. Not everyone needs to ride them all.
Let’s go through them station by station.
Main Line: The Core Path Everyone Must Complete
Station 0: Prerequisites
You don’t need much: Python, PyTorch, linear algebra, and a bit of probability.
You don’t need to reach math-major level in linear algebra. Being able to understand matrix multiplication, vector dot products, and how tensor shapes change at each step is sufficient.
For PyTorch, you should be able to build a simple neural network and understand what tensors, nn.Module, and forward propagation mean.
The most common trap at this station is getting stuck here forever—wanting to master all the math before starting. Don’t. Learning while supplementing knowledge is the most efficient approach.
Station 1: Transformer (2017)
The paper is Attention Is All You Need. Almost every major large language model today grew out of this paper.
At this station, you need to understand:
- What self-attention is actually calculating
- The roles of Q, K, and V
- Why multi-head attention is used
- What problems residual connections and LayerNorm solve
- What the FFN does in each layer
- Why the model needs positional encoding (since it has no inherent sense of word order)
Recommended approach: First read illustrated articles or watch videos to build intuition, then go back and read the original paper. The original paper is very concise; reading it directly can be discouraging.
Station 2: GPT-2 (2019)
This is the most critical station on the entire route. You must get off the train here.
The original Transformer is an encoder-decoder architecture designed for translation. The GPT series keeps only the decoder, and the task is simplified to: predict the next token based on the previous ones.
The goal at this station is to implement a GPT-2 from scratch: from tokenization and embeddings, through attention mechanisms and Transformer blocks, to stacking multiple layers, and finally loading official pretrained weights so the model can actually generate text.
Why emphasize “from scratch”?
Because almost all so-called “new techniques” that come later are simply replacing parts within the GPT-2 architecture. Once you have a working GPT-2 in your mind, any new model you encounter can be compared against it: what did they change, and why?
Without this reference point, everything that follows can only be memorized by rote.
Station 3: Pretraining
At Station 2 you loaded someone else’s trained weights. Here you need to understand where those weights come from.
The core concepts are four things: loss function (cross-entropy), backpropagation, gradient descent, and the Adam optimizer. Use these to train a randomly initialized model until it can speak.
You don’t need to actually spend millions training a large model. Training a small GPT from scratch on a tiny dataset and watching the loss gradually decrease is enough to grasp the principles.
Station 4: The ChatGPT Moment (2022)
A pretrained model can only continue text. If you ask it a question, it may just generate three more similar questions instead of answering you.
The InstructGPT paper solves exactly this problem: turning a model that “can continue text” into one that “follows instructions.” The method has three steps: first, supervised fine-tuning on human-written Q&A data; then training a reward model to score responses; finally using reinforcement learning to steer the model toward higher-scoring answers.
ChatGPT is the product of this pipeline. At this station, you only need to understand the overall process. The details belong to the Alignment track.
Station 5: LLaMA (2023)
LLaMA was a watershed moment for open-source large language models. After it, the basic architecture of most open-source models became largely standardized.
Comparing LLaMA with GPT-2, the backbone is still the Transformer decoder, but several components were replaced: LayerNorm changed to RMSNorm, the FFN activation changed to SwiGLU, absolute positional encoding replaced with RoPE, and later versions introduced GQA (Grouped Query Attention) so multiple attention heads share KV caches, saving memory.
This is what was meant earlier by “replacing parts.” On the main line, you only need to know what was changed. The detailed explanation of each component belongs to the Architecture track.
Station 6: MoE — Sparse Mixture of Experts (2021–2024)
The bigger the model, the more powerful—but also the more computationally expensive. The MoE approach is: have a huge number of parameters, but activate only a small portion for each token.
The FFN is split into many “experts,” plus a router that decides which experts each token should be sent to. The total parameter count can be very large, yet the computation per forward pass remains modest.
On this route, three milestones are worth studying: Google’s Switch Transformer, which simplified routing to selecting just one expert per token; Mixtral, which brought MoE into the open-source community; and DeepSeek-V3, with 671 billion total parameters but only about 37 billion activated per token.
If you want to understand DeepSeek’s papers, this station is essential.
Station 7: Reasoning Models (2024–2025)
OpenAI’s o1 and DeepSeek-R1 represent the most recent major paradigm shift: let the model think before answering.
Before giving a final answer, the model generates a long chain of reasoning. This capability is primarily trained through reinforcement learning, especially on tasks where answers can be automatically verified, such as mathematics and code.
DeepSeek-R1’s paper reveals many details and serves as the best entry point for this station.
Final Destination: The Ability to Read New Papers Independently
Completing the main line doesn’t mean you know everything. But you will have gained one crucial ability: when a new model is released, you can clearly explain which stations it modifies, why those changes were made, and what problems they solve.
Models released in 2026 will, for the most part, still be improvements built upon several of the stations shown in this map. Once you’re familiar with the map, you’ll be able to understand new developments much faster.
Reaching this point means you have truly entered the field.
2. Five Branch Lines: Transfer by Interest
Inference Line: Ideal for those who care about speed and cost
Once the model is trained, how do you make it run fast and run cheaply? This is the direction engineers can pick up most easily and where they are most likely to find jobs.
KV Cache: Store the already-computed K and V to avoid recalculating everything from scratch for every new token.
FlashAttention: Reorganize the computation order of attention to reduce memory reads and writes.
PagedAttention: Borrow the paging concept from operating systems to manage KV Cache memory. This is the core innovation behind vLLM.
Quantization: Compress model weights from 16-bit down to 8-bit or even 4-bit.
Speculative Decoding: Let a small model draft tokens first, then have the large model verify them in batches.
Inference Frameworks: Such as vLLM and SGLang, which package the above techniques together.
Recommended entry point: Start with KV Cache. It’s the simplest and serves as the foundation for all subsequent optimizations.
Training Line: Ideal for those who want to understand why large models are so expensive
Scaling Laws: Given a fixed compute budget, how to optimally allocate parameters and data.
Data and Tokenization: Data cleaning, deduplication, and mixture ratios. This often has a bigger impact on performance than architectural changes.
Mixed Precision: Train with BF16 or even FP8 to save memory and increase speed.
Distributed Parallelism: When a model doesn’t fit on one GPU, how to split it using data parallelism, tensor parallelism, pipeline parallelism, and ZeRO.
Learning Rate Scheduling: Warmup + cosine decay — the fundamentals for stable large model training.
This line has the highest practical barrier. For most people, understanding the principles is sufficient.
Alignment Line: Ideal for those who want to do fine-tuning or understand R1
SFT (Supervised Fine-Tuning): Use question-answer data to teach the model to follow instructions.
LoRA and QLoRA: Train only a small set of additional parameters, enabling fine-tuning on a single consumer-grade GPU.
RLHF: Reward model + PPO — the method used by InstructGPT.
DPO: Skip the reward model and train directly on preference data of “good answers vs. bad answers.”
GRPO: A reinforcement learning method proposed by DeepSeek that doesn’t require a separate value model. It was used in the training of R1.
If you want to get hands-on, LoRA offers the best cost-performance entry point.
Architecture Line: Ideal for those who want to read and understand new model technical reports
This line is an expansion of “Changing Parts” at Station 5.
- Replace LayerNorm with RMSNorm
- Replace the original FFN activation with SwiGLU
- Replace absolute positional encoding with RoPE
- Use GQA (Grouped Query Attention) to let multiple heads share KV
- MLA is a method proposed by DeepSeek that compresses KV into lower dimensions, further reducing memory usage
- Long Context: How models handle hundreds of thousands or even millions of tokens
The learning method is straightforward: For each component, compare it against GPT-2 and ask three questions:
What was it before? What is it now? What problem does the change solve?
Application Line: Optional, but closest to real-world deployment
RAG (Retrieval-Augmented Generation): Let the model retrieve relevant documents before generating an answer.
Tool Calling: Enable the model to call external functions and APIs.
Agent: Let the model plan multiple steps, call tools, and complete complex tasks autonomously.
Multimodal: Enable the model to process images and audio.
I’ve marked this line as dashed, not because it’s unimportant, but because its relationship to the main track is different. The main track and the other four branch lines explain how the model itself works. The Application Line explains how to use the model.
If your goal is to build products, you can switch to this line relatively early. However, it’s recommended to at least reach Station 4 first. Otherwise, when you encounter problems, it will be hard to tell whether it’s due to the model’s capability limits or your own usage.
3. How to Ride This Train
Finally, here are three pieces of advice.
First, you must get off at the GPT-2 station.
It is the anchor point of the entire map. Implement it once by hand—even if the code is clumsy—everything that follows will have a clear reference point.
Second, you don’t need to get off at every station, but you should know where each one is.
Mastering all five branch lines thoroughly is the accumulation of experts in several different directions. For a typical learner, completing the main track and then deeply exploring one or two branch lines is already clearer than most people.
Third, when learning principles, calculate a small example by hand.
For example, take a three-token sentence with four-dimensional vectors and compute the entire attention process from start to finish. Doing it once on paper is more effective than reading ten popular science articles.
In terms of time: With a programming background, studying the main track seriously takes about two to three months. The branch lines are on-demand and have no endpoint, because new stations are being added in this field every month.
The complete map is shown below. Please save it. As you learn, come back and check your current position.
Note: This article was written with the assistance of Claude Opus 5.5.