SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.11917 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 11 functions out of this paper's own repositories and ran 8 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
abhay-sheshadri/backward-chaining-circuits canonical 8 of 11
FunctionStatusWhere it lives
extract_adj_matrix Ran abhay-sheshadri/backward-chaining-circuits/src/utils.py
pointer only (licence: NONE) · get_code("1ed19ad2693bee3e")
get_example_cache Ran abhay-sheshadri/backward-chaining-circuits/src/utils.py
pointer only (licence: NONE) · get_code("1dcef83bda5714f3")
get_loaders Ran abhay-sheshadri/backward-chaining-circuits/src/utils.py
pointer only (licence: NONE) · get_code("acd6a741f6a7a07f")
hierarchy_pos Ran abhay-sheshadri/backward-chaining-circuits/src/tree_generation/viz.py
pointer only (licence: NONE) · get_code("cd57abb736d9cb6d")
kl_divergence Ran abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py
pointer only (licence: NONE) · get_code("0b3394b38c5b85c6")
sample_tree_graph Ran abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py
pointer only (licence: NONE) · get_code("dff7b2d24930b654")
shortest_path Ran abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py
pointer only (licence: NONE) · get_code("896fdf4ea0b858b0")
topological_sort_edges Ran abhay-sheshadri/backward-chaining-circuits/src/tree_generation/gen.py
pointer only (licence: NONE) · get_code("4f1daa704a312a04")
add_attention_blockout Not yet run abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py
pointer only (licence: NONE) · get_code("867c6b6984a3ebc7")
add_attention_blockout_parallel Not yet run abhay-sheshadri/backward-chaining-circuits/src/attention_knockout.py
pointer only (licence: NONE) · get_code("b1c6a36e5eed0d39")
logits_to_logit_diff Not yet run abhay-sheshadri/backward-chaining-circuits/src/interp_utils.py
pointer only (licence: NONE) · get_code("e6652ed7bc481af1")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.11917")
get_code_for_paper("2402.11917")
have("2402.11917")

Connect an agent — have() is free.