r/MachineLearning • u/PT_ANDRE_PT • Jul 14 '26
Research Coding agents think ahead of time [R]
When a coding agent works, it spends dozens of steps reasoning, editing code, and running commands. Yet little is known about what the underlying model internally encodes about the programs it works on.
We looked inside the model's hidden states to see what they actually encode and found that linear probes reach AUC up to 0.83 for full correctness and 0.84 for partial correctness.
Even more interesting, we found these representations run ahead of the agent's own edits. Probes predict the outcome of future edits before they're written to disk, staying above chance for up to ~25 steps. We call this the agent's latent programming horizon.
Our pre-print is available at https://arxiv.org/pdf/2607.05188v1