TL;DR
AI coding agents crush benchmarks by passing unit tests, yet real-world maintainers routinely reject their pull requests because the code feels bloated, alien, and ignorant of project conventions. Learning to Commit solves this by putting agents through a virtual "onboarding" phase: they attempt past commits in chronological order, compare their guesses against what human maintainers actually merged, and distill their mistakes into a living "skill document." The result is code that doesn't just work, it actually belongs—improving architectural alignment while lifting test-pass rates in the process.
What Problem Does This Paper Address?
Imagine hiring a brilliant developer who refuses to learn your team's history. You hand them a bug ticket; they fix it, the tests turn green, and they submit a pull request. Then you read the diff: they re-implemented three helper functions your codebase already has, ignored module boundaries, and violated unwritten architectural rules. You reject the PR.
Today’s LLM coding agents behave like these "amnesiac newcomers." Standard benchmarks like SWE-bench treat software engineering as a series of isolated, stateless puzzles—handing the agent a static snapshot of a codebase and grading solely on whether tests pass. Looking only at the latest snapshot is like looking at a finished skyscraper without seeing the blueprints; it shows what is there, not how the maintainers prefer to build. Consequently, agents produce "alien code" lacking organicity—how indistinguishable a generated patch is from one written by a veteran maintainer.
Methods
Instead of relying on static retrieval (RAG) over past commits or changing model weights, the authors introduce next-commit prediction via a two-phase framework called Learning to Commit.
- Repository Onboarding (Supervised Contrastive Reflection): Repositories are split strictly by time. Walking chronologically through historical commits before a cutoff date, the agent undergoes active trial-and-error:
- Blind Attempt: Given a synthetic issue description and the historical repo snapshot, the agent explores the codebase using standard tools (search, read, edit) and writes a candidate patch.
- Contrastive Reflection: The ground-truth human commit ("oracle diff") is revealed. Because the agent just tried the task itself, comparing its patch to the expert’s exposes its exact, intrinsic blind spots ("on-policy" supervision).
- Skill Update: The agent updates a structured markdown skill document via create, revise, and deprecate operations—recording reusable rules about internal APIs, file locations, and architectural boundaries.
- Skill-Conditioned Resolution: When a genuinely future issue arrives, the agent receives the current codebase alongside its accumulated skill document, consulting its hard-earned lessons to write an organic patch.
Datasets
- Learning to Commit Benchmark (New): Curated from 5 major open-source AI engineering repositories (including
vllmandmilvus), spanning over 63,000 commits. It uses strict per-repository chronological splits (10 historical onboarding commits and 10 future test commits per repo) to prevent data leakage. Crucially, instead of unit tests, it evaluates organicity using deterministic metrics—File IoU (did it touch the exact right files?) and Line Deviation (did it bloat the patch?)—alongside a multi-dimensional pairwise LLM judge validated against human reviewers. - SWE-bench Pro: A public, contamination-resistant benchmark with executable test suites. The authors sample 50 tasks and reframe them temporally: for a task at time $t$, the agent onboards using the top-3 relevant commits strictly prior to $t$.
Key Insights and Ideas
- Failing first is the secret sauce for localization: When an "observation-only" baseline simply studied expert patches without trying the task first, it learned coding conventions well enough, lifting file localization (File IoU) by just 1 percentage point. Forcing the agent to make a blind attempt first jumped that gain to 5 percentage points. You don't truly learn where files live until you guess wrong and get corrected.
- Unsupervised self-reflection is worse than amnesia: Having an agent reflect on its own attempts without seeing the ground-truth oracle diff caused its win rate against a memoryless baseline to drop to 44%. Left to its own devices, the agent hallucinates conventions and reinforces its own bad habits.
- Organicity unlocks functional correctness: Writing idiomatic code isn't just cosmetic. In strict repositories, violating conventions breaks tests, and historical skills point agents toward crucial companion files (like registries or config schemas) that aren't mentioned in the issue description.
Key Results
Trends across onboarding iterations showing skill document growth, rising File IoU, and dropping Line Deviation.
- More organic patches: On the Learning to Commit benchmark (using Claude Opus 4.6 with sequential full-corpus learning), the framework boosted File IoU from 62% to 67%, cut patch bloat (Line Deviation) by roughly a quarter (0.58 to 0.43), and achieved a 59% pairwise win rate over the vanilla agent. Gains held steady across Claude Sonnet 4.6 and Kimi K2.5.
- Higher test-pass rates: On SWE-bench Pro, conditioning on learned skills lifted
pass@1across all models, with gains scaling alongside base model strength: Kimi K2.5 rose +3.0 percentage points (to 34.0%), Sonnet 4.6 rose +6.0 pp (to 40.0%), and Opus 4.6 jumped +8.0 pp (from 48.0% to 56.0%).
Limitations and Future Work
- The "Tunnel Effect": Occasionally, loaded skills make an agent overconfident, priming it to jump straight into a familiar pattern while skipping basic exploratory searches—causing regressions on 8 out of 200 pooled task-runs on SWE-bench Pro.
- Higher exploration cost: Skill-conditioned agents take noticeably more tool-call steps (e.g., 40 vs. 26 steps on average) because they inspect the codebase more thoroughly to verify conventions before committing.
- Benchmark scope: The newly curated benchmark lacks executable test suites, relying on SWE-bench Pro to verify functional correctness.
- Future Work: The authors aim to convert this blind-attempt-versus-oracle signal directly into a reinforcement learning objective, training model weights end-to-end rather than relying purely on text-based skill distillation.
Summary updated