AI
COBALT: Training Code-Generation Models Without Costly Online Reinforcement Learning
Researchers propose a simpler method that reuses offline code trajectories to improve multi-turn code generation in large language models, matching online RL performance at lower cost.
Researchers have introduced COBALT, a new training approach designed to make multi-turn code generation in large language models more practical and efficient. Rather than relying on expensive and unstable online reinforcement learning, the method reuses pre-collected offline code trajectories to improve model performance.
The Challenge with Current Approaches#
Training language models to generate code across multiple turns—where the model must build on its own previous outputs—typically requires online reinforcement learning. While effective, this approach demands repeated model sampling during training, making it computationally expensive and prone to instability issues. The need for a more practical alternative motivated the development of this new technique.
How COBALT Works#
The method's efficiency stems from a key insight: multi-turn code generation behaves like a one-step recoverable decision process. The approach begins by collecting code generation trajectories using an existing reference model, then breaks these trajectories into partial segments. During training, the language model learns to complete each partial trajectory through single-step generation tasks. This reformulation allows the system to leverage existing data rather than generating new rollouts continuously.
Performance Results#
Testing on LiveCodeBench demonstrates substantial improvements: R1-Distill 8B and Qwen3 8B models saw gains of up to 9.0 and 6.2 absolute Pass@1 points respectively. Notably, COBALT matches the performance of established multi-turn online RL baselines like GRPO and VeRPO, despite being simpler and less resource-intensive.
Robustness Against Misleading Feedback#
The researchers also analyzed how the method handles potentially problematic execution feedback. Through perturbation-based testing, they showed that COBALT exhibits improved robustness against reward hacking scenarios where execution feedback might mislead the model—a practical advantage for real-world deployment where feedback signals may be imperfect.

