Kronumos 2 Kairos: Cost-Bounded Automated Program Repair via Dual-Brain Cybernetic Sub-Cortex on SWE-bench Verified
This paper introduces Kronumos 2 Kairos, a cost-bounded automated program repair engine that combines a fine-tuned 7B code model with a novel "Dual-Brain Cybernetic Sub-Cortex" to achieve 8 verified bug fixes on the SWE-bench Verified dataset with zero marginal inference cost and a 93.5% reduction in token usage compared to industry baselines.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Software maintenance is a quiet, massive industry that consumes more than sixty percent of the global engineering budget. It is the work of finding broken pieces in complex digital systems and fixing them without breaking the parts that still work. For decades, this has been a human task, requiring deep knowledge of how different code files talk to one another. Recently, computer programs trained on vast amounts of code have begun to attempt this work themselves. These programs, known as large language models, can read a description of a problem and suggest a fix. However, when these models try to fix real-world software, they often struggle. They get lost in the sheer volume of information, they make subtle formatting errors that cause the computer to reject their work, and they do so at a high financial cost, often requiring expensive cloud computing power for every single attempt.
A new study introduces a different approach to this problem, one that prioritizes precision and cost-efficiency over brute force. The researchers built a system called Kronumos 2 Kairos, designed to act as a surgical tool rather than a broad search engine. Instead of letting a computer model wander through a codebase, guessing and checking repeatedly, this system forces the model to focus on a very specific, narrow task. It pairs a moderately sized, open-source computer model with a rigid, rule-based engine that acts as a strict quality control inspector. The goal was to see if a smaller, cheaper model could fix real software bugs if it was protected from its own tendency to make careless mistakes and if it was prevented from wasting resources on unnecessary steps. The researchers tested this system on a benchmark of five hundred real-world software issues, a standard set of challenges used to measure the ability of artificial intelligence to repair code.
The system operates by splitting the work into two distinct parts. The first part is the "cognitive cortex," which is the computer model responsible for understanding the problem and writing the code fix. The second part is the "sub-cortex," a deterministic engine written in a language that guarantees exact, predictable behavior. This sub-cortex acts as a filter and a formatter. Before the model even sees the problem, the sub-cortex strips away thousands of lines of irrelevant technical noise that usually clutter the error messages. It removes sensitive information like passwords and API keys to ensure privacy. It then takes the model's output and checks it against the strict rules of how code patches must be written. If the model makes a mistake in the line numbers, the indentation, or the formatting of the fix, the sub-cortex catches it immediately. It either corrects the error or rejects the patch entirely, ensuring that no broken or malformed code is ever submitted for testing. This process prevents the system from wasting time on attempts that are doomed to fail due to simple formatting errors.
The researchers ran this system against the five hundred real-world software issues. The results showed that the system could successfully resolve eight of these bugs. While eight out of five hundred might seem like a small number, the significance lies in how the system achieved this. The researchers used a model with only seven billion parameters, which is significantly smaller than the massive models used by commercial companies that often cost thousands of dollars to run. By using their dual-brain architecture, the system managed to solve these problems with zero marginal cost for the computing power used. The average amount of data the system processed for each task was just over two thousand tokens, a figure that is ninety-three percent lower than the hundreds of thousands of tokens typically consumed by other automated repair systems. This drastic reduction in data usage means the system is far more efficient and scalable than current alternatives.
A critical finding of the study was the importance of the strict quality control engine. When the researchers removed the sub-cortex's ability to fix formatting errors after the model wrote the code, the number of successful repairs dropped from eight to six. This demonstrated that a significant portion of the model's failures were not due to a lack of understanding, but rather due to minor, correctable mistakes in how the code was presented. The sub-cortex acted as a safety net, catching these errors and ensuring that the logical fixes the model found were actually delivered in a usable format. The system also proved that it could operate without running the software tests itself during the repair process. Instead of trying the fix and seeing if it works, the system relied on its internal rules to ensure the fix was structurally sound before it was ever applied.
The study evaluated the system across four different software ecosystems, including major projects like Django and Scikit-Learn. The eight successful repairs covered a variety of issues, from fixing a crash in a database migration tool to correcting a mathematical error in a data analysis library. In one instance, the system fixed a bug where a program would crash if a specific setting was missing; the model correctly identified that the code needed to check for the setting's absence before trying to use it. In another case, it fixed a problem where a program would accidentally change data that it was supposed to leave alone. The researchers manually inspected every successful fix to confirm that the logic was correct and that the solution was not just a lucky guess.
The researchers acknowledge that their system is not a complete solution to all software bugs. The model still struggles with very complex problems that require deep reasoning across many different files or that involve abstract concepts beyond its training. However, the study establishes a new baseline for what is possible with smaller, open-source models. It shows that by combining a capable but modest computer model with a rigid, rule-based system that enforces strict standards, it is possible to achieve reliable results without the massive costs associated with current state-of-the-art systems. The work suggests that the future of automated repair may not depend on making models infinitely larger, but on building better systems to guide them and catch their mistakes.
This research provides a clear path forward for making automated software repair accessible and affordable. By proving that a system can fix real bugs with zero cost and high efficiency, the study challenges the notion that only the most expensive, powerful models can do this work. The success of the dual-brain approach highlights the value of separating the creative task of writing code from the mechanical task of ensuring it follows the rules. As the field of automated repair continues to evolve, this work offers a practical example of how to balance intelligence with discipline, ensuring that the tools we build to fix our software are themselves robust, reliable, and efficient.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.