A logistic regression classifier on the model's internal activations forecasts whether future edits will compile, pass tests, or break working code.
A coding agent building a program has already, in its internal state, encoded whether the code it is building will ultimately be correct — up to about 25 edits in advance. A new arXiv preprint shows that a simple probe can read that encoding and predict whether future changes will compile, pass tests, or introduce a regression.
The probe is a small logistic-regression classifier trained on the model's residual stream, the running internal state that large language models build up as they process a task. Across two coding models and two benchmarks, the probe reads out whether the program the agent is building will eventually be correct with an AUC up to 0.83, meaning it separates passing from failing programs about 83% of the time.
The same probe reaches further ahead than the next edit. Trained to predict the outcome of changes that have not yet been written to disk, the probe performs above chance up to roughly 25 steps in advance. The authors call this the "latent programming horizon," a measure of how many future edits a probe can predict from the agent's current internal state.
The signal also transfers across benchmarks: a probe trained on one coding task still reads the relevant property on another without retraining. The authors frame that as suggestive of a general property of how these models internally represent the code they are building, not a quirk of a particular test set, though two benchmarks is a thin base for any generality claim.
The mechanism is distinct from chain-of-thought or "think harder" prompting, which ask a model to write more reasoning tokens before its next action. Here, the signal lives in the model's running internal activations, not in text the model produces. That distinction matters for audits: a probe reads state the model never had to verbalize.
Two limits are worth naming. The probe is correlational, not causal. It reads what the model is representing; it does not show that the model is "planning" those future edits in any agentic sense. The headline numbers are also across two models and two benchmarks, a real slice of the coding-agent landscape but not a sweeping claim about every agent shipping today.
The work is part of a wider push for mechanistic interpretability of coding agents, the research program that tries to read what a model is representing internally. If internal state tracks future test outcomes this cleanly, a coding agent becomes something you can audit mid-task rather than only after the fact. A future tool could flag a likely-bad edit before the file is saved, or surface a regression the agent has not yet introduced.
A useful audit would need a probe that runs cheaply on the model in production, hooks into the agent's edit loop, and flags likely regressions before they land in a commit. The preprint does not yet claim that; the residual-stream signal it documents is the prerequisite, not the product.
The preprint is not peer-reviewed. Full method, model identities, and benchmark details live behind the HTML version and should be confirmed before any product decision rests on the numbers. The first venue that takes it will be the test of whether the horizon holds up at scale.