Summary (Overview)
- CodeLift is a reinforcement learning method for software engineering (SWE) agents that dynamically calibrates pass-rate rewards by treating the test suite as an adaptive curriculum, addressing three identified imbalances in raw pass-rate rewards: multiplicity, progress-regression, and difficulty imbalances.
- The method introduces behavior balancing, which groups tests and patches by their outcome patterns and weights test groups by the fraction of patch groups they "kill" (fail), naturally reducing the influence of trivial all-passing tests while emphasizing challenging ones.
- CodeLift also introduces snapshot slicing, which applies the same scoring rule to intermediate repository states at self-test checkpoints, enabling credit assignment for useful intermediate actions even when later edits introduce regressions.
- Experiments on SWE-bench Verified and SWE-bench Pro (Python) show consistent improvements over binary and enhanced pass-rate baselines across pass@1/2/4/8, with gains ranging from +2.75 to +7.40 percentage points on Verified.
- Analyses demonstrate that CodeLift provides denser learning signals (75.1% active rollout groups vs. Binary's 47.9%), more balanced progress-regression rewards (1.08 ratio vs. PassRate's 3.71), and an adaptive curriculum where test weights dynamically shift as the policy improves.
Introduction and Theoretical Foundation
Background
Large language model (LLM) agents have made significant progress in software engineering (SWE), with reinforcement learning with verifiable rewards (RLVR) serving as a key contributor. In typical SWE agentic tasks, agents navigate repositories, edit code, and run tests, with final patches verified against hidden test suites.
The Binary Reward Problem
The standard recipe uses a pass-all-test binary verifier:
where is the result of test . This binary reward is too sparse to distinguish patches that partially resolve issues from those that break existing functionality. When all patches in a rollout group fail, there is no learning signal from relative advantage.
Pass-Rate as a Dense Alternative
The natural dense alternative is test pass-rate:
However, the paper identifies three test-weighting imbalances that miscalibrate pass-rate rewards:
-
Multiplicity imbalance: Multiple tests may check the same functionality and fail together. A patch with higher pass rate might fix only a few heavily-tested functionalities while breaking many lightly-tested ones, creating reward bias.
-
Progress-regression imbalance: Most repository tests are pass-to-pass (P2P) regression tests protecting existing functionality, while only a few fail-to-pass (F2P) tests check requested progress. Under pass-rate rewards, penalties for P2P regressions can outweigh rewards for F2P progress, discouraging agents from making changes.
-
Difficulty imbalance: Pass rate assigns equal weight to tests of different difficulty. When easy tests dominate, a patch can get high reward while still failing challenging tests.
Methodology
Behavior Balancing
For each issue , CodeLift evaluates final patches on its golden tests, forming a matrix . It then:
- Groups identical rows into patch groups and identical columns into test groups
- Computes each test group's failure frequency and normalized weight:
where , or if all . This ensures:
- All-passing tests receive zero weight (they cannot distinguish patch quality)
- Tests passed by fewer patch groups receive more weight
- The weights adapt dynamically as the policy improves, creating an adaptive curriculum
Snapshot Slicing
CodeLift uses self-test actions as checkpoints to cut rollouts into token intervals. For each slice with cumulative endpoint state , it computes the state score:
The snapshot correction and slice advantage are:
Credit Assignment
Using a leave-one-out (LOO) estimator:
This compares each endpoint against the mean of other rollouts' final scores, giving positive credit when it exceeds that reference. The full algorithm is summarized in Algorithm 1.
Empirical Validation / Results
Main Results
Table 1: Main results on SWE benchmarks (pass@k %)
| Method | Verified pass@1 | Verified pass@2 | Verified pass@4 | Verified pass@8 | Pro pass@1 | Pro pass@2 | Pro pass@4 | Pro pass@8 |
|---|---|---|---|---|---|---|---|---|
| Base | 26.00 | 35.14 | 43.52 | 50.60 | 12.17 | 18.96 | 27.00 | 35.71 |
| Binary | 34.63 | 43.04 | 50.36 | 56.80 | 16.54 | 25.00 | 34.16 | 41.73 |
| PR-Harmonic | 34.45 | 43.76 | 51.62 | 58.00 | 16.92 | 24.70 | 32.56 | 38.72 |
| PR-VeRPO | 34.45 | 42.41 | 49.43 | 55.40 | 19.50 | 28.24 | 36.62 | 42.86 |
| PR-Process | 35.55 | 44.11 | 51.60 | 58.40 | 19.36 | 27.48 | 35.79 | 42.48 |
| CodeLift | 38.30 | 47.53 | 55.84 | 62.80 | 20.16 | 28.71 | 36.84 | 43.23 |
| Δ vs. Binary | +3.67 | +4.49 | +5.48 | +6.00 | +3.62 | +3.71 | +2.68 | +1.50 |
CodeLift consistently outperforms all baselines across all benchmarks and sampling budgets.
Ablation Study
Table 2: Ablation for CodeLift's components
| Method | Verified pass@1 | Verified pass@4 | Pro pass@1 | Pro pass@4 |
|---|---|---|---|---|
| CodeLift | 38.30 | 55.84 | 20.16 | 36.84 |
| -Δ snapshot | -2.47 | -4.47 | -0.28 | -0.15 |
| CL-Outcome | 35.83 | 51.37 | 19.88 | 36.69 |
| -Δ behavior | -1.20 | -1.01 | -3.34 | -2.53 |
| Binary | 34.63 | 50.36 | 16.54 | 34.16 |
Both components contribute meaningfully: behavior-balanced scoring has larger impact on Pro, while snapshot slicing has larger impact on Verified.
Robustness Analysis
Table 3: Robustness across training settings (Qwen3-Coder on SWE-rebench)
| Method | Adv. | Verified pass@1 | Verified pass@4 | Pro pass@1 | Pro pass@4 |
|---|---|---|---|---|---|
| Base | - | 44.13 | 57.80 | 34.59 | 49.94 |
| Binary | RLOO | 47.70 | 63.20 | 34.30 | 50.88 |
| Binary | GRPO | 47.05 | 61.36 | 34.77 | 50.38 |
| CodeLift | RLOO | 48.30 | 65.40 | 35.95 | 51.76 |
| CodeLift | GRPO | 48.80 | 65.80 | 35.76 | 51.40 |
CodeLift outperforms Binary under both RLOO and GRPO advantage estimators.
Theoretical and Practical Implications
Dense and Stable Learning Signals
- CodeLift maintains a mean of 75.1% active rollout groups (with non-zero advantages) throughout training, compared to Binary's 47.9%.
- Raw PassRate collapses quickly during training, while CodeLift maintains stable performance (35.8–36.2% after step 180 vs. Binary's 30.4–35.0%).
Balanced Progress-Regression Preferences
- Under raw PassRate, the mean penalty for introducing regressions is 3.71× the mean reward for making progress, encouraging conservative behavior (58.3% of positive advantages come from patches without pass-rate changes).
- CodeLift achieves a 1.08 ratio (near parity), with 81.6% of positive advantages coming from patches that make real progress.
Adaptive Curriculum
- CodeLift assigns zero weight to all-passing test groups, dynamically redistributing weight to tests that fewer patch groups pass.
- As the policy improves, easy test groups join the all-pass group without occupying weight space, while hard groups' average weights keep rising.
- This curriculum emerges naturally from existing final-patch test outcomes, requiring no extra rollout generation (only ~2.35 additional CPU-based test executions per rollout for snapshot slicing).
Conclusion
CodeLift combines behavior balancing and snapshot slicing to provide dense, well-calibrated rewards for SWE agents. The method:
- Groups tests and patches by outcome behavior to reduce pass-rate imbalances
- Naturally introduces an adaptive curriculum from existing final-patch outcomes
- Applies the same scoring rule to intermediate patches, assigning credit for progress even when later edits introduce regressions
Experimental results on SWE-bench Verified and SWE-bench Pro (Python) demonstrate consistent advantages over binary and enhanced pass-rate baselines. The analysis confirms denser learning signals, more balanced rewards, and test weights that adapt to the changing policy.
Limitations: The method is validated on Python repositories only; performance in other languages remains to be evaluated. Snapshot slicing requires additional test executions (~2.35 non-final patches per rollout), though these run on CPUs rather than GPUs.
Future directions could include extending CodeLift to other programming languages and repository environments, and further refining the credit assignment mechanism for even finer-grained learning signals.
Related papers
- Into the Unknown: Benchmarking AI agents on open scientific research problems
No frontier AI agent can autonomously produce a valid follow-up scientific paper; all 135 submissions failed integrity, completeness, or sufficiency, with fabrication and false claims being the dominant failure mode.
- Athanor: An Agent-Native System for Autonomous Post-Training Research
A team of four autonomous agents post-trained a 4B base model to vendor-instruct level in 104 hours for $12,000, without teacher models or human advice.
- AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents
AutoCompact trains coding agents to decide when and how to compact context, improving SWE-bench Verified pass rates by 9.2% over the base model.