Shortcut Solutions Learned by Transformers Impair Continual Compositional Reasoning

William T. Redman [email protected], Erik C. Johnson [email protected], Brian Robinson [email protected] · 2026

Read Shortcut Solutions Learned by Transformers Impair Continual Compositional Reasoning by William T. Redman [email protected], Erik C. Johnson [email protected], Brian Robinson [email protected] (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-05495.txt.

Introduction

Transformers can cheat: they may learn a shortcut that solves early tasks but blocks later learning. William T. Redman, Erik C. Johnson, and Brian Robinson test that worry in a continual version of the LEGO reasoning framework. Models must keep learning related tasks in sequence, composing what they already know.

BERT, a feedforward model, settled into shortcut solutions and transferred poorly. ALBERT, a recurrent cousin, learned a loop-like strategy and did better. When tasks demanded composition across experiences, both families failed, though mixing data across tasks rescued ALBERT and not BERT. Architecture, it seems, shapes the solutions models find.

Catalog record

CREATORWilliam T. Redman [email protected], Erik C. Johnson [email protected], Brian Robinson [email protected]
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE49 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.05495

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Shortcut Solutions Learned by Transformers Impair Continual Compositional Reasoning William T. Redman [email protected], Erik C. Johnson [email protected], Brian Robinson [email protected] Abstract Identifying and exploiting common features across domains is at the heart of the human ability to make analogies, and is believed to be crucial for the ability to continually learn. To do this successfully, general and flexible computational strategies must be developed. While the extent to which Transformer neural network models can perform compositional reasoning has been the subject of intensive recent investigation, little work has been done to systematically understand how well these models can leverage their representations to learn new, related experiences. To address this gap, we expand the previously developed Learning Equality and Group Operations (LEGO) framework to a continual learning (CL) setting (“continual LEGO”). Using this continual LEGO experimental paradigm, we study the capability of feedforward and recurrent Transformer models to perform CL. We find that BERT, a canonical feedforward Transformer model, learns shortcut solutions that limits its ability to generalize and prevents strong forward transfer to new experiences. In contrast, we find evidence supporting the hypothesis that ALBERT, a recurrent version of BERT, learns a For loop-esque solution, which leads to better CL performance. When applying BERT and ALBERT models to a CL setting that requires composition across experiences, we find that both model families fail. Our investigation suggests that ALBERT models can have their performance drop rescued by use of training strategies that combine data across experiences, but this is not true for BERT models, where a detrimental shortcut solution becomes entrenched with initial training. Our results demonstrate that the recurrent ALBERT model may have an inductive bias better suited for CL and motivate future investigation of the interplay between Transformer architecture and computational solutions that emerge in modern models and tasks. 1 Introduction At the core of compositional reasoning (i.e., solving complex tasks by iteratively solving and composing simpler sub-tasks) is the ability to recognize relationships between objects. While the exact objects and their relationships may differ across different types of experiences, common underlying structure can be broadly present. Therefore, developing general computational strategies for composition not only enables good performance on individual experiences, but can also allow for faster acquisition of new experiences. For instance, learning to iteratively loop over objects and their relationships (i.e., an algorithmic For loop-esque computation) can be equally useful when spatially navigating (e.g., “turn left at the stop sign”, “turn right at the light”,…) and when solving a logic problem (e.g., “Alice has four watermelons”, “Alice gives two watermelons to Bob”,…). Thus, endowing artificial neural networks with the ability to perform compositional reasoning over continually new experiences will involve identifying how to endow them with general computational strategies. Self-attention ( 5 ) has revolutionized machine learning by enabling the learning of input-specific relations across long context windows. Analysis of the emergent attention patterns has identified interpretable and generalizable computations ( 37 ; 15 ) . For instance, dissection of the attention patterns learned by BERT ( 9 ) , a canonical feedforward Transformer model, and ALBERT ( 21 ) , its recurrent counterpart (with weights shared between layers), on the synthetic Learning Equality and Group Operations (LEGO) task unveiled the presence of attention heads that performed local and global attention ( 37 ) . Mimicking these patterns in randomly initialized networks leads to increased performance, emphasizing the learned computational strategies’ utility and suggesting possible routes to improving upon standard Transformer architectures. While demonstrating the power of Transformers, self-attention has also been found to support “shortcuts” ( 23 ) (i.e., solutions that are non-generalizable). Indeed, it has been proven that such shortcut solutions always exist in the context of certain tasks ( 23 ) , suggesting they may be inescapable. However, there is also evidence that Transformer models can learn generalizable solutions, as ALBERT was argued to learn a For loop computation ( 37 ) . This tension between general and shortcut solutions has major implications for if and how Transformer models are capable of learning to continually compose across new experiences. And yet the fundamental capabilities of Transformer models to perform continual learning (CL) remains a largely understudied research direction, particularly in the context of compositional reasoning (although see 1 for some recent work in this direction). To begin to address this important gap in a simplified and controlled setting, we develop a CL extension of LEGO (“continual LEGO”) and perform an in-depth analysis on how BERT and ALBERT models perform. Our work provides the first in-depth analysis of how feedforward and recurrent Transformer models perform on continual compositional reasoning. Our contributions are the following: • We expand the synthetic compositional reasoning LEGO task ( 37 ) to enable a systematic investigation of CL capabilities of Transformer models. • We find that architectural choices (e.g., number of attention heads, number of hidden layers) differentially affect the generalization accuracy and strength of forward transfer for BERT and ALBERT models, with BERT models demonstrating inconsistent performance on CL, as model size is increased. • We identify evidence of shortcut and algorithmic For loop-esque solutions in BERT and ALBERT models, respectively, providing a mechanistic explanation of their different performance on the continual LEGO task. • We demonstrate that both families of models fail to perform well on a continual LEGO setting that requires composition across experiences, a failure that we find can be rescued by training on data that incrementally combines across experiences in ALBERT models, but not BERT models, where a shortcut solution has become entrenched. Collectively, our results demonstrate that – on a synthetic continual compositional reasoning task – the shortcut solutions learned by BERT and ALBERT models, while enabling success on complex tasks, can impair their CL capabilities. We hope our work leads to greater understanding of these important limitations and to what extent they exist in modern Transformer architectures and tasks. 2 Related work 2.1 Continual learning with Transformers CL has historically been studied in the context of computer vision ( 31 ) . Unsurprisingly then, vision Transformers (ViTs) ( 10 ; 11 ) have received the bulk of attention from investigations characterizing Transformers’ ability to perform CL ( 35 ; 33 ; 38 ) . This work has demonstrated that ViTs are susceptible to catastrophic forgetting, in some cases even more so than CNNs ( 35 ) . This failure has been attributed to degradation of the locality that emerges in the self-attention heads ( 38 ) , as well as a greater bias towards new classes ( 35 ) . Addressing these limitations by architectural changes leads to improvement in CL performance ( 35 ; 33 ; 38 ) . For transformer-based large language models 36 , recent work has benchmarked CL when sequentially training on language corpuses across domains for different model sizes. Our work complements this prior literature by considering CL in the context of compositional reasoning, which to our knowledge has received little investigation from the Transformer community ( 1 ) . Additionally, unlike image classification, reinforcement learning, or language domains where distributional shifts can be challenging to quantify, our continual compositional reasoning tasks offer a structured approach to study forward transfer. Thus, we are able to probe forward transfer

Read the complete text