Abstract
Compositional relational reasoning (CRR) is a hallmark of human intelligence, yet our understanding of how large language models (LLMs) navigate these tasks remains limited. This paper introduces Generalized Associative Recall (GAR), a synthetic benchmark designed to bridge the gap between simple memory tasks and complex reasoning. By evaluating state-of-the-art models, we reveal a persistent "compositionality gap" that widens as models scale. Furthermore, through mechanistic interpretability on Vicuna-33B, we identify specific "True" and "False" attention heads that function as internal logic gates. Intervention experiments demonstrate that these heads are critical for reasoning performance and generalize across diverse logical contexts.
Introduction: The Challenge of Compositional Reasoning
While Large Language Models (LLMs) demonstrate remarkable capabilities, their ability to perform Compositional Relational Reasoning (CRR)—the process of linking multiple logical steps to reach a conclusion—is not well understood. Current research typically focuses on either simple associative recall (memorizing key-value pairs) or complex real-world benchmarks. The former is easy to analyze but lacks depth, while the latter is often too noisy for mechanistic interpretability (MI), the study of identifying specific internal circuits responsible for model behavior.
This research addresses this divide by proposing a "Goldilocks" benchmark: one that is sufficiently challenging to test models like GPT-4, yet structured enough to allow researchers to map the internal mechanisms driving the reasoning process.
The GAR Benchmark: Bridging the Gap
The authors developed the Generalized Associative Recall (GAR) framework to treat reasoning as a "relational loop." In this framework, a model must successfully traverse multiple relations to arrive at a correct answer. For example, to conclude that "John has a fruit," the model must first link John to apple (contextual recall) and then link apple to the category fruit (factual knowledge).
GAR includes 384 distinct tasks and over 4,600 examples, incorporating complexities such as negation ("John does not have..."), syntactic swaps, and varying formats (generation vs. classification). This structured approach allows for a systematic exploration of how models handle the integration of local syntax and long-range semantics.
Evaluating LLM Performance and the Compositionality Gap
Evaluation across a wide range of models, including Llama-2, Vicuna, and GPT-4, reveals that GAR is surprisingly difficult. Even GPT-4 achieved an average accuracy of only 71.5%, suggesting that these synthetic tasks capture fundamental reasoning challenges that scaling alone has not yet solved.
A critical finding is the Compositionality Gap. As models increase in size (e.g., from Llama-7B to 70B), they become significantly better at individual sub-tasks. However, their ability to compose these sub-tasks into a coherent logical chain does not improve at the same rate. In fact, Figure 2(c) shows that the gap between sub-task performance and full compositional performance actually widens as models scale, indicating that larger models are not proportionally better at "sticking" logical steps together.
Mechanistic Insights: Discovering Logic Gates
To understand how models solve these tasks, the researchers applied Attribution Patching to Vicuna-33B. This technique traces information flow to identify critical attention heads and MLP layers. The study discovered a specific class of "higher-order relating heads" that represent abstract notions of True and False rather than just predicting the next token.
For instance, heads 14.18 and 14.46 were identified as "True" heads, while 15.51 and 14.0 acted as "False" heads. To prove their necessity, the team performed Intervention Experiments. By manually fixing the attention patterns of these heads in a smaller model (Vicuna-7B), they observed a 17% increase in accuracy, confirming these heads are primary drivers of reasoning performance. Remarkably, these discovered heads also predicted truthfulness in natural language datasets like SNLI, suggesting they are fundamental components of the model's internal logic processing.
Conclusion
The introduction of the GAR benchmark provides a vital tool for assessing the compositional limits of LLMs. The discovery of a widening compositionality gap suggests that simply increasing model parameters is insufficient for mastering complex logic. However, the identification of universal "logic heads" offers a promising path forward. Future work will focus on moving from identifying these circuits to developing training methods that can effectively close the compositionality gap in both synthetic and natural language environments.
Summary updated