liveBook · Manning

Group Relative Policy Optimization

As explained in Domain-Specific Small Language Models

A reinforcement learning optimization method that updates a policy by comparing groups of sampled actions, avoiding the need for a separate value model.

Group Relative Policy Optimization (GRPO) is a reinforcement learning method for improving language-model reasoning by comparing groups of sampled actions and making small, controlled policy updates. Unlike Proximal Policy Optimization (PPO), it removes the separate value model that estimates long-term reward, reducing memory and compute requirements. section 15.4 section 15.5

A practical GRPO workflow combines:

  • Multiple reward functions that assess correctness, XML formatting, response structure, and intermediate output quality. section 15.5
  • Memory-saving components such as LoRA, 4-bit quantization, gradient checkpointing, and optionally vLLM-accelerated generation. section 15.5

Specializing a small language model for 3D printing

A Qwen 2.5 3B Instruct model is adapted on additive-manufacturing questions with a single 16-GB GPU. The training setup samples six generations per prompt, applies correctness and format rewards, trains for 200 steps, saves LoRA weights, and tests multi-step answers about simulation-model simplification. section 15.4

How Domain-Specific Small Language Models covers it

How deep it goes
Explains the PPO contrast, reward design, configuration, training, saving, and evaluation, but does not derive the optimization mathematically.
Examples
Uses additive-manufacturing data, XML-formatted reasoning prompts, custom reward functions, and a Qwen 2.5 3B Instruct model.
What it assumes
Assumes familiarity with language-model fine-tuning and datasets while introducing GRPO through PPO, LoRA, quantization, and reward configuration.
What you can do after
Builds a domain-specialized reasoning model using TRL’s GRPOConfig and GRPOTrainer on consumer-GPU-class hardware.
How it connects
Connects reinforcement learning with PPO, reward functions, LoRA, quantization, TRL, Unsloth, and vLLM.

Also explained in

Compare how 3 books explain Group Relative Policy Optimization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.