KatInterview

Designing a Critic-Free RL Pipeline for Training Reasoning Models

Machine LearningModel answer
HardModel answerMachine Learningreinforcement-learningllm-trainingoptimization

Last updated

Build a post-training system for a 70B reasoning LLM using group-relative optimization, exploring advantage estimation, memory efficiency, and reward design.

Context

You're architecting the post-training infrastructure for a 70-billion-parameter language model specialized in mathematical reasoning and code generation. Traditional reinforcement learning approaches that maintain separate actor, critic, reference, and reward networks create prohibitive memory demands and coordination complexity across your GPU cluster.

Your team is evaluating a critic-free reinforcement learning approach that estimates advantages by comparing multiple sampled outputs for each prompt, combined with an attention mechanism that compresses key-value cache storage through latent representations.

Your Task

Design and justify the technical decisions for this training pipeline, addressing:

Part 1: Group-Based Advantage Calculation

Explain how to estimate per-sequence advantages without training a value network. For a given prompt and a collection of G generated responses with associated rewards, derive the advantage formula and describe how it integrates into the policy gradient objective. What is the mathematical relationship between the probability ratio clipping mechanism and the KL divergence regularization term? Analyze what happens when the group size is very small versus moderately large.

Part 2: Infrastructure and Memory Analysis

Calculate the memory footprint difference between maintaining a critic network versus eliminating it for a 70B model under mixed-precision training. Additionally, compare standard grouped-query attention against a latent-space attention design that compresses key-value representations. Provide concrete numbers for cache memory requirements when generating 16 outputs of 16,000 tokens each, and explain how this affects throughput and maximum context capacity.

Part 3: Reward Engineering for Reasoning Tasks

Design a reward function that combines execution-based correctness verification with structural format requirements. Identify two common pathological behaviors that emerge during reinforcement learning with verifiable rewards (such as the model exploiting length-based advantage normalization or collapsing to repetitive outputs). For each failure mode, propose specific algorithmic or reward-shaping interventions that address the root cause.

Hints

Hint 1

The group mean serves as an empirical baseline estimate—think about what happens to variance when group size approaches 2

Hint 2

Memory savings come from both inference-time weight storage and training-time optimizer states; quantify each separately

Hint 3

Length-based normalization creates perverse incentives when advantages are negative; consider alternatives that treat all tokens equally