{"id":"0a45a57b-5b2a-4bea-81ed-b45c845c6443","arxiv_id":"2607.05188","paper_version":1,"verdict":"CONDITIONAL","confidence":"MODERATE","novelty_score":7.0,"correctness_risk":"unknown","formal_verification":"none","parameter_count":6,"one_line_summary":"Linear probes on coding-agent residual streams decode current program properties (AUC up to 0.83) and predict future edit outcomes up to 25 steps in advance.","lead":"This paper shows that the hidden states of language models running coding agents linearly encode properties of the program being edited, and that these representations anticipate future edits up to 25 steps ahead. A smart generalist might read this because it suggests AI coding agents have internal planning mechanisms that could be monitored or steered.","discovery_kind":"unclear","skeptic_critique":{"model":"glm-5.2","headline":"The 25-step lookahead horizon is confounded by label persistence: with a median of only 2 edits per ~52-step trajectory, most (t, t+k) pairs likely have zero intervening edits, so the probe may be predicting the current state rather than a future one.","rationale":"The reader identified the correct load-bearing concern: label persistence inflates the apparent lookahead horizon. My independent reading confirms this is the single most important weakness. The mechanism is explicit in Section 3.2, and the dataset statistics in Table 1 (median 2 edits per ~52-step trajectory) make it quantitatively plausible that most (t, t+k) pairs at k up to 25 have no intervening edit. The paper does not address this confound anywhere, including in the Limitations section. The current-state probing results (Section 4.1) are solid: shuffled controls collapse, cross-dataset transfer works, the inverted-U layer pattern is consistent, and the dataset is large (22.4M hidden states across 22,714 trajectories). These findings stand on their own. The horizon claim (Section 4.2) is the novel, surprising contribution and is the one most affected. The smooth AUC decay in Figure 6 is suggestive but not decisive — it is equally consistent with a label-persistence mixture model as with genuine lookahead. The concrete test I propose (conditioning on edit-containing windows) would settle this definitively using existing data. The verdict should remain CONDITIONAL: the current-state claim merits acceptance, but the headline '25-step horizon' requires the label-persistence analysis before it can be fully credited. The reader's assessment is accurate and well-calibrated; no adjustment is needed.","tokens_in":22569,"tokens_out":3714,"duration_ms":57309,"concrete_test":"Recompute the lookahead AUC curves in Figure 6 conditioned only on (t, t+k) pairs where at least one edit event occurs in the window [σ(t), σ(t)+k]. Additionally, report the fraction of pairs with zero intervening edits at each k. If the conditioned AUC still decays smoothly and remains above chance at k=25, the horizon claim is supported. If the conditioned AUC drops to near-chance much earlier (e.g., by k=5–10), or if the no-edit fraction exceeds 50% at k=25, the 25-step horizon claim is an artifact of label persistence. This can be computed from the existing dataset without new trajectory collection.","verdict_should_be":"UNCHANGED","load_bearing_attack":"The reader correctly identifies the central concern. Section 3.2 defines labels as carried forward from the most recent edit: 'every generated token position t with e_i ≤ t < e_{i+1} receives the label of edit e_i.' For the lookahead probe at horizon k, the target is y^φ_{σ(t)+k}, the label in effect at step σ(t)+k. If no edit occurs in the window [σ(t), σ(t)+k], then y^φ_{σ(t)+k} = y^φ_{σ(t)}, and the probe is effectively doing current-state prediction — which we already know works at AUC ~0.77. Table 1 shows a median of only 2 edits per trajectory across trajectories with a median of 52–56 steps. This means the average inter-edit gap is roughly 17–26 steps, so for k up to 25, a substantial fraction of (t, t+k) pairs will have zero intervening edits. The observed smooth decay from AUC ~0.77 at k=0 to ~0.55 at k=25 is consistent with a mixture where the no-edit fraction (performing at k=0 levels) gradually decreases while the edit fraction (performing near chance) increases — without any genuine lookahead being required. The paper does not report the fraction of (t, t+k) pairs with zero intervening edits, nor does it condition AUC on whether an edit actually occurs in the window. Without this analysis, the '25-step horizon' claim — the paper's most novel finding — cannot be distinguished from an artifact of label autocorrelation. The current-state probing results (k=0, Section 4.1) are not affected by this concern and remain well-supported.","agreement_with_reader":"agree"},"referee_report":{"model":"glm-5.2","summary":"This paper studies whether the residual streams of language models acting as coding agents linearly encode properties of the evolving program (parsability, correctness, partial correctness, regressions). The authors collect 22,714 agentic trajectories from two models (Laguna-XS.2, Qwen3.6-35B-A3B) on two benchmarks (SWE-Bench-Verified, SWE-Bench-Pro), extract hidden states, and train logistic regression probes. They find that current program properties are decodable with AUC up to 0.83, that the signal peaks in intermediate layers, and that probes transfer across benchmarks without retraining. The paper's most novel claim is the 'latent programming horizon': probes trained to predict program properties k steps ahead remain above chance up to k=25 steps.","tokens_in":22844,"tokens_out":1012,"duration_ms":77681,"significance":"The current-state probing results (Section 4.1) are well-supported and represent a solid contribution to the interpretability of coding agents, extending single-function correctness probing to multi-step agentic editing on real codebases. The experimental design is rigorous: the shuffled-label controls collapse to 0.50, the task-split protocol prevents leakage, and the cross-dataset transfer experiment provides genuine external validity. The inverted-U layer pattern is consistent across models and properties. However, the paper's most novel finding—the 25-step lookahead horizon—rests on a label persistence confound that is not addressed in the current text, weakening the central novelty claim.","major_comments":[{"comment":"§3.2 and §4.2: The lookahead claim is confounded by label persistence. Section 3.2 defines labels as carried forward from the most recent edit: 'every generated token position t with e_i ≤ t < e_{i+1} receives the label of edit e_i.' For the lookahead probe at horizon k, the target is y^φ_{σ(t)+k}. If no edit occurs in the window [σ(t), σ(t)+k], then y^φ_{σ(t)+k} = y^φ_{σ(t)}, and the probe is effectively doing current-state prediction—which Section 4.1 already shows works at AUC ~0.77. Table 1 shows a median of only 2 edits per trajectory across trajectories with a median of 52–56 steps, meaning the average inter-edit gap is roughly 17–26 steps. For k up to 25, a substantial fraction of (t, t+k) pairs will have zero intervening edits. The observed smooth decay from AUC ~0.77 at k=0 to ~0.55 at k=25 is consistent with a mixture where the no-edit fraction (performing at k=0 levels) is逐渐d,","section":null}],"minor_comments":[{"comment":"§3.4: The section title reads 'Probing Program Poperties' — typo for 'Properties'.","section":null},{"comment":"Figure 6: The y-axis ranges differ across panels (e.g., 0.50–0.75 for Verified vs. 0.50–0.85 for Pro), making visual comparison of decay rates across benchmarks slightly misleading. Consider using a consistent range.","section":null},{"comment":"Table 1: The 'Med. edits' column shows a median of 2 for Laguna-Verified, but the text in §3.6 says 'a median number of two and a mean of 3.5 edits per trajectory.' It would help to include the mean in the table for completeness.","section":null},{"comment":"Figure 16 caption: 'shown at layer 20 (best or near-best by probe validation AUC for both models)' — but probed layers are at indices 1, 11, 21, 31, 40 (§3.4). Layer 20 was not probed. Please clarify or correct.","section":null},{"comment":"§4.1: The text notes that WELL-FORMEDNESS on SWE-Bench-Verified collapses to near chance 'always below 0.60,' but Table 5 shows layer 31 at 0.571 and layer 21 at 0.566. The phrasing 'always below 0.60' is technically correct but could be more precise about the range.","section":null}],"recommendation":"major_revision","confidential_remarks":"The label persistence confound is the central issue. If the authors can show that the lookahead signal survives conditioning on 'edit actually occurs in [t, t+k],' the horizon claim becomes a genuinely strong novel contribution. If they cannot, the paper should be reframed around the current-state probing results (which are solid and publishable on their own) with the horizon results either removed or substantially hedged. The reader's report correctly identifies this as the load-bearing concern."},"author_rebuttal":{"model":"glm-5.2","summary":"We thank the referee for the careful reading and the constructive engagement with our work. The referee correctly identifies a genuine confound in our lookahead analysis that we must address. Below we respond point by point.","responses":[{"response":"The referee is correct. This is a genuine confound in our current analysis, and we appreciate the precise way it has been articulated. Because labels are carried forward between edits, a substantial fraction of (t, t+k) pairs at large k will have identical labels at t and t+k, meaning the lookahead probe is effectively doing current-state prediction on those pairs. Given the edit frequency statistics in Table 1 (median 2 edits per trajectory, median 52–56 steps), this fraction is non-trivial for k in the 10–25 range, and the smooth decay we report is indeed consistent with a mixture of no-edit pairs (performing near k=0 levels) and edit pairs (potentially performing near chance). We cannot rule out that the entire above-chance signal at large k is driven by this persistence artifact rather than by genuine lookahead in the hidden state. This is a real weakness in the current manuscript. We will address it in the revision as follows. First, we will add an explicit analysis of the no-edit fraction at each horizon k, reporting the proportion of (t, t+k) pairs where the label is unchanged due to zero intervening edits. Second, and more importantly, we will re-run the lookahead analysis stratified by whether at least one edit occurs in the window [σ(t), σ(t)+k]. If the above-chance signal persists in the edit-occurred stratum at large k, the horizon claim is supported; if it collapses, we will retract the 25-step horizon claim and reframe the contribution accordingly. Third, we will add a baseline that predicts y^φ_{σ(t)+k} using only y^φ_{σ(t)} (i.e., a label-persistence oracle), so that the reader can see exactly how much of the lookahead AUC is attributable to persistence versus genuine future-state encoding. We acknowledge that, as the manuscript currently stands, the 25-","revision_made":"no","referee_comment":"§3.2 and §4.2: The lookahead claim is confounded by label persistence. Section 3.2 defines labels as carried forward from the most recent edit: 'every generated token position t with e_i ≤ t < e_{i+1} receives the label of edit e_i.' For the lookahead probe at horizon k, the target is y^φ_{σ(t)+k}. If no edit occurs in the window [σ(t), σ(t)+k], then y^φ_{σ(t)+k} = y^φ_{σ(t)}, and the probe is effectively doing current-state prediction—which Section 4.1 already shows works at AUC ~0.77. Table 1 shows a median of only 2 edits per trajectory across trajectories with a median of 52–56 steps, meaning the average inter-edit gap is roughly 17–26 steps. For k up to 25, a substantial fraction of (t, t+k) pairs will have zero intervening edits. The observed smooth decay from AUC ~0.77 at k=0 to ~0.55 at k=25 is consistent with a mixture where the no-edit fraction (performing at k=0 levels) is逐渐d"}],"tokens_in":22152,"tokens_out":1153,"duration_ms":34661,"standing_objections":[]},"desk_editor":{"model":"glm-5.2","letter":"The current-state probing results are the real contribution here, and they hold up. Linear probes on residual streams decode whether the current program parses, passes tests, reduces failures, or introduces regressions, reaching AUC up to 0.83 across two models and two benchmarks. The shuffled-label controls collapse to 0.50, the inverted-U layer pattern is consistent across all settings, and cross-dataset transfer works with modest drops (0.04–0.09 AUC). This is the first probing study on multi-step agentic editing of real codebases — prior correctness probing work (Ribeiro, Bui, Vu) studied single-step generation, and Jin & Rinard's future-state probing used synthetic grid-world programs. The dataset is large (22,714 trajectories, 22.4M hidden states), code and data are shipped, and the paper is honest about decodability not implying causality. That part of the paper is clean and deserves credit. The soft spot is the lookahead horizon claim, and the stress-test concern lands squarely. Section 3.2 defines labels as carried forward from the most recent edit: every token position between edit e_i and e_{i+1} gets the label of e_i. Table 1 shows a median of only 2 edits per trajectory across trajectories with a median of 52–56 steps. So the average inter-edit gap is roughly 17–26 steps, meaning for k up to 25, a substantial fraction of (t, t+k) pairs will have zero intervening edits — the probe is then predicting the current label, not a future one. The smooth decay from AUC ~0.77 at k=0 to ~0.55 at k=25 is entirely consistent with a mixture where the no-edit fraction (performing at k=0 levels) gradually shrinks while the edit fraction (near chance) grows. No genuine lookahead is required to produce this curve. The paper does not report the fraction of (t, t+k) pairs with zero intervening edits, nor does it condition AUC on whether an edit actually occurs in the window. This is the most novel claim in the paper and it is the one most affected by the confound. The fix is straightforward: report the fraction of windows with zero intervening edits and condition the lookahead AUC on windows where an edit actually occurs. If the signal survives that conditioning, the horizon claim is real. If it does not, the current-state results still stand on their own. This paper is for researchers in mechanistic interpretability and software engineering who want concrete handles on what coding agents represent internally. The current-state results are useful and publishable regardless of the horizon outcome. It deserves a serious referee who will ask for the label-persistence analysis. I'd recommend a revise-and-resubmit: the current-state findings are sound, but the headline 25-step horizon claim should not stand without the conditioning analysis.","headline":"The current-state probing is solid and new; the 25-step lookahead claim is confounded by label persistence and needs an easy fix.","tokens_in":23443,"tokens_out":664,"would_cite":true,"duration_ms":55200,"reading_group":"maybe","serious_thinker":"yes","would_accept_peer_review":true},"rs_alignment":null,"lean_confirmation":null,"pith_extraction":{"msc":[],"pacs":[],"model":"glm-5.2","headline":"Coding agents internally track program correctness up to 25 steps ahead","keywords":[],"falsifier":"If one conditioned the horizon analysis only on (t, t+k) pairs where at least one edit occurs between t and t+k, and the above-chance performance collapsed, the latent programming horizon claim would be weakened to a current-state encoding claim.","tokens_in":22596,"feed_emoji":"🧠","tokens_out":1098,"duration_ms":29003,"temperature":0.7,"pith_summary":"This paper shows that when a language model acts as a coding agent — iteratively reading, editing, and testing code across dozens of steps — its internal hidden states carry a linearly decodable representation of the program it is working on. A simple logistic regression probe on those hidden states can predict whether the current code compiles, passes its test suite, reduces failing tests, or introduces regressions, reaching AUC up to 0.83. The authors then show something they find more surprising: probes trained to predict the outcome of edits that have not yet been written still perform above chance up to roughly 25 agent steps in advance. They call this the agent's latent programming horizon — the idea that the model's internal state already contains information about the shape of future programs well before those changes are committed to disk. The probes transfer across two different software-engineering benchmarks without retraining, suggesting the encoded signal is a general property of how these models represent code, not an artifact of one task distribution. The experiments cover two open-weight models and over 22,000 trajectories on real-world codebases.","feed_headline":"Coding agents internally track program correctness up to 25 steps ahead","feed_subtitle":"Linear probes on hidden states decode whether code passes tests or introduces regressions, and anticipate future edit outcomes before theyre","key_machinery":"The method is straightforward probing: collect the residual stream vector at each agent step, train a logistic regression classifier to predict a binary program property (e.g., does the code pass its test suite), and measure AUC. For the horizon experiments, the probe at step t is trained to predict the property label at step t+k, where k ranges from 0 to 50. Labels are computed by actually checking out each program version at each edit event and running the test suite. The shuffled-label control confirms the signal lives in the representation, not in the probe's capacity to fit arbitrary labels.","core_discovery":"The central object the paper introduces is the latent program representation: the internal encoding, in a transformer's residual stream, of the semantic state of the program being edited. The authors show this representation exists, is linearly decodable, is strongest in intermediate layers, and extends forward in time — the latent programming horizon — meaning the hidden state at step t carries information about program properties at step t+k that the agent has not yet materialized through edits. The paper demonstrates this by training separate linear probes for each of four program properties (well-formedness, full correctness, partial correctness, regression) at each of several lookahead,","pith_inferences":[],"forward_implications":["If the latent programming horizon is real, one could build lightweight monitors that read hidden states to predict whether an agent's upcoming edits will succeed or introduce regressions, before those edits are made — enabling early intervention or course correction.","The finding that program properties are most decodable in intermediate layers suggests that mechanistic interpretability work on coding agents should focus probing and steering efforts on mid-depth representations rather than final-layer outputs.","Cross-benchmark transfer of probes implies a shared internal vocabulary for program state across different codebases and task types, which could support model-agnostic monitoring tools.","If the 25-step horizon reflects genuine internal planning rather than label persistence, it would suggest that coding agents develop something analogous to the look-ahead representations found in game-playing networks, opening questions about how training objectives (next-token prediction, RL from test feedback) cultivate this forward representation."],"fun_headline_variants":["Code properties decode linearly from agent hidden states","Probes predict edit outcomes 25 steps before they occur","Agent hidden states encode program correctness ahead of edits","Program state is linearly decodable from agent residual streams","Coding agents encode future program state in hidden layers"],"cache_read_input_tokens":0,"weakest_assumption_plain":"The lookahead probes predict the label of the program k steps ahead, but if the agent makes no edit in those k steps, the label is carried forward unchanged from the last edit. This means the probe may be predicting the current state rather than a genuinely future state, and the paper does not report how often this label-carry-forward occurs, so the 25-step horizon could be partly inflated by periods of no change.","fun_headline_variants_meta":{"raw":{"variants":["Code properties decode linearly from agent hidden states","Probes predict edit outcomes 25 steps before they occur","Agent hidden states encode program correctness ahead of edits","Program state is linearly decodable from agent residual streams","Coding agents encode future program state in hidden layers"]},"model":"glm-5.2","effort":"high","cost_usd":0.0,"raw_usage":{"total_tokens":601,"prompt_tokens":527,"completion_tokens":74,"prompt_tokens_details":null},"tokens_in":527,"tokens_out":74,"duration_ms":8838,"temperature":1.0,"reasoning_tokens":null,"cache_read_input_tokens":0,"cache_creation_input_tokens":0},"cache_creation_input_tokens":0},"created_at":"2026-07-08T00:12:25.493344+00:00","model_set":{"reader":"glm-5.2"},"falsifier":"If one conditioned the horizon analysis only on (t, t+k) pairs where at least one edit occurs between t and t+k, and the above-chance performance collapsed, the latent programming horizon claim would be weakened to a current-state encoding claim.","supporting_citations":[],"review_version":1}