Abstract
Code large language models (LLMs) have become indispensable tools for building efficient and automated coding pipelines. Existing models are typically post-trained using reinforcement learning (RL) from general-purpose LLMs using "human instruction-final answer" pairs, where the instructions are usually from manual annotations. However, collecting high-quality coding instructions is both labor-intensive and difficult to scale. On the other hand, code snippets are abundantly available from various sources. This imbalance presents a major bottleneck in instruction-based post-training. We propose CodeBoost, a post-training framework that enhances code LLMs purely from code snippets, without relying on human-annotated instructions. CodeBoost introduces the following key components: (1) maximum-clique curation, which selects a representative and diverse training corpus from code; (2) bi-directional prediction, which enables the model to learn from both forward and backward prediction objectives; (3) error-aware prediction, which incorporates learning signals from both correct and incorrect outputs; (4) heterogeneous augmentation, which diversifies the training distribution to enrich code semantics; and (5) heterogeneous rewarding, which guides model learning through multiple reward types including format correctness and execution feedback from both successes and failures. Extensive experiments across several code LLMs and benchmarks verify that CodeBoost consistently improves performance, demonstrating its effectiveness as a scalable and effective training pipeline.
Introduction
The current paradigm for fine-tuning code LLMs relies heavily on "instruction-answer" pairs, typically curated through Supervised Fine-Tuning (SFT) or Reinforcement Learning from Human Feedback (RLHF). However, high-quality, human-annotated coding instructions are labor-intensive to produce and difficult to scale. Conversely, raw code snippets are available in massive quantities across open-source repositories. The challenge lies in how to "squeeze" meaningful reasoning and execution knowledge out of these snippets without explicit human guidance. CodeBoost addresses this by utilizing bi-directional execution tasks and error-aware rewards to enhance models directly from raw code.
Methodology
CodeBoost introduces a pipeline designed to turn raw code into a high-quality RL training signal through five key components:
1. Maximum-Clique Curation
To ensure training diversity, the framework moves beyond standard embedding-based de-duplication. It represents the dataset as a graph where edges connect "structurally distant" snippets (based on Jaccard similarity of line-level substrings) and extracts a maximum clique to form a representative, non-redundant training set.
2. Bi-Directional and Error-Aware Prediction
The model is trained on two complementary tasks:
- Forward Task: Given a code snippet and input, predict the execution output (
stdoutandstderr). - Backward Task: Given execution results and a partially masked snippet, fill in the missing code lines.
Unlike many frameworks that filter for "perfect" code, CodeBoost requires models to predict both standard output and standard error. This forces the model to reason through potential failures and understand the logic behind exceptions.
3. Heterogeneous Augmentation and Rewarding
The authors apply digit-level and logical-level perturbations (modifying operators like > to < via Concrete Syntax Tree parsing). This prevents the model from relying on memorized patterns and forces it to "mentally execute" the specific logic of the snippet.
For training, the framework uses the Group Relative Policy Optimization (GRPO) algorithm. Rewards are calculated based on format adherence, exact matches for stdout, and Jaccard similarity for stderr (which is often more system-dependent and harder to match exactly).
Experimental Setup
- Training Data: A curated dataset of 58k Python code snippets sourced from OpenCoder, CodeForces-CoTs, and Open-Thoughts-114k.
- Evaluation Benchmarks: BigCodeBench (Hard), CRUXEval (Input/Output), MBPP / EvalPlus, and LiveCodeBench.
- Base Models: Qwen2.5-Coder-7B, Llama-3.1-8B, and Yi-Coder-9B.
Key Results and Insights
CodeBoost consistently improved performance across nearly every benchmark and model architecture:
- Llama-3.1-8B-Instruct: Saw a dramatic improvement, jumping from a total performance score of 242.0 to 258.1.
- Qwen2.5-Coder-7B-Instruct: Improved from 327.0 to 334.6, showing that even highly optimized models benefit from "knowledge squeezing."
- Seed-Coder-8B-Instruct: Reached a total score of 359.6, the top-performing model in the evaluation suite.
Analysis
- Failure is a Teacher: Execution errors (
stderr) provide valuable learning signals. Predicting why code fails requires a deeper understanding of language constraints than simply predicting a successful output. - Forward > Backward: Ablation studies revealed that the forward task (predicting output) provides a stronger learning signal for code LLMs than the backward task (reconstruction).
- The Power of Small Changes: Digit and logical augmentations were found to be the most critical components for boosting performance, as they break the model's reliance on common coding tropes and force active reasoning.
Conclusion
CodeBoost demonstrates that raw code snippets, when curated and processed through an error-aware RL framework, can significantly enhance the reasoning and execution capabilities of Code LLMs without the need for expensive human annotations. Future work will look to expand this framework to multi-lingual settings and multi-modal outputs, such as GUIs and plots, which remain a challenge for text-based execution feedback.
Summary updated