Latent Programming Horizons in Coding Agents

André Silva, Han Tu, Martin Monperrus
7/6/2026
cs.LGcs.SE

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

A coding agent solving a software-engineering task spends dozens of steps reasoning, editing code, and running tests, yet little is known about what the underlying language model internally represents about the program it is working on. We show that the residual streams of language models under coding agents linearly encode properties of the evolving program: a logistic-regression probe on hidden states is able to decode whether the current code parses, passes its test suite, reduces the number of failing tests, and introduces regressions, reaching AUC up to 0.83 for correctness across two models and two benchmarks. Our second finding is more surprising: these representations run ahead of the agent's own edits. Probes trained to predict the outcome of future edits (before they are materialized and written on disk) achieve performance above chance up to roughly 25 steps in advance. We call this the agent's latent programming horizon. As a proof of external validity, we show that the probes transfer across benchmarks without retraining. Our positive results open calls for more research in mechanistic interpretability of coding agents.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{silva2026latent,
  title  = {Latent Programming Horizons in Coding Agents},
  author = {André Silva and Han Tu and Martin Monperrus},
  year   = {2026},
  eprint = {2607.05188},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.05188v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.05188.svg)](https://codeofpaper.com/paper/2607.05188)

Discussion