Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languages
Luxshan Thavarasa, Sivasuthan Sukumar
cs.CL
Submitted: 2026-08-04
Comments: 19 pages, 16 figures. Code and data: https://github.com/Luxshan2000/icl-conditional-circuits
Code: https://github.com/Luxshan2000/icl-conditional-circuits
License: http://creativecommons.org/licenses/by/4.0/
The gist: When a language model follows an in-context conditional rule such as "if P(x) then A else B," does it assemble a runtime circuit with one module that tests the predicate and another that routes the
Terminology
Abstract
When a language model follows an in-context conditional rule such as "if P(x) then A else B," does it assemble a runtime circuit with one module that tests the predicate and another that routes the answer? We probe this with activation patching under a four-donor design whose two swapped-rule donors make the condition and the answer word disagree, so each layer reveals which of the two it carries. Across three open models from two families and six languages sharing one fixed item bank, a mid-stack residual band carries the predicate's truth value: patching it reroutes the answer with predicate-outcome flip near 1.0 and mapping flip near 0.0, meeting a strict pre-specified isolation criterion in 17 of 18 cells, and the same localization holds across five predicate families. The router shows the opposite profile. A learned subspace flips A and B near-perfectly within the trained pair yet transfers to a new pair at approximately 0 in every model, while in Gemma-3-4B (the only model probed cross-lingually) it transfers at approximately 0.98 to the same pair in other languages. Under every probe we ran, the router direction is token-bound and non-transferable (largely answer-readout in Gemma, pair-specific in Qwen) rather than an abstract routing module. Test is modular; under these probes, route is not.
Sources
- Towards a Mechanistic Understanding of Propositional Logical Reasoning in Large Language Models
- Discovering Variable Binding Circuitry with Desiderata
- Localizing Model Behavior with Path Patching
- Steerable but Not Decodable: Function Vectors Operate Beyond the Logit Lens
- In-context Learning and Induction Heads
- How to use and interpret activation patching
- Necessary, Decodable and Reversible, Yet Not Transferable: A Stress Test for Attention-Head Role Claims
- In-Context Learning Operates as Concept Subspace Learning
- Gemma 3 Technical Report
- Qwen3 Technical Report
- Function Induction and Task Generalization: An Interpretability Study with Off-by-One Addition
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering