How Does AI Find the Code to Fix? Training a Localizer on the Fixer’s Chances of Success

FGL trains a code localizer using the probability that a fixing model will succeed. It pinpoints bugs with less code, without running tests or using reinforcement learning.
← All posts
온
온틀 리서치
2026년 11월 25일 Updated 2026.12.01 30 min read views 7

Before you can fix a bug, you need to figure out which code to look at. This paper changes how the model responsible for that search—the localizer—is trained. Instead of teaching it to identify the files touched by a reference patch, it teaches the localizer to select the code that gives the bug-fixing model, or fixer, the best chance of success. The result: the localizer helps the fixer find bugs as often as the teacher’s localization does, while reducing the code it needs to read by 27.5%, according to the abstract. No tests were run, and no reinforcement learning was used.

The Problem This Paper Addresses

Automated software bug fixing usually has two stages: finding where to make a change, known as localization, and writing the change, known as patch generation. The model handling the first stage is the localizer.

Traditionally, localizers have mostly been trained like this: given a human-written reference patch for an issue, use the list of files that patch modifies as the target. The model learns, “For this issue, select these files.” It is intuitive, and the data is tidy. There is no ambiguity about which files a patch touches.

But there is a catch. The paper’s central observation fits into one sentence: the code a fixer needs to read is not the same as the code a patch changes. Think about fixing a bug yourself. The final diff might change just three lines in one function, but getting there can require reading the caller, a configuration file that affects shared state, and another module with a similar pattern. Most of that reading leaves no trace in the final patch.

Traditional training, however, treats only the files changed by the patch as correct answers. In effect, it teaches the localizer to point to the final editing targets rather than the context the fixer needs to understand the problem. The greater the mismatch, the more likely it is that a localizer can identify the correct files yet leave the fixer unable to solve the bug from that narrow view. It gives the right destination address without directions for getting there.

The Core Idea

The proposed method is called Fixer-Guided Localization, or FGL. Its design philosophy is right there in the title: “Let the Fixer Decide.”

Here is how it works.

  1. The localizer proposes multiple localization candidates for an issue. Each candidate is a different suggestion for which code to inspect.
  2. A frozen fixer scores each candidate using a single criterion: “Given this code, how likely am I to produce a verified patch?” The fixer itself is not trained or updated; it serves only as the judge.
  3. Those scores become the training signal for the localizer through weighted supervised fine-tuning. This is SFT with larger weights assigned to higher-scoring candidates.

Two choices matter here. First, the scoring criterion is the probability, or likelihood, of the fixer succeeding, rather than agreement with the files touched by a patch. This naturally encourages the localizer to learn which code needs to be read. Second, scoring does not require actually running tests. The method measures the probability of the fixer producing a patch; it does not generate that patch and run it through a test suite. It also uses no reinforcement learning, or RL. Instead of updating a policy through an RL reward signal, it converts the fixer’s likelihood into weights for ordinary SFT.

Why does this matter in practice? Test execution is slow, test environments can be difficult to set up, and RL is unstable and expensive. FGL avoids both while still obtaining a signal about the context the fixer prefers. Scoring requires only a probability calculation from the fixer.

The abstract calls this cycle “one EM round.” It can be read as a single round of an expectation-maximization-like process: propose candidates, assign more weight to good ones, and retrain the model in that direction.

How the Experiments Were Set Up

The following covers only the setup described in the abstract.

  • Base model: Gemma 4 E4B. The full pipeline was built for Kaggle’s Gemma-4 Developer Agent competition.
  • Training data: 1,629 test-verified Kimi K3 trajectories. These are 1,629 records of a coding agent working through a problem, with success confirmed by tests. The unit matters: these are trajectories, not tasks or steps.
  • Comparisons: The main comparison is between an agent trained with FGL and a matched control. The control appears to hold other conditions constant while omitting the FGL objective. A separate comparison pits the trained agent against the base model.
  • Evaluation scale: Results are reported for one EM round on a development set, alongside a separate analysis of 13 evaluation runs. Single-agent performance was measured across 78 tasks.
  • Constraints: The setting gives a 4B agent an 8-minute budget per task.

It also matters what these metrics measure. The number of tasks that reached a patch, the number that stalled while reading nonexistent files, and the number solved describe agent behavior and final success. Localization efficiency is measured by how much code is read while maintaining the same frequency of finding bugs. There are also things these numbers do not directly tell us. They cannot establish generalization across codebases and languages, effectiveness with larger models, or what happens over multiple EM rounds.

Results and What They Mean

The numbers need to be read alongside their conditions. Results from separate experiments should stay separate.

(1) Localization efficiency: the overall comparison. Training with the FGL objective reduced the code used by 27.5% while allowing the fixer to find bugs as often as it did with the teacher’s localization. In other words, it achieved the same success rate with a smaller context. Reading less while finding bugs just as often is the central benefit FGL targets.

(2) Development set: one EM round versus a matched control. All three metrics moved in the intended direction. - Tasks that reached a patch: 53 versus 46 - Tasks that stalled while reading nonexistent files: 43 versus 54 (lower is better) - Tasks solved: 8 versus 6

There were fewer dead ends from reading nonexistent files, more tasks progressed to a patch attempt, and more were actually solved. This suggests that a single round moved the agent in the right direction.

(3) Behavioral changes: trained agent versus base model. The trained agent explored about 3 times as much as the base model and wrote far fewer incorrect patches. As a single agent, it solved up to 11 of 78 tasks, compared with 8 for the base model.

One distinction is essential here: the “8” in (2) and the “8” in (3) come from different experiments. In (2), 8 is the number of tasks the trained agent solved after one round on the development set, compared with 6 for the control. In (3), 8 is the number the base model solved out of 78 tasks, compared with up to 11 for the trained agent. The same number does not mean the same result.

(4) Analysis of small-agent limitations. An analysis of 13 evaluation runs identified three factors holding back a 4B agent under an 8-minute budget: time, repetitive loops, and edit quality. The paper also offers practical lessons for training small coding agents.

The takeaway is that changing the localizer’s training signal from “what was edited?” to “what helped fix the bug?” improved both efficiency—reading less—and behavior—getting lost less often. And it did so without test execution or RL.

Limitations and Open Questions

The authors’ analysis directly identifies three barriers facing a 4B agent within an 8-minute budget: running out of time, getting stuck repeating the same actions, and producing poor-quality edits. Better localization through FGL does not remove those barriers. Training a good localizer and getting a fixer to write good patches remain separate problems.

The following are questions that arise from reading the abstract, rather than findings it explicitly reports.

  • Does the frozen fixer’s quality impose a ceiling? If the scorer is a fixed fixer, its success-probability signal may be weak for bugs it cannot handle in the first place. A judge cannot easily teach a competitor to recognize something the judge cannot see.
  • What happens over multiple EM rounds? The abstract reports one round. This summary does not tell us whether repeated rounds keep improving performance or where progress stops.
  • How well does it generalize across scales and domains? These numbers come from a particular combination: Gemma 4 E4B, a specific competition, and Kimi K3 trajectories. Behavior with larger models or different codebases remains an open question.

The absolute numbers also deserve a realistic reading. Solving 11 of 78 tasks is low by large-model standards, but it comes under the demanding conditions of a single 4B agent with an 8-minute budget. The experiment asks how far a small model can go, rather than competing for the highest possible performance.

Comparison with Other Approaches

This comparison is limited to the two contrasts explicitly drawn in the abstract.

  • Reference-patch supervision versus FGL. The prevailing approach uses the files edited by a patch as the correct targets. FGL replaces that definition of correctness with the fixer’s likelihood of success. The target shifts from what to edit to what to read.
  • Test execution and RL versus weighted SFT. Other ways to use the fixer’s success as a signal include generating patches and running tests to verify them, or using success as a reward for RL. FGL avoids both, converting the fixer’s likelihood into weights for ordinary SFT. Its distinguishing feature is that it bypasses slow execution and unstable RL.

A detailed comparison with the broader localization research landscape falls outside the scope of this abstract-based summary. No exhaustive claims are intended.

ONTLE’s Perspective

ONTLE provides AI project managers to client companies. Consider one of the most routine parts of an AI PM’s work: a bug ticket arrives in a client’s repository, and the AI PM passes context to a developer or coding agent, saying, “This looks like a payments-module issue; look at these files.” That act of handing over context is localization.

Many classification and routing systems fall into the trap FGL describes. They learn which files were ultimately changed for similar past tickets, then point to those files. The result looks accurate, yet the person or agent receiving the work cannot even reproduce the issue from those files alone. The caller, configuration, and related modules should have been included, but the system selected only the final editing targets.

Applying FGL’s idea to this workflow means evaluating the AI PM’s context selection by whether the recipient actually solved the issue, rather than by agreement with past diffs. Each time a ticket closes, record whether the file set the PM initially supplied was sufficient to solve it, and use that success signal to train the selection model. There is no need to run tests or design complex rewards: the existing “solved/not solved” outcome can serve as the weight. For a service like ONTLE, where closed-ticket histories accumulate across multiple clients, those outcome labels become an inexpensive substitute for FGL’s fixer-likelihood signal. The direction of the 27.5% efficiency improvement is particularly relevant: hand over fewer files, reduce developer fatigue, and maintain the same resolution rate.

A Checklist for Practitioners

These checks are drawn directly from the paper’s ideas for teams considering them in their own services.

  1. Is your localizer learning what to edit or what to read? If it is trained only on files changed by reference patches, it likely carries the very mismatch FGL identifies.
  2. Can you provide a frozen scorer, such as a fixer or verifier? FGL assumes a fixed fixer scores the candidates. First check whether your pipeline has a fixed model that can assign success likelihoods, or labels recording final outcomes.
  3. Can you obtain a signal without running tests? If environment setup and test execution are bottlenecks, assess whether likelihood-weighted SFT offers a cost-effective way to bypass RL and tests.
  4. Do you track attempts to read nonexistent files and the rate of reaching a patch? As the development-set comparison shows, fewer dead ends (43 versus 54) and more tasks reaching a patch (53 versus 46) are leading indicators that move before final success rates.
  5. Do you measure the three barriers facing small models on short budgets? Time, repetitive loops, and edit quality held back the agent in the 4B, 8-minute setting. Check whether your own agent is instrumented to measure them.
  6. Do you track efficiency—the amount of code read—alongside success rates? FGL’s core benefit is achieving the same hit rate with less context. Looking only at success rates hides that improvement.
Does FGL change only the localizer, or is the fixer trained too?

The fixer remains frozen and only scores candidates. The localizer is the model being trained, through weighted supervised fine-tuning that uses the fixer’s patch-success likelihood scores as weights.

Why avoid reinforcement learning and test execution?

This is a central design choice emphasized in the abstract. FGL does not run tests; it looks at the probability that the fixer will produce a patch. It also uses no RL. It avoids slow test execution and unstable RL while incorporating the signal about which context the fixer prefers into weighted SFT.

Does 27.5% mean the success rate increased by 27.5%?

No. It is an efficiency figure: according to the abstract, the amount of code the fixer needs to read fell by 27.5%, while the frequency of success in finding bugs stayed on par with the teacher’s localization. The hit rate was maintained; the reading load decreased.

Isn’t solving 11 of 78 tasks low for a single agent?

The absolute number is not high, but it comes from demanding conditions: a 4B model working alone with an 8-minute budget per task. The base model solved 8 under the same conditions, compared with up to 11 for the trained agent. The experiment aims to explore how far a small agent can go, rather than compete for peak performance.

Can the work be reproduced using public materials?

According to the abstract, the data, code, and adapters are all publicly available. The base model is Gemma 4 E4B, and the training data consists of 1,629 test-verified Kimi K3 trajectories. See the arXiv and HuggingFace pages in the references below for detailed links.

References