Disentangling Recall and Reasoning in Transformer Models through Layer-wise Attention and Activation Analysis

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Fartale, Harshwardhan, Kattamuri, Ashish, Raja, Rahul, Vats, Arpita, Prasad, Ishita, Moharir, Akshata Kishore
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914389332852736
author Fartale, Harshwardhan
Kattamuri, Ashish
Raja, Rahul
Vats, Arpita
Prasad, Ishita
Moharir, Akshata Kishore
author_facet Fartale, Harshwardhan
Kattamuri, Ashish
Raja, Rahul
Vats, Arpita
Prasad, Ishita
Moharir, Akshata Kishore
contents Transformer-based language models excel at both recall (retrieving memorized facts) and reasoning (performing multi-step inference), but whether these abilities rely on distinct internal mechanisms remains unclear. Distinguishing recall from reasoning is crucial for predicting model generalization, designing targeted evaluations, and building safer interventions that affect one ability without disrupting the other.We approach this question through mechanistic interpretability, using controlled datasets of synthetic linguistic puzzles to probe transformer models at the layer, head, and neuron level. Our pipeline combines activation patching and structured ablations to causally measure component contributions to each task type. Across two model families (Qwen and LLaMA), we find that interventions on distinct layers and attention heads lead to selective impairments: disabling identified "recall circuits" reduces fact-retrieval accuracy by up to 15\% while leaving reasoning intact, whereas disabling "reasoning circuits" reduces multi-step inference by a comparable margin. At the neuron level, we observe task-specific firing patterns, though these effects are less robust, consistent with neuronal polysemanticity.Our results provide the first causal evidence that recall and reasoning rely on separable but interacting circuits in transformer models. These findings advance mechanistic interpretability by linking circuit-level structure to functional specialization and demonstrate how controlled datasets and causal interventions can yield mechanistic insights into model cognition, informing safer deployment of large language models.
format Preprint
id arxiv_https___arxiv_org_abs_2510_03366
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Disentangling Recall and Reasoning in Transformer Models through Layer-wise Attention and Activation Analysis
Fartale, Harshwardhan
Kattamuri, Ashish
Raja, Rahul
Vats, Arpita
Prasad, Ishita
Moharir, Akshata Kishore
Machine Learning
Artificial Intelligence
Transformer-based language models excel at both recall (retrieving memorized facts) and reasoning (performing multi-step inference), but whether these abilities rely on distinct internal mechanisms remains unclear. Distinguishing recall from reasoning is crucial for predicting model generalization, designing targeted evaluations, and building safer interventions that affect one ability without disrupting the other.We approach this question through mechanistic interpretability, using controlled datasets of synthetic linguistic puzzles to probe transformer models at the layer, head, and neuron level. Our pipeline combines activation patching and structured ablations to causally measure component contributions to each task type. Across two model families (Qwen and LLaMA), we find that interventions on distinct layers and attention heads lead to selective impairments: disabling identified "recall circuits" reduces fact-retrieval accuracy by up to 15\% while leaving reasoning intact, whereas disabling "reasoning circuits" reduces multi-step inference by a comparable margin. At the neuron level, we observe task-specific firing patterns, though these effects are less robust, consistent with neuronal polysemanticity.Our results provide the first causal evidence that recall and reasoning rely on separable but interacting circuits in transformer models. These findings advance mechanistic interpretability by linking circuit-level structure to functional specialization and demonstrate how controlled datasets and causal interventions can yield mechanistic insights into model cognition, informing safer deployment of large language models.
title Disentangling Recall and Reasoning in Transformer Models through Layer-wise Attention and Activation Analysis
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2510.03366