Context Bootstrapped Reinforcement Learning
Organizations: University of California, Santa Barbara · Cisco Research
Abstract
Reinforcement Learning from Verifiable Rewards (RLVR) suffers from exploration inefficiency, where models struggle to generate successful rollouts, resulting in minimal learning signal. This challenge is particularly severe for tasks that require the acquisition of novel reasoning patterns or domain-specific knowledge. To address this, we propose Context Bootstrapped Reinforcement Learning (CBRL), which augments RLVR training by stochastically prepending few-shot demonstrations to training prompts. The injection probability follows a curriculum that starts high to bootstrap early exploration, then anneals to zero so the model must ultimately succeed without assistance. This forces the policy to internalize reasoning patterns from the demonstrations rather than relying on them at test time. We validate CBRL across two model families and five Reasoning Gym tasks. Our results demonstrate that CBRL consistently improves success rate, provides better exploration efficiency, and is algorithm-agnostic. We further demonstrate CBRL's practical applicability on Q, a domain-specific programming language that diverges significantly from mainstream language conventions.
Figures & tables
| Qwen2.5-3B-Instruct | Llama-3.2-3B-Instruct | |||||||
| Environment | Baseline | Baseline w/ Few Shots | GRPO | CBRL GRPO | Baseline | Baseline w/ Few Shots | GRPO | CBRL GRPO |
| ARC-1D | ||||||||
| Manipulate Matrix | ||||||||
| Spell Backward | ||||||||
| Word Sorting | ||||||||
| Puzzle24 | ||||||||
| Method | Valid Q (%) | Avg. Pass (%) | Success Rate (%) |
| Baseline | 3.1 | 0.3 | 0.0 |
| Baseline w/ Few Shots | 4.3 | 0.6 | 0.4 |
| GRPO | 89.1 | 27.3 | 5.0 |
| CBRL GRPO | 80.9 | 43.0 | 26.3 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
| Model | |
| Base Model | Qwen2.5-3B-Instruct |
| Optimization | |
| Algorithm | GRPO / RLOO |
| Training Steps | 500 |
| Learning Rate | |
| Hyperparameter | ARC-1D | Puzzle 24 | Manipulate Matrix | Spell Backward | Word Sorting |
| Max Prompt Length | 4,096 | 1,024 | 3,072 | 768 | 1,024 |
| Max Response Length | 2,048 | 512 | 512 | 256 | 512 |
| Samples per Prompt ( ) | 4 | 4 | 4 | 8 | 4 |
| Metric | ARC-1D | Puzzle 24 | Manipulate Matrix | Spell Backward | Word Sorting |
| Training Steps | 500 | 500 | 500 | 500 | 500 |
| Batch Size | 32 | 32 | 32 | 32 | 32 |
| Samples per Prompt ( ) | 4 | 4 | 4 | 8 | 4 |
| Environment | Configuration Parameters |
| ARC-1D | min_size=10 , max_size=30 , num_train=3 |
| Puzzle 24 | operators={+, -, *, /} , min_value=1 , max_value=10 |
| Manipulate Matrix | min_rows=2 , max_rows=10 , min_cols=2 , max_cols=10 , |
| min_transforms=1 , max_transforms=10 | |
| Spell Backward | min_word_len=3 , max_word_len=10 |
| Word Sorting | min_words=3 , max_words=10 , |
| Hyperparameter | Value |
| ICL Injection Enabled | True |
| Start Probability ( ) | 0.5 |
| End Probability ( ) | 0.0 |
| Number of ICL Examples | 2 |
| Injection Seed | 0 |
| Hyperparameter | Value |
| Temperature | 0.6 |
| Top- | 0.9 |
| Evaluation Set Size | 100 |
| Evaluation Repeats | 3 |
| Developer Prompt | DeepSeekZero |
| Precision | bfloat16 |
| Hyperparameter | Value |
| Model | |
| Base Model | qqwen-7B-Pretrain Hogan et al. (2025) |
| Model Size | 7B parameters |
| Optimization | |
| Algorithm | GRPO |
| Total Epochs | 64 |
| Metric | Value |
| Dataset | |
| Training Set Size | 542 problems |
| Test Set Size | 136 problems |
| Data Source | morganstanley/sft-python-q-problems |
| Training Data Consumption | |
| Batch Size | 64 |
| Hyperparameter | Value |
| ICL Injection Enabled | True |
| Start Probability ( ) | 0.5 |
| End Probability ( ) | 0.0 |
| Number of ICL Examples | 2 |
| Injection Seed | 42 |
| Parameter | Value |
| Reward Type | Code Execution |
| Base Reward Weight | 1.0 |
| Perfect Bonus | 2.0 |
| Max Test Cases per Problem | 5 |
| Execution Timeout | 10 seconds |
| Reward Computation | |
| Task | Expected Output Format |
| Reasoning Gym | <think> reasoning process </think> <answer> final answer </answer> |
| Q Programming | q solve:[args] |
RL for Language Model Reasoning
Reinforcement learning for language model reasoning uses reward-driven training to improve multi-step problem solving, tool use, and reliable answers.
See all 1,057 papers