TL;DR
We’ve all seen "instruction bloat" in LLM coding agents—those AGENTS.md files that grow forever but never seem to make the agent smarter. This paper explores an automated "retrospective loop" where an agent learns from its mistakes and a "Notary" gates those lessons, only to find that even a perfectly governed loop fails to improve performance if the feedback signal is too thin or if lessons aren't treated as testable hypotheses.
What Problem Does This Paper Address?
When Large Language Model (LLM) agents work on software, they often repeat the same mistakes across different Pull Requests (PRs). The standard fix is manual: a human developer notices a pattern, stops the pipeline, and adds a "lesson" to the agent's instructions.
However, these instruction files tend to grow indefinitely, increasing inference costs without necessarily improving success. Worse, if you let an agent edit its own instructions, it might "game" the system, encoding chance failures as hard rules or accumulating low-impact clutter. The authors tackle the challenge of building a governed, self-improving loop that can automatically learn, audit, and refine these rules without human intervention.
Methods
The authors designed a four-stage agentic pipeline: PLANNING, IMPLEMENTATION, REVIEW (which is kept "frozen" to provide a stable baseline), and FIX.
To make this pipeline "self-improving," they added three key components:
- The Retrospective Agent: Every 10 PRs, this agent looks back at the logs (review comments, test outcomes, etc.) and proposes edits to the rules (add, replace, delete, or merge).
- The Notary: This is the gatekeeper. It checks the Retrospective Agent’s homework. It rejects proposals that lack evidence, contradict existing contracts, or simply repeat the frozen reviewer's criteria.
- The Provenance Ledger: An append-only record of every decision, proposal, and piece of evidence, ensuring the system remains auditable.
The goal was to see if this "Notary-gated" loop could actually move the needle on performance by distilling experience into better instructions.
Datasets
The study was pre-registered and conducted across 880 PR runs using:
- Repositories:
sqlglotanddvc(two popular Python libraries). - Benchmark:
SWE-rebench, which uses real-world GitHub issues and their associated "hidden" tests to evaluate if an agent actually fixed the bug. - Model: A local open-weight LLM (
Qwen3.6-35B-A3B).
Key Insights and Ideas
- Signal Starvation: The biggest "aha" moment was realizing how little feedback the agent actually had. On average, there were only 0.45 comments per PR. It’s hard for a student to learn when the teacher only speaks once every two assignments.
- Admitted $\neq$ Effective: The Notary was great at its job—it filtered out 34 unsupported proposals. However, even the "good" rules it admitted didn't lead to better outcomes. Just because a rule is based on past evidence doesn't mean it will help with future, unseen problems.
- Rules as Hypotheses: The authors argue that we shouldn't just "admit" a rule and forget it. Instead, every learned rule should be treated as a testable hypothesis. If a rule is added but doesn't improve metrics over the next few windows, it should be retired.
- Uptake is Tricky: Even when the agent followed the new rules (which they tracked using "probe" rules), it didn't always translate to a fix. For example, a rule to add docstrings was followed often, but it didn't help solve the underlying logic bugs.
Key Results
The results were a bit of a cold shower for fans of fully autonomous self-improvement:
- Governance Worked: The loop ran end-to-end, and the Notary successfully rejected 38% of proposals (55/89 accepted).
- Performance Stayed Flat: Despite ten rounds of retrospectives, there was no measurable improvement in hidden-test resolution or a reduction in review comments.
- Instruction Growth: The rules grew from ~1,000 tokens to nearly 1,800, increasing cost without increasing value.
Limitations and Future Work
The study was limited by its use of a single local LLM and only two repositories. The authors suggest that future "Notaries" shouldn't just look at text evidence; they should re-run tasks to see if a proposed rule actually changes the outcome before admitting it.
They also highlight the need for "outcome-aware" admission: if the goal is to reduce "spiral stops" (where the agent gets stuck in a loop), the Notary should specifically look for rules that address those process signals, rather than just code-style comments. Ultimately, the vision is a system where rules are constantly competing to prove their worth, with the "Notary" acting more like a scientist than a simple clerk.
Summary updated