Manuscript Offprint

arXiv:2610.20683

Causal Syntax Circuits in CodeLMs: Budget and Probe Decide What Looks Localised

Harsh Kumar, Tanmay Shailesh Joshi, Rahul Maity, Anusa Saha

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Code models write Python when the prompt does not say which language to use. We ask a mechanistic question about that habit: is it produced by a small, findable group of components inside the model? We run one pipeline—mean ablation, activation patching, greedy circuit extraction, a random-control significance test, and activation steering—over 55 model–language settings spanning ten open code models (five base and five instruction-tuned), three target languages (Rust, C#, PHP), two prompt suites, and two component budgets. We report five findings. First, the preference is large, grows with model size, and survives instruction tuning: it is larger on every instruction-tuned checkpoint than on its base version, by 12% on average. Second, its measured size is mostly a property of the probe; replacing our aligned prompts with XLCoST parallel functions takes the same measurement on the same models from about 1.6 to about 0.01. Third, whether the preference looks localised depends on how many components the search may keep: with a budget of 12, 1 of 15 settings yields a circuit that beats size-matched random controls after multiple-comparison correction, and with a budget of 40, 6 of 15 do. Fourth, interventions that a smaller-budget study reports as uniformly failing do sometimes succeed: patching makes a Python prompt prefer target syntax in 2 of 45 settings, and steering changes the most likely next token in 9 of 45. Fifth, every circuit whose effect is significant but points away from the target language comes from a setting where circuit extraction failed, which makes such results a diagnostic rather than a phenomenon. The practical lesson is that a claim about whether a behaviour is localised can turn on analysis choices that papers rarely report. We release the full grid so those choices can be varied.

1 Introduction

Ask a code model to “sort a list” and it will usually hand you Python. Ask it in a Rust repository, with a Rust file open, and it will often still reach for Python idioms unless the prompt spells out the language. Benchmarks report the same pattern at scale: base code models score higher on Python than on the other languages they were trained on, and they fall back to Python when the target is left open [Cassano et al., 2023, Zheng et al., 2023]. We call this tendency programming-language defaultness. The two facts are separate, and we do not claim one causes the other; the most likely common cause is that Python is over-represented in code training corpora.

∗^{*}Equal contribution.

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Linguistic Principles for Foundation Models (LP4FM).

Table 1: Every claim in the paper, under every probe: the number of settings supporting the claim out of the settings run. Only the first row is stable. The rest move when the component budget or the prompt suite changes, which is the paper's main point. Definitions are in §3.

Claimaligned, k=12aligned, k=40instruct, k=12XLCoST, k=12
sign ΔM\Delta_M recovers the tagged language15/1515/1515/150/10
circuit beats random controls (qBH<0.05q_{\text{BH}} < 0.05)1/156/152/150/10
circuit is significant but away-pointing2/152/151/150/10
patching lifts ΔM\Delta_M above zero0/151/151/150/10
steering makes the argmax target syntax0/156/153/150/10

What behaviour would count as correct. We are not arguing that a Python default is a bug: when a task admits many languages, a model has to break the tie somehow. The property we care about is narrower and testable—a user should be able to move the default—so our question is mechanistic, not normative. Is the preference carried by a small group of components that an inference-time edit could redirect, in the way that refusal [Arditi et al., 2024] and natural-language identity [Tang et al., 2024, Kojima et al., 2024] have been reported to be? A yes would make cheap, weight-free language control possible for teams whose codebases are not Python. A no tells practitioners to spend their effort elsewhere.

Why revisit this. An earlier version of this study answered that question in the negative across 15 model–language settings: the preference was measurable everywhere, a specific circuit survived correction in one setting, and neither patching nor steering ever changed the generated language. That conclusion rested on two choices that looked like implementation details—keeping the top 12 components after ablation ranking, and measuring on a hand-built suite of aligned function pairs—plus a scope restriction to base models.

Contributions. We extend the grid from 15 settings to 55 by adding (i) five instruction-tuned checkpoints, (ii) a component budget of 40, matching the scale used by sparse-feature circuit work [Marks et al., 2025], and (iii) a second prompt suite drawn from XLCoST parallel functions [Zhu et al., 2022]. 2^{2} Table 1 is the whole result in one place, and each of the five findings below is stated once, in a box, where its evidence is presented. Changing those three things changes the conclusion.

References (31)