acceptodds
Under review as a conference paper at ICLR 2027

Composable Causal Control of Structured Code Editing

Abstract

A language model must apply an editing rule to a source program when it edits code. We test whether internal-state interventions can control the rule and source features separately in Qwen3.5-122B-A10B. We keep the visible prompt and supplied Edit/old prefix fixed. We replace internal states with states recorded from other runs, which we call donors. Replacing states at instruction tokens changes the editing rule but preserves source features. Replacing states at old-code tokens changes source features but preserves the rule. Applying both interventions produces the combined target. The generated replacement differs from either donor’s complete output. We then test whether the interventions also transfer unwanted donor information. We change the rule donor’s source program and the source donor’s editing rule. The outputs still retain the intended combination. The same procedure works across four tested code structures: straight-line code, multiple-return branches, nested branches and dataflow chains. We also reuse the same recorded states across two recipient programs. These interventions transfer a different data-dependency graph within the same statement layout. We then restore downstream residual states from a reference run. This restoration recovers recipient source features while keeping the changed rule. In a separate study, we change states associated with externally supplied plans. These changes affect the model’s choice between inspecting and editing code. We also test how the supplied action prefix affects sensitivity to the plan-state intervention. Supplying a policy branch reduces the sensitivity of the next-token distribution in 5 of 6 task families.

Primary area:
interpretability and explainable AI
Keywords:
mechanistic interpretability, causal interventions, coding agents, structured action generation, activation patching, autoregressive serialization

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_FDjwOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
1
Soundness
2
Read review
Paper summary

The paper investigates whether internal-state interventions in Qwen3.5-122B-A10B can separately control an editing rule and source-code features. It patches instruction-token states to transfer the rule and old-code-token states to transfer source structure, and reports that combining both interventions produces the intended composite edit. Additional experiments study downstream restoration and the influence of Plan-state interventions on action selection.

Critical strengths

1.Controlled causal design. The paper keeps visible prompts fixed and includes self-replacement, repeat, and donor-background controls; 2.Behavioral evaluation. The strongest experiments evaluate complete and applicable code edits, rather than relying only on probes or next-token statistics.

Critical weaknesses

1.Insufficient and narrowly scoped evidence. The main claims rely on one model and a few hand-constructed factorial cases, often only four outcomes per condition, without statistical uncertainty. Several Plan experiments are also inconclusive: the specificity criterion is not met, one repository cohort fails its verifier criterion, and only 4/96 unforced outputs are semantically valid. The main text lacks a unified method diagram and complete per-condition results, making the approach and evidence difficult to assess. 2.Unclear novelty. The method is largely standard activation/interchange patching, closely related to prior request/context composition. The main novelty appears to be its application to structured code editing, while the composition, restoration, and Plan experiments do not form a sufficiently clear or unified methodological advance.

Questions for authors

1.What is the precise methodological contribution beyond prior interchange-intervention and request/context composition work? 2.How were layers B17/B18 and the intervention spans selected, and were these choices fixed before evaluating the reported tasks? 3.Assessment-changing evidence: Do the composition results replicate across additional models, independently selected programs, and non-aligned token spans?

Reviewer_B5vAOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
1
Read review
Paper summary

This paper investigates whether internal-state interventions can independently control editing rules and source-code features in structured code editing. Using Qwen3.5-122B-A10B, the authors apply activation patching to residual states associated with instruction tokens and serialized source-code tokens while keeping the visible recipient prompt and supplied Edit prefix unchanged.

The main experiments use a factorial design that crosses two source programs with two editing rules. The results show that interventions at instruction positions can change the editing rule while preserving source features, whereas interventions at old-code positions can transfer source features while preserving the rule. Combining these interventions produces outputs corresponding to the intended combination of factors. The authors further evaluate this behavior across four code structures, test the reuse of donor states across recipients, and examine selectivity under changes in donor backgrounds.

Additional experiments show that downstream residual restoration can reverse the induced source switch while retaining the modified editing rule. The paper also investigates how interventions on externally supplied Plan states affect native inspection/edit decisions in software repositories and how supplying policy-specific action tokens changes sensitivity to these interventions.

Critical strengths
  1. The paper uses a factorial intervention design. This design separates the effect of the editing rule from the effect of the source program. In all conditions, the visible recipient prompt and the supplied Edit/old prefix stay the same. Only the internal states change. Because of this, the changes in the generated programs come from the interventions. The rule-only, source-only, and joint conditions give comparisons that are easy to interpret. Earlier work used activation patching for simpler task or context changes. This paper uses it to control complete structured code edits. This extension is a meaningful contribution.
  2. The Plan experiments measure two different outcomes: native action choice and verifier outcomes. The authors clearly report that a changed inspection/Edit choice does not always give a verifier-valid edit. The authors also report these negative or mixed results: (1) The equal-span shuffled and neutral controls do not meet the registered specificity criterion. (2) The serialization results are different across semantic families. 5 of 6 families show attenuation, but recursive-list merge reverses. (3) The intervention at one layer-19 attention read gives only a small preference shift. The donor-source token stays preferred. These reports make the results more informative. They also help to set the correct scope of the conclusions.
Critical weaknesses
  1. The main composition experiments use a small number of constructed programs and simple editing rules. Each setting crosses 2 source programs with 2 rules. This gives only 4 source/rule worlds per setting. Because of this, a 4/4 result shows consistency only in these constructed worlds. It does not show reliability on a larger, representative set of code-editing tasks. The content experiments also have these restrictions: (1) All experiments use one model (Qwen3.5-122B-A10B). (2) The donor and recipient token spans must have equal lengths and aligned positions. (3) The prompt supplies the Edit envelope and the complete old argument.

    The last restriction fixes action choice and old localization. This makes the editing task much simpler than realistic code editing.

    I recommend that the authors clearly separate two claims. The first claim is the control that the experiments show. The second claim is general compositional control of realistic code editing. More experiments can help to show that the results are general (e.g., more diverse programs and rules, unseen source/rule combinations, and donor and recipient spans of different lengths).

  2. The repository experiments show that the Plan-state perturbation can change native inspection/Edit choices. But the effect is much smaller when the denominator is the full cohort. Reciprocal switching occurs in 10/11 and 17/22 informative tasks. In the full cohorts, this is only 10/24 and 17/64 tasks. Verifier-valid switched edits occur in only 5/24 and 5/64 tasks of the full cohorts. In Cohort 2, only 5 of the 17 switched edits pass the canonical verifier. This is below the recorded criterion of 8. These results show that the intervention changes action preferences more easily than it produces useful task-level behavior. I recommend an analysis of why switched edits fail the verifier. Possible causes are an incorrect action choice, incorrect edit content, or other factors. I also recommend that the discussion of possible applications clearly separates behavioral steering from actual task success.

Questions for authors
  1. Do the rule and source effects also compose for more diverse programs and editing rules? If you have such results, please report them.
  2. The composition experiments use only 4 constructed source/rule worlds per setting. Which claim do you make: control in these worlds, or general compositional control of realistic code editing? Please state this scope clearly in the paper.
  3. When you discuss possible applications, how do they separate behavioral steering from actual task success?
  4. The paper states that the current design is not an unseen-combination test. Do the results hold for unseen source/rule combinations?
Reviewer_jTEUOpenReview ↗
Rating
1
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies whether the editing rule and source features can be controlled separately and combined through internal-state interventions during structured code editing of large language models. This paper uses Qwen3.5-122B-A10B and apply activation patching to influence the model's code editing behavior by replacing residual states at different token positions. The experimental results show that the two interventions can separately change the editing rule and source features(under certain conditions), while their joint application can produce code that satisfies the intended combined target. This paper further examines this effect across different code structures and through control experiments, and extends to how plan-state interventions affect coding agents' inspection/edit choices. However, the effectiveness of this approach on broader tasks and in real-world software development scenarios still lacks sufficient validation.

Critical strengths

1.This papers' experiments show that editing rules and source code features can be controlled separately and combined through internal-state interventions(under certain conditions) during structured code editing of large language models.In addition, this paper extends previous findings on request/context composition to complete structured code edits that must satisfy semantic and structural requirements. This provides experimental evidence of compositional control beyond simply changing individual generated tokens.

2.This paper provides relatively comprehensive runtime validation and control checks for the state replacement process. The appendix includes detailed experimental results, such as hook-off references, self-replacement controls, etc. In addition, this paper reports unsuccessful results in some experiments and discuss the limitations of their interpretations. These checks and results provide reasonable confidence in the observed findings.

Critical weaknesses

1.The main finding of this paper has limited generalizability since it uses highly controlled experimental conditions. It is based on a single model, selected intervention layers, manually constructed combinations of source code and editing rules (and other certain conditions). In addition, the edit action and the complete old_string are provided rather than generated by the model. Although the experiments show that the model's code editing behavior can be causally controlled under certain conditions, it remains unclear whether the same effects can generalize to more diverse and realistic code-editing tasks. These limitations reduce the contribution of this paper.

2.This paper's novelty is also limited. The prior paper[1] has already studied how language models separate request processing from contextual retrieval and demonstrated their composition through causal interventions. It covers several task domains (including coding-related retrieval tasks) and several models. It also provides a more detailed mechanistic case study. This paper extends these findings to structured code editing, but this extension seems relatively incremental. The paper does not identify a generalizable internal representation or clearly explain the computational mechanism by which editing rules are combined with source-code structures. Therefore, this paper just provides interesting observations from intervention experiments, rather than a deeper or more general understanding.

[1]Variengien A, Winsor E. Look Before You Leap: Universal Emergent Mechanism for Retrieval in Language Models[C]//The Thirteenth International Conference on Learning Representations. 2025.

Questions for authors
  1. What is the main advance over prior studies on request/context composition?
  2. How generalizable are the rule/source composition beyond the controlled experimental conditions?
  3. Do the Plan experiments provide any additional conclusions beyond the main results?

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.