[KongchangAI]
· 2 min read· 1,372 words

Anthropic Researcher Breaks Down LLM Training: From Tuning to Self-Thinking

Anthropic Researcher Breaks Down LLM Training: From Tuning to Self-Thinking

From house price prediction to reinforcement learning, deconstructing the full LLM training chain and emergent intelligence.

Based on a conversation with Anthropic researcher Jeremy Berman, this article starts with house price prediction to systematically break down the LLM training pipeline. Neural networks use backpropagation to fit complex functions, and language models extend this to word sequence prediction. Pretraining learns internet text distribution but only enables chaining. Post-training gives the model an assistant persona via dialogue samples and stop tokens, while chain-of-thought elicits reasoning. GRPO reinforcement learning lets the model learn from its own reasoning trajectories for self-evolution, though the post-trained persona is fragile. Finally, it explores whether models can transcend training data to discover new knowledge, suggesting long-horizon reasoning training can build new abstractions, shifting AI from fitting data to teaching learning.

From House Price Prediction to Emergent Intelligence: First Principles of Neural Networks

In a deep conversation, Anthropic researcher Jeremy Berman deconstructed the entire training pipeline of large language models in the simplest way. His starting point is not the Transformer architecture, but a toy problem of pricing New York apartments: given location, area, and number of bathrooms, predict the price. Traditional programming requires hand-written rules, but the neural network approach lets the computer find the mapping function itself—multiplying inputs by a bunch of adjustable "knobs" (parameters), summing them, and outputting a prediction. These knobs start random, but by comparing the difference between predictions and true prices (loss), and using automatic differentiation engines like PyTorch to compute how each knob affects the loss (gradient), they can be gradually fine-tuned to approximate the correct answer.

The essence of this process is backpropagation: the chain rule computes the gradient of each parameter, then updates parameters in the opposite direction of the gradient to minimize loss. Berman emphasizes that a single layer of neurons can only express linear relationships, but by stacking multiple layers and introducing activation functions, neural networks become "universal function approximators"—theoretically, with enough layers and knobs, they can fit any complex function. This is the cornerstone of deep learning.

Backpropagation and Automatic Differentiation: Backpropagation is the core algorithm for training neural networks, essentially an efficient application of the chain rule. It starts from the loss function and computes the partial derivative (gradient) of each parameter with respect to the loss layer by layer, thereby knowing how to adjust parameters to reduce loss. Automatic differentiation engines (like PyTorch's autograd) handle this process automatically in the computation graph, without manual derivation. Gradient descent updates parameters along the negative gradient direction, with the learning rate controlling the step size. This mechanism enables deep networks with many parameters to be effectively optimized, and is key to the scalability of deep learning.

Language Models: When Neural Networks Learn "Word Chaining"

A language model is a special form of neural network, differing in that inputs and outputs change from numbers to word sequences (more precisely, tokens). The training method seems the same—predicting the next word—but the key difference is: the language model outputs a probability distribution over the entire vocabulary, not a single value. For example, in the text sequence "SOHO, 1200, 2BATH", the model needs to learn to push the probability of the token "1200" higher given the preceding context. The loss function measures the gap between the model's predicted probability and the true next word.

Berman demonstrated with a Qwen 0.5B (500 million parameters) base model. After pretraining, this model exhibits pure "internet autoregressive" characteristics: input "0", and it might output a code snippet; input "Matthew Berman said", and it will fabricate a plausible but entirely fictional quote. This reveals the essence of pretrained models—they are merely high-fidelity compressions of the training data distribution, not seekers of factual correctness.

The pretraining phase requires massive data and compute because the degrees of freedom in language space are far higher than structured numbers. The same mapping task might require only a few parameters with a regular neural network, but a language model needs to absorb grammar, semantics, world knowledge, and countless latent patterns to calibrate the next-word probability distribution close to the true distribution.

Tokens and Vocabulary Probability Distribution: Language models do not directly process characters or words, but split text into tokens (subword units), each corresponding to an ID in the vocabulary. The model outputs a probability distribution over the entire vocabulary, representing the likelihood of the next token. Training uses cross-entropy loss to measure the gap between the predicted distribution and the true next token. This design allows the model to handle out-of-vocabulary words and open vocabulary, while outputting probabilities for sampling generation. Vocabulary sizes are typically tens to hundreds of thousands, and the high dimensionality of the probability distribution is one reason language models require many parameters.

Post-training: Giving the "Chaining Machine" Personality and Thought

The base model does not actively become an assistant; it only continues based on format. Researchers found that if the input is prefilled with "User: What is 1+1? Assistant:", the model will mimic the assistant's tone from the internet to answer. Post-training leverages this pattern-matching ability: constructing大量 "user-assistant" dialogue samples (can be manually written or model-generated), and adding a stop token, so the model learns to output a termination signal after answering. Qwen2's chat template (like <|im_start|>) is an engineering embodiment of this idea.

This explains why message roles (system, user, assistant) in chat interfaces are concatenated into special format text at the底层—the model always sees a continuous token stream, and so-called "dialogue" is just carefully designed prompt engineering.

But this is not enough. Early instruction models would output wrong answers without thinking, such as miscalculating 398×923+2901 by an order of magnitude. Researchers found that simply adding "Let's think step by step" after the question causes the model to unfold reasoning steps, significantly improving accuracy. This discovery gave rise to Chain-of-Thought (CoT) technology, and OpenAI's o1 is the first public model to internalize "thinking" as an inherent capability.

Chain-of-Thought (CoT): Chain-of-Thought is a prompting technique that guides the model to generate step-by-step reasoning before answering, significantly improving accuracy on complex tasks (like math, logic). The principle is to let the model decompose the problem into intermediate steps, leveraging autoregressive properties to derive gradually, avoiding jumping directly to the answer. CoT was initially implemented with few-shot examples or simple instructions ("Let's think step by step"), and later developed into an intrinsic model capability (e.g., o1 internalizes thinking via reinforcement learning). CoT reveals that language models possess latent reasoning abilities,只需适当激发.

Reinforcement Learning: Letting Models Self-Evolve Through Trial and Error

The DeepSeekAd R1 paper revealed the key method behind o1—GRPO (Group Relative Policy Optimization). The process is: let the model generate multiple answers to the same question, score based on format and answer correctness, compute the "advantage value" of each answer relative to the group average, then adjust the probability of each token based on the advantage value. Good answers have their probabilities increased overall, bad ones decreased.

Compared to simple rejection sampling (keeping only correct answers), GRPO can utilize negative samples and offset noise through intra-group normalization. More importantly, this is on-policy training—the model learns from its own generated reasoning trajectories, not human demonstrations. Berman points out that this makes parameter updates gentler, because the model already has the ability to generate these trajectories and only needs fine-tuning; whereas imitating others' thinking may破坏 other existing capabilities.

This raises a key question: why can't we jump directly from pretraining to reinforcement learning? Berman explains that once the model acquires an "assistant persona", feeding it raw pretraining data (like code corpora) will cause it to mimic the data style and lose assistant behavior. The self-identity shaped by post-training is fragile and requires careful maintenance of the data distribution.

On-policy vs. Off-policy Learning: In reinforcement learning, on-policy means the agent learns from data generated by the current policy, while off-policy uses data from other policies (like old policies or human demonstrations). GRPO is an on-policy method; the model learns from its own generated reasoning trajectories, leading to more stable parameter updates and preserving existing capabilities. Conversely, imitating human demonstrations (off-policy) can cause distribution shift and破坏 learned skills. This distinction explains why post-training requires careful data distribution maintenance to avoid catastrophic forgetting.

Can Models Discover New Knowledge?

The conversation concludes with a fundamental controversy: can models trained on historical data transcend the distribution and create new knowledge? Berman's answer is yes. He analogizes with Einstein's general relativity: initially, the idea was not "high probability", but through long-term reasoning to build new abstractions, it eventually became a derivable conclusion. Similarly, language models—when trained to reason autonomously over long horizons, can gradually build new conceptual structures, thereby breaking the boundaries of training data.

This view echoes the current AI community's exploration of reasoning scaling laws. Although Berman admits models have not yet produced world-changing original discoveries, they have已攻克 some unsolved math problems. From tuning to self-thinking, the training philosophy of LLMs is shifting from "fitting data" to "teaching learning", and the endpoint of this path is still full of imagination.

#LLM training#Anthropic#reinforcement learning#GRPO#chain-of-thought#pretraining#post-training#neural networks
Share:

Related articles