Papers › A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Task

A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Task

19 Feb 2024arXiv:2402.11917archive 2025-07-28

Jannik Brinkmann, Abhay Sheshadri, Victor Levoso, Paul Swoboda, Christian Bartelt

Transformers demonstrate impressive performance on a range of reasoning benchmarks. To evaluate the degree to which these abilities are a result of actual reasoning, existing work has focused on developing sophisticated benchmarks for behavioral studies. However, these studies do not provide insights into the internal mechanisms driving the observed capabilities. To improve our understanding of the internal mechanisms of transformers, we present a comprehensive mechanistic analysis of a transformer trained on a synthetic reasoning task. We identify a set of interpretable mechanisms the model uses to solve the task, and validate our findings using correlational and causal evidence. Our results suggest that it implements a depth-bounded recurrent mechanisms that operates in parallel and stores intermediate results in selected token positions. We anticipate that the motifs we identified in our synthetic setting can provide valuable insights into the broader operating principles of transformers and thus provide a basis for understanding more complex models.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.11917")

Code

Syntology Ran 8 of 11 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 8 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

abhay-sheshadri/backward-chaining-circuits officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 8 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

8ran
3unverified

Licence: 11 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from abhay-sheshadri/backward-chaining-circuits. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

extract_adj_matrix abhay-sheshadri/backward-chaining-circuits/src/utils.py official repository ran no licence file found · pointer only · 1ed19ad2693bee3e · report
get_example_cache abhay-sheshadri/backward-chaining-circuits/src/utils.py official repository ran no licence file found · pointer only · 1dcef83bda5714f3 · report
get_loaders abhay-sheshadri/backward-chaining-circuits/src/utils.py official repository ran no licence file found · pointer only · acd6a741f6a7a07f · report
hierarchy_pos abhay-sheshadri/backward-chaining-circuits/src/tree_generation/viz.py official repository ran no licence file found · pointer only · cd57abb736d9cb6d · report
kl_divergence abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py official repository ran fingerprinted no licence file found · pointer only · 0b3394b38c5b85c6 · report
sample_tree_graph abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py official repository ran no licence file found · pointer only · dff7b2d24930b654 · report
shortest_path abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py official repository ran no licence file found · pointer only · 896fdf4ea0b858b0 · report
topological_sort_edges abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py official repository ran no licence file found · pointer only · 4f1daa704a312a04 · report
add_attention_blockout abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py official repository unverified no licence file found · pointer only · 867c6b6984a3ebc7 · report
add_attention_blockout_parallel abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py official repository unverified no licence file found · pointer only · b1c6a36e5eed0d39 · report
logits_to_logit_diff abhay-sheshadri/backward-chaining-circuits/src/interp_utils.py official repository unverified no licence file found · pointer only · e6652ed7bc481af1 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SET

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections