Latent Programming Horizons in Coding Agents
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
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.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 53 of its 58 references that are in the map. First posted on arXiv 6 Jul 2026.
Builds on
53 of 58 references.
Closest ancestors · 5
Same direction, newest first
- 2026TACT: Mitigating Overthinking and Overacting in Coding Agents via Activation Steering7 May
- 2025Understanding Software Engineering Agents: A Study of Thought-Action-Result Trajectories23 Jun
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
- 2024Executable Code Actions Elicit Better LLM Agents1 Feb
Other references · 48
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2016Understanding intermediate layers using linear classifier probescited by 1,353
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
- 2022Toy Models of Superpositioncited by 971
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 716
- 2019Designing and Interpreting Probes with Control Taskscited by 640
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
- 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 431
- 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
- 2025Layer by Layer: Uncovering Hidden Representations in Language Modelscited by 311
- 2025SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?cited by 279
36 more
- 2024AutoCodeRover: Autonomous Program Improvementcited by 278
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 263
- 2024Let's Think Dot by Dot: Hidden Computation in Transformer Language Modelscited by 191
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 171
- 2025Reasoning Models Know When They're Right: Probing Hidden States for Self-Verificationcited by 159
- 2023Future Lens: Anticipating Subsequent Tokens from a Single Hidden Statecited by 121
- 2015Neural Programmer-Interpreterscited by 101
- 2025CWM: An Open-Weights LLM for Research on Code Generation with World Modelscited by 93
- 2024Transformers represent belief state geometry in their residual streamcited by 77
- 2024Emergent World Models and Latent Variable Estimation in Chess-Playing Language Modelscited by 62
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2025No Answer Needed: Predicting LLM Answer Accuracy from Question-Only Linear Probescited by 38
- 2021What do pre-trained code models know about code?cited by 36
- 2015Neural Programmer: Inducing Latent Programs with Gradient Descentcited by 34
- 2024Evidence of Learned Look-Ahead in a Chess-Playing Neural Networkcited by 34
- 2022SelfAPR: Self-supervised Program Repair with Test Execution Diagnosticscited by 33
- 2023Emergent Representations of Program Semantics in Language Models Trained on Programscited by 30
- 2022Probing Pretrained Models of Source Codecited by 26
- 2025Knowing Before Saying: LLM Representations Encode Information About Chain-of-Thought Success Before Completioncited by 23
- 2024Searching Latent Program Spacescited by 20
- 2020Latent Programmer: Discrete Latent Codes for Program Synthesiscited by 18
- 2024Planning in a recurrent neural network that plays Sokobancited by 18
- 2025Correctness Assessment of Code Generated by Large Language Models Using Internal Representationscited by 17
- 2022AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelscited by 16
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2020Neural Program Synthesis with a Differentiable Fixercited by 6
- 2025Temporal Predictors of Outcome in Reasoning Language Modelscited by 6
- 2025Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoderscited by 5
- 2025On LLMs' Internal Representation of Code Correctnesscited by 5
- 2026Gradient-Based Program Synthesis with Neurally Interpreted Languagescited by 5
- 2025Gradient-Based Program Repair: Fixing Bugs in Continuous Program Spacescited by 4
- 2025Localized Calibrated Uncertainty in Code Language Modelscited by 3
- 2026CodeCircuit: Toward Inferring LLM-Generated Code Correctness via Attribution Graphscited by 3
- 2026Code Correctness Is Linearly Decodable from LLM Hidden States Before Generationcited by 3
- 2023INSPECT: Intrinsic and Systematic Probing Evaluation for Code Transformerscited by 2
- 2025Model-Agnostic Correctness Assessment for LLM-Generated Code via Dynamic Internal Representation Selectioncited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2026Beyond Resolution Rates: Behavioral Drivers of Coding Agent Success and Failure
- 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Tasks
- 2026Self-Evolving Coding Agents
- 2026AgentSWE: Can Coding Agents Build the Agent You Actually Want?
- 2026The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languages
- 2026Socratic-SWE: Self-Evolving Coding Agents via Trace-Derived Agent Skills
- 2026Yet Even Less Is Even Better For Agentic, Reasoning, and Coding LLMs
- 2026SpecForge: Recursive Self-Improvement for Coding Agents via Behavioral Specifications