liveBook · Manning

Reinforcement learning

As explained in Build a Reasoning Model (From Scratch)

A training approach where a model learns from rewards or feedback to improve its behavior.

Improves an LLM’s reasoning during training by rewarding responses that produce desirable outcomes. It is usually a post-training stage after pretraining and sometimes instruction fine-tuning, although reasoning-focused RL can also start from a pretrained base model. section 1.3 section 6.1

A practical RL workflow for reasoning models includes:

  • Frame reasoning as sequences of actions and outcomes rather than explicit rule execution. section 1.5
  • Sample multiple responses for each prompt and compute group-relative learning signals from their rewards. section 6.0
  • Use task-correctness rewards in reinforcement learning with verifiable rewards (RLVR), or human feedback in RLHF. section 6.0
  • Update model weights with group-based policy optimization to reinforce higher-reward reasoning behavior. section 6.0

RL differs from inference-time scaling: RL invests computation during training to improve later accuracy, while inference-time scaling spends more computation per generated answer. The two approaches can be combined. section 6.1

Figure 6.4 Road map of this chapter. After this section’s brief introduction to RL for LLMs, we’ll discuss the difference between two RL stages, RLHF and RLVR. In the rest of the chapter, we’ll focus on implementing RLVR using the GRPO algorithm.

Use the roadmap to place RL after the introductory distinction between RLHF and RLVR and before implementation with GRPO. section 6.1

How Build a Reasoning Model (From Scratch) covers it

How deep it goes
Explains reward signals, response groups, policy updates, and RLHF-versus-RLVR distinctions, then points toward GRPO implementation.
Examples
Uses reasoning LLMs, task-correctness rewards, and classic agents trained for chess, Go, or video games as examples.
What it assumes
Assumes a pretrained language model and optionally instruction fine-tuning, while introducing LLM-specific RL rather than general RL.
What you can do after
Apply RL to LLM reasoning by selecting reward signals, sampling response groups, and updating weights with group-based policy optimization.
How it connects
Connects reinforcement learning with pretraining, instruction fine-tuning, preference tuning, inference-time scaling, RLHF, RLVR, and policy optimization.

Also explained in

Compare how 18 books explain reinforcement learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Reasoning Model (From Scratch). The section links point to the parts of the book it draws on.