Fixer-Guided Localization: 27.5% Less Code for the Same Bug Hits, but No Significant Gain in Solved Tasks

Let the Fixer Decide: Training a Code Localizer from the Fixer's Likelihood

Khalil Hennara, Muhammad Hreden, Zeina Aldallal, Sara Chrouf, Safwan AlModhayan

cs.AI, cs.SE

2026-11-09

A code localizer trained by weighted SFT on a frozen fixer's patch likelihood, with no tests or RL, cuts localization size 27.5% offline; the end-to-end gain (8 vs 6 solved) is not significant.

What problem this solves

Code localizers are normally trained to predict which files or functions a reference patch edits. But the code a fixer needs to read is not the code it changes. A fix often depends on a caller, a base class or a test that the patch never touches. The paper cites a localizer with about 80% file accuracy that still produced only 38% resolved issues.

Retrieval-augmented LMs solved the analogous problem long ago: train the retriever on what helps the reader. For issue resolution, learning from outcomes has meant reinforcement learning with test execution, which is expensive. This paper asks whether supervised fine-tuning alone can get a localizer to learn from the fixer.

The setting is the Kaggle Gemma 4 Developer Agent competition, which fixes the model, serving stack and tools. With a small budget, the authors trained only Gemma 4 E4B.

Method

Fixer-Guided Localization (FGL) treats the localization as a latent variable and follows an EM recipe:

One design choice matters a lot: two folds. Training tasks are split into halves A and B, each with its own localizer and fixer, and each fold scores the other's tasks. A fixer that has seen a task's patch can reproduce it from nearly any context, so every candidate would score high and the weights would carry no information. A localizer that has seen a task just repeats the teacher. Fold models only propose and score, and are never deployed.

The whole loop uses forward passes of the frozen fixer. There are no tests and no online rollouts.

For data, Kimi K3 ran in the competition's own agent loop: 3,068 attempts, 1,629 test-verified solutions (55%), about $775. The teacher often "remembered" the upstream fix, citing invented PR numbers and commit hashes, so a cleaning pass rewrote 3,233 recall passages in 1,116 trajectories while leaving tool calls and patches untouched. Each trajectory is cut at the first edit: the exploration before it becomes a localizer record, the rest a fixer record. Any extra reads use only outputs the teacher actually saw.

Results

Offline signal test (1,016 training tasks, other fold's fixer run live):

InputFirst edit at a patched locationLocalization sizeContext overflows
Teacher localization T42.4%2,731 tokens146
Top FGL candidate S43.1% (p=0.74)1,980 tokens (-27.5%)82 (-44%)

The fixer preferred a candidate other than the teacher's on 83% of tasks.

Development set (78 tasks, 4×L4, 8 minutes per task, paired McNemar tests within a sampling setting):

System (temp 0.7, 44 calls)SolvedReached a patchEnded with no patchRepeated "No such file"
S3r1-soft (EM target)853943 tasks
S3r1-ctrl (teacher localization only)6461654 tasks

Soft solves 4 tasks ctrl misses, ctrl solves 2 that soft misses (p=0.69). Every process metric moves the right way; the solved count is within noise. Hard EM is no better than soft.

The single-agent S1 is the most robust system: 8, 10 and 11 solved across three runs, against 8 for the base model (p=0.69 and 0.45). Every two-agent system solves 4 to 8. Across all 13 runs only 18 distinct tasks were ever solved, and no comparison reaches p<0.05.

Trained agents make about three times as many tool calls as the base model (median 30 to 44 vs. 11), and wrong patches fall from 61 tasks to 9 to 14. The cost is time: 54 to 60 tasks run out of budget.

Why it matters

For anyone considering SFT instead of RL for a localizer, this is a cheap feasibility result. Offline, a fixer-likelihood target keeps the hit rate and shrinks the context, and the signal needs only forward passes of a frozen model, no sandbox.

It does not show more solved tasks. The evidence supports "works offline, improves process metrics," not "raises success rate."

The engineering lessons may be worth as much. Filter teacher trajectories by the student's expected speed (teacher median 15 calls; the student generates about 50 tokens/s on 4×L4). Asking for 16K output tokens in a 32K window rejects any prompt over 16K, which ended 4 of 5 tasks in the first run. And rerun small evaluations: the same model varies by about three solved tasks on 78 problems.

Limitations

Stated by the authors: one model size (E4B), one EM round updating only the localizer, one run per system per setting, two sampling groups that cannot be compared with each other, and 4-way parallel evaluation that is slower than the official scorer. The signal test measures where the fixer edits, not whether its patch passes, and candidates were sampled after the teacher's exploration rather than the localizer's own.

Some further doubts. One of four scoring jobs stopped early, so only 1,040 tasks have EM scores and the rest keep only the teacher's localization, which dilutes the signal. Two-agent systems trail the single agent overall, and the localizers' habit of using a nonexistent /workspace/src/ path is a failure source unrelated to the objective that can mask any FGL effect. Finally, no end-to-end comparison is significant, so "8 vs. 6" is not evidence by itself.

Terms

Source

Related papers

All paper explainers