Context Bootstrapped Reinforcement Learning

Saaket Agashe, Jayanth Srinivasa, Gaowen Liu, Ramana Kompella, Xin Eric WangarXiv 2026

TL;DR

Reinforcement Learning from Verifiable Rewards (RLVR) often stalls when large language models fail to stumble upon correct answers during early training, leaving them with zero learning signal. Context Bootstrapped Reinforcement Learning (CBRL) solves this "exploration inefficiency" by stochastically injecting few-shot examples into training prompts and gradually annealing the injection probability to zero. This temporary scaffolding guides early exploration, forcing the model to internalize complex reasoning patterns so it can perform entirely independently at test time.

What Problem Does This Paper Address?

Post-training large language models (LLMs) using RLVR (the paradigm behind models like DeepSeek-R1) relies on a simple mechanism: the model generates a rollout, and a deterministic verifier provides a binary reward based purely on the final correctness.

However, this framework suffers from a fundamental bottleneck: Exploration Inefficiency. If a task requires highly specific reasoning patterns or involves an underrepresented domain (like a niche programming language), the model's initial chance of generating a correct response is near zero. When every rollout in a batch is incorrect, the learning gradient collapses to zero, and training plateaus indefinitely.

Methods

The authors propose CBRL, a simple, fully on-policy, and algorithm-agnostic training modification that leverages an LLM's native In-Context Learning (ICL) capabilities as temporary scaffolding.

Overview of the CBRL framework showing the injection probability annealing schedule and sample construction.

The method operates via three core components:

  1. Few-Shot Example Bank: A small repository of solved task examples containing a problem statement, an optional step-by-step reasoning trace, and the final answer.
  2. Stochastic Context Injection: At each training step, the prompt is augmented with $k$ few-shot examples sampled from the bank with a probability $p_t$. Crucially, rewards are computed only on the model's generated response to the target query, not on the injected context.
  3. Linear Annealing Curriculum: The injection probability $p_t$ follows a strict linear decay schedule: $$p_t = p_{\text{start}} + \frac{t - 1}{T - 1}(p_{\text{end}} - p_{\text{start}})$$ Where $p_{\text{start}}$ typically equals 0.5 and $p_{\text{end}}$ decays to 0.0 by the end of the training budget ($T$).

By randomly withholding examples even early in training, the model is forced to attempt problems independently, preventing it from becoming dependent on the prompts.

Datasets

The authors evaluated CBRL across two distinct domains:

  • Reasoning Gym: A procedural benchmark where the authors selected five tasks requiring distinct reasoning patterns: ARC-1D (abstract visual-logic reasoning in 1D), Word Sorting, Spell Backward, Matrix Manipulation, and Puzzle-24.
  • Q Programming: A dataset consisting of 678 Leetcode-style programming problems (542 train, 136 test) for Q, a terse, vector-based language used for financial time-series databases. Q features unconventional right-to-left evaluation and implicit typing, making it highly unfamiliar to standard base LLMs.

Key Insights and Ideas

  • Durable Internalization, Not Prompt Dependence: A common fear with prompting during training is that the model will collapse once the prompts are removed. CBRL proves the opposite: as the scaffolding anneals to zero, the model maintains its performance gains. It internalizes the underlying reasoning mechanics rather than superficially relying on the context.
  • The "Goldilocks" Injection Probability: Through ablation studies, the authors found that an initial injection probability of $p_i = 0.5$ performs best. Setting it too low provides insufficient scaffolding to escape reward plateaus, while setting it too high ($p_i = 1.0$) overwhelms the policy's own exploration, preventing it from learning independent reasoning.
Figure 3. Effect of initial injection probability pi on success rate for Qwen2.5-3B-Instruct trained with CBRL-GRPO on ARC-1D (500 steps). Performance peaks at pi = 0.5; both extremes yield lower accuracy.
  • Algorithm-Agnostic Compatibility: Because CBRL only modifies the input prompt distribution and leaves the underlying RL loss functions untouched, it works out-of-the-box with various policy gradient methods, including Group Relative Policy Optimization (GRPO) and REINFORCE Leave-One-Out (RLOO).

Key Results

CBRL consistently outperformed baseline RL training across multiple model families (Qwen2.5 and Llama-3.2) and environments.

Quantitative Improvements

  • Reasoning Gym: CBRL improved accuracy across all 10 model-environment pairs. Notable jumps included Qwen2.5-3B on Word Sorting (+22.34% absolute improvement) and Puzzle-24 (+12.67%). Under RLOO, Word Sorting skyrocketed from 20.33% to 67.33%.
  • Q Programming: For the QQwen-7B-Pretrain model, standard GRPO merely optimized for syntactically valid code but failed functional tests (5.0% success rate). CBRL enabled the model to actually apply the language constructs correctly, boosting the final functional Success Rate to 26.3% and the average test pass rate to 43.0%.
Training reward curves showing that CBRL achieves higher early rewards and maintains its advantage after injection stops.

Qualitative Shift

As seen in the training curves (Figure 4), CBRL accelerates early learning by providing immediate, successful rollout paths. Qualitatively, the resulting models shift from surface-level guessing to executing structured, step-by-step reasoning blocks that mirror the logic of the initial few-shot exemplars.

Limitations and Future Work

Despite its success, the authors note a few limitations and areas for future exploration:

  • Fixed Linear Schedule: The current linear decay schedule is rigid. An adaptive schedule that adjusts the injection probability based on real-time reward trends or success rates could optimize training efficiency.
  • Task-Context Alignment: CBRL actually reduced performance on two tasks (ARC-1D and Matrix Manipulation) when paired with the RLOO algorithm. This indicates that the method's success is highly sensitive to how well the selected context matches the specific task structure. Automated, task-aware retrieval mechanisms are a suggested fix.
  • Long-Horizon Scaling: Future work is required to see if CBRL can scale to multi-step agentic workflows and longer reasoning chains where early exploration errors compound exponentially.

Summary updated

BibTeX
@misc{agashe2026context,
  author = {Saaket Agashe and Jayanth Srinivasa and Gaowen Liu and Ramana Kompella and Xin Eric Wang},
  title = {{Context Bootstrapped Reinforcement Learning}},
  year = {2026},
  eprint = {2603.18953},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.18953},
}
Figure