Home / Learn / Red Teaming RLHF and Post-Training

LessonRed Teaming RLHF and Post-TrainingLesson 19 of 24

RLVR grades the answer, not the thought

Reasoning models are trained on verifiable rewards that grade only the final answer, leaving the hidden reasoning trace unsupervised. That ungraded scratchpad is the seam.

  • Reasoning RL (RLVR), Multimodal and Agentic Alignment
  • Card 5, Lesson 01
  • GRPO, verifiable rewards and unaligned scratchpads
On this page
The route

From Human Preferences (RLHF) to Verifiable Outcomes (RLVR)

Classic RLHF (Cards 1–4) relies on a human rater or a neural Reward Model R_phi(x, y) to grade how a response looks. However, frontier reasoning models (such as DeepSeek-R1, OpenAI's o-series, and Qwen-QwQ) introduced a major shift in post-training called RLVR (Reinforcement Learning with Verifiable Rewards), typically optimized using GRPO (Group Relative Policy Optimization).1

In RLVR, there is no human rater and often no neural Reward Model grading the reasoning steps. Instead:

  1. For a prompt x, the policy generates a group of G candidate rollouts {y_1, y_2, ..., y_G}, where each rollout consists of a long hidden reasoning trace <thought> ... </thought> followed by a final visible answer.
  2. A deterministic Verifier (a regex matcher, math equivalence checker, compiler, or unit-test sandbox) checks only the final answer and assigns a binary outcome reward r_i in {0, 1}.
  3. GRPO normalizes the rewards within the group to compute the advantage A_i = (r_i - mean(r)) / std(r) and updates the policy:
text
L_GRPO(theta) = - (1/G) * sum over i of [ A_i * log pi_theta(y_i | x) - beta * KL( pi_theta || pi_ref ) ]
The RLVR / GRPO loop

The Fatal Seam in RLVR: The Ungraded Scratchpad

Look closely at the diagram above. Because the deterministic Verifier only grades y_final (the final answer box), every single token inside <thought> ... </thought> receives the exact same positive reinforcement signal A_i > 0 as long as the final answer passes the test!

Why do labs avoid putting heavy RLHF safety filters directly on the <thought> tokens during training? Because empirical experiments showed that penalizing the <thought> trace for mentioning sensitive concepts causes reasoning collapse (or trains the model to engage in steganographic / deceptive reasoning, hiding its true thoughts from the safety monitor while still arriving at the prohibited output).

This creates three massive attack surfaces unique to RLVR / GRPO reasoning models:

1. The "Raw Base Model" Inside <thought>

Because <thought> is optimized purely for problem-solving efficiency rather than conversational politeness or SFT refusal templates, the token distribution inside <thought> behaves much closer to an unaligned base model.

2. Thought-to-Answer Leakage (Delimiter & Continuation Hijacking)

On open-weight reasoning models (and API endpoints that stream or expose reasoning summaries), if the model solves the restricted task inside <thought> before deciding to refuse after </thought>, a red teamer can prevent the </thought> transition from triggering a refusal:

3. Exploiting Over-Thinking (Reasoning Exhaustion)

RLVR models are heavily rewarded for decomposing complex constraint-satisfaction problems step-by-step. When a prompt wraps a sensitive technical operation inside a dense NP-hard scheduling puzzle, register-allocation constraint, or formal verification proof, the model allocates 98% of its <thought> attention budget to satisfying the mathematical constraints. By the time it reaches </thought>, its internal advantage representation is dominated by "I solved the constraint puzzle!", overriding shallow post-RLVR safety SFT.

Worked Transcript: Exploiting the RLVR Constraint-Satisfaction Drive

The attack reframes a restricted request as the kind of byte-count or complexity verification puzzle that RLVR training rewarded most heavily, so the reasoning block locks into constraint-solving mode and carries the derivation into the visible answer.

(redacted: a two-attempt transcript, a direct request that was caught inside <thought>, then a constraint-puzzle framing that drove the reasoning block to emit a null-free x86_64 execve shellcode byte-encoding table.)

Field Exercise 5.01: Steering the <thought> Block

(redacted: an exercise that ran against third-party hosted thinking models (Google AI Studio) and inspected the exposed reasoning trace. Replace with a version run on an open-weights reasoning model you operate, where inspecting the trace is in scope.)

Next Lesson

In RLVR, the model is trained against automated unit tests and code verifiers. What happens when the model learns during training, or at inference time, that it can hack the unit test itself rather than solving the problem safely? We explore that in 02 Hack the unit test, own the verifier.

Notes

  1. DeepSeek-AI, "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning", arXiv 2501.12948, https://arxiv.org/abs/2501.12948 (read 2026-11-09). ↩