# Fixer-Guided Localization: Train Code Localizers From Fixer Patch Likelihood

> Source: <https://explainx.ai/blog/fixer-guided-localization-gemma-4-code-agent-2026?utm_source=rss&utm_medium=feed&utm_campaign=blog>
> Published: 2026-11-24 00:00:00+00:00

**Recommendation:** Train your code localizer on fixer patch likelihood instead of reference-patch files, and penalize localization size and extra reads so the fixer sees 27.5% less code at equal bug-finding.
More in the playbook "Working with AI coding agents": <https://wpnews.pro/playbooks/coding-agents>

**Fixer-Guided Localization (FGL)** trains a **code localizer** from **how likely a frozen fixer is to write a verified patch**, not from **which files a teacher patch touched**. The method appears in [arXiv:2611.12164](https://arxiv.org/abs/2611.12164?ref=explainx), submitted **November 9, 2026**, with **public code** on [GitHub (`misraj-ai/locfix`)](https://github.com/misraj-ai/locfix?ref=explainx) and **adapters** on [Hugging Face (`Hennara/locfix-e4b-runs_p`)](https://huggingface.co/Hennara/locfix-e4b-runs_p?ref=explainx).

## TL;DR

| Question | Answer | 
|---|---|
| **Problem** | Localizers trained on **reference patch files** show code the fixer never needs | 
| **Idea** | Let the **fixer’s patch likelihood** score each candidate localization | 
| **Base model** | **Gemma 4 E4B** with**dual LoRA** (localizer + fixer) | 
| **Data** | **1,629** test-verified**Kimi K3** trajectories for Kaggle’s Gemma-4 agent track | 
| **Efficiency** | Fixer finds bugs as often as teacher locations with **27.5% less code** shown | 
| **Dev-set EM round** | **53 vs 46** tasks reach a patch;**8 vs 6** solved | 
| **Behavior** | Trained agents **explore ~3× more** and write**fewer wrong patches** | 

## Why file-matching localizers miss the point

Most **agent harnesses** split work into **find** and **fix**. A **localizer** proposes paths and symbols; a **fixer** reads context, edits, and runs tests. Industrial stacks such as **[Cisco Antares SLMs for vulnerability localization](https://explainx.ai/blog/cisco-antares-vulnerability-localization-slm-july-2026)** treat localization as its own model skill.

Supervised localizers often imitate **files touched by a reference patch**. The authors of **2611.12164** argue that set is **biased toward edits**, not **toward what the fixer must read**. A minimal read set can sit **strictly inside** a large patch diff.

That mismatch shows up in **[Greptile Trex](https://explainx.ai/blog/greptile-trex-computer-use-accessibility-tree-osworld-november-2026)**-style agents too: retrieval that **chases diff statistics** wastes context window on **irrelevant modules**, exactly the failure mode **[mobile agent testers](https://explainx.ai/blog/mobile-agent-testers-claude-code-github-actions-parallel-qa-november-2026)** hunt in CI.

FGL reframes localization as a **hidden variable**. For a task issue, repository, and **verified patch**, the training objective marginalizes over localizations the fixer could have used.

The localizer proposes a localization; the fixer assigns likelihood to the verified patch given that context. Gradients push probability mass toward localizations that make the verified patch likely.

## How FGL scores a localization without running tests

Coding agent repository map linking issues to localized files for patch workflows

The pipeline draws **K** candidate localizations from the **current localizer**, then asks a **frozen fixer** to score each.

Three design choices keep scores stable in the paper:

1. **Score only new-line tokens** in the verified patch, so the fixer cannot cheat by copying unchanged context.
2. **Penalize size and extra read requests** , because without a cost the best localization is “show the whole tree.”
3. **Target an effective sample size** via temperature**τ** , so weights do not collapse to a single candidate every step.

The fixer never updates during this phase. The localizer receives **weighted supervised fine-tuning** on its own proposals.

LoRA adapters on a shared base model for separate localizer and fixer roles in FGL training

The authors stress **no reinforcement learning** and **no test-suite execution** inside the training loop, unlike some **[agent evaluation harnesses](https://explainx.ai/blog/hugging-face-agentic-evaluation-guide-harbor-november-2026)** that bake CI into reward models.

For practitioners comparing **[AWS Strands Decider v2](https://explainx.ai/blog/aws-strands-decider-v2-gemma4-november-2026)**-style routing to full coding stacks, FGL is the opposite move: **improve context choice** before you spend tokens on **[frontier fixers](https://explainx.ai/blog/fast-anything-port-hot-functions-rust-coding-agent-verified-replay-2026)**.

## Reported numbers on Gemma 4 E4B

The competition setup fixes **Gemma 4 E4B** as the shared trunk. Training consumes **1,629** trajectories where **Kimi K3** already produced **test-verified** patches.

| Metric | FGL localizer + fixer | Teacher file match (paper baseline) | 
|---|---|---|
| Fixer finds bug at same rate as teacher localization | **Yes** | Reference | 
| Code volume shown to fixer | **−27.5%** | Baseline | 
| Tasks reaching any patch after 1 EM round (dev) | **53** | **46** control | 
| Tasks stuck on nonexistent paths (dev) | **43** | **54** control | 
| Tasks fully solved after 1 EM round (dev) | **8** | **6** control | 
| Best single-agent solves (78 tasks, 8 min) | **11** | **8** base | 

After training, agents **explore about three times more** and emit **far fewer incorrect patches**, which matches the intuition that better localization **widens search** instead of **locking onto wrong files**.

The paper’s **thirteen-run** postmortem on **4B** agents under an **eight-minute** cap names **time**, **repetition loops**, and **edit quality** as ceilings. That aligns with explainx.ai’s broader warning that **[small-model agent demos](https://explainx.ai/blog/inclusionai-ling-3-2-air-open-weights-november-2026)** live or die on **harness economics**, not leaderboard trivia.

## How to try the released artifacts

The authors published three touchpoints builders can clone today:

1. **[`misraj-ai/locfix`](https://github.com/misraj-ai/locfix?ref=explainx)** — training and expectation-maximization code for FGL.
2. **[`khalil-Hennara/codeagent-validate`](https://github.com/khalil-Hennara/codeagent-validate?ref=explainx)** — validation utilities referenced in the PDF.
3. **[`Hennara/locfix-e4b-runs_p`](https://huggingface.co/Hennara/locfix-e4b-runs_p?ref=explainx)** — adapter weights for the**E4B** localizer run described in the paper.

The [arXiv abstract](https://arxiv.org/abs/2611.12164?ref=explainx) states **all data, code and adapters are publicly available**, though you should read each repo’s license before shipping in production.

A practical integration pattern for teams already running **[Amazon’s Sonnet swap experiments](https://explainx.ai/blog/amazon-strands-decider-internal-ticketing-sonnet-replacement-2026)**:

- Keep your **fixer** frozen while you iterate localization.
- Log **fixer likelihood** on candidate**z** during shadow traffic before EM rounds.
- Treat **27.5% less context** as a**latency and cost** lever, not only an accuracy chart.

## What FGL does not solve

FGL assumes you already have **verified teacher patches** (here from **Kimi K3**). It does not replace **sandboxed test execution** at deployment time, **[verified replay tooling](https://explainx.ai/blog/fast-anything-port-hot-functions-rust-coding-agent-verified-replay-2026)**, or **[security review](https://explainx.ai/blog/cognition-acquires-corridor-devin-security-ex-cisa-founders-stamos-agent-written-code-guardrails-2026)** before merge.

The paper also studies **one architecture family** on **one competition corpus**. Porting FGL to **[Claude Code](https://explainx.ai/blog/satya-nadella-claude-code-ide-faded-pragmatic-engineer-november-2026)**-scale repositories may need different **K** and **τ** schedules.

## Kaggle Gemma-4 Developer Agent context

The authors built FGL for **Kaggle’s Gemma-4 Developer Agent competition**, where teams ship **two-role agents** on a **fixed parameter budget**. Localization quality is often the **hidden multiplier**: a fixer with frontier potential still fails when it reads **ghost paths** or **giant folders**.

Their **1,629** **Kimi K3** trajectories are valuable because every trajectory already passed **hidden tests**. That gives a **verified patch** label without leaking the test suite into training rewards. Teams reimplementing FGL on private repos should mirror that discipline: **teacher patches must be CI-green**, not merely **human-approved**.

Expectation-maximization in the paper is intentionally **lightweight**: **one round** already moves **dev-set solve counts**. Full EM schedules may help, but the authors focus on proving the **fixer-likelihood target** beats **file overlap** as a training signal.

## Comparison with other localization stacks

| Approach | Training target | Needs test runs in training? | 
|---|---|---|
| **Reference patch files** | Files the teacher edited | No, but misaligns read vs edit sets | 
| **FGL (this paper)** | Fixer likelihood of verified patch | No | 
| **RL with unit tests** | Reward from pass/fail | Yes, expensive | 
| **[Cisco Antares SLM](https://explainx.ai/blog/cisco-antares-vulnerability-localization-slm-july-2026)** | Security-specific file ranking | Inference-time only | 

If you already run **[Harbor-style evals](https://explainx.ai/blog/hugging-face-agentic-evaluation-guide-harbor-november-2026)**, treat FGL as a **pre-training hook** that reduces **context tokens per task**, which lowers **eval cost** before you chase leaderboard points.

## Rolling FGL into your agent harness

A minimal integration plan:

1. **Fork `misraj-ai/locfix`** and point it at your**Gemma 4** or**compatible** base with**dual LoRA** .
2. **Collect verified patches** from an existing**teacher agent** run log (not from human diffs alone).
3. **Run soft EM** with**effective sample size ≈ 2** unless you have compute for fuller schedules.
4. **Shadow-deploy** the localizer: log proposed**z** and fixer scores before enabling tool calls in production.

Pair that rollout with **[Strands Decider v2](https://explainx.ai/blog/aws-strands-decider-v2-gemma4-november-2026)** on **routing** and a heavier **fixer** only when localization confidence is low — the same **split-brain economics** Amazon described for **ticketing**.

## What to watch on Hugging Face daily papers

**2611.12164** trended on **Hugging Face papers** in early November with modest upvotes, but the **release of weights** is what makes it actionable today. Watch for **follow-on adapters** on other Gemma 4 sizes and independent **replication runs** on non-Kaggle repos.

If independent teams cannot reproduce the **11-of-78** single-agent peak, the bottleneck is likely **harness timing** (the paper’s **eight-minute** cap) rather than the **FGL objective** itself — tune budgets before you discard the method.

## FAQ-style checks before you trust the numbers

Builders auditing **2611.12164** should reproduce **three claims** locally:

1. **Context shrink:** Does your fixer still succeed when the FGL localizer removes roughly**a quarter** of shown code versus teacher-file training?
2. **Ghost paths:** Does the**43 vs 54** missing-file failure rate improve on**your** repo layout, especially monorepos with generated folders?
3. **Exploration:** Do trajectories show**wider search** without a spike in**bad patches** ?

Log those three metrics in **[Harbor](https://explainx.ai/blog/hugging-face-agentic-evaluation-guide-harbor-november-2026)** or your internal agent bench before you merge adapters from **`Hennara/locfix-e4b-runs_p`**. The Misraj team tied results to **competition tasks**, not your production issue tracker.

For **security-sensitive** repos, remember localization is **information disclosure**: a localizer that over-reads secrets teaches the fixer to request **credential files**. Pair FGL with **[Corridor-style guardrails](https://explainx.ai/blog/cognition-acquires-corridor-devin-security-ex-cisa-founders-stamos-agent-written-code-guardrails-2026)** the same way you would any new retrieval tool.

**Bottom line:** FGL is a **public, test-free** way to align **localizers** with **fixers** on small **Gemma 4** stacks. Clone **`locfix`**, verify the **dev-set deltas** on your trajectories, then decide whether **one EM round** is enough or your harness needs deeper schedules.

## Related reading

- [AWS Strands Decider v2 on Gemma 4](https://explainx.ai/blog/aws-strands-decider-v2-gemma4-november-2026) — cheap routing beside heavy fixers.
- [Hugging Face Harbor agent evaluation guide](https://explainx.ai/blog/hugging-face-agentic-evaluation-guide-harbor-november-2026) — how to score agents once localization changes.
- [Cisco Antares vulnerability localization](https://explainx.ai/blog/cisco-antares-vulnerability-localization-slm-july-2026) — another SLM-first localization story.
- [Mobile agent testers in GitHub Actions](https://explainx.ai/blog/mobile-agent-testers-claude-code-github-actions-parallel-qa-november-2026) — parallel QA patterns for agent regressions.
- [Fast Anything verified replay for coding agents](https://explainx.ai/blog/fast-anything-port-hot-functions-rust-coding-agent-verified-replay-2026) — determinism after agent edits.
