Manuscript Offprint
arXiv:2611.00387Geometric and algebraic inference in humans and neural networks
Abstract
Humans possess a remarkable ability to draw inferences from limited data. While some inferences are made intuitively from past experience, others require online reasoning based on novel information given in context. Here, we formalize these strategies, which we term geometric and algebraic inference, and study their computational tradeoffs in humans and neural networks. The geometric strategy gradually shapes representational geometry to reflect underlying relational structure, making subsequent inference cheap. The algebraic strategy flexibly attends to and reasons over novel relations given in context, but costs additional computation at inference time. We identify opposing signatures of these two strategies in transitive inference, a domain widely studied across species, and characterize the conditions under which each is observed. Our framework predicts that the geometric strategy should be dominant when relations are familiar, whereas the algebraic should emerge to support de novo inferences drawn in context. Multiple experiments demonstrate these opposing signatures in humans, neural networks trained from scratch, and large language models (LLMs). Causal interventions in the neural networks reveal that the geometric and algebraic strategies depend on representational geometry and selective attention mechanisms, respectively, and reproduce the effects of analogous neurobiological disruptions in humans. Our framework unifies these effects with disparate phenomena, including content effects observed in human and LLM reasoning and data-distribution effects observed in machine learning. Our findings reconcile competing views of cognitive flexibility that emphasize either representational geometry or algebraic manipulation by showing that each can have unique strengths, and can characterize different aspects of both human and neural network behavior.
1 Introduction
Windmills tend to be larger than toasters. You have probably never entertained that specific comparison, yet you know without much thought that it is true. If, on the other hand, you were told that Leo is taller than Max, Owen is taller than Zoe, and Max is taller than Owen, you might have to reason step by step to deduce that Leo is taller than Zoe.
These examples seem to rely on different underlying processes, but both can be understood as instances of transitive inference (TI), the derivation of an unseen relation from learned ones via the transitive property. Such inferences are a textbook form of logical deduction, long considered a hallmark of rational thought (Inhelder & Piaget, 1958)—yet they are exhibited in a remarkably wide range of nonhuman animals, including pigeons (von Fersen et al., 1991), corvids (Paz-y-Miño C et al., 2004), rats (Davis, 1992; Dusek & Eichenbaum, 1997), and monkeys (D'Amato & Colombo, 1990; Gazes et al., 2012; Jensen et al., 2017). These behaviors may not require the kind of explicit logical deduction typically associated with human syllogistic reasoning, and may instead be explained by simpler processes, such as
Correspondence: jake_russin@brown.edu ones that rely on incrementally building up a continuum of ordered representations (Frank et al., 2005, 2003; Jensen et al., 2015; Vasconcelos, 2008; Wynne, 1995). However, no one doubts that humans can, at least under certain circumstances, perform logical deductions over completely novel relations (Dehaene et al., 2022; Johnson-Laird, 2010; Rips, 1994). Here, rather than asking which strategy underlies TI in general, we show that humans solve TI problems in two fundamentally distinct ways—one that relies on ordered internal representations and one that relies on step-by-step logical deduction—and provide a normative account of when each strategy should be used.
These debates are not specific to TI, but reflect a contrast between two longstanding perspectives on human cognitive flexibility (Fodor & Pylyshyn, 1988; McClelland et al., 2010; Sloman, 1996; Smolensky, 1988). The geometric view emphasizes that generalization is possible when experience is distilled into representations whose geometry mirrors the structure of a domain, allowing novel relations to be read directly from that geometry. This view is exemplified in work on neural geometry (Bernardi et al., 2020; Chung & Abbott, 2021; Kay et al., 2024; Nelli et al., 2023; Sorscher et al., 2022), cognitive maps (Behrens et al., 2018; Constantinescu et al., 2016; S. A. Park et al., 2020, 2026; Tolman, 1948; Whittington et al., 2020), distributional semantics (Boleda, 2020; Grand et al., 2022; Landauer & Dumais, 1997; Mikolov et al., 2013; Rogers & McClelland, 2004), and representation learning in neural networks more generally (Bengio et al., 2013; LeCun et al., 2015; Rumelhart et al., 1986). The algebraic view emphasizes that generalization is possible when knowledge is encoded as abstract, content-independent rules, allowing novel relations to be derived by systematically applying those rules step by step. This view has been emphasized in formal approaches to language (Chomsky, 1957; Pinker & Prince, 1988), rule-based or hypothesis-driven learning (Goodman et al., 2008; Kemp & Tenenbaum, 2008; Marcus, 2001; Marcus et al., 1999; Piantadosi et al., 2012; Tenenbaum & Griffiths, 2001; Tenenbaum et al., 2011), compositionality (Fodor & Pylyshyn, 1988; Russin, McGrath, & Williams, 2025), and in symbolic models of cognition more generally (Anderson et al., 2004; Dehaene et al., 2022; Fodor, 1975; Laird et al., 1987; Newell & Simon, 1972; Rips, 1994). Although these perspectives emerged from distinct research traditions and have historically been framed as rivals (Lake et al., 2017; McClelland et al., 2010; Pinker & Prince, 1988; Smolensky, 1988), we demonstrate that humans and neural networks can flexibly generalize in both ways on TI tasks, and characterize their unique computational advantages and when each is expressed.
Computational models of TI have generally realized one of these generalization strategies or the other, either building up ordered representations (Ciranka et al., 2022; Frank et al., 2003; Jensen et al., 2015; Kay et al., 2024; Miconi & Kay, 2025; von Fersen et al., 1991; Wynne, 1995) or executing a step-by-step reasoning process (Hummel & Holyoak, 2001; Kumaran & McClelland, 2012; Sternberg & Weil, 1980). Studying how the two strategies relate and interact, however, requires a single system capable of both. Although neural networks have typically been associated with the geometric strategy (Frank et al., 2003; Lippl et al., 2024; Noroozizadeh et al., 2026; Russin et al., 2021), recent models, including large language models (LLMs), exhibit both in-weight learning (IWL), in which weights change incrementally with experience, and in-context learning (ICL), an emergent ability to make inferences about novel premises provided in context, by re-routing activation dynamics rather than weights (Brown et al., 2020; Olsson et al., 2022). These two forms of learning have been shown to generalize differently (Anand et al., 2025; S. C. Y. Chan, Dasgupta, et al., 2022; Geerts et al., 2025; Lampinen et al., 2025; Lepori et al., 2026). Furthermore, modern neural networks can increasingly reason in context as well, producing chains of thought (CoTs) akin to step-by-step algebraic reasoning (Guo et al., 2025; Kojima et al., 2022; Nye et al., 2021; OpenAI, 2024; Wei et al., 2022). The distinction between IWL and ICL has parallels in human learning (Botvinick et al., 2019; Collins & Frank, 2012; Pesnot Lerousseau & Summerfield, 2026; Russin, Pavlick, & Frank, 2025): IWL is analogous to incremental synaptic plasticity supporting statistical learning in basal ganglia and hippocampus, whereas ICL is analogous to activation dynamics supporting working memory gating and hierarchical generalization in prefrontal cortex (Collins & Frank, 2013; O'Reilly & Frank, 2006; O'Reilly et al., 2022; Rougier et al., 2005; Russin, O'Reilly, & Bengio, 2020; Soni et al., 2026; Wang et al., 2018). Thus, modern neural networks may present an opportunity to study geometric and algebraic generalization in a system other than humans.
In this work we develop a theoretical framework that formalizes the distinction between geometric and algebraic generalization, and show that it makes testable predictions about learning, inference, and their underlying mechanisms in humans and neural networks. We derive our predictions formally, validate them in networks trained from scratch, and confirm them empirically in humans and LLMs evaluated on the same problems. Our framework unifies disparate phenomena from cognitive science, neuroscience, and machine learning, including symbolic distance effects (Moyer & Landauer, 1967; Potts, 1974), content effects (Evans et al., 1983; Lampinen et al., 2024), and data-distribution effects (S. C. Y. Chan, Santoro, et al., 2022; Reddy, 2024), showing that they can be grounded in a single set of principles. We also use mechanistic interventions to demonstrate that the two strategies rely on dissociable mechanisms in our neural networks, reproducing findings from analogous neural perturbations across species (Dusek & Eichenbaum, 1997; Frank et al., 2006; Waltz et al., 1999).
This formalization clarifies the distinct computational advantages of each strategy (Fig. 1), yielding behavioral predictions that can be tested by manipulating the query's symbolic distance (premises separating the two items; Figs. 2D,E and 3B,C). The geometric strategy can only answer queries on familiar items whose relative ranks have been learned (e.g., windmills are larger than toasters), but can do so in a single step by comparing pre-compiled ranks. The algebraic strategy can answer any query given premises provided in context even after a single shot (e.g., Leo is taller than Max), but requires more computational steps as symbolic distance increases. A single learner capable of both strategies should therefore deploy the geometric strategy on items familiar from past experience (i.e., learned in weights), and the algebraic strategy when novel relations are given in context.
Because the two strategies use different representations and computations, they generate distinct behavioral predictions. Under simple noise assumptions, inference under the two strategies exhibits opposite symbolic distance effects (Fig. 2D,E): with greater distance, the geometric strategy's ordered representations are more discriminable (assuming Gaussian noise in learned ranks; see Appendix A), whereas the algebraic strategy requires a greater number of reasoning steps (and thus opportunities for error; see Appendix A). When items are familiar and context is uninformative, the learner should rely on the geometric

Figure 1: Two strategies for transitive inference. The geometric strategy pre-compiles item ranks into ordered representations. The algebraic strategy reasons step by step over relations given in context.
strategy, resulting in better accuracy with larger distance—the classic symbolic distance effect (SDE) that has been observed in many prior TI studies across species (Banks, 1977; D'Amato & Colombo, 1990; Frank et al., 2005; Jensen et al., 2017; Lippl et al., 2024; Moyer & Landauer, 1967; Potts, 1974; Trabasso & Riley, 1975; von Fersen et al., 1991). Conversely, when items are novel and context is informative, our framework predicts the learner should use the algebraic strategy, requiring longer response times and worse accuracy with larger distance—a reverse SDE. While it would be possible for a learner in this case to use the geometric strategy to pre-compile in-context relations on the fly (in-context representation learning; C. F. Park et al., 2025), our framework predicts that the algebraic strategy should be preferred in this case due to its lower cost (Appendix A). In the following, we test these predictions in neural networks trained from scratch, humans, and LLMs, all evaluated on the same TI problems.
3 Results
3.1 Symbolic distance effects
Because the two strategies predict opposite symbolic distance effects (Fig. 2D,E), and strategy choice should depend on familiarity, a learner capable of both should show an SDE when familiar orderings are queried and a reverse SDE when inferences must be made on novel premises. We tested this prediction in neural networks trained from scratch, humans, and LLMs in a setting where correct relations could be derived from relations given in the context (Fig. 2A). Transformers and humans were trained with feedback on a single ordering of seven items. Inspired by prior work (S. C. Y. Chan, Dasgupta, et al., 2022; S. C. Y. Chan, Santoro, et al., 2022; Pesnot Lerousseau & Summerfield, 2026), we designed tests to isolate each strategy: an IWL test querying pairs of familiar (trained) items without an informative context, and an ICL test querying novel items with the context shown (Fig. 2B,C).
To demonstrate the principles of our framework in a controlled setting where they could be isolated, we first tested these predictions in neural networks trained from scratch, using the transformer architecture (Vaswani et al., 2017). To emulate the prior step-by-step reasoning experience of human adults, we pretrained these networks in a setting where they learned (or “metalearned”; Binz et al., 2024; Wang et al., 2018) how to solve TI problems by reasoning in context. Models were trained on a distribution of TI problems to generate intermediate reasoning steps before responding (see Alg. 3). After pretraining, the networks were finetuned on a single ordering of seven items, analogous to humans learning a single ordering during a TI experiment. As predicted, the trained networks exhibited an SDE on the IWL test (Geerts et al., 2025; Kay et al., 2024; Lippl et al., 2024; N. Singh, 2026) but a reverse SDE on the ICL test (Fig. 2G), and required more reasoning steps on more distant queries on the ICL, but not the IWL test (Fig. 2H,I). Pair-level results and the complete reasoning-step sweeps are reported in Fig. S1, and results with other reasoning algorithms in Fig. S2.
We ran the same experiment with human participants (Experiment 1; N = 40): each learned a single ordering with feedback, then completed the IWL test and the ICL test in the same session (order counterbalanced). As expected, accuracy increased with distance on the IWL test (an SDE; p < .001) but decreased with distance on the ICL test (a reverse SDE; p < .001), producing a distance-by-test interaction (p < .001; Fig. 2J; Tables S2–S4). Response times (RTs) also showed the predicted dissociation (distance-by-test interaction: p < .001; Fig. 2K; Tables S5–S7): on the ICL test RT increased steeply with distance (p < .001), whereas on the IWL test it was shorter and did not depend significantly on distance (p = .442). Learning-phase and pair-level results are reported in Figs. S13 and S14. Overall, these results are consistent with the hypothesis that humans use a geometric strategy in which relations are read from pre-compiled ordered representations when tested on familiar items, and use an algebraic strategy that makes step-by-step inferences when tested on novel items.
The above simulations explicitly trained transformers to solve TI tasks. To determine whether the same principles arise spontaneously and at scale, we tested a variety of LLMs on the same task (Methods 5.3). Previous studies have reported a classic SDE in LLMs given TI problems in context (Rane et al., 2025; Wu

Figure 2: Symbolic distance effects (SDE). (A) Learning phase: participants were shown a query above a row of relations in context, and were given feedback. (B) IWL test (red): to test whether participants committed ranks of items to memory, we tested trained items with an uninformative context. (C) ICL test (blue): to test whether participants could make TIs in context, we tested them on novel items. (D) Under simple noise assumptions, the two strategies produce opposite distance effects on accuracy. (E) Expected reasoning steps grow with distance in the algebraic but not the geometric strategy. (F) Under the algebraic strategy, accuracy rises with reasoning budget, and longer distances require more steps. (G) Transformers trained from scratch exhibited an SDE on the IWL test and a reverse SDE on the ICL test. (H) The number of reasoning steps required to reach 90% of maximum accuracy increased with distance on the ICL, but not the IWL test. (I) ICL test accuracy increased with the number of reasoning steps, and longer distances required more steps. (J) Humans exhibited an SDE on the IWL test and a reverse SDE on the ICL test. (K) Human response times increased with distance on the ICL, but not the IWL test. (L) LLMs (Qwen3-32B shown) exhibited an SDE when discriminating familiar relations (country population), and a reverse SDE when tested on novel relations in context. (M) Across LLMs, the accuracy increased with symbolic distance on the IWL test and decreased on the ICL test for 15 of 18 models (lower right quadrant). (N) When evaluated with chain of thought (CoT), LLMs (Qwen3-32B shown) used more reasoning tokens for longer distances on the ICL test, and used fewer reasoning tokens on the IWL test (country population). (O) Across LLMs, the reasoning budget needed was larger on the ICL test than on the IWL test and increased with distance on the ICL test for 18 of 19 models (upper right quadrant). (P) The same held on the LLM ICL test as a function of the reasoning budget in tokens (Qwen3-32B shown). Panels F, I, and P show one line per symbolic distance (darker for larger distances); I and P show the best accuracy reached at each budget or below. Numbers show accuracy at the largest reasoning budget (eight steps; 1,024 tokens) over distances 2–6.
& Deng, 2025), and accuracy that declines with distance on other relational problems (A. Liu et al., 2025), but to our knowledge, none has investigated whether LLMs produce a reverse symbolic distance effect when reasoning on TI problems. Our IWL test queried five real-world dimensions (e.g., countries ordered by population) with no relations shown; the ICL test queried novel arbitrary relations (names of people ordered by height) with adjacent relations shown in context. As predicted, LLMs consistently showed a classic SDE on the IWL test due to the semantic knowledge acquired in their weights during pretraining (El-Shangiti et al., 2025; Heinzerling & Inui, 2024; Shah et al., 2023; Shaki et al., 2025), and a reverse SDE on the ICL test (15 of 18 models; Fig. 2L,M). These models performed better on the ICL test when they reasoned step by step before producing a response (with CoT), and the reasoning budget required (i.e., tokens required to reach 90% of maximum accuracy) was generally higher on the ICL test compared to the IWL test, and increased with distance on the ICL test (18 of 19 models; Fig. 2N-P). Appendix C.3 reports variation observed across models and dimensions. Overall, these results are consistent with predictions, showing that even though they were not explicitly trained to do so, LLMs in general exhibit the same signatures of the geometric and algebraic generalization strategies we observed in humans.
Taken together, these results confirm our prediction in humans and in both custom and large-scale neural networks that the classic SDE, a signature of the geometric strategy, emerges when relying on IWL, and can reverse if instead an algebraic strategy is flexibly deployed to handle novel premises in context.
3.2 Content effects
The tests above were designed to isolate each of the two strategies. However, when familiar items appear alongside informative contextual information, both strategies are available, and conflicts can arise. The two strategies reinforce one another when the information given in context is congruent with prior knowledge (e.g., “windmills are larger than trucks”), but can compete when it is incongruent—when relations are reversed or shuffled (e.g., “trucks are larger than windmills”). The resulting content effects have been observed across many domains in human reasoning (Andrews, 2010; Byrne, 1989; Cheng & Holyoak, 1985; Evans et al., 1983; Oakford & Chater, 1994; Wason & Shapiro, 1971; Wilkins, 1928) and have recently been shown to emerge in LLMs (Bertolazzi et al., 2026; Lampinen et al., 2024; A. Liu et al., 2025). We hypothesized that these content effects arise from competition between the two strategies, and further predicted that prior knowledge should dominate direct responses, whereas responses should become context-informed only after sufficient reasoning, with larger distances requiring more reasoning (Fig. 3B-D).
We first tested this prediction in transformers trained from scratch, using a pretraining distribution in which one ordering was very frequent, supporting the formation of a content prior (analogous to real-world cases where a consistent “ordering,” such as the relative sizes of common objects, is frequently observed). To determine how this content prior interacted with contextual evidence, we tested the network in the presence of contextual information that was either congruent, reversed, or shuffled relative to the prior, as well as in the usual IWL test, where context was completely uninformative (Fig. 3A).
As predicted, the model’s direct responses (i.e., without reasoning) were strongly shaped by prior knowledge (Figs. 3E and S5). On the IWL test, the model exhibited a classic SDE, with accuracy increasing with symbolic distance. A congruent context reinforced prior knowledge, increasing accuracy relative to the IWL test at every symbolic distance. When the ordering given in context was reversed and the model answered without reasoning, prior knowledge still drove direct prepotent responses, yielding below-chance agreement with the context across non-adjacent distances. With a shuffled context, in which the queried relation agreed with the prior on half of the trials, direct accuracy was near chance at every distance above one. However, when the network was allowed to reason through the relations given in context, it could progressively overcome this interference, shifting responses toward the context-appropriate inference (Figs. 3G and S5B). Furthermore, as predicted, the number of reasoning steps required to overcome the prior increased with symbolic distance under both reversed and shuffled contexts, whereas congruent contexts required almost none (Fig. 3F,G). Thus, the model could leverage the algebraic strategy to overcome content interference, and in doing so, exhibited its characteristic reverse SDE on incongruent trials. But in the absence of such interference, the geometric strategy was sufficient and so no such effect was observed.
A Context about the queried items
Congruent
context matches known order
truck > toaster
toaster > whistle
windmill > truck
Is it true or false that windmill > whistle?
Reversed
context reverses known order
toaster > truck
whistle > toaster
truck > windmill
Is it true or false that windmill > whistle?
Shuffled
known order, randomly shuffled
whistle > truck
truck > windmill
windmill > toaster
Is it true or false that windmill > whistle?
No relevant context
Uninformative
context has irrelevant items
guitar > mug
mug > coin
piano > guitar
Is it true or false that windmill > whistle?
In every prompt, > means "is larger than"
No context
query alone, analogous to IWL test
Is it true or false that windmill > whistle?
B Predictions

E Transformers (scratch)
H Humans
J LLM (Qwen3-32B)
K LLMs
C Predictions
F Transformers (scratch)
I Humans
L LLM (Qwen3-32B)
M LLMs
D Predictions
G Transformers (scratch)
N LLM (Qwen3-32B)
Figure 3: Content effects in transitive inference. (A) Context conditions. The ordering shown in the context was either congruent, reversed, or shuffled relative to prior knowledge, or was uninformative. (B) Content effects emerge in a system capable of both strategies. When context is congruent, the system performs well regardless of distance, but when it is reversed or shuffled, accuracy falls with distance. When context is uninformative (IWL test), the system shows an SDE. (C) Expected reasoning steps grow with distance on reversed and shuffled trials (identical; offset for visibility) but not on congruent trials. (D) On reversed trials, accuracy rises with reasoning steps; on congruent trials it stays near ceiling. (E) Transformer accuracy by symbolic distance with no reasoning steps. In the IWL test, an SDE was observed. Accuracy was near ceiling when the context was congruent but fell below chance when it was reversed and near chance when it was shuffled. (F) The number of reasoning steps required to reach 90% of maximum accuracy increased with distance on reversed and shuffled trials, but not on congruent. (G) Transformer accuracy on reversed trials recovered with reasoning steps, with longer distances requiring more steps; congruent accuracy remained high. (H) Humans exhibited an SDE in the congruent condition and a reverse SDE in the shuffled condition (uninformative and reversed contexts were not tested). (I) Human response times increased with distance in the shuffled, but not the congruent condition. (J) LLMs showed the predicted content effects without reasoning (Qwen3-32B, US state population). (K) Across LLMs and sets of items (one point per model × set), accuracy in the reversed condition decreased as accuracy in the no-context condition increased, suggesting a stronger prior increases interference. (L) With reasoning, the budget required to reach 90% of maximum accuracy increased with distance under a reversed and shuffled context (Qwen3-32B, US state population). (M) Across LLMs and real-world dimensions (one point per model × dimension), models showed content effects (higher accuracy on congruent than reversed), and reasoning effects (accuracy on reversed trials increased with reasoning; upper right quadrant). (N) LLM accuracy on reversed trials recovered with reasoning; longer distances required more reasoning tokens (Qwen3-32B, US state population). Panels G and N show the best accuracy reached at or below each budget. Numbers show accuracy at the largest reasoning budget (eight steps; 1,024 tokens) over distances 2–6.
Next, we tested the same content effects in humans with an analogous task (Experiment 2; Methods 5.2.2). Each question showed eight statements ordering nine animals by weight (e.g., “The horse is heavier than the dog.”), listed in a scrambled order, and asked which of two animals was heavier according to the statements. Between subjects, the statements were either all congruent with their real-world ordering () or followed a shuffled ordering (). As expected, accuracy was lower in the shuffled than in the congruent condition (; Table S8), particularly when the queried relation conflicted with the real-world ordering (Fig. S19). Notably, symbolic distance had opposite effects across conditions (condition-by-distance interaction: ; Fig. 3H): accuracy increased with distance in the congruent condition (an SDE; ) but decreased with distance in the shuffled condition (a reverse SDE; ). RTs showed the same dissociation (condition-by-distance interaction: ; Fig. 3I; Table S9): in the shuffled condition RT increased with distance (), whereas in the congruent condition it was shorter and did not increase with distance (). These results are consistent with our hypothesis that participants would leverage the geometric strategy when the context was congruent with their prior knowledge, and the algebraic strategy when it was incongruent with it.
Finally, we tested LLMs on TI problems involving multiple real-world dimensions, varying whether the relations shown in context were congruent, reversed, or randomly shuffled with respect to their real-world order (Fig. 3A). As predicted, direct answers were again shaped by the content prior (Fig. 3J): in 81 of 110 model-dimension combinations, congruent accuracy exceeded reversed (Appendix C.3). Furthermore, poorer performance on reversed trials was greater in settings in which the model had a stronger prior (Fig. 3K), consistent with the idea that poor performance was due to interference from the prior. Importantly, however, as in the transformers trained from scratch, LLM performance on reversed-context problems recovered with step-by-step reasoning (Fig. 3L–N): in 98 of 110 model-dimension combinations, reversed-context accuracy increased with reasoning budget (Fig. 3M; Figs. S36–S39).
Together, these results show that our framework can also account for the content effects observed in humans (Evans et al., 1983; Evans & Curtis-Holmes, 2005; Schubert et al., 2021) and in LLMs (Lampinen et al., 2024). When a system has encoded knowledge in its representational geometry but can also execute an algebraic strategy via in-context reasoning, a natural competition between the two emerges: interference hurts performance on incongruent trials, but can be overcome via step-by-step reasoning.
3.3 Independent mechanisms underlie the geometric and algebraic strategies
The above experiments show that human and neural network behavior can be consistent with the geometric and algebraic strategies, but do not directly investigate their underlying mechanisms. We hypothesized that the geometric strategy would be reflected in network weights encoding the ordering, but that algebraic reasoning would depend on step-by-step attentional computations guiding activations toward the solution consistent with the context (Jin et al., 2024; Ortu et al., 2024; Yu et al., 2023). To test this, we intervened on each strategy (Fig. 4A) in the transformers and in an LLM (Qwen3-32B). To target the geometric strategy, we identified and erased the rank direction, the direction in an item's representation that encodes the familiar ordering, at every layer (Belrose et al., 2023; El-Shangiti et al., 2025; Gurnee & Tegmark, 2024; Heinzerling & Inui, 2024). To target the algebraic strategy, we ablated context-reading heads, the attention heads that attended most to the relevant relations in context while the model reasoned.
In our transformers, erasing the rank direction substantially reduced IWL accuracy and removed the content-prior bias on reversed trials, but left accuracy after reasoning largely intact (Fig. 4B). These results are similar to ones from neuroscience showing that lesions to hippocampus can impair transitive inferences about learned relations in rodents (Dusek & Eichenbaum, 1997). Conversely, ablating two context-reading heads per network had the opposite effect: accuracy after reasoning fell sharply on reversed trials and the ICL test, whereas IWL test accuracy was unchanged. The LLM showed the same pattern (Fig. 4C): erasing the rank direction reduced IWL accuracy without impairing accuracy after reasoning, and ablating 32 context-reading heads reduced accuracy after reasoning while having little effect on IWL accuracy. These results resemble ones from patients with damage to prefrontal cortex, who could not complete inferences on premises given in scrambled order (Fig. 4D; Waltz et al., 1999). Additional analyses are reported in
A

B
Transformers (scratch)
C
LLM (Qwen3-32B)
D
E
Transformers (scratch)
Figure 4: Mechanisms underlying the geometric and algebraic strategies. (A) Interventions. The geometric strategy was targeted by erasing the rank direction in the model's representations; the algebraic strategy was targeted by ablating context-reading heads. (B) In our transformers, erasing the rank direction impaired direct IWL responses and removed the bias on reversed trials, but left accuracy after reasoning intact. Ablating two context-reading heads impaired accuracy after reasoning but not direct responses. (C) The same interventions in an LLM (Qwen3-32B, US state population; 32 context-reading heads). Open bars show controls; accuracy is pooled over distances 2–6. (D) Patients with prefrontal damage could not order names from scrambled premises (Waltz et al., 1999). Humans given midazolam were more accurate on novel pairs (Frank et al., 2006). (E) Transformers that reasoned during finetuning, with two context-reading heads per network intact or ablated during finetuning and at test. Error bars: SE; dashed lines indicate chance.
Figs. S6 and S44. Together, these results suggest that the mechanisms underlying the two strategies are largely independent: while the geometric strategy relies on rank information encoded in representational geometry, the algebraic strategy relies on attention heads that read contextual information during reasoning and focus network activity on that information to overcome the prior.
Even though the mechanisms underlying the two strategies appear largely independent, they may still compete during learning. Frank et al. (2006) found that when humans took midazolam, a drug that transiently impairs explicit memory while leaving implicit memory intact, before learning a TI task, their performance on novel pairs on a subsequent test improved (p = .03, n = 11 per drug; Fig. 4D). This suggests that in humans, reliance on reasoning over explicit memories during learning may reduce implicit learning that would otherwise occur. To test the analogous hypothesis in our networks, we ablated context-reading heads while the networks reasoned during finetuning on a fixed ordering (simulating midazolam's inhibition of the explicit strategy during learning). Similar to midazolam's effect in humans, this ablation increased performance on the subsequent IWL test on non-adjacent pairs, while degrading performance on the ICL test (Fig. 4E). This suggests that although their mechanisms may be largely independent, the two strategies compete during learning to reduce errors (Russin, Pavlick, & Frank, 2025).
3.4 Benefits and costs of each strategy depend on data distribution

Figure 5: Data-distribution effects. (A) Schematic of the training frequency of orderings under Zipf distributions with different skew ( ). (B) Learners should shift from geometric to algebraic as the data distribution becomes more diverse (smaller ). (C) Final test accuracy versus skew. As data diversity decreases (i.e., increases), final ICL test accuracy decreases, and final IWL test accuracy increases. (D) Predicted accuracy on novel versus familiar items as skew ( ) varies. (E) ICL versus IWL test accuracy per seed. As skew ( ) increases, ICL accuracy decreases and IWL accuracy increases, with a large range where models perform well on both tests.
In the simulations above, we showed that a single network can acquire both strategies through pretraining. Prior work has shown that the diversity of the training distribution determines whether transformers and humans acquire an IWL or ICL strategy (B. Chan et al., 2025; S. C. Y. Chan, Santoro, et al., 2022; Ku et al., 2026; Pesnot Lerousseau & Summerfield, 2026; Raventós et al., 2023; Reddy, 2024). Here we show that these results extend to the benefits arising from step-by-step reasoning (CoT), and, moreover, that this is predicted by a simple model of each strategy's learning and inference costs (Fig. 5B,D and Appendix A). Pre-compiling an ordering is worthwhile only if it will be experienced consistently (e.g., the sizes of common objects), so a learner should prefer the geometric strategy when training is concentrated on a few such orderings (i.e., when training data is highly skewed). The algebraic strategy, on the other hand, is costly at inference but applies to any ordering (e.g., arbitrary newly learned heights), so should be preferred when many conflicting orderings are seen during training (e.g., when learning algebra in math class it is not a good idea to try to memorize what "x" is, as it can change on every new problem).
Because it would be difficult to perform experiments manipulating the pretraining distribution of LLMs, or the developmental environments of humans, we tested these predictions only in transformers trained from scratch. Networks were pretrained on 100 orderings of the same items, each indicated by a distinct cue, where their frequencies followed a Zipf distribution with skew ranging from uniform ( ) to highly skewed ( ; Fig. 5A). After pretraining, we applied the same IWL and ICL tests (Fig. 2B,C).
More diverse training distributions drove networks to become less accurate on the IWL test but more accurate on the ICL test (Figs. 5C,E and S9). Across a broad intermediate range ( ), however, the same networks performed well on both tests, memorizing frequent orderings while also generalizing in context to novel ones (Fig. 5E). To isolate the effect of conflict, we finetuned networks on 1 to 10 orderings comprising either conflicting orderings of the same items or separate orderings of disjoint items. IWL test accuracy was more sensitive to conflict than to the total number of orderings alone: accuracy declined more steeply across conflicting orderings than across disjoint orderings (Fig. S10B).
Together, these results support the predicted cost tradeoff: networks acquired the geometric strategy when a few orderings were frequent, the algebraic when orderings were diverse, and acquired both across an intermediate regime. Thus, repeated exposure incentivizes use of pre-compiled representational geometry, while varied experience encourages development of a more flexible algebraic strategy.
4 Discussion
We have shown that both humans and neural networks, including LLMs, are capable of two fundamentally different forms of inference. Geometric inference works via incremental weight changes that build internal representations whose geometry reflects a domain's relational structure, allowing generalization to unseen relations through direct representational comparison. Algebraic inference uses selective-attention mechanisms acquired through diverse experience to derive new relations step by step from information available in context, akin to working-memory-based inferences thought to unfold via activation dynamics in prefrontal cortex (Kriete et al., 2013; O'Reilly & Frank, 2006; Rougier et al., 2005; Waltz et al., 1999). These two forms of generalization complement each other: the geometric strategy crystallizes knowledge and makes subsequent inference cheap, while the algebraic strategy enables fluid adaptation even when no previous knowledge is available, at the cost of additional computation. Our framework demonstrates how these two strategies can coexist and interact within a single system, providing a unified account of three disparate sets of phenomena: symbolic distance effects, content effects, and data-distribution effects.
The distinct representational and computational requirements of the two strategies explain the symbolic distance effect that has been observed across species (D'Amato & Colombo, 1990; Jensen et al., 2017; Vasconcelos, 2008), but also predict that this effect can be reversed when making de novo inferences about novel premises (Barrouillet, 1996; Sedek & von Hecker, 2004; von Hecker et al., 2023). Our results from both humans and LLMs provide direct evidence of this reversal (Fig. 2), thus demonstrating the circumstances under which TI resembles classical logical deduction (Inhelder & Piaget, 1958; Wright, 2012). When relying on prior knowledge in the IWL test, humans and neural networks exhibited the classic SDE. Mechanistic interventions revealed in the neural networks that this prior knowledge was encoded in representational geometry such that larger distances were easier to discriminate. But when forced to solve de novo TI problems on the ICL test, both humans and networks exhibited the reverse SDE, even though in principle it was possible to use the geometric strategy (by pre-compiling ranks in context before answering the query, which would produce a classic SDE). This finding was predicted by our framework (Appendix A), but may seem especially surprising for the LLMs, which are forced to process every relation given in context in their initial forward pass (before CoT), and have been shown to learn sophisticated representations in context (C. F. Park et al., 2025). We speculate that LLMs nevertheless show a reverse SDE because their fixed depth limits the serial computation possible in a single forward pass (Li et al., 2024; Merrill & Sabharwal, 2024), or because a single-pass ICL strategy that accommodates larger symbolic distances is difficult to (meta)learn (Abbe et al., 2024; Wen et al., 2025; Wies et al., 2023), as we observed in networks trained from scratch (Fig. S11). Interventions showed that step-by-step reasoning on these problems required selective-attention mechanisms to guide activation dynamics toward contextual information. Thus, despite their different architectures and learning histories, both humans and neural networks appear to converge on the same two strategies (Lan et al., 2025; McGrath & Russin, 2024; Russin, Pavlick, & Frank, 2025; Sripada & Lewis, 2026; Webb et al., 2023): learned representational geometry supports inference about familiar relations, while step-by-step reasoning enables inference about novel ones.
These findings bear on a longstanding debate about whether TI in humans and other animals involves explicit logical deduction or more primitive incremental learning (Acuna et al., 2002; Bryant & Trabasso, 1971; De Soto et al., 1965; Jensen et al., 2019; Lazareva et al., 2020; Trabasso, 1977; Vasconcelos, 2008; von Fersen et al., 1991). In our framework, the reverse SDE arises from the algebraic strategy, and the classic SDE from the geometric strategy. To our knowledge, no nonhuman animal has shown a reverse SDE, so future work could test whether the algebraic strategy is unique to humans (Dehaene et al., 2022), or is shared with other species such as nonhuman primates (Canton & Piantadosi, 2024). The geometric strategy, by contrast, can be realized either by a simple associative mechanism (Ciranka et al., 2022; Wynne, 1995) or by richer relational coding (Behrens et al., 2018; Kay et al., 2024; Nelli et al., 2023). Which of these supports TI in nonhuman animals has been debated (Dusek & Eichenbaum, 1997; Gazes et al., 2012; Lazareva et al., 2020; von Fersen et al., 1991; Wynne, 1995). In our networks the geometric strategy is likely closer to relational coding (Noroozizadeh et al., 2026), but a conclusive test may require
TI paradigms with two or more dimensions (S. A. Park et al., 2020, 2026).
Our findings also demonstrate how the two strategies can interact with one another in a system capable of both, cooperating when information in context is congruent with prior knowledge, and competing when it is incongruent. This framework is consistent with a dual-process account of TI (Frank et al., 2006, 2005; Wendelken & Bunge, 2010; Wright, 2001), which posits two separate routes for making transitive inferences—for example, an “analytic” route that relies heavily on working memory and prefrontal cortex and is especially engaged in novel situations, and an “intuitive” route that relies heavily on long-term memory and hippocampus and is especially engaged when information has been memorized (Wright, 2012). Our framework extends this dual-process proposal by specifying an algorithmic account of how both processes can be implemented in a single neural network (Fig. 4), with the intuitive route accomplished by representational geometry learned via IWL, and the analytic route accomplished by a step-by-step reasoning (CoT) procedure operating over information available in context.
Our framework also makes specific predictions about what should happen when the two strategies come into conflict, thereby explaining the content effects observed in both human and LLM reasoning (Evans et al., 1983; Evans & Curtis-Holmes, 2005; J. Hu et al., 2025; X. Hu et al., 2026; Kim et al., 2025; Lampinen et al., 2024; Lupyan, 2013; Studdiford & Lupyan, 2026). In TI, our transformers, human participants, and the LLMs all exhibited content effects, performing better on congruent trials where context agreed with prior knowledge than on incongruent trials where these came into conflict (Fig. 3). Because the two strategies rely on relatively independent mechanisms, we predicted that step-by-step reasoning should overcome the prior encoded in representational geometry, with larger symbolic distances requiring more steps. This prediction was confirmed behaviorally in all three systems (Fig. 3), and mechanistically in the neural networks (Fig. 4). These results relate to prior work identifying separate mechanisms for memorized versus in-context answers in LLMs (Jin et al., 2024; Kahardipraja et al., 2025; Ortu et al., 2024; Wu et al., 2025; Yu et al., 2023), and to neural network models of cognitive control (Cohen et al., 1990; Collins & Frank, 2013; O'Reilly & Frank, 2006; O'Reilly et al., 2020). Our framework also explains why imposing a time limit on participants increases belief bias in syllogistic reasoning (Evans & Curtis-Holmes, 2005). However, belief bias has been observed even when participants take their time and reason aloud from the premises (Evans et al., 1983), suggesting that content can also interfere with the reasoning process itself. This may occur because the reasoning process has been metalearned, and is therefore sensitive to whether problems are far outside its training distribution (Fig. S5). If true, then experience with such conflicts should improve performance, as has indeed been observed in humans (Ball, 2013). Overall, our framework offers a mechanistic account of why content effects arise, and why reasoning can sometimes overcome them.
Because the geometric strategy is implemented via IWL and the algebraic strategy proceeds via a form of ICL (CoT), our framework also connects to and extends existing work from machine learning to predict the conditions under which each strategy can be acquired. In particular, transformers have been shown to develop ICL abilities when their training data is diverse, but to rely on IWL otherwise (B. Chan et al., 2025; S. C. Y. Chan, Santoro, et al., 2022; Raventós et al., 2023; Reddy, 2024; A. K. Singh et al., 2023; Wurgaft et al., 2025). This pattern has also been observed in humans (Pesnot Lerousseau & Summerfield, 2026; Raviv et al., 2022). We observed the same dependence on training diversity (Fig. 5), extending prior work to a setting where the ICL strategy required CoT reasoning steps rather than being accomplished in a single forward pass. Furthermore, our framework grounds this dependence in the same learning and inference costs that predict the symbolic distance effects (Fig. 1), bridging research from machine learning and cognitive science. Because ICL is itself (meta)learned, our framework is also consistent with the proposal that sophisticated human reasoning abilities are metalearned over the course of development rather than innately specified (Binz et al., 2024; Botvinick et al., 2019; Lake & Baroni, 2023; Wang et al., 2018), a hypothesis that, while difficult to test in practice, may make specific empirical predictions (Russin et al., 2024; Russin, McGrath, & Williams, 2025). Our framework thus not only characterizes how each strategy operates, but also explains why certain kinds of experiences give rise to each.
We assume that a learner capable of both strategies will select between the two according to their relative learning and inference costs (Fig. 5B,D, Appendix A). Similar tradeoffs have been proposed in many areas of cognitive science, including in the context of model-based versus model-free reinforcement learning (Daw et al., 2005; Kool et al., 2017), the automatization of skills (Logan, 1988), amortized inference (Dasgupta & Gershman, 2021; Gershman & Goodman, 2014), and resource-rational analysis (Lieder & Griffiths, 2020). In particular, the successor representation, which caches multi-step relations among states so that they do not need to be computed at inference time, is closely related to the geometric strategy we discuss here, and has similar tradeoffs (Brunec & Momennejad, 2022; Dayan, 1993; Lehnert et al., 2020; Momennejad, 2020; Momennejad et al., 2017; Russek et al., 2017; Son et al., 2023, 2026; Stachenfeld et al., 2017). Because our transformers were never explicitly trained to trade off the cost of reasoning against accuracy, we did not probe their ability to make this tradeoff for themselves, and instead simply characterized the relationship between accuracy and reasoning budget (Fig. 2H,I). However, humans and LLMs explicitly trained to reason are capable of making such tradeoffs, and appear to do so in similar ways (de Varda et al., 2025; R. Liu et al., 2025). An important direction for future work is to determine the extent to which shared costs shape these tradeoffs in both humans and LLMs.
Theories of human cognitive flexibility and generalization have historically divided into those emphasizing structured distributed representations (Behrens et al., 2018; McClelland et al., 2010; O'Reilly et al., 2022; Rogers & McClelland, 2004; Sloman, 1993) and those emphasizing explicit reasoning with abstract or symbolic rules (Anderson et al., 2004; Braine, 1978; Dehaene et al., 2022; Feiman et al., 2022; Fodor & Pylyshyn, 1988; Laird et al., 1987; Mandelbaum et al., 2022; Marcus, 2001; Newell & Simon, 1972, 1976; Quilty-Dunn et al., 2023; Sackur & Dehaene, 2009). Our framework is consistent with the idea that these two views need not be seen as alternatives (Griffiths et al., 2026; McGrath et al., 2023, 2024; Russin, O'Reilly, & Bengio, 2020; Sloman, 1996; Smolensky, 1988; Smolensky et al., 2022), and can instead be understood as characterizing two generalization strategies with different advantages. Furthermore, our results are consistent with recent evidence that symbolic or rule-like mechanisms can emerge in both artificial and biologically inspired neural networks, even when these networks are not explicitly trained to develop them (Collins & Frank, 2013; Kriete et al., 2013; Rougier et al., 2005; Russin, Jo, et al., 2020; Russin, McGrath, & Williams, 2025; Todd et al., 2026; Webb et al., 2024, 2021; Y. Yang et al., 2025).
5 Methods
5.1 Transformers trained from scratch
Task and training data. Each sequence contained a cue token that indexed the ordering, a query, a shuffled and randomly oriented set of adjacent relations specifying that ordering, and an answer. Sequences contained nine ordered items, but the two endpoints were never queried, yielding seven queryable ranks and symbolic distances . On CoT trials, the model was trained to produce the output from a predefined reasoning algorithm before answering. On non-CoT (direct) trials, it was trained to give the answer immediately.
Architecture and optimization. We trained decoder-only causal transformers from scratch (Vaswani et al., 2017). Each transformer had four layers, eight attention heads, a residual width of 256, a feedforward width of 1,024, rotary position embeddings (Su et al., 2024), pre-layer normalization (Xiong et al., 2020), tied input and output embeddings (Press & Wolf, 2017), and no dropout. Models were trained with Adam (Kingma & Ba, 2015) for 100,000 pretraining steps (batch size 64, learning rate 0.001, no weight decay) and evaluated using greedy decoding with zero to eight generated reasoning steps. Every experiment ran 10 independently initialized networks.
Symbolic distance effects experiments. During pretraining, each of 100 training cue tokens deterministically selected an ordering over items sampled from a pool of 300, while 16 further reserved cues were never trained; every pretraining trial carried a teacher-forced reasoning chain, and symbolic distances were sampled uniformly from one to six. We then finetuned each network for 1,600 gradient steps at a learning rate of 0.0001 on adjacent queries from one fixed seven-item ordering, supervising on answers only. To avoid catastrophic forgetting (McKloskey & Cohen, 1989), 10% of finetuning trials were replaced by fresh pretraining trials (Fig. S4), and 1 in 10 of the remaining trials showed an uninformative context of other items in place of the fixed ordering, matching the masked-context share of the human learning phase. The IWL test queried items from the finetuned ordering under an uninformative context; the ICL test queried novel items, outside the finetuned ordering and its distractors, whose ordering was shown in context under a reserved cue. In every test condition, a response was scored as correct when it agreed with the condition's reference ordering: the finetuned ordering when the context was uninformative, and the ordering shown in context otherwise. Each test condition comprised all 42 ordered pairs of the seven queryable ranks, each presented with 10 independently sampled contexts. ICL accuracy was averaged over one to five generated reasoning steps while IWL accuracy was measured with no intermediate steps (Fig. 2G). To measure the number of reasoning steps required at each symbolic distance, we took the smallest number of steps reaching 90% of each seed's maximum accuracy over the zero-to-eight-step sweep. Accuracy as a function of reasoning steps (Figs. 2I and 3G) shows, at each budget, the best accuracy reached at that budget or below within each seed, averaged over seeds.
Content effects experiments. Ten models were pretrained for 100,000 gradient steps, without finetuning, on 100 cue-defined orderings in which a frequent cue selected the same ordering on 20% of trials, and reasoning chains were included on 90% of trials. Additional frequent-cue and chain-of-thought proportions are reported in Fig. S5.
Mechanistic interventions. In the content-effects networks, a rank direction was fit at the embedding and after each block using least-squares concept erasure (LEACE) (Belrose et al., 2023). Each item token's coordinate along this rank direction was erased at every layer, in the prompt and throughout the network's reasoning and answer. The control manipulation erased a random direction. Each network's top two context-reading heads, the heads with the most attention from each reasoning step to the context relations containing that step's items, were ablated by replacing their outputs with their mean outputs at the same positions. The control manipulation ablated two random heads from outside the top four (mean over 20 draws). To test whether the two strategies compete during learning, the ten pretrained networks of the symbolic distance experiment were finetuned with a learning rate of 0.001 and an uninformative context on 1% of trials, performing eight reasoning steps before answering. Their top two context-reading heads were ablated throughout finetuning and testing. After 1,600 steps, IWL accuracy (best over reasoning budgets) was measured on trained pairs, on non-adjacent pairs containing the first or last item (end item; only AE in the human study, which only had five items), and on non-adjacent pairs among the middle five items (interior; only BD in the human study). Details are given in Appendix B.1.
Data-distribution effects experiments. Following S. C. Y. Chan, Santoro, et al. (2022) and Pesnot Lerousseau and Summerfield (2026), we manipulated the diversity of the training data by sampling the th of 100 cue-defined orderings with probability at 14 values of from 0 to 10. We trained 10 models per condition for 100,000 gradient steps with reasoning chains on 90% of trials. We measured IWL by direct answers on trained orderings under an uninformative context and ICL by taking the best accuracy over reasoning-step budgets on a novel ordering shown in context. We also varied the number of equally frequent cue-defined orderings (1, 2, 5, 10, 100, or 1,000), with reasoning chains on every pretraining trial (Fig. S10A). To distinguish the effects of conflict among different orderings from the raw number of orderings, we finetuned pretrained models for 1,600 gradient steps on either 1 to 10 conflicting orderings of the same items or 1 to 10 orderings of disjoint item sets. These conditions are compared in Fig. S10B.
5.2 Human experiments
5.2.1 Experiment 1
Participants. We recruited 65 adults through Prolific (Palan & Schitter, 2018). Eligibility was restricted to healthy adults aged 18–65 with no history of brain injury. Participants were paid 2.67. Of the 65 participants, 13 did not finish, 11 were removed after exhausting the comprehension-check attempts built into the experiment, and 1 was excluded because accuracy during the second half of training was below 60%, leaving 40 participants for analysis. The 40 analyzed participants were aged 21 to 64 years (26 female, 14 male). All participants provided informed consent under a protocol approved by the Brown University Institutional Review Board.
Procedure. Participants completed an online “alien preference” task implemented in jsPsych 8.2.3 (de Leeuw et al., 2023). Stimuli were 80 unique clip-art images drawn from the PicturePerfectSet (Saryazdi et al., 2018) and randomly assigned to experimental roles for each participant. Participants selected which of two queried objects the aliens preferred by pressing F or J. Pairwise clues were displayed as a horizontal row: the preferred object appeared above the other object, and an arrow pointed toward it (see Fig. 2A). Staged instructions and practice covered direct, single-step, and multi-step queries; each comprehension check required 100% accuracy within two attempts.
Participants then completed 100 training trials on one fixed ordering of seven images. Every training query compared adjacent items (). Two rank-consistent distractors were inserted into the ordering on each trial, and the displayed window always contained a chain connecting the queried items. Corrective feedback remained for at least 0.5 s after correct responses and 5 s after errors. On a random 10% of training trials, the clue row was masked as in the IWL test, while the query and corrective feedback were unchanged. Participants next completed three 40-trial test blocks spanning distances . The ICL test used five disjoint orderings of novel images and showed the full ordering needed to answer each query. The IWL test queried trained images while replacing every image in the clue display with a featureless gray box, preserving its structure but removing item identity and useful order information. Following Pesnot Lerousseau and Summerfield (2026), we also included an arbitrage test querying trained images under a reversed display (see Fig. S17). The same approximately distance-balanced set of 40 rank pairs was used in all three blocks within each participant. ICL and IWL block order was counterbalanced, and arbitrage was always last. Test trials provided neutral choice confirmation but no accuracy feedback.
Statistical analysis. Accuracy was analyzed at the trial level using binomial generalized linear mixed-effects models with a logit link (Bates et al., 2015). We fit separate ICL and IWL models with linear symbolic distance as a fixed effect and participant-specific random intercepts and distance slopes, and a combined model with fixed effects of distance, test, and their interaction, plus the corresponding participant-specific random effects. Response-time analyses included correct, non-timeout ICL and IWL trials; response times were natural-log transformed, and trials more than three standard deviations from a participant's mean log response time within a test were removed (4 of 2,478 ICL/IWL trials; 0.16%). Log response times were analyzed using linear mixed-effects models (Kuznetsova et al., 2017).
5.2.2 Experiment 2
Participants. We recruited 132 adults through Prolific (Palan & Schitter, 2018) under the same eligibility criteria and consent protocol as Experiment 1, and assigned each to the congruent or shuffled condition. After excluding participants who did not finish (14), answered at chance (18), or answered too fast (1), 49 congruent and 50 shuffled participants remained (Appendix B.2.2). The 99 analyzed participants were aged 21 to 64 years (50 female, 48 male, 1 not available).
Procedure. Each of 48 questions showed eight statements ordering nine animals by weight, in a scrambled order, and asked which of two animals was heavier according to the statements. The ends of the ordering were never queried, giving symbolic distances 1–6. In the shuffled condition, each question used its own reordering of the animals, balanced so that the queried relation agreed with the real-world order on exactly half of the questions at every distance.
Statistical analysis. Accuracy and log response times of correct answers were analyzed with mixed-effects models with fixed effects of condition, log symbolic distance, their interaction, and trial number, and participant-specific random intercepts and distance slopes.
5.3 Large language models
Models. We tested 22 open-weight LLMs (1B–70B parameters; Appendix B.3): 10 reasoning models trained to generate a chain of thought before answering (Qwen3 (A. Yang et al., 2025), DeepSeek-R1-Distill (Guo et al., 2025), Phi-4-reasoning (Abdin et al., 2025), gpt-oss (OpenAI et al., 2025)) and 12 instruction-tuned models that reasoned only when prompted (Qwen2.5 (Qwen et al., 2024), Llama 3 (Grattafori et al., 2024), Gemma 2 (Gemma Team et al., 2024), GLM-4 (Team GLM et al., 2024), Mistral (Jiang et al., 2023), OLMo 2 (Team OLMo et al., 2025)).
Task. Each problem was an ordering of 11 items presented only through its 10 adjacent relations, and a query asked whether one item ranked above another. Analyses used the innermost seven queryable ranks, giving symbolic distances . The IWL test queried familiar items from five real-world dimensions (country population, US state population, city population, animal body mass, and country surface area), with no relations shown, so that only prior knowledge could be used to answer (item selection in Appendix B.3). The ICL test queried 11 common names arbitrarily ordered by height, with all 10 relations shown. Each ICL problem was repeated with 10 random premise orders, and the IWL test was replicated on additional item sets per dimension (Appendix B.3).
Prompts and scoring. Prompts used each model's chat template, with a short system instruction defining the relation (e.g., > means "has a larger population"), the relations one per line as A > B, and the query "Is it true or false that A > B?" (full example in Appendix B.3). Direct answers were read from a single forward pass at the answer position: the total probabilities of True/true were compared with those of False/false, the larger giving the prediction.
Chain of thought. The model generated its chain with greedy decoding up to a budget of new tokens (; is the direct condition). After the budget was reached, the cue "Therefore the answer is:" was appended and the answer was scored. Reasoning models used their native thinking block with no additional prompt to reason. Instruction-tuned models were explicitly prompted to reason by appending "Let's think step by step." to the query (Kojima et al., 2022). As in the transformer experiments, the reasoning budget required for each distance was defined to be the smallest budget whose accuracy reached 90% of the maximum over all budgets. When accuracy was plotted against reasoning budget (Figs. 2P and 3N), it was defined to be the best accuracy reached at or below each budget.
Content effects. For each dimension, the 10 relations shown were congruent, reversed, or shuffled with respect to the real-world ordering (Geerts et al., 2025; A. Liu et al., 2025), and answers were scored against the ordering shown. A fourth context condition showed 10 true relations among 11 other items of the same dimension that never mentioned the queried pair (uninformative context). The congruent, reversed, and shuffled conditions were also run with different reasoning budgets. To vary prior strength, direct answers were also collected on additional item sets per dimension with closer or wider value spacing (Fig. 3K;
Appendix B.3). To resolve ambiguity in the instructions, all context-condition instructions also included “Base your answer only on the comparisons given — not on outside knowledge.”
Mechanistic interventions. In Qwen3-32B, a rank direction was fit in the same way at every hidden state and erased at every mention of an item. The 32 of its 4,096 attention heads with the most attention from the composed inferences of its reasoning chains to the context relations mentioning their items were ablated (Appendix B.3).
Acknowledgments
We thank Roman Feiman, Jason Ritt, Jae-Young Son, Daniel Carstensen, and the members of the Language Understanding and Representation Lab, the Laboratory of Neural Computation and Cognition, and the Brown Language and Thought Lab for helpful discussions.
Funding: J.R. and J.K. were supported by the National Institute of Mental Health of the National Institutes of Health (NIH) under Award Numbers T32MH126388 and T32MH115895, respectively. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH. This work used computational resources supported by the NIH S10 instrumentation grant S10OD036341 (High-Performance Compute Cluster for Brain Science) via the Center for Computation and Visualization at Brown University. M.J.F. was supported by an Office of Naval Research MURI Award N00014-23-1-2792. E.P. was supported in part by Schmidt Sciences Grant #GR5300958, and the NSF AI Research Institute on Interaction for AI Assistants Grant #GR5300593. The content of this article does not necessarily reflect the views of the US Government, and no official endorsement should be inferred.
Competing interests: E.P. is a paid consultant for Google DeepMind. The content of this article does not necessarily reflect the views of Google, and no official endorsement should be inferred. The other authors declare no competing interests.
Data and materials availability: All code is publicly available at the following repositories:
• Transformer experiments: https://github.com/jlrussin/geometric-algebraic-ti-transformers
• Human experiments: https://github.com/jlrussin/geometric-algebraic-ti-humans
• LLM experiments: https://github.com/joonhwakim/geometric-algebraic-ti-llms
The human data cannot be shared publicly under the terms of participants' consent.
Use of AI tools: Under the authors' direction, AI tools (Anthropic Claude Opus and Fable 4.7–5.5 and OpenAI GPT 5.5–6.1) were used to help write code for experiments, analysis, and visualization. AI tools were also used for assisting with literature search, editing text for grammar, spelling, and clarity, and for generating initial drafts of specific methods paragraphs. The authors reviewed and verified all AI-assisted content and take full responsibility for all aspects of the work.
References
Abbe, E., Bengio, S., Lotfi, A., Sandon, C., & Saremi, O. (2024). How far can transformers reason? The globality barrier and inductive scratchpad. In Advances in Neural Information Processing Systems (Vol. 37, pp. 27850–27895). doi: 10.52202/079017-0874
Abdin, M., Agarwal, S., Awadallah, A., Balachandran, V., Behl, H., Chen, L., ... Zheng, G. (2025). Phi-4-reasoning technical report. arXiv preprint arXiv:2504.21318.
Acuna, B. D., Sanes, J. N., & Donoghue, J. P. (2002). Cognitive mechanisms of transitive inference. Experimental Brain Research, 146(1), 1–10. doi: 10.1007/s00221-002-1092-y
Alain, G., & Bengio, Y. (2016). Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644.
Anand, S., Lepori, M. A., Merullo, J., & Pavlick, E. (2025). Dual process learning: Controlling use of in-context vs. in-weights strategies with weight forgetting. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=jDsmB4o5S0
Anderson, J. R., Bothell, D., Byrne, M. D., Douglass, S., Lebiere, C., & Qin, Y. (2004). An integrated theory of the mind. Psychological Review, 111(4), 1036–1060. doi: 10.1037/0033-295X.111.4.1036
Andrews, G. (2010). Belief-based and analytic processing in transitive inference depends on premise integration difficulty. Memory & Cognition, 38(7), 928–940. doi: 10.3758/MC.38.7.928
Ball, L. J. (2013). Microgenetic evidence for the beneficial effects of feedback and practice on belief bias. Journal of Cognitive Psychology, 25(2), 183–191. doi: 10.1080/20445911.2013.765856
Banks, W. P. (1977). Encoding and processing of symbolic information in comparative judgments. In G. H. Bower (Ed.), The psychology of learning and motivation (Vol. 11, pp. 101–159). New York, NY: Academic Press. doi: 10.1016/S0079-7421(08)60476-4
Barrouillet, P. (1996). Transitive inferences from set-inclusion relations and working memory. Journal of Experimental Psychology: Learning, Memory, and Cognition, 22(6), 1408–1422. doi: 10.1037/0278-7393.22.6.1408
Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1), 1–48. doi: 10.18637/jss.v067.i01
Behrens, T. E. J., Muller, T. H., Whittington, J. C. R., Mark, S., Baram, A. B., Stachenfeld, K. L., & Kurth-Nelson, Z. (2018). What is a cognitive map? Organizing knowledge for flexible behavior. Neuron, 100(2), 490–509. doi: 10.1016/j.neuron.2018.10.002
Belrose, N., Schneider-Joseph, D., Ravfogel, S., Cotterell, R., Raff, E., & Biderman, S. (2023). LEACE: Perfect linear concept erasure in closed form. In Advances in Neural Information Processing Systems (Vol. 36, pp. 66044–66063). doi: 10.52202/075280-2884
Bengio, Y., Courville, A., & Vincent, P. (2013). Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8), 1798–1828. doi: 10.1109/TPAMI.2013.50
Bernardi, S., Benna, M. K., Rigotti, M., Munuera, J., Fusi, S., & Salzman, C. D. (2020). The geometry of abstraction in the hippocampus and prefrontal cortex. Cell, 183(4), 954-967.e21. doi: 10.1016/j.cell.2020.09.031
Bertolazzi, L., Pezzelle, S., & Bernardi, R. (2026). How language models conflate logical validity with plausibility: A representational analysis of content effects. In Findings of the Association for Computational Linguistics: ACL 2026 (pp. 9316–9347). Association for Computational Linguistics. doi: 10.18653/v1/2026.findings-acl.454
Binz, M., Dasgupta, I., Jagadish, A. K., Botvinick, M. M., Wang, J. X., & Schulz, E. (2024). Meta-learned models of cognition. Behavioral and Brain Sciences, 47, e147. doi: 10.1017/S0140525X23003266
Boleda, G. (2020). Distributional semantics and linguistic theory. Annual Review of Linguistics, 6(1), 213–234. doi: 10.1146/annurev-linguistics-011619-030303
Botvinick, M. M., Ritter, S., Wang, J. X., Kurth-Nelson, Z., Blundell, C., & Hassabis, D. (2019). Reinforcement learning, fast and slow. Trends in Cognitive Sciences, 23(5), 408–422. doi: 10.1016/j.tics.2019.02.006
Braine, M. D. (1978). On the relation between the natural logic of reasoning and standard logic. Psychological Review, 85(1), 1–21. doi: 10.1037/0033-295X.85.1.1
Brinkmann, J., Sheshadri, A., Levoso, V., Swoboda, P., & Bartelt, C. (2024). A mechanistic analysis of a transformer trained on a symbolic multi-step reasoning task. In Findings of the Association for Computational Linguistics: ACL 2024 (pp. 4082–4102). Association for Computational Linguistics. doi: 10.18653/v1/2024.findings-acl.242
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., ... Amodei, D. (2020). Language models are few-shot learners. In Advances in Neural Information Processing Systems (Vol. 33, pp. 1877–1901). Retrieved from https://papers.nips.cc/paper/2020/hash/1457c0d6bfcb4967418fbf8ac142f64a-Abstract.html
Brunec, I. K., & Momennejad, I. (2022). Predictive representations in hippocampal and prefrontal hierarchies. The Journal of Neuroscience, 42(2), 299–312. doi: 10.1523/JNEUROSCI.1327-21.2021
Bryant, P. E., & Trabasso, T. (1971). Transitive inferences and memory in young children. Nature, 232(5311), 456–458. doi: 10.1038/232456a0
Byrne, R. M. (1989). Suppressing valid inferences with conditionals. Cognition, 31(1), 61–83. doi: 10.1016/0010-0277(89)90018-8
Canton, J. F., & Piantadosi, S. T. (2024). Uniquely human intelligence arose from expanded information capacity. Nature Reviews Psychology, 3(4), 275–293. doi: 10.1038/s44159-024-00283-3
Chan, B., Chen, X., György, A., & Schuurmans, D. (2025). Toward understanding in-context vs. in-weight learning. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=aKJr5NnN8U
Chan, S. C. Y., Dasgupta, I., Kim, J., Kumaran, D., Lampinen, A. K., & Hill, F. (2022). Transformers generalize differently from information stored in context vs in weights. arXiv preprint arXiv:2210.05675.
Chan, S. C. Y., Santoro, A., Lampinen, A. K., Wang, J. X., Singh, A. K., Richemond, P. H., ... Hill, F. (2022). Data distributional properties drive emergent in-context learning in transformers. In Advances in Neural Information Processing Systems (Vol. 35, pp. 18878–18891). Retrieved from https://proceedings.neurips.cc/paper_files/paper/2022/hash/77c6ccaafd9962e2307fc64680fc5ace-Abstract-Conference.html
Chen, X., Chi, R. A., Wang, X., & Zhou, D. (2024). Premise order matters in reasoning with large language models. In Proceedings of the 41st International Conference on Machine Learning (Vol. 235, pp. 6596–6620). Retrieved from https://proceedings.mlr.press/v235/chen24i.html
Cheng, P. W., & Holyoak, K. J. (1985). Pragmatic reasoning schemas. Cognitive Psychology, 17(4), 391–416. doi: 10.1016/0010-0285(85)90014-3
Chomsky, N. (1957). Syntactic structures. The Hague: Mouton & Co.
Chung, S., & Abbott, L. F. (2021). Neural population geometry: An approach for understanding biological and artificial neural networks. Current Opinion in Neurobiology, 70, 137–144. doi: 10.1016/j.conb.2021.10.010
Ciranka, S., Linde-Domingo, J., Padezhki, I., Wicharz, C., Wu, C. M., & Spitzer, B. (2022). Asymmetric reinforcement learning facilitates human inference of transitive relations. Nature Human Behaviour, 6(4), 555–564. doi: 10.1038/s41562-021-01263-w
Cohen, J. D., Dunbar, K., & McClelland, J. L. (1990). On the control of automatic processes: A parallel distributed processing account of the Stroop effect. Psychological Review, 97(3), 332–361. doi: 10.1037/0033-295x.97.3.332
Collins, A. G. E., & Frank, M. J. (2012). How much of reinforcement learning is working memory, not reinforcement learning? A behavioral, computational, and neurogenetic analysis. European Journal of Neuroscience, 35(7), 1024–1035. doi: 10.1111/j.1460-9568.2011.07980.x
Collins, A. G. E., & Frank, M. J. (2013). Cognitive control over learning: Creating, clustering, and generalizing task-set structure. Psychological Review, 120(1), 190–229. doi: 10.1037/a0030852
Constantinescu, A. O., O'Reilly, J. X., & Behrens, T. E. J. (2016). Organizing conceptual knowledge in humans with a gridlike code. Science, 352(6292), 1464–1468. doi: 10.1126/science.aaf0941
D'Amato, M. R., & Colombo, M. (1990). The symbolic distance effect in monkeys (Cebus apella). Animal Learning & Behavior, 18(2), 133–140. doi: 10.3758/BF03205250
Dasgupta, I., & Gershman, S. J. (2021). Memory as a computational resource. Trends in Cognitive Sciences, 25(3), 240–251. doi: 10.1016/j.tics.2020.12.008
Davis, H. (1992). Transitive inference in rats (Rattus norvegicus). Journal of Comparative Psychology, 106(4), 342–349. doi: 10.1037/0735-7036.106.4.342
Daw, N. D., Niv, Y., & Dayan, P. (2005). Uncertainty-based competition between prefrontal and dorsolateral striatal systems for behavioral control. Nature Neuroscience, 8(12), 1704–1711. doi: 10.1038/nn1560
Dayan, P. (1993). Improving generalization for temporal difference learning: The successor representation. Neural Computation, 5(4), 613–624. doi: 10.1162/neco.1993.5.4.613
de Leeuw, J. R., Gilbert, R. A., & Luchterhandt, B. (2023). jsPsych: Enabling an open-source collaborative ecosystem of behavioral experiments. Journal of Open Source Software, 8(85), 5351. doi: 10.21105/joss.05351
de Varda, A. G., D'Elia, F. P., Kean, H., Lampinen, A. K., & Fedorenko, E. (2025). The cost of thinking is similar between large reasoning models and humans. Proceedings of the National Academy of Sciences, 122(47), e2520077122. doi: 10.1073/pnas.2520077122
Dehaene, S., Al Roumi, F., Lakretz, Y., Planton, S., & Sablé-Meyer, M. (2022). Symbols and mental programs: A hypothesis about human singularity. Trends in Cognitive Sciences, 26(9), 751–766. doi: 10.1016/j.tics.2022.06.010
De Soto, C. B., London, M., & Handel, S. (1965). Social reasoning and spatial paralogic. Journal of Personality and Social Psychology, 2(4), 513–521. doi: 10.1037/h0022492
Dusek, J. A., & Eichenbaum, H. (1997). The hippocampus and memory for orderly stimulus relations. Proceedings of the National Academy of Sciences, 94(13), 7109–7114. doi: 10.1073/pnas.94.13.7109
El-Shangiti, A. O., Hiraoka, T., AlQuabeh, H., Heinzerling, B., & Inui, K. (2025). The geometry of numerical reasoning: Language models compare numeric properties in linear subspaces. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 2: Short Papers) (pp. 550–561). Association for Computational Linguistics. doi: 10.18653/v1/2025.naacl-short.47
Evans, J. S. B. T., Barston, J. L., & Pollard, P. (1983). On the conflict between logic and belief in syllogistic reasoning. Memory & Cognition, 11(3), 295–306. doi: 10.3758/bf03196976
Evans, J. S. B. T., & Curtis-Holmes, J. (2005). Rapid responding increases belief bias: Evidence for the dual-process theory of reasoning. Thinking & Reasoning, 11(4), 382–389. doi: 10.1080/13546780542000005
Feiman, R., Mody, S., & Carey, S. (2022). The development of reasoning by exclusion in infancy. Cognitive Psychology, 135, 101473. doi: 10.1016/j.cogpsych.2022.101473
Fodor, J. A. (1975). The language of thought. New York: Thomas Y. Crowell.
Fodor, J. A., & Pylyshyn, Z. W. (1988). Connectionism and cognitive architecture: A critical analysis. Cognition, 28(1-2), 3–71. doi: 10.1016/0010-0277(88)90031-5
Frank, M. J., O'Reilly, R. C., & Curran, T. (2006). When memory fails, intuition reigns: Midazolam enhances implicit inference in humans. Psychological Science, 17(8), 700–707. doi: 10.1111/j.1467-9280.2006.01769.x
Frank, M. J., Rudy, J. W., Levy, W. B., & O'Reilly, R. C. (2005). When logic fails: Implicit transitive inference in humans. Memory & Cognition, 33(4), 742–750. doi: 10.3758/BF03195340
Frank, M. J., Rudy, J. W., & O'Reilly, R. C. (2003). Transitivity, flexibility, conjunctive representations, and the hippocampus. II. A computational analysis. Hippocampus, 13(3), 341–354. doi: 10.1002/hipo.10084
Garg, S., Tsipras, D., Liang, P., & Valiant, G. (2022). What can transformers learn in-context? A case study of simple function classes. In Advances in Neural Information Processing Systems (Vol. 35, pp. 30583–30598). Retrieved from https://proceedings.neurips.cc/paper_files/paper/2022/hash/c529dba08a146ea8d6cf715ae8930cbe-Abstract-Conference.html
Gazes, R. P., Chee, N. W., & Hampton, R. R. (2012). Cognitive mechanisms for transitive inference performance in rhesus monkeys: Measuring the influence of associative strength and inferred order. Journal of Experimental Psychology: Animal Behavior Processes, 38(4), 331–345. doi: 10.1037/a0030306
Geerts, J., Liu, A., Chan, S. C. Y., Clopath, C., & Stachenfeld, K. L. (2025). Relational reasoning and inductive bias in transformers and large language models. arXiv preprint arXiv:2506.04289.
Gemma Team, Riviere, M., Pathak, S., Sessa, P. G., Hardin, C., Bhupatiraju, S., ... Andreev, A. (2024). Gemma 2: Improving open language models at a practical size. arXiv preprint arXiv:2408.00118.
Gershman, S. J., & Goodman, N. D. (2014). Amortized inference in probabilistic reasoning. Proceedings of the Annual Meeting of the Cognitive Science Society, 36. Retrieved from https://escholarship.org/uc/item/34j1h7k5
Goodman, N. D., Tenenbaum, J. B., Feldman, J., & Griffiths, T. L. (2008). A rational analysis of rule-based concept learning. Cognitive Science, 32(1), 108–154. doi: 10.1080/03640210701802071
Grand, G., Blank, I. A., Pereira, F., & Fedorenko, E. (2022). Semantic projection recovers rich human knowledge of multiple object features from word embeddings. Nature Human Behaviour, 6(7), 975–987. doi: 10.1038/s41562-022-01316-8
Grattaflori, A., Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., ... Ma, Z. (2024). The Llama 3 herd of models. arXiv preprint arXiv:2407.21783.
Griffiths, T. L., Lake, B. M., McCoy, R. T., Pavlick, E., & Webb, T. W. (2026). Whither symbols in the era of advanced neural networks? Trends in Cognitive Sciences. doi: 10.1016/j.tics.2026.02.003
Guo, D., Yang, D., Zhang, H., Song, J., Wang, P., Zhu, Q., ... Zhang, Z. (2025). DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature, 645(8081), 633–638. doi: 10.1038/s41586-025-09422-z
Gurnee, W., & Tegmark, M. (2024). Language models represent space and time. In International Conference on Learning Representations. Retrieved from https://proceedings.iclr.cc/paper_files/paper/2024/hash/0a6059857ae5c82ea9726ee9282a7145-Abstract-Conference.html
Heinzerling, B., & Inui, K. (2024). Monotonic representation of numeric attributes in language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers) (pp. 175–195). Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-short.18
Hu, J., Lepori, M. A., & Franke, M. (2025). Signatures of human-like processing in transformer forward passes. arXiv preprint arXiv:2504.14107.
Hu, X., Angstadt, M., Storks, S., Huang, Z., Taxali, A., Weigard, A., ... Sripada, C. (2026). Conflict and congruency effects in large language models: In-weight and in-context competition in a verbal conflict task. arXiv preprint arXiv:2608.11510.
Hummel, J. E., & Holyoak, K. J. (2001). A process model of human transitive inference. In M. Gattis (Ed.), Spatial schemas and abstract thought (pp. 279–306). Cambridge, MA: The MIT Press. doi: 10.7551/mitpress/6392.003.0015
Inhelder, B., & Piaget, J. (1958). The growth of logical thinking: From childhood to adolescence. New York: Basic Books. doi: 10.1037/10034-000
Jensen, G., Alkan, Y., Muñoz, F., Ferrera, V. P., & Terrace, H. S. (2017). Transitive inference in humans (Homo sapiens) and rhesus macaques (Macaca mulatta) after massed training of the last two list items. Journal of Comparative Psychology, 131(3), 231–245. doi: 10.1037/com0000065
Jensen, G., Muñoz, F., Alkan, Y., Ferrera, V. P., & Terrace, H. S. (2015). Implicit value updating explains transitive inference performance: The Betasort model. PLOS Computational Biology, 11(9), e1004523. doi: 10.1371/journal.pcbi.1004523
Jensen, G., Terrace, H. S., & Ferrera, V. P. (2019). Discovering implied serial order through model-free and model-based learning. Frontiers in Neuroscience, 13, 878. doi: 10.3389/fnins.2019.00878
Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C., Chaplot, D. S., de las Casas, D., ... El Sayed, W. (2023). Mistral 7B. arXiv preprint arXiv:2310.06825.
Jin, Z., Cao, P., Yuan, H., Chen, Y., Xu, J., Li, H., ... Zhao, J. (2024). Cutting off the head ends the conflict: A mechanism for interpreting and mitigating knowledge conflicts in language models. In Findings of the Association for Computational Linguistics: ACL 2024 (pp. 1193–1215). Association for Computational Linguistics. doi: 10.18653/v1/2024.findings-acl.70
Johnson-Laird, P. N. (2010). Mental models and human reasoning. Proceedings of the National Academy of Sciences, 107(43), 18243–18250. doi: 10.1073/pnas.1012933107
Kahardiprajaa, P., Achtibat, R., Wiegand, T., Samek, W., & Lapuschkin, S. (2025). The atlas of in-context learning: How attention heads shape in-context retrieval augmentation. In Advances in Neural Information Processing Systems (Vol. 38, pp. 130953–130997). doi: 10.52202/085713-3940
Kay, K., Biderman, N., Khajeh, R., Beiran, M., Cueva, C. J., Shohamy, D., ... Abbott, L. F. (2024). Emergent neural dynamics and geometry for generalization in a transitive inference task. PLOS Computational Biology, 20(4), e1011954. doi: 10.1371/journal.pcbi.1011954
Kemp, C., & Tenenbaum, J. B. (2008). The discovery of structural form. Proceedings of the National Academy of Sciences, 105(31), 10687–10692. doi: 10.1073/pnas.0802631105
Kim, G., Valentino, M., & Freitas, A. (2025). Reasoning circuits in language models: A mechanistic interpretation of syllogistic inference. In Findings of the Association for Computational Linguistics: ACL 2025 (pp. 10074–10095). Association for Computational Linguistics. doi: 10.18653/v1/2025.findings-acl.525
Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. In International Conference on Learning Representations. Retrieved from http://arxiv.org/abs/1412.6980
Kirkpatrick, J., Pascanu, R., Rabinowitz, N., Veness, J., Desjardins, G., Rusu, A. A., ... Hadsell, R. (2017). Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13), 3521–3526. doi: 10.1073/pnas.1611835114
Kojima, T., Gu, S., Reid, M., Matsuo, Y., & Iwasawa, Y. (2022). Large language models are zero-shot reasoners. In Advances in Neural Information Processing Systems (Vol. 35, pp. 22199–22213). doi: 10.52202/068431-1613
Kool, W., Gershman, S. J., & Cushman, F. A. (2017). Cost-benefit arbitration between multiple reinforcement-learning systems. Psychological Science, 28(9), 1321–1333. doi: 10.1177/0956797617708288
Kriete, T., Noelle, D. C., Cohen, J. D., & O'Reilly, R. C. (2013). Indirection and symbol-like processing in the prefrontal cortex and basal ganglia. Proceedings of the National Academy of Sciences, 110(41), 16390–16395. doi: 10.1073/pnas.1303547110
Ku, A. Y., Griffiths, T. L., & Chan, S. C. Y. (2026). An evolutionary perspective on modes of learning in transformers. arXiv preprint arXiv:2505.09855.
Kumaran, D., Hassabis, D., & McClelland, J. L. (2016). What learning systems do intelligent agents need? Complementary learning systems theory updated. Trends in Cognitive Sciences, 20(7), 512–534. doi: 10.1016/j.tics.2016.05.004
Kumaran, D., & McClelland, J. L. (2012). Generalization through the recurrent interaction of episodic memories: A model of the hippocampal system. Psychological Review, 119(3), 573–616. doi: 10.1037/a0028681
Kuznetsova, A., Brockhoff, P. B., & Christensen, R. H. B. (2017). lmerTest package: Tests in linear mixed effects models. Journal of Statistical Software, 82(13), 1–26. doi: 10.18637/jss.v082.i13
Laird, J. E., Newell, A., & Rosenbloom, P. S. (1987). SOAR: An architecture for general intelligence. Artificial Intelligence, 33(1), 1–64. doi: 10.1016/0004-3702(87)90050-6
Lake, B. M., & Baroni, M. (2023). Human-like systematic generalization through a meta-learning neural network. Nature, 623(7985), 115–121. doi: 10.1038/s41586-023-06668-3
Lake, B. M., Ullman, T. D., Tenenbaum, J. B., & Gershman, S. J. (2017). Building machines that learn and think like people. Behavioral and Brain Sciences, 40, e253. doi: 10.1017/S0140525X16001837
Lampinen, A. K., Chaudhry, A., Chan, S. C. Y., Wild, C., Wan, D., Ku, A. Y., ... McClelland, J. L. (2025). On the generalization of language models from in-context learning and finetuning: A controlled study. arXiv preprint arXiv:2505.00661.
Lampinen, A. K., Dasgupta, I., Chan, S. C. Y., Sheahan, H. R., Creswell, A., Kumaran, D., ... Hill, F. (2024). Language models, like humans, show content effects on reasoning tasks. PNAS Nexus, 3(7), pgae233. doi: 10.1093/pnasnexus/pgae233
Lan, D. C. L., Hunt, L. T., & Summerfield, C. (2025). Goal-directed navigation in humans and deep rein-forcement learning agents relies on an adaptive mix of vector-based and transition-based strategies. PLOS Biology, 23(7), e3003296. doi: 10.1371/journal.pbio.3003296
Landauer, T. K., & Dumais, S. T. (1997). A solution to Plato's problem: The latent semantic analysis theory of acquisition, induction, and representation of knowledge. Psychological Review, 104(2), 211–240. doi: 10.1037/0033-295X.104.2.211
Lazareva, O. F., Gazes, R. P., Elkins, Z., & Hampton, R. R. (2020). Associative models fail to characterize transitive inference performance in rhesus monkeys (Macaca mulatta). Learning & Behavior, 48(1), 135–148. doi: 10.3758/s13420-020-00417-6
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436–444. doi: 10.1038/nature14539
Ledoit, O., & Wolf, M. (2004). A well-conditioned estimator for large-dimensional covariance matrices. Journal of Multivariate Analysis, 88(2), 365–411. doi: 10.1016/S0047-259X(03)00096-4
Lee, N., Sreenivasan, K., Lee, J. D., Lee, K., & Papailiopoulos, D. (2024). Teaching arithmetic to small transformers. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=dsUB4bst9S
Lehnert, L., Littman, M. L., & Frank, M. J. (2020). Reward-predictive representations generalize across tasks in reinforcement learning. PLOS Computational Biology, 16(10), e1008317. doi: 10.1371/journal.pcbi.1008317
Lepori, M. A., Linzen, T., Yuan, A., & Filippova, K. (2026). Language models struggle to use representations learned in-context. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 14841–14857). Association for Computational Linguistics. doi: 10.18653/v1/2026.acl-long.676
Li, Z., Liu, H., Zhou, D., & Ma, T. (2024). Chain of thought empowers transformers to solve inherently serial problems. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=3EWTEy9MTM
Lieder, F., & Griffiths, T. L. (2020). Resource-rational analysis: Understanding human cognition as the optimal use of limited computational resources. Behavioral and Brain Sciences, 43, e1. doi:10.1017/S0140525X1900061X
Lippl, S., Kay, K., Jensen, G., Ferrera, V. P., & Abbott, L. F. (2024). A mathematical theory of relational generalization in transitive inference. Proceedings of the National Academy of Sciences, 121(28), e2314511121. doi: 10.1073/pnas.2314511121
Liu, A., Prior, H., Balasubramaniam, G., Moroshko, R., Zait, A., Labzovsky, I., … Marino, K. (2025). ReCogLab: A framework testing relational reasoning & cognitive hypotheses on LLMs. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=y0RSk4Ycsa
Liu, R., Geng, J., Wu, A. J., Sucholutsky, I., Lombrozo, T., & Griffiths, T. L. (2025). Mind your step (by step): Chain-of-thought can reduce performance on tasks where thinking makes humans worse. In Proceedings of the 42nd International Conference on Machine Learning (Vol. 267, pp. 38489–38517). Retrieved from https://proceedings.mlr.press/v267/liu25t.html
Logan, G. D. (1988). Toward an instance theory of automatization. Psychological Review, 95(4), 492–527. doi: 10.1037/0033-295X.95.4.492
Lupyan, G. (2013). The difficulties of executing simple algorithms: Why brains make mistakes computers don't. Cognition, 129(3), 615–636. doi: 10.1016/j.cognition.2013.08.015
Mandelbaum, E., Dunham, Y., Feiman, R., Firestone, C., Green, E. J., Harris, D., … Quilty-Dunn, J. (2022). Problems and mysteries of the many languages of thought. Cognitive Science, 46(12), e13225. doi: 10.1111/cogs.13225
Marcus, G. F. (2001). The algebraic mind: Integrating connectionism and cognitive science. Cambridge, MA: MIT Press.
Marcus, G. F., Vijayan, S., Bandi Rao, S., & Vishton, P. M. (1999). Rule learning by seven-month-old infants. Science, 283(5398), 77–80. doi: 10.1126/science.283.5398.77
McClelland, J. L., Botvinick, M. M., Noelle, D. C., Plaut, D. C., Rogers, T. T., Seidenberg, M. S., & Smith, L. B. (2010). Letting structure emerge: Connectionist and dynamical systems approaches to cognition. Trends in Cognitive Sciences, 14(8), 348–356. doi: 10.1016/j.tics.2010.06.002
McClelland, J. L., McNaughton, B. L., & O'Reilly, R. C. (1995). Why there are complementary learning systems in the hippocampus and neocortex: Insights from the successes and failures of connectionist models of learning and memory. Psychological Review, 102(3), 419–457. doi: 10.1037/0033-295X.102.3.419
McCloskey, M., & Cohen, N. J. (1989). Catastrophic interference in connectionist networks: The sequential learning problem. In G. H. Bower (Ed.), The psychology of learning and motivation (Vol. 24, pp. 109–165). San Diego, CA: Academic Press. doi: 10.1016/S0079-7421(08)60536-8
McGrath, S. W., & Russin, J. (2024). Multiple realizability and the rise of deep learning. Proceedings of the Annual Meeting of the Cognitive Science Society, 46. Retrieved from https://escholarship.org/uc/item/6nc0889w
McGrath, S. W., Russin, J., Pavlick, E., & Feiman, R. (2023). Properties of LoTs: The footprints or the bear itself? Behavioral and Brain Sciences, 46, e284. doi: 10.1017/S0140525X23001863
McGrath, S. W., Russin, J., Pavlick, E., & Feiman, R. (2024). How can deep neural networks inform theory in psychological science? Current Directions in Psychological Science, 33(5), 325–333. doi: 10.1177/09637214241268098
Merrill, W., & Sabharwal, A. (2024). The expressive power of transformers with chain of thought. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=NjNG1Ph8Wh
Miconi, T., & Kay, K. (2025). Neural mechanisms of relational learning and fast knowledge reassembly in plastic neural networks. Nature Neuroscience, 28(2), 406–414. doi: 10.1038/s41593-024-01852-8
Mikolov, T., Yih, W.-t., & Zweig, G. (2013). Linguistic regularities in continuous space word representations. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (pp. 746–751). Association for Computational Linguistics. Retrieved from https://aclanthology.org/N13-1090/
Momennejad, I. (2020). Learning structures: Predictive representations, replay, and generalization. Current Opinion in Behavioral Sciences, 32, 155–166. doi: 10.1016/j.cobeha.2020.02.017
Momennejad, I., Russek, E. M., Cheong, J. H., Botvinick, M. M., Daw, N. D., & Gershman, S. J. (2017). The successor representation in human reinforcement learning. Nature Human Behaviour, 1(9), 680–692. doi: 10.1038/s41562-017-0180-8
Moyer, R. S., & Landauer, T. K. (1967). Time required for judgements of numerical inequality. Nature, 215(5109), 1519–1520. doi: 10.1038/2151519a0
Muennighoff, N., Yang, Z., Shi, W., Li, X. L., Fei-Fei, L., Hajishirzi, H., ... Hashimoto, T. (2025). s1: Simple test-time scaling. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing (pp. 20275–20321). Association for Computational Linguistics. doi: 10.18653/v1/2025.emnlp-main.1025
Nelli, S., Braun, L., Dumbalska, T., Saxe, A. M., & Summerfield, C. (2023). Neural knowledge assembly in humans and neural networks. Neuron, 111(9), 1504-1516.e9. doi: 10.1016/j.neuron.2023.02.014
Newell, A., & Simon, H. A. (1972). Human problem solving. Englewood Cliffs, NJ: Prentice-Hall.
Newell, A., & Simon, H. A. (1976). Computer science as empirical inquiry: Symbols and search. Communications of the ACM, 19(3), 113–126. doi: 10.1145/360018.360022
Noroozizadeh, S., Nagarajan, V., Rosenfeld, E., & Kumar, S. (2026). Deep sequence models tend to memorize geometrically; it is unclear why. In Proceedings of the 43rd International Conference on Machine Learning (Vol. 306, pp. 93801–93862). Retrieved from https://proceedings.mlr.press/v306/noroozizadeh26a.html
Nye, M., Andreassen, A. J., Gur-Ari, G., Michalewski, H., Austin, J., Bieber, D., ... Odena, A. (2021). Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114.
Oaksford, M., & Chater, N. (1994). A rational analysis of the selection task as optimal data selection. Psychological Review, 101(4), 608–631. doi: 10.1037/0033-295x.101.4.608
Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., … Olah, C. (2022). In-context learning and induction heads. arXiv preprint arXiv:2209.11895.
OpenAI. (2024). OpenAI o1 system card. arXiv preprint arXiv:2412.16720.
OpenAI, Agarwal, S., Ahmad, L., Ai, J., Altman, S., Applebaum, A., … Zhao, S. (2025). gpt-oss-120b & gpt-oss-20b model card. arXiv preprint arXiv:2508.10925.
O'Reilly, R. C., & Frank, M. J. (2006). Making working memory work: A computational model of learning in the prefrontal cortex and basal ganglia. Neural Computation, 18(2), 283–328. doi:10.1162/089976606775093909
O'Reilly, R. C., Nair, A., Russin, J., & Herd, S. A. (2020). How sequential interactive processing within frontostriatal loops supports a continuum of habitual to controlled processing. Frontiers in Psychology, 11, 380. doi: 10.3389/fpsyg.2020.00380
O'Reilly, R. C., Ranganath, C., & Russin, J. (2022). The structure of systematicity in the brain. Current Directions in Psychological Science, 31(2), 124–130. doi: 10.1177/09637214211049233
Ortu, F., Jin, Z., Doimo, D., Sachan, M., Cazzaniga, A., & Schölkopf, B. (2024). Competition of mechanisms: Tracing how language models handle facts and counterfactuals. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) (pp. 8420–8436). Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.458
Palan, S., & Schitter, C. (2018). Prolific.ac—A subject pool for online experiments. Journal of Behavioral and Experimental Finance, 17, 22–27. doi: 10.1016/j.jbef.2017.12.004
Park, C. F., Lee, A., Lubana, E. S., Yang, Y., Okawa, M., Nishi, K., … Tanaka, H. (2025). ICLR: In-context learning of representations. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=pXlm0mlHJZ
Park, S. A., Miller, D. S., Nili, H., Ranganath, C., & Boorman, E. D. (2020). Map making: Constructing, combining, and inferring on abstract cognitive maps. Neuron, 107(6), 1226-1238.e8. doi: 10.1016/j.neuron.2020.06.030
Park, S. A., Zolfaghar, M., Russin, J., Miller, D. S., O'Reilly, R. C., & Boorman, E. D. (2026). The representational geometry of cognitive maps under cognitive control. bioRxiv preprint. doi: 10.1101/2023.02.04.527142
Paz-y-Miño C, G., Bond, A. B., Kamil, A. C., & Balda, R. P. (2004). Pinyon jays use transitive inference to predict social dominance. Nature, 430(7001), 778–781. doi: 10.1038/nature02723
Pesnot Lerousseau, J., & Summerfield, C. (2026). Shared sensitivity to data distribution during learning in humans and transformer networks. Nature Human Behaviour, 10(3), 601–614. doi: 10.1038/s41562-025-02359-3
Piantadosi, S. T. (2014). Zipf's word frequency law in natural language: A critical review and future directions. Psychonomic Bulletin & Review, 21(5), 1112–1130. doi: 10.3758/s13423-014-0585-6
Piantadosi, S. T., Tenenbaum, J. B., & Goodman, N. D. (2012). Bootstrapping in a language of thought: A formal model of numerical concept learning. Cognition, 123(2), 199–217. doi: 10.1016/j.cognition.2011.11.005
Pinker, S., & Prince, A. (1988). On language and connectionism: Analysis of a parallel distributed processing model of language acquisition. Cognition, 28(1-2), 73–193. doi: 10.1016/0010-0277(88)90032-7
Potts, G. R. (1974). Storing and retrieving information about ordered relationships. Journal of Experimental Psychology, 103(3), 431–439. doi: 10.1037/h0037408
Press, O., & Wolf, L. (2017). Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers (pp. 157–163). Association for Computational Linguistics. doi: 10.18653/v1/E17-2025
Prystawski, B., Li, M., & Goodman, N. D. (2023). Why think step by step? Reasoning emerges from the locality of experience. In Advances in Neural Information Processing Systems (Vol. 36, pp.
70926-70947). doi: 10.52202/075280-3107
Quilty-Dunn, J., Porot, N., & Mandelbaum, E. (2023). The best game in town: The reemergence of the language-of-thought hypothesis across the cognitive sciences. Behavioral and Brain Sciences, 46, e261. doi: 10.1017/S0140525X22002849
Qwen, Yang, A., Yang, B., Zhang, B., Hui, B., Zheng, B., ... Qiu, Z. (2024). Qwen2.5 technical report. arXiv preprint arXiv:2412.15115.
Rane, S., Kirkman, C. F., Todd, G., Royka, A., Law, R. M. C., Cartmill, E., & Foster, J. G. (2025). Position: Principles of animal cognition to improve LLM evaluations. In Proceedings of the 42nd International Conference on Machine Learning (Vol. 267, pp. 82051–82061). Retrieved from https://proceedings.mlr.press/v267/rane25a.html
Raventós, A., Paul, M., Chen, F., & Ganguli, S. (2023). Pretraining task diversity and the emergence of non-Bayesian in-context learning for regression. In Advances in Neural Information Processing Systems (Vol. 36, pp. 14228–14246). Retrieved from https://proceedings.neurips.cc/paper_files/paper/2023/hash/2e10b2c2e1aa4f8083c37dfe269873f8-Abstract-Conference.html
Raviv, L., Lupyan, G., & Green, S. C. (2022). How variability shapes learning and generalization. Trends in Cognitive Sciences, 26(6), 462–483. doi: 10.1016/j.tics.2022.03.007
Reddy, G. (2024). The mechanistic basis of data dependence and abrupt learning in an in-context classification task. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=aN4Jf6Cx69
Rips, L. J. (1994). The psychology of proof: Deductive reasoning in human thinking. Cambridge, MA: The MIT Press. doi: 10.7551/mitpress/5680.001.0001
Robins, A. (1995). Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2), 123–146. doi: 10.1080/09540099550039318
Rogers, T. T., & McClelland, J. L. (2004). Semantic cognition. Cambridge, MA: The MIT Press. doi: 10.7551/mitpress/6161.001.0001
Rougier, N. P., Noelle, D. C., Braver, T. S., Cohen, J. D., & O'Reilly, R. C. (2005). Prefrontal cortex and flexible cognitive control: Rules without symbols. Proceedings of the National Academy of Sciences, 102(20), 7338–7343. doi: 10.1073/pnas.0502455102
Rumelhart, D. E., McClelland, J. L., & PDP Research Group. (1986). Parallel distributed processing: Explorations in the microstructure of cognition. Volume 1: Foundations. Cambridge, MA: The MIT Press. doi: 10.7551/mitpress/5236.001.0001
Russek, E. M., Momennejad, I., Botvinick, M. M., Gershman, S. J., & Daw, N. D. (2017). Predictive representations can link model-based reinforcement learning to model-free mechanisms. PLOS Computational Biology, 13(9), e1005768. doi: 10.1371/journal.pcbi.1005768
Russin, J., Jo, J., O'Reilly, R. C., & Bengio, Y. (2020). Systematicity in a recurrent neural network by factorizing syntax and semantics. Proceedings of the Annual Meeting of the Cognitive Science Society, 42. Retrieved from https://escholarship.org/uc/item/3c0462ph
Russin, J., Kim, J., Pavlick, E., & Frank, M. J. (2025). Step-by-step analogical reasoning in humans and neural networks. Proceedings of the Annual Meeting of the Cognitive Science Society, 47. Retrieved from https://escholarship.org/uc/item/1n6366h7
Russin, J., McGrath, S. W., Pavlick, E., & Frank, M. J. (2024). Is human compositionality meta-learned? Behavioral and Brain Sciences, 47, e162. doi: 10.1017/S0140525X24000189
Russin, J., McGrath, S. W., & Williams, D. J. (2025). From Frege to ChatGPT: Compositionality in language, cognition, and deep neural networks. arXiv preprint arXiv:2405.15164.
Russin, J., O'Reilly, R. C., & Bengio, Y. (2020). Deep learning needs a prefrontal cortex. In Bridging AI and Cognitive Science (BAICS) Workshop at ICLR 2020. Retrieved from https://baicsworkshop.github.io/pdf/BAICS_10.pdf
Russin, J., Pavlick, E., & Frank, M. J. (2025). Parallel trade-offs in human cognition and neural networks: The dynamic interplay between in-context and in-weight learning. Proceedings of the National Academy of Sciences, 122(35), e2510270122. doi: 10.1073/pnas.2510270122
Russin, J., Zolfaghar, M., Park, S. A., Boorman, E. D., & O'Reilly, R. C. (2021). Complementary structure-learning neural networks for relational reasoning. Proceedings of the Annual Meeting of the Cognitive Science Society, 43. Retrieved from https://escholarship.org/uc/item/3hr31532
Sackur, J., & Dehaene, S. (2009). The cognitive architecture for chaining of two mental operations. Cognition, 111(2), 187–211. doi: 10.1016/j.cognition.2009.01.010
Saryazdi, R., Bannon, J., Rodrigues, A., Klammer, C., & Chambers, C. G. (2018). Picture perfect: A stimulus set of 225 pairs of matched clipart and photographic images normed by Mechanical Turk and laboratory participants. Behavior Research Methods, 50(6), 2498–2510. doi: 10.3758/s13428-018-1028-5
Schubert, A.-L., Ferreira, M. B., Mata, A., & Riemenschneider, B. (2021). A diffusion model analysis of belief bias: Different cognitive mechanisms explain how cognitive abilities and thinking styles contribute to conflict resolution in reasoning. Cognition, 211, 104629. doi: 10.1016/j.cognition.2021.104629
Sedek, G., & von Hecker, U. (2004). Effects of subclinical depression and aging on generative reasoning about linear orders: Same or different processing limitations? Journal of Experimental Psychology: General, 133(2), 237–260. doi: 10.1037/0096-3445.133.2.237
Shah, R., Marupudi, V., Koenen, R., Bhardwaj, K., & Varma, S. (2023). Numeric magnitude comparison effects in large language models. In Findings of the Association for Computational Linguistics: ACL 2023 (pp. 6147–6161). Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.383
Shaki, J., La Malfa, E., Wooldridge, M. J., & Kraus, S. (2025). Out-of-context reasoning in large language models. In Findings of the Association for Computational Linguistics: EMNLP 2025 (pp. 19606–19615). Association for Computational Linguistics. doi: 10.18653/v1/2025.findings-emnlp.1068
Singh, A. K., Chan, S. C. Y., Moskovitz, T., Grant, E., Saxe, A. M., & Hill, F. (2023). The transient nature of emergent in-context learning in transformers. In Advances in Neural Information Processing Systems (Vol. 36, pp. 27801–27819). Retrieved from https://proceedings.neurips.cc/paper_files/paper/2023/hash/58692a1701314e09cbd7a5f5f3871cc9-Abstract-Conference.html
Singh, N. (2026). Emergent ordinal geometry in transformers trained on local comparisons. arXiv preprint arXiv:2606.01269.
Sloman, S. A. (1993). Feature-based induction. Cognitive Psychology, 25(2), 231–280. doi: 10.1006/cogp.1993.1006
Sloman, S. A. (1996). The empirical case for two systems of reasoning. Psychological Bulletin, 119(1), 3–22. doi: 10.1037/0033-2909.119.1.3
Smolensky, P. (1988). On the proper treatment of connectionism. Behavioral and Brain Sciences, 11(1), 1–23. doi: 10.1017/S0140525X00052432
Smolensky, P., McCoy, R. T., Fernandez, R., Goldrick, M., & Gao, J. (2022). Neurocompositional computing: From the Central Paradox of Cognition to a new generation of AI systems. AI Magazine, 43(3), 308–322. doi: 10.1002/aaai.12065
Son, J.-Y., Bhandari, A., & FeldmanHall, O. (2023). Abstract cognitive maps of social network structure aid adaptive inference. Proceedings of the National Academy of Sciences, 120(47), e2310801120. doi: 10.1073/pnas.2310801120
Son, J.-Y., Carstensen, D. L., & Favila, S. E. (2026). Humanlike representation of social networks in large language models. PsyArXiv. doi: 10.31234/osf.io/73fpj_v1
Soni, A., Traylor, A., Merullo, J., Frank, M. J., & Pavlick, E. (2026). Transformer mechanisms mimic frontostriatal gating operations when trained on human working memory tasks. Journal of Cognitive Neuroscience, 38(11), 2128–2140. doi: 10.1162/jocn.a.2679
Sorscher, B., Ganguli, S., & Sompolinsky, H. (2022). Neural representational geometry underlies few-shot concept learning. Proceedings of the National Academy of Sciences, 119(43), e2200800119. doi: 10.1073/pnas.2200800119
Sripada, C., & Lewis, R. L. (2026). Cognitive convergence: Deep similarities between large language models and human cognition. arXiv preprint arXiv:2607.26179.
Stachenfeld, K. L., Botvinick, M. M., & Gershman, S. J. (2017). The hippocampus as a predictive map. Nature Neuroscience, 20(11), 1643–1653. doi: 10.1038/nn.4650
Sternberg, R. J., & Weil, E. M. (1980). An aptitude strategy interaction in linear syllogistic reasoning. Journal of Educational Psychology, 72(2), 226–239. doi: 10.1037/0022-0663.72.2.226
Studdiford, Z., & Lupyan, G. (2026). Reasoning as pattern matching: Shared mechanisms in human and LLM everyday reasoning. arXiv preprint arXiv:2606.13607.
Su, J., Ahmed, M., Lu, Y., Pan, S., Bo, W., & Liu, Y. (2024). RoFormer: Enhanced transformer with rotary position embedding. Neurocomputing, 568, 127063. doi: 10.1016/j.neucom.2023.127063
Team GLM, Zeng, A., Xu, B., Wang, B., Zhang, C., Yin, D., … Wang, Z. (2024). ChatGLM: A family of large language models from GLM-130B to GLM-4 All Tools. arXiv preprint arXiv:2406.12793.
Team OLMo, Walsh, P., Soldaini, L., Groeneveld, D., Lo, K., Arora, S., … Hajishirzi, H. (2025). 2 OLMo 2 Furious. In Conference on Language Modeling. Retrieved from https://openreview.net/forum?id=2ezugTT9kU
Tenenbaum, J. B., & Griffiths, T. L. (2001). Generalization, similarity, and Bayesian inference. Behavioral and Brain Sciences, 24(4), 629–640. doi: 10.1017/S0140525X01000061
Tenenbaum, J. B., Kemp, C., Griffiths, T. L., & Goodman, N. D. (2011). How to grow a mind: Statistics, structure, and abstraction. Science, 331(6022), 1279–1285. doi: 10.1126/science.1192788
Todd, E., Brinkmann, J., Gandikota, R., & Bau, D. (2026). In-context algebra. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=J2peqXPQbB
Tolman, E. C. (1948). Cognitive maps in rats and men. Psychological Review, 55(4), 189–208. doi:10.1037/h0061626
Trabasso, T. (1977). The role of memory as a system in making transitive inferences. In R. V. Kail & J. W. Hagen (Eds.), Perspectives on the development of memory and cognition (pp. 333–366). Hillsdale, NJ: Lawrence Erlbaum Associates.
Trabasso, T., & Riley, C. A. (1975). The construction and use of representations involving linear order. In R. L. Solso (Ed.), Information processing and cognition: The Loyola Symposium (pp. 381–410). Hillsdale, NJ: Lawrence Erlbaum Associates. Retrieved from https://doi.org/10.4324/9781032722450-16
Vasconcelos, M. (2008). Transitive inference in non-human animals: An empirical and theoretical analysis. Behavioural Processes, 78(3), 313–334. doi: 10.1016/j.beproc.2008.02.017
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., … Polosukhin, I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems (Vol. 30, pp. 5998–6008). Retrieved from https://papers.nips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html
von Fersen, L., Wynne, C. D. L., Delius, J. D., & Staddon, J. E. R. (1991). Transitive inference formation in pigeons. Journal of Experimental Psychology: Animal Behavior Processes, 17(3), 334–341. doi:10.1037/0097-7403.17.3.334
von Hecker, U., Müller, E., Dill, S. K., & Klauer, K. C. (2023). Mental representation of equivalence and order. Quarterly Journal of Experimental Psychology, 76(12), 2779–2793. doi: 10.1177/17470218231153974
Waltz, J. A., Knowlton, B. J., Holyoak, K. J., Boone, K. B., Mishkin, F. S., de Menezes Santos, M., … Miller, B. L. (1999). A system for relational reasoning in human prefrontal cortex. Psychological Science, 10(2), 119–125. doi: 10.1111/1467-9280.00118
Wang, J. X., Kurth-Nelson, Z., Kumaran, D., Tirumala, D., Soyer, H., Leibo, J. Z., … Botvinick, M. M. (2018). Prefrontal cortex as a meta-reinforcement learning system. Nature Neuroscience, 21(6), 860–868. doi: 10.1038/s41593-018-0147-8
Wason, P. C., & Shapiro, D. (1971). Natural and contrived experience in a reasoning problem. Quarterly Journal of Experimental Psychology, 23(1), 63–71. doi: 10.1080/00335557143000068
Webb, T. W., Frankland, S. M., Altabaa, A., Segert, S., Krishnamurthy, K., Campbell, D. I., … Cohen,
J. D. (2024). The relational bottleneck as an inductive bias for efficient abstraction. Trends in Cognitive Sciences, 28(9), 829–843. doi: 10.1016/j.tics.2024.04.001
Webb, T. W., Holyoak, K. J., & Lu, H. (2023). Emergent analogical reasoning in large language models. Nature Human Behaviour, 7(9), 1526–1541. doi: 10.1038/s41562-023-01659-w
Webb, T. W., Sinha, I., & Cohen, J. D. (2021). Emergent symbols through binding in external memory. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=LSFCEb3GYU7
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., ... Zhou, D. (2022). Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems (Vol. 35, pp. 24824–24837). Retrieved from https://papers.nips.cc/paper_files/paper/2022/hash/9d5609613524ecf4f15af0f7b31abca4-Abstract-Conference.html
Wen, K., Zhang, H., Lin, H., & Zhang, J. (2025). From sparse dependence to sparse attention: Unveiling how chain-of-thought enhances transformer sample efficiency. arXiv preprint arXiv:2410.05459.
Wendelken, C., & Bunge, S. A. (2010). Transitive inference: Distinct contributions of rostrolateral prefrontal cortex and the hippocampus. Journal of Cognitive Neuroscience, 22(5), 837–847. doi:10.1162/jocn.2009.21226
Whittington, J. C. R., Muller, T. H., Mark, S., Chen, G., Barry, C., Burgess, N., & Behrens, T. E. J. (2020). The Tolman-Eichenbaum machine: Unifying space and relational memory through generalization in the hippocampal formation. Cell, 183(5), 1249-1263.e23. doi: 10.1016/j.cell.2020.10.024
Wies, N., Levine, Y., & Shashua, A. (2023). Sub-task decomposition enables learning in sequence to sequence tasks. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=BrJATVZDWEH
Wilkins, M. C. (1928). The effect of changed material on ability to do formal syllogistic reasoning. Archives of Psychology, 16(102). Retrieved from https://archive.org/details/effectofchangedm00wilk
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., ... Rush, A. (2020). Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations (pp. 38–45). Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-demos.6
Wright, B. C. (2001). Reconceptualizing the transitive inference ability: A framework for existing and future research. Developmental Review, 21(4), 375–422. doi: 10.1006/drev.2000.0525
Wright, B. C. (2012). The case for a dual-process theory of transitive reasoning. Developmental Review, 32(2), 89–124. doi: 10.1016/j.dr.2012.04.001
Wu, W., & Deng, W. (2025). Transitive inference in large language models and prompting intervention. In ICASSP 2025 - 2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 1–5). IEEE. doi: 10.1109/icassp49660.2025.10889585
Wu, W., Wang, Y., Xiao, G., Peng, H., & Fu, Y. (2025). Retrieval head mechanically explains long-context factuality. In International Conference on Learning Representations. Retrieved from https://openreview.net/forum?id=EytBpUGB1Z
Wurgaft, D., Lubana, E. S., Park, C. F., Tanaka, H., Reddy, G., & Goodman, N. D. (2025). In-context learning strategies emerge rationally. In Advances in Neural Information Processing Systems (Vol. 38, pp. 131263–131323). doi: 10.52202/085713-3950
Wynne, C. D. L. (1995). Reinforcement accounts for transitive inference performance. Animal Learning & Behavior, 23(2), 207–217. doi: 10.3758/BF03199936
Xiong, R., Yang, Y., He, D., Zheng, K., Zheng, S., Xing, C., ... Liu, T. (2020). On layer normalization in the transformer architecture. In Proceedings of the 37th International Conference on Machine Learning (Vol. 119, pp. 10524–10533). Retrieved from https://proceedings.mlr.press/v119/xiong20b.html
Yang, A., Li, A., Yang, B., Zhang, B., Hui, B., Zheng, B., ... Qiu, Z. (2025). Qwen3 technical report. arXiv preprint arXiv:2505.09388.
Yang, Y., Campbell, D. I., Huang, K., Wang, M., Cohen, J. D., & Webb, T. W. (2025). Emergent symbolic mechanisms support abstract reasoning in large language models. In Proceedings of the 42nd International Conference on Machine Learning (Vol. 267, pp. 70515–70549). Retrieved from https://proceedings.mlr.press/v267/yang25c.html
Yu, Q., Merullo, J., & Pavlick, E. (2023). Characterizing mechanisms for factual recall in language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (pp. 9924–9959). Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.615
Zipf, G. K. (1949). Human behavior and the principle of least effort: An introduction to human ecology. Cambridge, MA: Addison-Wesley Press. Retrieved from https://archive.org/details/in.ernet.dli.2015.90211
Appendix
A Formalization of the geometric and algebraic strategies ..... 32
B Extended methods ..... 34
B.1 Transformers trained from scratch ..... 34
B.2 Human experiments ..... 39
B.2.1 Experiment 1 ..... 39
B.2.2 Experiment 2 ..... 41
B.3 Large language models ..... 43
C Extended results ..... 46
C.1 Transformers trained from scratch ..... 46
Additional symbolic-distance results ..... 46
Alternative chain-of-thought algorithms ..... 46
Architecture robustness ..... 48
Replay prevents catastrophic forgetting ..... 48
Content effects across pretraining distributions ..... 48
Additional mechanism results ..... 50
Additional data-distribution manipulations ..... 56
Chain-of-thought improves sample efficiency ..... 57
Learning without an explicit cue ..... 57
C.2 Human experiments ..... 58
C.2.1 Experiment 1 ..... 58
Statistical tables ..... 58
Learning phase ..... 58
Additional symbolic-distance results ..... 60
Arbitrage test ..... 61
C.2.2 Experiment 2 ..... 65
Statistical tables ..... 65
Robustness ..... 65
Agree and conflict questions ..... 66
Strategies and self-reports ..... 67
C.3 Large language models ..... 71
Additional symbolic-distance results ..... 71
Reasoning requirements across models and dimensions ..... 75
Content effects across models and dimensions ..... 80
Recovery with reasoning ..... 84
Reasoning requirements under content conditions ..... 88
Additional mechanism results ..... 92
Reasoning traces ..... 93
Example reasoning traces ..... 95
A Formalization of the geometric and algebraic strategies
Here we formalize the geometric and algebraic strategies for transitive inference as two algorithms for answering order queries about a set of premises. A single ordering is a total order over items presented only through adjacent premises, which connect each item to its two immediate neighbors (endpoints have only one). A query on two items asks their relative order, and the symbolic distance between them is the number of premises separating them.
An ordinal transitive-inference environment is a family of such orderings. For simplicity, we assume that the orderings are defined over the same items. We write for the position of item in ordering , so , and the symbolic distance is . A query is constructed by sampling an ordering and a pair of interior items from that ordering; the task is to return the correct relation or . We use (seven queryable items) throughout.
Two algorithms. Geometric (pre-compile). We can realize the geometric strategy by pre-compiling the rank of every item in an ordering (Alg. 1), enabling inference via constant-time comparisons that are independent of distance. Ranks can be compiled by walking outward from any starting item. The ranks are specific to an ordering—different orderings must be compiled separately.
Algorithm 1 Geometric strategy: pre-compile
Pre-compile (once per ordering ): pick any item of the ordering; ;
while has a greater neighbor do ; ; ;
while has a lesser neighbor do ; ;
Query : return if , else
▷
▷ walk up to the last item
▷ walk down to the first item
▷
Algebraic (traverse). We can realize the algebraic strategy by walking from one queried item until reaching either the other queried item or an end of the ordering, at a cost proportional to the number of steps (Alg. 2; Fig. 2E). Nothing is pre-compiled, so this strategy can answer a query about any ordering.
Simple noise assumptions reproduce symbolic distance effects. Under straightforward assumptions about noise in the inference process, the geometric strategy (Alg. 1) reproduces the symbolic distance effect and the algebraic strategy (Alg. 2) reproduces the reverse symbolic distance effect.
Geometric. A query is answered by comparing the two pre-compiled ranks (Alg. 1). The decision variable is the rank difference . If there is Gaussian noise in the readout, then the response is if and otherwise, where ( in Figs. 2D and 3B,D). In this case, accuracy increases as a function of symbolic distance (Fig. 2D):
where is the standard normal cumulative distribution function. Because inference is always a single comparison, inference cost does not grow with distance (Fig. 2E).
Algebraic. A query is answered by walking along the ordering (Alg. 2). The walk ends when it reaches the target, after steps, or an end of the ordering—which comes first depends on the direction
Algorithm 2 Algebraic strategy: traverse
Pre-compile: none
Query : if and are adjacent then return the relation given by their premise ▷ no steps pick a neighbor of at random let satisfy , and let be the opposite relation ; while and has a neighbor other than do ▷ one premise read per step the neighbor of other than ; ; if then return else return ▷ reached the target after steps ▷ reached an end, so is on the other side of
chosen. We assume a limited reasoning budget of steps, drawn uniformly from 1 to on each query ( in Figs. 2D and 3B), and that the algorithm falls back to a guess, correct with probability , if the walk does not end within the budget. Writing for the number of steps the walk takes,
Longer walks fail more often, so the algebraic strategy's accuracy decreases with distance—the reverse symbolic distance effect (Fig. 2D)—while the expected number of steps grows with distance (Fig. 2E).
Content effects. A single system capable of both strategies can combine the advantages of each, using pre-compiled ranks for familiar items and reasoning step by step for unfamiliar items. When both strategies are available, the information given in context can either agree with prior experience (congruent) or contradict it (incongruent). When the context is congruent, a system capable of both strategies should answer accurately regardless of the length of the reasoning process. However, when the context is incongruent, the system should answer incorrectly if it relies on its pre-compiled ranks, but can overcome this interference by reasoning step by step through the information available in the context.
Figure 3B,C illustrates content effects in a system capable of both strategies. The system answers from its pre-compiled ranks unless it is given enough time to complete its reasoning process. With the same reasoning budget as above, a query is answered correctly if the walk ends within the budget, and otherwise from the pre-compiled ranks, which, as in the geometric strategy, match prior experience with probability . Accuracy therefore stays near ceiling when the context is congruent and falls with distance when it is reversed or shuffled (less steeply when shuffled). When the context is uninformative, accuracy shows the geometric strategy's symbolic distance effect (Fig. 3B). Congruent queries require no reasoning, but incongruent queries do, and the expected number of reasoning steps required grows with distance (Fig. 3C).
Learning and inference costs. The two strategies trade off learning and inference costs (memory costs also differ, but we do not consider them here). During learning, the geometric strategy pre-compiles ranks, requiring a pass through all items, whereas the algebraic strategy does not learn specific orderings at all. During inference, the geometric strategy's cost is constant in distance, while the algebraic strategy's inference cost grows with distance. When the algebraic strategy walks toward the target, it takes steps, and when it walks away, it takes steps equal to the distance from the starting item to the end of the ordering in that direction. For non-adjacent queries the expected number of steps at distance is .
The total cost of each strategy therefore depends on the environment. We assume a total of queries, drawn independently from a fixed data distribution. Orderings are sampled according to a Zipf distribution with skew : ordering is sampled with probability . When is 0, the distribution is uniform over all orderings. As increases, the distribution becomes more skewed, concentrating queries on a few frequent orderings.
The geometric strategy compiles an ordering when it first encounters it, so over queries it compiles distinct orderings in expectation—a count that falls as rises. Let be the cost of one elementary inference operation, and let be the cost of learning one ordering. Averaged over queries, the algebraic walk takes as many steps as the mean distance if adjacent pairs are walked. The total costs are then:
The cost of the geometric strategy is paid at learning time and scales with the number of distinct orderings encountered: when queries are concentrated on a few orderings (large ), the learning burden decreases. The cost of the algebraic strategy is paid at inference time and scales with the mean distance : when many queries have large distances, inference becomes more costly.
Figure 5B shows how these costs affect a learner capable of both strategies. We assume that the learner acquires each strategy to the extent that it is not much costlier than the other: strategy is adopted according to , where is the logistic function, is the other strategy, and and control how much costlier a strategy can be before it is abandoned. Accuracy on the test that isolates strategy is given by . As the orderings become more diverse (smaller ), accuracy on familiar items (IWL test) falls while accuracy on novel items given in context (ICL test) rises. Plotted against each other (Fig. 5D), the two accuracies are both high over an intermediate range of . Figure 5B,D uses , , , , , , and from 0 to 10.
The geometric strategy can also be applied to a novel ordering given in context, by pre-compiling all ranks from the premises given in context before answering the specific query. Because each such ordering is new, this would require reading all premises before making the comparison to answer the query, at a total cost of . This would always be costlier than the algebraic strategy, which has an average cost of , because as no two items are more than premises apart.
B Extended methods
Below we describe the methods used for training transformers from scratch, conducting online human experiments, and evaluating large language models (LLMs).
B.1 Transformers trained from scratch
Task and input sequences. Transformers learned ordinal relations between items denoted by arbitrary tokens. Each transitive-inference problem defined a strict total order but exposed that order only through the relations between adjacent items. A query presented two items and required the model to determine which one had the higher rank. For example, one possible training sequence for the order i0 > i1 > i2 > i3 > i4 > i5 > i6 > i7 > i8 was:
<bos> <cue7> ? i3 i1 ? | i8 i7 -1 | i2 i3 +1 | i1 i0 -1 | i5 i6 +1 | i4 i3 -1 | i7 i6 -1 | i2 i1 -1 | i5 i4 -1 | i3 i1 -1
Sequences began with <bos> followed by a cue token (e.g., <cue7>) that indexed the particular ordering between items in the sequence. The query (e.g., i3 i1) appeared both before the context and after it. Before the context, the query items were presented between two distinct special tokens, both printed ?.
The separator | marked the boundary after the query and after each subsequent relation pair. The eight pairs of items and their relations shown in the context specified the nine-item order. The positions of these adjacent relations in the context were shuffled. The two endpoints appeared in the context but were not queried. Unless indicated otherwise, the symbolic distance (the rank difference between the two query items) was sampled uniformly from 1 to 6. A valid pair of ranks at that distance was then sampled uniformly, and the order of the two query items was randomized. Each +1 or -1 in the context represented the relation (+1 encoded > and -1 encoded <), and scaled a single learned relation embedding.
Chain-of-thought generation. During pretraining, sequences sometimes contained demonstrations of chains of thought (CoTs) for the given problem. For the example problem given above, the complete CoT training sequence would be:
<bos> <cue7> ? i3 i1 ? | i8 i7 -1 | i2 i3 +1 | i1 i0 -1 | i5 i6 +1 | i4 i3 -1 | i7 i6 -1 | i2 i1 -1 | i5 i4 -1 | i2 i3 +1 | i2 i1 -1 | i3 i1 -1
The CoT inserted i2 i3 +1 and i2 i1 -1 after the in-context relations but before the final query and answer (i3 i1 -1). Algorithm 3 gives the CoT-generation procedure used in the main experiments; it implements the algebraic strategy of Alg. 2 on the shuffled context, with the first-presented pair playing the role of the random direction.
Algorithm 3 Chain-of-thought generation
Require: shuffled context pairs
Query : if a pair in contains both and then let satisfy , as specified by else the earliest pair in that contains while true do the item in other than let satisfy , as specified by append to in its presented orientation if then break else if no pair in other than contains then break the unique pair in other than that contains append the query items to append to return
The algorithm was designed so that each successive pair could be directly obtained from the current context sequence without consulting the latent global ranks. For adjacent queries, the answer was read directly from the context pair containing both query items, and no intermediate relation was emitted. For non-adjacent queries, the pairs emitted at each step copied the context relations in their presented orientations. If traversal reached the other query item, the answer was the relation emitted at the final step; if instead the traversal reached the opposite endpoint, the answer was the opposite of the one emitted at the final step. To maintain a fixed sequence length during training, sequences were padded after the first answer by repeating the answer pair, ensuring good performance at reasoning budgets greater than or equal to the number required to produce the answer.
Pretraining distribution. Each cue token indexed a fixed ordering over the pool of items. This was achieved via a seeded pseudorandom score that was fixed for every cue-item combination. On each pre-training trial, a cue was drawn from the experiment's cue-frequency distribution (see experiment details below), a set of items was sampled without replacement, and those items were placed in the cue-associated order. After the items were ranked, a query and the complete adjacent-relation context were constructed using the sampling and randomization procedure described above. During pretraining, a proportion of trials included CoT, specified by the experiment configuration (see details for each experiment below).
Fixed-order learning distribution. After pretraining, finetuning repeatedly presented one or more fixed orderings, giving the model the opportunity to memorize them. Each finetuning trial queried an adjacent pair from one of these orderings and used an answer-only target. Consistent with Experiment 1 (see details below), distractors were inserted into the sequence so that finetuning retained the same overall format as pretraining. In order to avoid catastrophic forgetting of the in-context CoT strategy (McCloskey & Cohen, 1989), 10% of samples were replaced with pretraining samples.
IWL and ICL tests. Held-out cues were never used during training, and in-context learning (ICL) test items were not part of the finetuned ordering or its distractors. The in-weight learning (IWL) test queried items from a fixed ordering learned during finetuning with an uninformative context composed of unrelated items outside the finetuning main and distractor sets. The ICL test queried a fresh ordering of novel items under a held-out cue on every trial and provided the complete set of adjacent relations specifying that ordering in the context. All pairs of queryable items were included in both tests, repeated with 10 random contexts. Two appendix figures (alternative CoT algorithms and architectures) instead report the ICL test with a cue drawn from the training cues, because the held-out-cue test degrades late in pretraining in some seeds.
Evaluation and scoring. At evaluation, the prompt ended after the context, before any CoT or answer emissions. We used greedy decoding (temperature zero) and varied the number of steps in the reasoning budget over an experiment-specific range. For convenience, was defined as the number of complete pair emissions generated by the model (four tokens each), rather than individual tokens. At , the model predicted the answer relation directly from the prompt. For , the model generated intermediate pairs, the two query-item tokens were appended, and the model's prediction was scored. Accuracy was exact agreement between the predicted and correct relation sign.
Architecture and optimization. All networks were decoder-only transformers (Vaswani et al., 2017) with four layers, eight attention heads, a residual width () of 256, and a feedforward width of 1,024 with GELU activations. Models used rotary position embeddings (Su et al., 2024), pre-layer normalization, causal scaled dot-product attention, no dropout, and no additive biases in the transformer projections. Embedding and unembedding matrices were tied (Press & Wolf, 2017). Relations were represented by a structural <rel> token and a scalar at the same sequence position . At an observed relation position, the representation entering the transformer blocks was , where denotes the learned relation-direction vector and denotes the embedding of the <rel> token. The <rel> token indicated the relation position while the sign of distinguished > from <. The same relation-direction vector was used to decode scalar relation outputs:
(2) where is the final normalized hidden state at the sequence position immediately preceding the target relation position . During CoT, when the model generated a token, its thresholded scalar output at that position ( if , if ) multiplied the relation-direction vector in its input at that token position. The model was supervised on both the correct token sequence and the correct scalars:
where is the set of token positions after the context and is the set of token positions.
Models were optimized with Adam (Kingma & Ba, 2015) (, ) using batches of 64 sequences, a constant learning rate of 0.001, zero weight decay, and gradient norms clipped at 1. Each training run used one NVIDIA RTX 3090, A5000, or A5500 GPU on Brown University's Oscar cluster.
Symbolic distance effects experiments. Each problem contained nine ordered items, of which the inner seven were queryable, giving symbolic distances . Pretraining used 100 uniformly sampled cue-defined orderings over a pool of 300 item tokens and 100,000 gradient steps. Training queries were sampled uniformly over the six possible distances, and all pretraining trials used CoT targets padded to nine pair emissions. Each pretrained model was then finetuned for 1,600 steps at a learning rate of 0.0001 on one fixed ordering of seven main items, using adjacent queries and answer-only targets. Each test condition contained all 42 ordered pairs among the seven queryable ranks, with 10 independently generated contexts per pair, for 420 trials per condition and seed. The reasoning budget was swept over . The main-text IWL curve used direct predictions (), whereas the ICL curve averaged accuracy at within seed and distance. To obtain a measure of the reasoning budget required at test time, the threshold for each seed and distance was defined to be the smallest whose accuracy was at least 90% of that seed's maximum accuracy over the full sweep. Curves show the mean and error bars the standard error across 10 independently initialized models (seeds 0-9).
Content effects experiments. For experiments on content effects, one frequent cue, , occurred on 20% of pretraining trials and deterministically selected the same global ordering. The remaining probability was divided among 99 background cues. Models received CoT supervision on 90% of trials and direct answers on 10%, and 10 models were trained for 100,000 steps with a 300-item pool. At test, queries under were accompanied by one of four contexts: an uninformative context (an IWL test), a context where the ordering was congruent with the learned ordering, a context where the ordering was reversed, and a context where the ordering was shuffled. In the shuffled condition, both queried items were interior to the ordering shown, and symbolic distance was their distance in that ordering; on exactly half of the trials at every distance (and for every ordered pair of positions), the shown order of the queried pair agreed with the learned ordering, and on the other half it conflicted. The pair's distance in the learned ordering was drawn uniformly from 1–6 (both ranks interior), independently of the distance shown, and the remaining seven items filled the other positions at random. In the IWL test condition, responses were scored relative to the learned ordering; in the other three contexts, responses were scored relative to the ordering shown in context. The main content-effects comparison used . In the congruent, reversed, and shuffled conditions, we also swept separately by symbolic distance. The reasoning steps required were computed as in the symbolic distance experiment, except that a seed had no value at a distance when its best accuracy over the sweep was not reliably above chance. A distance was marked as unreached when this held for more than half of the seeds. Each condition used all 42 ordered pairs of queryable ranks with 10 context replications per pair and seed.
Probes and interventions. We examined the internal representations of the networks from the content-effects experiments, holding during pretraining. After pretraining, linear probes (Alain & Bengio, 2016) were trained via ridge regression to predict each item's rank in the frequent ordering from the model's activity at each layer, and were evaluated on held-out items. For probes beyond the embedding layer, item activity was recorded under uninformative contexts with the frequent cue.
We then used least-squares concept erasure (LEACE) (Belrose et al., 2023) to manipulate a rank direction at every layer in networks pretrained with frequent-cue proportion .2. The direction was fit separately at each layer from the unedited network's states at every item-token occurrence in a set of 500 examples with the frequent cue and an uninformative context, plus one example for each queryable item that the 500 left unqueried. At a given site, let denote the state at occurrence , the mean state over all occurrences, and the standardized rank of its item in the frequent ordering, where and are the mean and standard deviation of ranks. We estimated the state covariance using Ledoit–Wolf shrinkage (Ledoit & Wolf, 2004), with eigenvalues floored at times the largest eigenvalue. The state-rank covariance defined a unit direction in whitened space (the rank direction):
Each item token's coordinate a along this direction could then be changed to by editing its state h:
Setting with gains , or left the rank direction intact, erased it, or inverted it, respectively. To write a new ordering, we first fit over the fit occurrences by least squares and assigned each item a new standardized rank from a random ordering with absolute Spearman rank correlation at most .2 with the frequent ordering. At write strength , we set
Matched controls replaced u at each site with a random unit vector, using the same covariance transformation and, for writing, the same target coordinates. Edits were applied at every site to every item occurrence in the query, context, generated reasoning chain, and answer positions, in every forward pass, with model weights held fixed. Within a forward pass, the sites were edited in order, so that each block read the state edited below it.
To ablate an attention head, we replaced its output with its mean output at the same position, computed over greedy rollouts of 1,024 trials drawn from the pretraining distribution. Context-reading heads were identified from attention alone, on reversed-context and ICL test trials. We took the attention from each reasoning step's positions to the relevant relations from the context, and defined a head's score to be the average attention mass on those relevant relations. The top two scoring heads were defined to be the context-reading heads, and were ablated together in each network. A control manipulation ablated two heads drawn at random from outside the network's top four heads, averaged over 20 draws. Every head in every network was also ablated on its own in a supplemental experiment (Fig. S6D). Accuracies were pooled over symbolic distances 2–6.
To test whether the two strategies compete during learning, we finetuned the ten pretrained models of the symbolic distance effects experiments again on the same fixed ordering for 1,600 steps, with two changes: the learning rate was 0.001 rather than 0.0001, and an uninformative context replaced the ordering on 1% rather than 10% of finetuning trials. 10% of trials were still replaced by pretraining trials. On every finetuning trial whose context showed the ordering, the model reasoned for eight steps. Loss was only backpropagated from subsequent answers. Trials with an uninformative context were answered directly, and replay trials were unchanged. Context-reading heads were scored on the pretrained model as above, from its chains on ICL test trials, and mean outputs were computed from greedy rollouts of 1,024 pretraining trials. The top two heads were mean-ablated on every finetuning and test trial, but not on replayed pretraining trials. Every 100 steps, the IWL and ICL tests were run with 50 contexts per ordered pair. For each model and symbolic distance, accuracy was taken at the best budget over and then pooled over distances (distances 2–6 for the ICL test). IWL accuracy was reported separately for trained (adjacent) pairs, for the nine non-adjacent pairs containing the first or last of the seven items (end item), and for the six non-adjacent pairs among the middle five items (interior). In the human study (Frank et al., 2006), the corresponding novel pairs were AE and BD of a five-item (A through E) ordering.
Data-distribution effects experiments. To vary the effective diversity of pretraining experience while holding the number of available orderings fixed, we sampled the ordering index according to a Zipf distribution (Piantadosi, 2014; Zipf, 1949) with skew : . We tested , trained 10 models per value for 100,000 gradient steps, and included CoT targets on 90% of trials. Sixteen additional cue tokens were held out and never used during training. ICL was evaluated on a novel ordering under a held-out cue; for every seed and distance, we selected the best accuracy over . IWL was evaluated at under an uninformative context; both were pooled over distances 2–6. The cue on each IWL trial was drawn from the training cue distribution.
To separate the effects of including a greater number of cues/orderings from the effects of conflicting orderings, we took the 10 models pretrained for the symbolic distance experiment and finetuned them for 1,600 answer-only gradient steps on 1–10 orderings. In the disjoint condition (“Disjoint orderings” in Fig. S10B), every ordering used a separate seven-item set under one cue. In the conflict condition (“Conflicting orderings”), 1–10 cue tokens selected different orderings of the same seven items. IWL was measured on the first finetuned ordering at and pooled over all query distances; the single ordering is common to the two definitions.
B.2 Human experiments
B.2.1 Experiment 1
Participants. We recruited 65 adults through Prolific. Eligibility was limited to US residents 18–65 years old who were fluent in English, had normal or corrected-to-normal vision, and reported no history of brain injury, dyslexia, color blindness, or cognitive impairment. Participants were paid 2.67. All participants gave informed consent under a protocol approved by the Brown University Institutional Review Board. Of the 65 participants, 13 were excluded due to incomplete data, 11 were excluded due to failed comprehension checks, and 1 was excluded for scoring below 60% accuracy in the second half of training—leaving 40 participants in the final sample. Participants in the final sample were aged 21 to 64 years (mean 35.4, SD 9.7); 26 were female and 14 male.
Stimuli and software. The task ran in a browser using jsPsych (de Leeuw et al., 2023) and was deployed with Firebase Hosting. Visual stimuli were 80 clip-art images selected from the 225-image PicturePerfect-Set (Saryazdi et al., 2018). We retained images with at least 60% clip-art name agreement, picture-name agreement of at least 4 on a five-point scale, familiarity of at least 2.5 on a five-point scale, labels no longer than 10 characters, and no more than 15 members of any semantic category. When assigning images to roles for each participant, we kept visually similar images, as measured by the similarity of their CIE-Lab color histograms, out of the same ordering. Images were cropped to remove whitespace and displayed at equal sizes. For each participant, the 80 images were pseudorandomly assigned without overlap to seven main items, 16 distractors, 45 novel-ordering items, and 12 practice items.
Display and response format. On each trial the two images in the query were displayed side by side, and participants selected an item with the F (left) or J (right) key. Below the query, “clues” were presented as a horizontal row of vertically arranged image pairs (see Fig. 2A). Within every clue, the higher-ranked image was on top and an arrow pointed toward it. The positions of clue pairs in the row were shuffled. A trial allowed up to 60 s for a response and began with a 0.5 s fixation display.
Instructions and practice. Participants were instructed that aliens were encountering earthly objects for the first time, and that they would be learning which objects the aliens preferred. Instruction was staged in three blocks. The first introduced the two-image query and feedback, followed by four comprehension questions and 10 query-only practice trials. The second introduced single adjacent-pair clues and the arrow convention, and ended with four comprehension questions and five single-step practice trials. The third introduced combining multiple clues and included a worked transitive example; it ended with four questions and five multi-step practice trials. A final four-question check followed the overview of the main experiment. Each check required 100% correct and allowed two total attempts. Failure returned the participant to the beginning of the relevant instruction block; failure on the second attempt ended the experiment. Each practice block required 70% accuracy. After an initial failed attempt, participants could complete up to two five-trial retry blocks; exhausting practice retries did not terminate the study. Instruction pages had a minimum viewing time of 5 s.
Learning phase. Participants completed 100 trials involving a single fixed ordering of seven main images. Every query compared main items of adjacent rank (); positions of the two items within the query were randomized. Two rank-consistent distractors were inserted into the ordering on each trial. Each distractor was assigned to a rank between a pair of adjacent main items or at an end of the ordering. To discourage familiarity-based heuristics, on each trial one of the non-query main items was replaced by a random distractor (while still ensuring the overall ordering remained consistent).
The number of distractors inserted between the two queried items determined the number of steps an in-context, algebraic strategy would have to perform. Across learning trials, the number of steps required by such a strategy was 0, 1, or 2 with probabilities .10, .45, and .45, respectively. Runs of the same chosen number of steps were limited to three trials.
The context displayed five to eight adjacent pairs, and always included the relations required to infer the relation between the queried items. Consecutive trials were constrained so that the same queried pair did not appear more than twice in a row. During the learning phase, participants received feedback on every trial: after an error, the incorrectly selected image was highlighted in red and participants had to wait for at least 5 s before they could continue; after a correct response, the selected image was highlighted in green for at least 0.5 s. A break was offered after every 20 learning trials. Exactly 10 of the 100 learning trials were randomly selected for an IWL-style display. On those trials the query and feedback were unchanged, but the items in context were covered by gray boxes. These trials were meant to familiarize participants with the masked test display.
Test phase. The test phase consisted of three 40-trial blocks: IWL, ICL, and arbitrage. The order of the ICL and IWL test blocks was counterbalanced; the arbitrage block always occurred last. Each block contained the same set of 40 query pairs: all 21 possible pairs, plus 19 repeated pairs chosen to approximately balance symbolic distances 1–6. No feedback was given during testing. Instead, the selected image was highlighted in gray and participants had to wait for 1 s before they could continue.
The ICL block used five mutually disjoint novel seven-item orderings. Each ordering was augmented by two distractors that were assigned to the endpoints; the complete nine-item adjacent chain was displayed on every trial. The same ordering was prevented from appearing on consecutive trials. The IWL block queried the seven trained images, but the items in context were covered by gray boxes. The arbitrage block also queried trained images, but the relations in context were reversed, introducing conflict between the context and prior knowledge, and between the IWL and ICL strategies. A 10-item post-task questionnaire asked about strategy, difficulty, reliance on clues versus memory, and display comprehension.
Statistical analysis. All statistical analyses were implemented in R. Random effects were chosen from a fixed sequence in order of most complex to simplest. We report the first model that was fit without warnings, errors, or singular fits.
Accuracy. Accuracy was analyzed with binomial generalized linear mixed-effects models using a logit link. All 1,600 ICL and 1,600 IWL trials were included, with timeouts contributing incorrect responses. Separate models for ICL and IWL included symbolic distance as a fixed effect and participant-specific random intercepts and distance slopes: is_correct ~ symbolic_distance + (1 + symbolic_distance | participant). A combined model tested the difference between the two distance effects using fixed effects of symbolic distance, test (phase), and their interaction, together with the corresponding participant-specific random effects: is_correct ~ symbolic_distance * phase + (1 + symbolic_distance * phase | participant). The logistic models were fit by maximum likelihood with lme4::glmer (Bates et al., 2015) using the bobyqa optimizer and a maximum of 200,000 function evaluations.
Response times. Response-time analyses were restricted to correct, non-timeout ICL and IWL trials, yielding 1,252 ICL trials and 1,226 IWL trials before outlier removal. Response times in milliseconds were transformed with the natural logarithm. Within each participant and test, trials with an absolute z score greater than 3 in log response time were removed; the grouping means and sample standard deviations were computed separately for every participant-test combination. This procedure removed one ICL and three IWL trials, leaving 1,251 ICL and 1,223 IWL trials (2,474 total) for analysis. Separate linear mixed-effects models for ICL and IWL included symbolic distance as a fixed effect and participant-specific random intercepts and distance slopes: log_rt ~ symbolic_distance + (1 + symbolic_distance | participant). A combined model tested the distance-by-test interaction with the corresponding participant-specific random effects: log_rt ~ symbolic_distance * phase + (1 + symbolic_distance * phase || participant). The response-time models were fit by restricted maximum likelihood with lmerTest::lmer (Kuznetsova et al., 2017), again using bobyqa with a maximum of 200,000 function evaluations.
B.2.2 Experiment 2
Participants. We recruited 132 adults through Prolific. Eligibility was limited to US residents 18–65 years old who were fluent in English, had normal or corrected-to-normal vision, and reported no history of brain injury, dyslexia, color blindness, or cognitive impairment; anyone who had taken part in Experiment 1 or in pilot versions of this experiment was excluded. Participants were paid 3.56. All participants gave informed consent under a protocol approved by the Brown University Institutional Review Board. Participants were assigned to the congruent or shuffled condition from a pre-generated list of randomly ordered pairs of the two conditions. Data were collected in two waves. In the first wave (50 participant slots), each participant took the next entry of the list. Because more shuffled than congruent participants quit or answered at chance in the first wave, the second wave recruited more to the shuffled condition, to reach about 50 retained participants per condition. Of the 132 participants, 14 did not finish (2 congruent, 12 shuffled). Of those who finished, we excluded participants whose answers beat chance (one-sided binomial test, p < .05) neither with respect to the in-context statements order nor with respect to real-world order (1 congruent, 17 shuffled). This rule removes random responders but keeps participants who answered from real-world knowledge alone, who score 50% against the statements in the shuffled condition. We also excluded participants who pressed the same key on at least 80% of questions (2, both also at chance) or answered at least 25% of questions in under 0.5 s (1 shuffled). The final sample comprised 49 congruent and 50 shuffled participants. Participants in the final sample were aged 21 to 64 years (mean 40.9, SD 10.6); 50 were female and 48 male, and sex was not available for 1. One participant in the shuffled condition reloaded the page mid-experiment; only their second, complete session was analyzed. To ensure that our results were not due to a bias in participant exclusions, we reran the main analyses without the exclusion for answering at chance, and the condition effects remained significant (Appendix C.2.2).
Stimuli and software. The task ran in a browser in full-screen mode on a desktop or laptop computer, using jsPsych 8.2.3 (de Leeuw et al., 2023), and was deployed with Firebase Hosting. Questions always asked which of two animals weighed more, according to the statements. Thirty-three animals were grouped into nine weight classes of three to five animals, by median body mass across three databases (typical adult mass for the six insects), so that every animal in one class was clearly lighter than every animal in the next. Each question used one animal from each class, so the nine animals' order by weight was unambiguous. Within a participant, no pair of animals was queried twice.
Display and response format. Each question showed, from top to bottom, the question "According to the statements, which is heavier?", the two answer choices, and eight statements, one per line, of the form "The horse is heavier than the dog." The statements specified an ordering of all nine animals but were listed in a scrambled order. Participants pressed F for the left answer or J for the right, with up to 50 s per question and no visible countdown. After an answer, the chosen answer was outlined and "You chose (answer)." appeared, without feedback about whether the chosen answer was correct. After at least 0.8 s, participants pressed the space bar to continue, and a 0.5 s blank screen preceded the next question.
Instructions. The same minimal instructions were used in both conditions. Participants had to spend a minimum of 4 s per instruction screen before they could move on. Instructions stated that "Your goal is to answer according to the given statements," described the keys and the 50 s limit, asked participants to answer as quickly and accurately as possible, explained that bonuses would depend on both speed and accuracy, and stated that feedback would show the chosen answer but not whether it was correct. There were no practice problems or comprehension checks.
Design. Each participant answered 48 questions in four blocks of 12, with a break after each of the first three blocks. The two animals at the ends of each ordering were never queried, giving symbolic distances , with two questions per distance in each block. Questions were ordered so that no more than four consecutive questions had the correct answer on the same side and no more than two shared a distance. In the shuffled condition, each question used its own reordering of the nine animals. Real-world distances were paired with shown distances so that the two distances were nearly uncorrelated. At every shown distance and every real-world distance the queried relation agreed with the real-world order on exactly half of the questions. Each reordering was drawn uniformly from those that placed the required animals at the queried positions. On each question, three to five of the eight statements agreed with real-world order.
Questionnaire. After the questions, participants answered an optional questionnaire: how they had found their answers (free text); how many of the statements had been true of the real world; how often they had answered from real-world knowledge instead of the statements; whether they had written anything down; the difficulty of the questions; and any technical or other problems. A debrief explained that some statements may have been false on purpose.
Statistical analysis. All statistical analyses were implemented in R. Every model had fixed effects of condition, log symbolic distance (, centered), their interaction, and trial number (per 10 questions, centered). Random effects were chosen from a fixed sequence of models from most complex to simplest. For each analysis, we report the first model that converged without warnings, errors, or singular fits. Models were fit with lme4 using the bobyqa optimizer with up to 200,000 function evaluations, and distance slopes within each condition were estimated from the fitted models with emmeans.
Accuracy. Accuracy (agreement with the statements' ordering) was analyzed with a binomial generalized linear mixed-effects model with a logit link, fit by maximum likelihood, on all 4,752 questions of the retained participants, with timeouts (1 congruent, 19 shuffled) counted as incorrect: is_correct ~ condition * log_distance + trial + (1 + log_distance | participant).
Response times. Response-time analyses were restricted to correct, non-timeout answers (4,010). Response times were natural-log transformed, and answers more than three standard deviations from the participant's mean log response time were removed (22; 0.55%), leaving 3,988. The linear mixed-effects model log_rt ~ condition * log_distance + trial + (1 + log_distance | participant) was fit by restricted maximum likelihood with lmerTest (Kuznetsova et al., 2017).
B.3 Large language models
Models. We evaluated 22 open-weight LLMs ranging from 1B to 70B parameters. Ten were reasoning models, trained to generate a chain of thought before answering: Qwen3 (1.7B, 4B, 8B, 14B, and 32B; A. Yang et al., 2025), DeepSeek-R1-Distill (Llama-8B, Qwen-14B, and Qwen-32B; Guo et al., 2025), Phi-4-reasoning (Abdin et al., 2025), and gpt-oss-20b (OpenAI et al., 2025). The other 12 were instruction-tuned models that reasoned only when prompted to: Qwen2.5-Instruct (7B and 32B; Qwen et al., 2024), Llama-3.1-Instruct (8B and 70B) and Llama-3.2-Instruct (1B and 3B; Grattafori et al., 2024), Gemma-2-9B-it (Gemma Team et al., 2024), GLM-4-0414 (9B and 32B; Team GLM et al., 2024), Mistral-7B-Instruct-v0.3 (Jiang et al., 2023), and OLMo-2-Instruct (7B and 32B; Team OLMo et al., 2025). Qwen3-32B, shown as an example in the main text, can switch its thinking on or off through its chat template, so its answers with and without a chain of thought came from the same weights and prompt. All models were run in bfloat16 (gpt-oss-20b dequantized from its released MXFP4 weights) using the transformers library (Wolf et al., 2020) on NVIDIA RTX PRO 6000 Blackwell Max-Q GPUs on Brown University's Oscar cluster.
Task and prompts. As in the transformers trained from scratch and in the humans, each problem used a single ordering and premises with adjacent pairs of items. Orderings included 11 items total, but only the inner seven items were queried, giving symbolic distances . Orderings of 11 rather than 9 were used because we found that some LLMs exhibited strong edge effects, performing better in context on pairs that had at least one item close to the edge of the ordering. Prompts were formatted according to each model's specific template. A short system instruction described the meaning of the relations (e.g., "is taller"), and the 10 adjacent relations were listed in the user turn in scrambled order, followed by the query. An example Qwen3-32B ICL test prompt is shown below:
<|im_start|>system
In the following question, > means "is taller" and < means "is shorter".
Answer whether the statement is true or false.<|im_end|>
<|im_start|>user
Bob > Mike
Sue > Joe
Tom > Dan
Amy > Sue
Joe > Mary
Anna > John
Dan > Lisa
Mike > Tom
Lisa > Anna
Mary > Bob
Is it true or false that Bob > Mary?<|im_end|>
<|im_start|>assistant
<think>
</think>
The query always used >, so whether the queried statement was true depended on the order of the two items. Every pair was asked once as a true and once as a false statement, so a model that always gave the same answer scored exactly .5. The instruction specified the relation of each real-world dimension: "has a larger population" for country, US state, and city population; "is heavier" for animal body mass; "has a larger area" for country surface area; and "is taller" for the given names, with the opposite relation for <. For Gemma-2 and Phi-4-reasoning, the instruction was placed in the user turn, and the date that Llama-3 chat templates insert was fixed to the template default. The prompt format was chosen to maximize overall direct ICL test accuracy in a preliminary sweep over 54 prompts, which crossed six relation templates (from A > B to natural-language phrasings) with different item sets, instruction preambles, separators, and ways of writing the relations.
Familiar and novel items. The IWL test and the content-effects experiments used familiar items from five real-world dimensions: country population, US state population, city population, animal body mass, and country surface area (Table S1). Values were taken from one source per dimension: the Wikipedia list of countries by population, the US Census Bureau's 2024 population estimates, Demographia's World Urban Areas (2025), the PanTHERIA database of adult body mass, and the World Bank's surface-area indicator. Items were spaced to place queries at near chance and at near ceiling, based on a pilot in which Qwen3-32B was queried without context or reasoning on items spanning a wide range of values. We describe the spacing of an item set by the ratio between the values of items six ranks apart: this ratio was 17.8 for country population, animal body mass, and country surface area and 5.6 for US state population, and city populations were evenly spaced. Countries and cities with few English Wikipedia page views were excluded, as were ambiguous names. Additional item sets with the same spacing but disjoint items were used to replicate the IWL test (Table S1), and one further disjoint set per dimension supplied the uninformative context. To vary prior strength (Fig. 3K), we also built 19 item sets with other spacings, in which items six ranks apart differed in value by factors from 2 to 56.2. The ICL test used novel items with no known ordering: 11 common English given names (John, Mary, Tom, Sue, Bob, Anna, Mike, Lisa, Joe, Amy, and Dan) assigned to heights at random in each problem and, in a second framing, 11 invented city names ordered by population (Ostrelia, Kavendale, Morvath, Tessalin, Brunmark, Halvora, Quillsby, Zendria, Pelmont, Corvane, and Ilbrook), which used the same instruction as country population.
Table S1: Main LLM item sets. Items are listed from smallest (rank 1) to largest (rank 11); the two endpoints were never queried. Spacing gives the target ratio between adjacent items; replicate sets are the additional disjoint item sets, with the same spacing, used to replicate the IWL test.
| Rank | Country population | US state population | City population | Animal body mass | Country surface area |
|---|---|---|---|---|---|
| 1 | Jamaica | New Mexico | Vienna | wolf | Tajikistan |
| 2 | Panama | Kansas | Milan | cheetah | Romania |
| 3 | Singapore | Oklahoma | Chicago | jaguar | Japan |
| 4 | Belgium | Alabama | Chennai | gorilla | Kenya |
| 5 | Netherlands | Indiana | Ho Chi Minh City | elk | Tanzania |
| 6 | Ukraine | New Jersey | Mexico City | zebra | Mongolia |
| 7 | Spain | Illinois | Kolkata | buffalo | Algeria |
| 8 | Germany | New York | Beijing | giraffe | India |
| 9 | Mexico | Florida | Mumbai | hippopotamus | Australia |
| 10 | Brazil | Texas | Delhi | rhinoceros | United States |
| 11 | United States | California | Jakarta | elephant | Russia |
| Spacing | ×1.62 | ×1.33 | even | ×1.62 | ×1.62 |
| Replicate sets | 2 | 2 | 0 | 1 | 2 |
IWL and ICL tests. The IWL test queried familiar items with no relations shown, so that only knowledge stored in the weights could be used to answer. A query without context has only one possible prompt, so the IWL test was repeated on each of a dimension's item sets (42 trials per set at ). The single-model panels and Fig. 2O pooled all item sets of a dimension, and Fig. 2M and Figs. S23–S26 used the first two sets of each dimension. The ICL test showed all 10 adjacent relations among novel items. Because LLMs are sensitive to the order in which premises are presented (Chen et al., 2024), each ICL distance was run with 10 random premise orders, each with its own random ordering, for 420 trials at
. The single-model panels show the given names, and the cross-model panels average the two novel framings.
Content effects experiments. For each dimension, the main item set was queried with all 10 adjacent relations shown, either congruent with the real-world ordering, reversed relative to it, or shuffled (Geerts et al., 2025; A. Liu et al., 2025), and answers were scored against the ordering shown. Each shuffled problem assigned the 11 items to ranks at random (one assignment per distance and premise order, shared by all models), and symbolic distance was measured in the ordering shown. In the uninformative condition, the context showed 10 true relations among 11 other items of the same dimension (written with > or < at random). In all four context conditions, the instruction was extended by the sentence “Base your answer only on the comparisons given — not on outside knowledge.” As in the ICL test, each problem was repeated with 10 random premise orders.
Reasoning and scoring. Without reasoning, the answer was read from a single forward pass. For reasoning models, the thinking block was closed before the answer: Qwen3’s chat template left it empty, an empty block was inserted for the DeepSeek-R1-Distill models and Phi-4-reasoning, and gpt-oss-20b was moved directly to its final-answer channel. With reasoning, reasoning models generated their own chain of thought, and instruction-tuned models were prompted by appending “Let’s think step by step.” to the query (Kojima et al., 2022). We used greedy decoding (temperature zero) and varied the reasoning budget , the maximum number of generated tokens, over , where is a direct answer. For each trial, one chain was generated up to 1,024 tokens, and each smaller budget used its first tokens, which is the chain that greedy decoding would produce with that budget. The chain was followed by the cue “Therefore the answer is:”, and the answer was scored as without reasoning; this resembles budget forcing (Muennighoff et al., 2025), except that the thinking block was not closed. The prediction was whichever of True and False had the higher total probability at the answer position, summing over capitalized and lowercase forms with and without a leading space. Accuracy was agreement between the prediction and the queried statement’s truth under the reference ordering: the real-world ordering in the no-context and uninformative conditions, and the ordering shown in context otherwise. Every trial yielded an answer, and no trials were excluded.
Analysis. Accuracy at each symbolic distance was the proportion of correct trials, shown with 68% Wilson intervals. As in the transformer experiments, the reasoning budget required at each distance was the smallest budget whose accuracy reached 90% of the maximum over budgets. A distance whose maximum accuracy was not reliably above chance had no required budget, and uncertainty in the required budget was the standard deviation over 1,000 bootstrap resamples of trials.
The cross-model panels summarized each model with a few numbers. In Fig. 2M, the distance effect was the least-squares slope of accuracy on distance, averaged over the five dimensions for the IWL test and over the two novel framings for the ICL test. In Fig. 2O, each model was placed by the difference between its mean required budgets on the ICL and IWL tests and by the slope of its required ICL budget on distance; ICL values were averaged over the two framings and IWL values over the dimensions with a required budget at three or more distances, and models without such a budget on either ICL framing were omitted. In Fig. 3K, each point was one model and item set, and the relation between no-context and reversed-context accuracy was summarized by Spearman’s rank correlation. In Fig. 3M, each point was one model and dimension; the content effect was congruent minus reversed accuracy averaged over distances and budgets, and recovery was the least-squares slope of reversed-context accuracy on budget (per 1,000 tokens). Figures 2M and 3K excluded the four models whose no-context accuracy, pooled over the first two item sets of every dimension (378 trials), was not above chance (one-sided binomial test, ): Llama-3.2-1B, Llama-3.2-3B, Phi-4-reasoning, and Qwen3-1.7B.
Interventions. The interventions in Figs. 4C and S44 were run on Qwen3-32B for three dimensions: country, city, and US state population. They were scored on the IWL test and reversed-context trials with direct answers, and on reversed-context trials and the ICL test (given names) after a reasoning budget of 1,024 tokens. Accuracies were pooled over symbolic distances 2–6 (90 trials per bar: three of the 10 premise orders with context, or three item sets on the IWL test, two for cities), and error bars show the binomial standard error over trials. A rank direction was fit at every hidden state (the token embeddings and the output of each of the 64 blocks) with the same closed form as for the transformers, from the unedited model's representations at the last subtoken of every mention of the dimension's familiar items (123 countries and 48 cities with at least 1.2 million annual English Wikipedia page views, and all 50 US states). Edits were applied at the last subtoken of every item mention, at every hidden state, in the prompt, the reasoning chain, and the answer pass. Writes toward another ordering followed the same procedure as for the transformers; answers after reasoning were collected only at write strengths 0 and 1. Attention heads were scored on the 252 reasoning trials of the reversed context and the ICL test, by the attention mass from the tokens of every composed inference in the chain (a relation between items at least two ranks apart) onto the context relations mentioning either item. The 32 highest-scoring of the model's 4,096 heads were ablated together by replacing each head's output with its mean output over all positions, and the control ablated 32 heads drawn at random from outside the top 64. These procedures differed from the transformers' in four respects. More heads were ablated (32 of 4,096 rather than 2 of 32), because ablating 16 heads impaired reasoning only for US states. Each head had one mean output rather than one per position, because positions do not align across trials, whereas the transformers were sensitive to position because every sequence length was always exactly the same for them. A single random set of heads was drawn, because each draw requires regenerating every reasoning chain. Only composed inferences were scored, whereas every reasoning step of the transformers restates one relation given in context and was scored. The city population items in these runs were spaced by a constant ratio rather than evenly, unlike the cities in the other LLM experiments.
C Extended results
Below we report additional results from transformers trained from scratch, human experiments, and LLMs.
C.1 Transformers trained from scratch
Additional symbolic-distance results. To provide a fuller view of the symbolic-distance results in Fig. 2, we examined the same networks' performance on individual item pairs, and with different numbers of reasoning steps (Fig. S1). On the IWL test (Fig. S1A), the directly trained adjacent pairs showed a strong memorization effect and some terminal-item effects (Jensen et al., 2015; Lippl et al., 2024). On the ICL test (Fig. S1B), adjacent ICL queries were also answered highly accurately, and did not require intermediate reasoning. For non-adjacent ICL queries, the full sweep over reasoning steps showed that increasingly distant pairs required more reasoning steps (Fig. S1C).
With one or more reasoning steps, the same pattern appeared in a baseline test, which queried the same finetuned items as the IWL test but with an informative context (Fig. S1D). We also used an arbitrage test (Geerts et al., 2025; Pesnot Lerousseau & Summerfield, 2026) in which the same finetuned items appeared with relations given in context that were reversed with respect to what was learned during finetuning, placing the IWL and ICL-CoT strategies in conflict (similar to the reversed condition in the content-effects experiments). As expected, without reasoning, responses primarily followed the finetuned (IWL) ordering, whereas additional reasoning shifted responses toward the (ICL) ordering shown in context, though not completely (Fig. S1E).
Alternative chain-of-thought algorithms. In the main experiments, models' CoTs were supervised on one particular reasoning algorithm (Alg. 3). Here, we asked whether the reverse SDE depended on

Figure S1: Additional symbolic-distance results. (A) IWL test accuracy for each pair of finetuned items with no reasoning steps, grouped by symbolic distance; A–G denote ranks in the learned ordering. (B) ICL test accuracy for each pair of ranks in a novel ordering shown in context, with one line per reasoning-step budget. (C) The same ICL test as a function of reasoning steps, with one line per symbolic distance. (D) Baseline test accuracy for finetuned items accompanied by a context that was congruent with the learned ordering. (E) Proportions of arbitrage responses consistent with the finetuned ordering or the reversed ordering shown in context, pooled over distances 2–6. Lines and bars show means across 10 seeds; bands and error bars show SE; faint dots show individual seeds where plotted; dashed lines indicate chance.
the choice of algorithm for generating CoTs. Using the same pretraining task with a 300-item pool and no finetuning, we trained 40 models with four different algorithms: the main algorithm (Alg. 3) emitted pairs given in context, starting from the first query item and following the relations; inferred relations instead emitted the cumulative inferred relation between that starting query item and the item reached so far; descend first began the walk toward lower-ranked items rather than along the first context pair containing the starting query item; and backtrack at dead ends restarted from the queried item in the opposite direction after reaching an endpoint.
Three of the four algorithms reproduced the main result: more distant comparisons required more reasoning steps (Fig. S2). The inferred-relations algorithm instead reversed this pattern, with larger-distance problems reaching criterion in slightly fewer steps. This suggests that models trained to produce inferred relations may learn a shortcut that allows them to infer larger-distance relations before shorter-distance ones.

Figure S2: Alternative chain-of-thought algorithms. (A–D) ICL test accuracy as a function of reasoning steps after 100,000 pretraining steps for the main, inferred-relations, descend-first, and backtrack-at-dead-ends algorithms, respectively. (E) The smallest number of reasoning steps required to reach 90% of each seed's maximum accuracy, by distance and algorithm. Lines show means across 10 seeds and bands show ±1 SE; dashed lines indicate chance.
Architecture robustness. To test whether the main CoT results depended on architecture or learning rate, we pretrained 10 initializations for each of 24 combinations of number of layers, residual width (; feedforward width ), inclusion of feedforward blocks, and learning rate. Every architecture that reached a low training loss showed the same pattern, where more reasoning steps were required for larger distances (Fig. S3). The only exceptions were two-layer networks that did not learn the task as well.
Replay prevents catastrophic forgetting. In the main symbolic-distance experiment, fresh pretraining trials replaced 10% of finetuning examples to prevent the well-known problem of catastrophic forgetting (Kirkpatrick et al., 2017; McCloskey & Cohen, 1989) of the ICL-CoT strategy acquired during pretraining. Here we demonstrate that this replay mechanism prevented catastrophic forgetting (Fig. S4). Starting from the same 10 pretrained checkpoints, we crossed replay proportions with finetuning learning rates , and and evaluated performance every 200 gradient steps.
Without replay, the larger learning rates rapidly established good IWL performance, but degraded ICL performance via catastrophic forgetting. Even modest replay preserved the ICL-CoT strategy while allowing substantial IWL. These results are consistent with prior work on replay (Robins, 1995) and complementary learning systems (Kumaran et al., 2016; McClelland et al., 1995; Russin et al., 2021) in neural networks and in humans.
Content effects across pretraining distributions. The content-effects results reported in the main text were obtained using a frequent-cue proportion of .2 and a CoT proportion of . To gain a more comprehensive understanding of the conditions under which these effects occur, we repeated

Figure S3: Architecture and learning-rate sweep. Each panel shows ICL test accuracy against reasoning steps for one of the 24 architectures after 100,000 pretraining steps; the printed loss is the mean training loss over the last 5,000 steps. Lines and bands show mean ±1 SE across 10 seeds; dashed lines indicate chance.

Figure S4: Replay during finetuning. Columns show different finetuning learning rates and colors show different levels of replay. The top row reports ICL test accuracy (best over reasoning steps); the bottom row reports direct IWL test accuracy with no reasoning steps. Accuracy is averaged over symbolic distances 2–6. Lines and bands show mean ±1 SE across 10 checkpoints; dashed horizontal lines indicate chance.
that design across frequent-cue proportions .01, .05, .1, .2, .5, .8, and 1 and values .5, .9, and .99 (Fig. S5). Results showed that as the frequent ordering became more prevalent, the effect of prior experience strengthened, driving behavior in incongruent conditions without reasoning. Greater CoT supervision during training generally improved the ability of the model to recover good performance on incongruent trials with reasoning, but simultaneously reduced the model's performance when the context was uninformative at lower frequent-cue proportions (Fig. S5A, red lines). This suggests a tradeoff where flexible reasoning can prevent learning information that would otherwise be easy to memorize. However, when the ordering was used on every pretraining trial (Fig. S5B, rightmost column), the model did not develop a flexible reasoning strategy that could overcome the prior when the context was incongruent, even when CoT supervision was high. Thus, sufficient CoT supervision allowed the model to overcome interference on incongruent trials, but sufficient diversity in the training distribution was required for reasoning to remain flexible.
Additional mechanism results. To supplement the results shown in Fig. 4B, we performed additional experiments investigating the mechanisms underlying each strategy in the transformers trained from scratch (Fig. S6; procedures in Appendix B.1). Figure S6A shows accuracy of linear decoders (probe accuracy) trained on representations from each layer, including the models' embeddings, in transformers trained with different frequent-cue proportions (i.e., the proportion of trials on which the most frequent cue and corresponding ordering were used). As expected, as the frequent cue became more prevalent, the learned ranks became more decodable from the model's item embeddings and activations in all layers.
In the main text (Fig. 4), we report results for erasing the rank direction, pooled over distances 2–6. Figure S6B shows results across symbolic distances, for erasing but also inverting the rank direction. As expected, erasing the rank direction reduced IWL performance at every distance, and removed the corresponding SDE (Fig. S6B, green). Inverting the rank direction drove responses below chance and

Figure S5: Content effects across pretraining distributions. Columns vary the proportion of pretraining trials using the frequent cue , and rows vary the probability of CoT supervision, . (A) Direct accuracy by symbolic distance in the IWL test and under congruent, reversed, or shuffled contexts. (B) Reversed accuracy as a function of reasoning steps, with one line per non-adjacent symbolic distance. (C) Number of reasoning steps required to reach 90% of maximum accuracy, by symbolic distance, under congruent, reversed, and shuffled contexts. Crosses above the axis mark distances at which most seeds never rose above chance. Lines and bands show mean 1 SE across 10 seeds; dashed lines indicate chance.
reversed the distance effect (Fig. S6B, pink). We also experimented with writing a random unrelated ordering along the rank direction (Fig. S6C). Doing so increasingly shifted direct answers toward that specific unrelated ordering, whereas agreement after eight reasoning steps remained near chance. These results are consistent with the hypothesis that the model employs a geometric strategy that uses learned ranks encoded in representational geometry when possible, but is also capable of using an algebraic strategy that is relatively independent of the rank direction.


Figure S6: Additional mechanism results. (A) Pairwise ordering accuracy of linear rank probes evaluated on held-out items, by layer and the frequent-cue proportion used during training (p(CoT) fixed at .9). (B) Direct IWL accuracy at distances 2–6 when the rank direction is intact, erased, or inverted, or a matched random direction is erased. (C) Agreement with a random unrelated ordering written along the rank direction on reversed-context trials, with zero or eight reasoning steps. Write strength ranges from untouched (0) to full replacement (1); the control bars show full-strength writes along a random direction. (D) Change in IWL-test accuracy (zero reasoning steps) and ICL-test accuracy (eight reasoning steps) when each attention head is ablated alone, for every head of every network, shaded by layer; each network's two context-reading heads are outlined. Lines and bars show means across 10 seeds; bands and error bars show SE; dots show individual seeds; dashed lines indicate chance (in D, no change).
The main text reports the result of ablating the top two context-reading heads (Fig. 4B). Figure S6D shows the change in IWL (zero reasoning steps), and ICL (eight reasoning steps) test performance after ablating every head in the network individually. Many attention heads reduced ICL test accuracy with little effect on IWL accuracy, including many of the context-reading heads (shown in purple), as shown by the density of points clustered around the vertical 0 line (no change in IWL accuracy). Many heads did not affect either, and only some reduced IWL accuracy without ICL accuracy, or reduced both. These results are consistent with the idea that the geometric strategy operates mostly via encodings of rank in representational geometry (and therefore does not depend as much on actions of specific attention heads), while the algebraic strategy is largely independent of representational geometry and is instead supported by specific attention heads that control the model's dynamic reasoning process.
In the main text (Fig. 4E), we report the effect of ablating the context-reading heads while networks reasoned during finetuning. Figure S7 shows results for networks finetuned without reasoning and for networks that reasoned while two random heads were ablated, drawn once per network from outside its top four heads. Reasoning during finetuning reduced IWL test accuracy on non-adjacent pairs relative to finetuning without reasoning (lower in 9 of 10 networks on both end-item and interior pairs; Fig. S7A). Surprisingly, ablating random heads in the models from the SDE experiments impaired performance on the ICL test about as much as ablating the context-reading heads, suggesting that the mechanism underlying reasoning in these models was more distributed across heads than in the content-effects models (Fig. S6D). Ablating these heads also increased accuracy on interior pairs, though less than context-reading heads: ablating the context-reading heads gave higher accuracy than ablating random heads on end-item pairs in 8 of 10 networks and on interior pairs in 7 of 10. The advantage of ablating the context-reading heads appeared within the first 100 steps and persisted throughout finetuning (Fig. S7B).
The learning rate (0.001) and proportion of uninformative trials (1%) in this experiment differ from those used elsewhere in the paper; they were chosen after inspecting three networks (seeds 0–2) in an exploratory version of the grid in Fig. S8. In the seven networks not used for this choice (seeds 3–9), ablating the context-reading heads lowered ICL test accuracy in all seven and raised accuracy on end-item and interior pairs in six of seven each. Across the grid (three seeds per setting), ablating the context-reading heads lowered ICL test accuracy at all 12 settings and raised IWL test accuracy at most of them (trained pairs 11, end-item pairs 11, interior pairs 10), including the setting used elsewhere in the paper (learning rate 0.0001, 10% uninformative trials). In contrast, reasoning without ablation did not consistently lower IWL test accuracy relative to finetuning without reasoning across settings.

No reasoning Reasoning Reasoning, context-reading heads ablated Reasoning, random heads ablated
Figure S7: Ablating context-reading heads during finetuning. (A) Accuracy on the ICL test and on the IWL test for networks finetuned with or without reasoning, and with reasoning but ablating two context-reading heads or two random heads. IWL accuracy is split by trained pairs, non-adjacent pairs with an end item, and interior non-adjacent pairs. Ablated networks were tested with the same heads ablated. (B) The same measures over finetuning. Accuracy is the best of 0–8 reasoning steps at test; the ICL test pools distances 2–6. Bars and lines show means across 10 seeds; bands and error bars show SE; dots show individual seeds; dashed lines indicate chance.

Figure S8: Ablation during finetuning across learning rates and proportions of uninformative context trials. As in Fig. S7A, accuracy for each learning rate (rows) and proportion of finetuning trials with an uninformative context (columns). Bars show means across 3 seeds; error bars show 1 SE; dashed lines indicate chance.
Additional data-distribution manipulations. In the main skew experiment, IWL performance emerged within the first evaluations when a few orderings dominated pretraining, whereas ICL performance emerged later, and more slowly the more skewed the distribution (Fig. S9).

Figure S9: Learning over pretraining by skew. (A, B) Test performance varied with data diversity. IWL generalization performance emerges rapidly with high skew (high ), while ICL-CoT generalization emerges when orderings are more diverse (low ). Lines and bands show mean 1 SE across 10 seeds; dashed lines indicate chance.
We tested the main data-distribution effect in two additional ways (Fig. S10). First, rather than changing the skew over a fixed set of orderings, we pretrained 10 models for 100,000 gradient steps on 1, 2, 5, 10, 100, or 1,000 equally frequent orderings over a 300-item pool. ICL was measured using a held-out cue and by taking the maximum over reasoning steps. As expected, increasing the number of orderings shifted performance from IWL to ICL.
Second, we finetuned 10 pretrained models for 1,600 gradient steps on 1–10 orderings over either the same items (conflict) or disjoint sets of items (no conflict). Conflicting orderings degraded IWL performance faster than equally numerous disjoint orderings, suggesting that incompatible orderings among the same set of items affect IWL more than the raw number of orderings alone.


Figure S10: Additional data-distribution manipulations. (A) Final ICL and IWL test accuracy after pretraining on different numbers of equally frequent orderings; ICL accuracy is the best over different numbers of reasoning steps, and IWL uses no reasoning steps. Both are averaged over distances 2–6. (B) Direct IWL test accuracy after finetuning on different numbers of conflicting orderings over shared items vs orderings over disjoint sets of items. The point at one ordering is shared by both lines. Lines and bands show mean 1 SE across 10 seeds; dashed lines indicate chance.
Chain-of-thought improves sample efficiency. The main results show how a step-by-step algebraic strategy can decompose unfamiliar multi-step problems into familiar single-step operations (Li et al., 2024; Merrill & Sabharwal, 2024; Prystawski et al., 2023; Russin, Kim, et al., 2025; Wies et al., 2023). Here, we ask whether this CoT strategy results in greater overall sample efficiency than memorizing all orderings independently (IWL) or acquiring a generalizable direct ICL strategy that can be accomplished in a single forward pass (Brinkmann et al., 2024; Garg et al., 2022; Geerts et al., 2025). Using the pretraining setup described in Appendix B, we varied from 0 to 1 in increments of .1, evaluated ICL at initialization and every 2,500 gradient steps for 100,000 total gradient steps, and averaged over 10 seeds. Because the IWL strategy and direct ICL strategy do not require intermediate reasoning steps, we took the maximum accuracy over all reasoning steps for each model and each seed.
At higher proportions of CoT trials during training, the model generalized to the ICL test in fewer training steps (Fig. S11), consistent with the hypothesis that reasoning during training can improve sample efficiency (Lee et al., 2024; Prystawski et al., 2023; Wies et al., 2023). Unsurprisingly, these models also showed a larger “reasoning gap” (Prystawski et al., 2023), as measured by the difference between performance with and without additional reasoning steps at test time. Previous work has shown that it is possible for transformers to learn to implement an ICL strategy in a single forward pass (Geerts et al., 2025), but in our setup, models trained at a very low proportion of CoT trials did not train as well.


Figure S11: Chain-of-thought supervision improves sample efficiency. (A) ICL test learning curves for values , scored at the best reasoning budget within seed and distance. (B) The corresponding reasoning gap, computed within seed and training step as best-over-budget accuracy minus accuracy with no reasoning steps. Both panels average distances 2–6. Lines and bands show mean 1 SE across 10 seeds; dashed lines indicate chance in A and zero gain in B.
Learning without an explicit cue. To bring our setup closer to prior studies (S. C. Y. Chan, Santoro, et al., 2022; Pesnot Lerousseau & Summerfield, 2026), we repeated the ordering-frequency and content-effects experiments with the same token in the cue position on every training and test trial. All other procedures were unchanged. The data-distribution effects were similar, although without the cue, IWL performance was lower at intermediate levels of skew and ICL performance remained high over a broader range (Fig. S12A,B). Content effects were also broadly similar, with weaker direct IWL performance and less interference on reversed-context trials (Fig. S12C,D).

Figure S12: Experiments without an explicit cue. (A, B) IWL- and ICL-test accuracy against ordering-frequency skew, with and without the cue, at . The dotted line in A is the IWL test accuracy of answering each pair by the frequency-weighted majority of the training orderings. (C) Direct accuracy by symbolic distance under four contexts, without the cue, at frequent-ordering proportion .2 and . (D) Congruent-and reversed-context accuracy at the same settings, taking the best accuracy up to each number of reasoning steps within seed and distance; darker lines indicate larger distances. Lines and bands show mean SE across 10 seeds; faint dots show individual seeds; dashed horizontal lines indicate chance.
C.2 Human experiments
C.2.1 Experiment 1
These analyses extend the main results from Experiment 1 (Fig. 2J,K).
Statistical tables. Tables S2–S7 show the statistical tests reported in the main text.
Table S2: Experiment 1: IWL test accuracy (log-odds).
| Effect | Estimate | SE | 95% CI | z | p |
|---|---|---|---|---|---|
| Fixed effects | |||||
| Intercept | 0.759 | 0.245 | [0.279, 1.240] | 3.10 | .002 |
| Symbolic distance | 0.286 | 0.072 | [0.145, 0.427] | 3.97 | <.001 |
| Random effects (SD) | |||||
| Intercept | 1.183 | ||||
| Symbolic distance | 0.287 | ||||
| Random-effect correlations | |||||
| Intercept, symbolic distance | -.28 | ||||
| Participants | 40 | ||||
| Observations | 1,600 | ||||
Learning phase. To examine how learning shaped participants' use of the geometric and algebraic strategies, we compared trials with the context shown (90% of trials) or masked (10% of trials; Fig. S13A,B). When the context was shown, accuracy was high from the beginning and increased over the course of learning, while response times fell. With the context masked, accuracy rose from near chance (53%) to 86%, and responses were relatively fast throughout.
We also compared the effect of the number of intervening distractors (i.e., the number of reasoning steps required by an in-context strategy) across the two halves of the learning phase on trials where the context was shown (Fig. S13C,D). Early in learning (trials 1–50), accuracy decreased with more intervening
Table S3: Experiment 1: ICL test accuracy (log-odds).
| Effect | Estimate | SE | 95% CI | z | p |
|---|---|---|---|---|---|
| Fixed effects | |||||
| Intercept | 3.183 | 0.427 | [2.345, 4.020] | 7.45 | <.001 |
| Symbolic distance | -0.387 | 0.069 | [-0.521, -0.253] | -5.65 | <.001 |
| Random effects (SD) | |||||
| Intercept | 2.130 | ||||
| Symbolic distance | 0.217 | ||||
| Random-effect correlations | |||||
| Intercept, symbolic distance | -.84 | ||||
| Participants | 40 | ||||
| Observations | 1,600 | ||||
Table S4: Experiment 1: accuracy on both tests (log-odds). Test coded ICL = 0, IWL = 1; distance not centered.
| Effect | Estimate | SE | 95% CI | z | p |
|---|---|---|---|---|---|
| Fixed effects | |||||
| Intercept | 3.250 | 0.447 | [2.374, 4.127] | 7.27 | <.001 |
| Symbolic distance | -0.399 | 0.071 | [-0.538, -0.260] | -5.63 | <.001 |
| Test (IWL) | -2.488 | 0.468 | [-3.405, -1.572] | -5.32 | <.001 |
| Symbolic distance × test (IWL) | 0.685 | 0.107 | [0.475, 0.895] | 6.40 | <.001 |
| Random effects (SD) | |||||
| Intercept | 2.248 | ||||
| Symbolic distance | 0.234 | ||||
| Test (IWL) | 2.190 | ||||
| Symbolic distance × test (IWL) | 0.430 | ||||
| Random-effect correlations | |||||
| Intercept, symbolic distance | -.87 | ||||
| Intercept, test (IWL) | -.86 | ||||
| Intercept, symbolic distance × test (IWL) | .73 | ||||
| Symbolic distance, test (IWL) | .66 | ||||
| Symbolic distance, symbolic distance × test (IWL) | -.79 | ||||
| Test (IWL), symbolic distance × test (IWL) | -.72 | ||||
| Participants | 40 | ||||
| Observations | 3,200 | ||||
Table S5: Experiment 1: IWL test response times (log ms).
| Effect | Estimate | SE | 95% CI | t | df | p |
|---|---|---|---|---|---|---|
| Fixed effects | ||||||
| Intercept | 7.491 | 0.064 | [7.361, 7.621] | 116.61 | 39.68 | <.001 |
| Symbolic distance | -0.009 | 0.012 | [-0.033, 0.015] | -0.78 | 38.26 | .442 |
| Random effects (SD) | ||||||
| Intercept | 0.361 | |||||
| Symbolic distance | 0.052 | |||||
| Residual | 0.480 | |||||
| Random-effect correlations | ||||||
| Intercept, symbolic distance | .69 | |||||
| Participants | 40 | |||||
| Observations | 1,223 | |||||
Table S6: Experiment 1: ICL test response times (log ms).
| Effect | Estimate | SE | 95% CI | t | df | p |
|---|---|---|---|---|---|---|
| Fixed effects | ||||||
| Intercept | 8.187 | 0.112 | [7.960, 8.414] | 73.14 | 36.17 | <.001 |
| Symbolic distance | 0.211 | 0.017 | [0.177, 0.245] | 12.53 | 34.28 | <.001 |
| Random effects (SD) | ||||||
| Intercept | 0.672 | |||||
| Symbolic distance | 0.083 | |||||
| Residual | 0.589 | |||||
| Random-effect correlations | ||||||
| Intercept, symbolic distance | .05 | |||||
| Participants | 40 | |||||
| Observations | 1,251 | |||||
Table S7: Experiment 1: response times on both tests (log ms). Test coded ICL = 0, IWL = 1; distance not centered.
| Effect | Estimate | SE | 95% CI | t | df | p |
|---|---|---|---|---|---|---|
| Fixed effects | ||||||
| Intercept | 8.180 | 0.111 | [7.956, 8.404] | 73.72 | 40.28 | <.001 |
| Symbolic distance | 0.214 | 0.013 | [0.187, 0.241] | 16.14 | 42.62 | <.001 |
| Test (IWL) | -0.690 | 0.105 | [-0.901, -0.479] | -6.58 | 43.80 | <.001 |
| Symbolic distance × test (IWL) | -0.222 | 0.018 | [-0.258, -0.187] | -12.58 | 43.86 | <.001 |
| Random effects (SD) | ||||||
| Intercept | 0.672 | |||||
| Symbolic distance | 0.058 | |||||
| Test (IWL) | 0.594 | |||||
| Symbolic distance × test (IWL) | 0.073 | |||||
| Residual | 0.540 | |||||
| Random-effect correlations | ||||||
| None (uncorrelated random effects) | ||||||
| Participants | 40 | |||||
| Observations | 2,474 | |||||
distractors, suggesting reliance on the algebraic strategy. In the second half of learning (trials 51–100), accuracy was high and relatively insensitive to the number of intervening distractors, suggesting participants were relying more on the geometric strategy. Response times in the second half of the learning phase still showed some dependence on the number of distractors, but were faster than in the first half.
Additional symbolic-distance results. To provide a fuller view of the distance effects in Fig. 2J,K, we examined accuracy and response times for all 21 item pairs, including the adjacent pairs that were directly trained (Fig. S14). On the IWL test, in addition to the symbolic distance effect (SDE), we also observed a memorization effect and a partial terminal-item effect. The memorization effect can be seen in that the directly trained adjacent pairs had generally higher accuracy than the distance-two pairs. On pairs including terminal items, accuracy was high for every pair containing the lowest rank item G, but not for pairs containing the highest rank item A. On the ICL test, participants showed a strong reverse symbolic distance effect in both accuracy and response time: accuracy generally declined with symbolic distance, and response times increased from approximately 5 s for adjacent pairs to 15 s for the longest-distance pair.


Figure S13: Learning phase. (A, B) Accuracy and response time in 20-trial bins with the context shown or masked. (C, D) Accuracy and response time by intervening distractors on trials where context was shown, comparing early and late trials. Lines and bands show mean ±1 SE across participants; response-time points average participant medians. Dashed horizontal lines indicate chance.
(AG), consistent with an algebraic strategy. IWL response times remained between 1.7 and 3.3 s across all pairs and did not depend much on distance. Figure S15 shows accuracy and response time by symbolic distance for each participant, and Fig. S16 shows each participant's slope of accuracy and log response time against symbolic distance on each test. The accuracy slope was positive on the IWL test and negative on the ICL test for 22 of the 40 participants, and response times increased with distance on the ICL test for 39 of the 40 participants.
Arbitrage test. To examine competition between the geometric and algebraic strategies in humans, we analyzed results from the arbitrage test (Pesnot Lerousseau & Summerfield, 2026), where the relations shown in context reversed the ordering seen during the learning phase, placing prior knowledge and contextual information in conflict. Because there were only two responses available on each trial (the training-consistent and context-consistent responses), we could not determine from response data alone whether a given choice reflected success of one of the strategies or failure of the other. Overall, responses were strongly biased toward the context ordering (72.5%), but this bias decreased with distance (Fig. S17A). Responses consistent with the trained ordering were faster overall, but both response types slowed with symbolic distance (Fig. S17B). Of the 40 participants, 15 chose the context-consistent response on at least 90% of trials (Fig. S17C). This pattern of results suggests that participants were biased toward the algebraic strategy on the arbitrage test, and produced more errors (i.e., responses consistent with the trained rather than the context ordering) on more distant queries. This bias may have resulted from the emphasis on using information in context in the instructions.

Figure S14: Additional human symbolic-distance results. (A) Accuracy and (B) response time for each item pair on the IWL and ICL tests, grouped by symbolic distance. A–G denote ranks from highest to lowest. Points and error bars show mean ±1 SE across participants; response-time points average participant medians. The dashed line marks chance.

Figure S15: Individual participants in Experiment 1. Accuracy (top) and response time (bottom) by symbolic distance on the IWL and ICL tests for each participant, ordered from slowest to fastest median ICL test response time. Response-time points are medians over correct trials; bands show 68% confidence intervals (accuracy) and ±1 bootstrap SD (response time) over each participant's trials. The dashed line marks chance.


Figure S16: Individual symbolic-distance slopes in Experiment 1. Each participant's slope of (A) accuracy and (B) log response time (shown as percent change) against symbolic distance on the IWL and ICL tests. Shaded regions mark an SDE on the IWL test with a reverse SDE on the ICL test in A and response times increasing with distance on the ICL test in B. Error bars show ±1 bootstrap SD.

Figure S17: Human arbitrage test. (A) Proportions of responses following the trained ordering or the reversed ordering shown in context, by symbolic distance. (B) Response times split by response type. Lines and bands show mean ±1 SE across participants; response-time points average participant medians. (C) Individual differences in context-following proportions.
C.2.2 Experiment 2
These analyses extend the main results from Experiment 2 (Fig. 3H,I).
Statistical tables. Tables S8 and S9 show the statistical tests reported in the main text.
Table S8: Experiment 2: accuracy (log-odds). Condition coded congruent −0.5, shuffled +0.5.
| Effect | Estimate | SE | 95% CI | z | p |
|---|---|---|---|---|---|
| Fixed effects | |||||
| Intercept | 2.569 | 0.149 | [2.277, 2.860] | 17.29 | <.001 |
| Condition (shuffled) | -2.442 | 0.287 | [-3.004, -1.880] | -8.52 | <.001 |
| Log symbolic distance | 0.182 | 0.127 | [-0.067, 0.431] | 1.43 | .152 |
| Trial number (per 10 questions) | 0.108 | 0.033 | [0.043, 0.172] | 3.26 | .001 |
| Condition × log symbolic distance | -1.325 | 0.200 | [-1.718, -0.932] | -6.61 | <.001 |
| Distance slope within condition | |||||
| Congruent | 0.845 | 0.199 | [0.454, 1.235] | 4.24 | <.001 |
| Shuffled | -0.480 | 0.113 | [-0.702, -0.259] | -4.25 | <.001 |
| Random effects (SD) | |||||
| Intercept | 1.176 | ||||
| Log symbolic distance | 0.252 | ||||
| Random-effect correlations | |||||
| Intercept, log symbolic distance | -.02 | ||||
| Participants | 99 | ||||
| Observations | 4,752 | ||||
Table S9: Experiment 2: response times (log ms). Condition coded congruent −0.5, shuffled +0.5.
| Effect | Estimate | SE | 95% CI | t | df | p |
|---|---|---|---|---|---|---|
| Fixed effects | ||||||
| Intercept | 8.429 | 0.080 | [8.270, 8.588] | 105.19 | 96.47 | <.001 |
| Condition (shuffled) | 0.937 | 0.160 | [0.619, 1.256] | 5.85 | 96.47 | <.001 |
| Log symbolic distance | 0.099 | 0.026 | [0.047, 0.152] | 3.75 | 95.75 | <.001 |
| Trial number (per 10 questions) | -0.163 | 0.007 | [-0.176, -0.150] | -24.81 | 3808.04 | <.001 |
| Condition × log symbolic distance | 0.345 | 0.053 | [0.240, 0.450] | 6.52 | 95.75 | <.001 |
| Distance slope within condition | ||||||
| Congruent | -0.073 | 0.037 | [-0.147, 0.000] | -1.98 | 90.49 | .050 |
| Shuffled | 0.272 | 0.038 | [0.197, 0.347] | 7.19 | 101.25 | <.001 |
| Random effects (SD) | ||||||
| Intercept | 0.792 | |||||
| Log symbolic distance | 0.218 | |||||
| Residual | 0.567 | |||||
| Random-effect correlations | ||||||
| Intercept, log symbolic distance | .76 | |||||
| Participants | 99 | |||||
| Observations | 3,988 | |||||
Robustness. Because more shuffled than congruent participants quit or answered at chance (Appendix B.2.2), we tested whether the condition effects in Fig. 3H,I depended on which participants were included in the analysis. Figure S18 shows the same results for every participant who finished, applying only the exclusions for pressing the same key on at least 80% of questions (two participants) and for answering under 0.5 s on at least 25% of questions (one more participant), including shuffled participants who were excluded from the main analysis for answering at chance. This left 49 participants in the congruent condition and 66 in the shuffled condition. When statistical models were refit on this sample, the main effects of condition and the condition-by-distance interactions on accuracy and response time all remained significant (p < .001).
Because we assigned more participants to the shuffled condition after the first wave to offset its higher rates of quitting and answering at chance, the conditions were unevenly split across the two waves in the main analysis (first wave: 30 congruent, 13 shuffled; second wave: 19 congruent, 37 shuffled). We therefore refit the models with wave and its interactions with condition and distance, which estimates each of the four effects within each wave and averages the two estimates with equal weight. All four remained significant (p < .001), were significant within each wave separately (p < .001), and did not differ reliably between the waves (all ). They also remained significant (p < .001) without the seven congruent participants recruited at the end of the second wave, when only the congruent condition was being assigned.
Leaving out one participant at a time never changed the sign or significance of any effect (99 refits per model), Lee bounds for the greater dropout in the shuffled condition (on participant means and slopes; 2,000 bootstrap samples) excluded zero for every effect, and both interactions remained significant with symbolic distance coded as logarithmic, linear, two-piece (a step at distance two, then linear), or categorical. The significant distance slopes within each condition also held in the refits on all finishers, with wave, and without the seven late-recruited congruent participants; the congruent response-time slope, which was not significant in the main analysis (p = .050), ranged from p = .047 to .069 across these refits.

B

Figure S18: Experiment 2 results for participants who finished the task. (A) Accuracy and (B) response time by symbolic distance for participants who finished (49 congruent, 66 shuffled), including shuffled participants excluded from the main analysis for answering at chance. Lines and bands show mean 1 SE across participants; dots show individual participants; response-time points average participant medians. The dashed line marks chance.
Agree and conflict questions. In the shuffled condition, the queried relation agreed with the real-world ordering on half of the questions at each distance (agree questions) and conflicted with it on the other half (conflict questions). To examine how prior knowledge contributed to the lower accuracy and reverse SDE in the shuffled condition (Fig. 3H,I), we compared the two types of questions (Fig. S19), fitting the models described in Appendix B.2.2 to the shuffled condition with question type in place of condition. Models that included participant-specific effects of question type had singular fits, so the tests of question type may be anti-conservative; we therefore also report participant-level tests (sign-flip tests of each participant's least-squares coefficients). Accuracy was lower on conflict than on agree questions at every distance (.76 vs .95 at distance one; .56-.61 vs .83-.87 at distances 2-6; b = -1.749, SE = 0.117, z = -14.94, p < .001), and this difference held on all finishers, with wave, and in participant-level tests. Accuracy declined with distance on both types of questions, and the decline did not differ reliably between them (question type × distance: ), although participant-level tests detected a slightly larger decline on conflict questions (). Response times increased with distance on both types of questions. Correct answers to conflict questions were slower than correct answers to agree questions (, SE = 0.029, , ), but this difference did not hold in participant-level tests () or when all answered questions were analyzed (), and it differed between the two waves (). Overall, these results are consistent with the hypothesis that prior knowledge interfered with performance in the shuffled condition.


Figure S19: Agree and conflict questions. (A) Accuracy and (B) response time by symbolic distance in the congruent condition and on shuffled-condition questions whose queried relation agreed or conflicted with the real-world ordering. Lines and bands show mean 1 SE across participants; response-time points average participant medians over correct answers. The dashed line marks chance.
Strategies and self-reports. The results in Fig. 3H,I suggest that participants answered from prior knowledge (the geometric strategy) when the statements were congruent with it, and chained through the statements (the algebraic strategy) when they were not. To examine strategy use in individual participants, we compared questionnaire answers (Appendix B.2.2) with each participant's response times (Fig. S20). In the questionnaire, a much higher proportion of participants in the congruent condition answered All of them or Most of them when asked how many of the statements were true (Fig. S20A), and a much higher proportion of participants in the congruent condition reported answering from real-world knowledge Often or Always (Fig. S20B). To measure how much each participant's response times depended on distance, we regressed log response time on symbolic distance and question number over the participant's correct answers (outliers removed as in Appendix B.2.2), and expressed the distance coefficient as the percent change in response time per unit of symbolic distance, (the RT vs distance slope). Across congruent participants, the median response time was 1.9 s and the median slope was ; across shuffled participants, they were 10.3 s and (Fig. S20C). Within each condition, slower participants had more positive slopes (Spearman's congruent, .61 shuffled), and both conditions included fast participants with flat or negative slopes and slow participants with positive slopes. Figures S21 and S22 show accuracy and response time by symbolic distance for each participant in the two conditions, ordered from slowest to fastest median response time. Slopes also tracked self-reports (Fig. S20D): shuffled participants who reported Never or Rarely answering from real-world knowledge had the most positive slopes (medians 14% and 16%, compared with 0–5% for the other answers), and among congruent participants, median slopes were negative within every answer choice except Never. These results suggest that both strategies were used in both conditions, but that the condition shifted the balance between them, with many more participants in the congruent condition relying on real-world knowledge.
A

B

C
D
Figure S20: Strategies and self-reports. (A) Judged proportion of true statements and (B) self-rated use of real-world knowledge, by condition. (C) Each participant's median response time against their RT vs distance slope: the percent change in response time per unit of symbolic distance, , where b is the distance coefficient of a least-squares regression of log response time on symbolic distance and question number over the participant's correct answers. (D) The same slope by answer in B; violins show the distribution, points show individual participants, and lines mark medians.

Figure S21: Individual participants in the congruent condition of Experiment 2. Accuracy (top) and response time (bottom) by symbolic distance for each participant, ordered from slowest to fastest median response time. Response-time points are medians over correct answers; bands show 68% confidence intervals (accuracy) and bootstrap SD (response time) over each participant's questions. The dashed line marks chance.

Figure S22: Individual participants in the shuffled condition of Experiment 2. Accuracy (top) and response time (bottom) by symbolic distance for each participant, ordered from slowest to fastest median response time. Response-time points are medians over correct answers; bands show 68% confidence intervals (accuracy) and bootstrap SD (response time) over each participant's questions. The dashed line marks chance.
C.3 Large language models
Additional symbolic-distance results. To provide a fuller view of the LLM results in Fig. 2L,M, here we show direct accuracy for all 22 models and five dimensions (Figs. S23–S26; procedures in Appendix B.3). On the IWL test, accuracy was higher at distance six than at distance one in 82 of the 110 model-dimension combinations, consistent with a symbolic distance effect. On the ICL test, accuracy was lower at distance six than at distance one in 15 of the 22 models, consistent with a reverse symbolic distance effect.

Figure S23: LLM symbolic-distance results: Qwen3 models. Direct accuracy on the IWL and ICL tests, with one panel per model (row) and dimension (column). All plots use the innermost seven ranks of 11-item orderings. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S24: LLM symbolic-distance results: DeepSeek, Phi, and gpt-oss models. Direct IWL and ICL test accuracy, formatted as in Fig. S23. The ICL measurement repeats across columns. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S25: LLM symbolic-distance results: Qwen2.5, GLM, Gemma, and Mistral models. Direct IWL and ICL test accuracy, formatted as in Fig. S23. The ICL measurement repeats across columns. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S26: LLM symbolic-distance results: Llama and OLMo models. Direct IWL and ICL test accuracy, formatted as in Fig. S23. The ICL measurement repeats across columns. Bands show 68% confidence intervals over trials; dashed lines indicate chance.
Reasoning requirements across models and dimensions. We also examined how the reasoning budget required to reach 90% of maximum accuracy varied with distance on the IWL and ICL tests (Figs. S27–S30). Crosses mark cases where the model did not perform reliably above chance at any tested budget, so no reasoning budget could be estimated. Among models with an estimate at both distances, the ICL budget was larger at distance six than at distance one in 15 of 17 models. The IWL budget instead decreased in 61 of 75 model-dimension combinations with estimates at both distances. Figure S31 shows ICL accuracy at each reasoning budget for all 22 models.

Figure S27: LLM reasoning requirements: Qwen3 models. Smallest reasoning budget reaching 90% of each series' maximum accuracy, by distance; zero denotes a direct answer. IWL estimates pool all available item sets per dimension; the ICL measurement repeats across columns. Crosses mark distances where accuracy was not reliably above chance at any tested budget (the 95% Wilson lower bound on maximum accuracy did not exceed .5), so no budget is reported. City population has only two IWL trials at distance six, so this criterion cannot be met even at perfect accuracy. Bands show ±1 bootstrap SE over trials, bounded by zero and 1,024 tokens.

Figure S28: LLM reasoning requirements: DeepSeek, Phi, and gpt-oss models. Budget estimates are defined as in Fig. S27; the ICL measurement repeats across columns. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.

Figure S29: LLM reasoning requirements: Qwen2.5, GLM, Gemma, and Mistral models. Budget estimates are defined as in Fig. S27; the ICL measurement repeats across columns. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.

Figure S30: LLM reasoning requirements: Llama and OLMo models. Budget estimates are defined as in Fig. S27; the ICL measurement repeats across columns. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.

Figure S31: LLM ICL accuracy by reasoning budget. ICL accuracy by reasoning budget, with one panel per model. Models trained to reason are in the top two rows and instruction-tuned models prompted to reason are in the bottom two. Darker lines indicate larger symbolic distances (1–6). Bands show 68% confidence intervals over trials; dashed lines indicate chance.
Content effects across models and dimensions. Figures S32–S35 extend the content-effects results in Fig. 3J to all models and dimensions. Models were explicitly instructed to answer from the comparisons given in context. Nevertheless, direct accuracy was higher with congruent than reversed contexts in 81 of 110 model-dimension combinations, consistent with interference from prior knowledge when it conflicted with the context.

Figure S32: LLM content effects: Qwen3 models. Direct accuracy by distance under the five context conditions. All four conditions with context use the instruction to rely only on the comparisons given; the no-context control uses the original instruction. Congruent, reversed, and shuffled trials are scored against the context ordering; the other conditions are scored against the real-world ordering. Bands show 68% confidence intervals over trials; dashed horizontal lines indicate chance.

Figure S33: LLM content effects: DeepSeek, Phi, and gpt-oss models. Direct accuracy under the five context conditions, with the instruction and scoring described in Fig. S32. Bands show 68% confidence intervals over trials; dashed horizontal lines indicate chance.

Figure S34: LLM content effects: Qwen2.5, GLM, Gemma, and Mistral models. Direct accuracy under the five context conditions, with the instruction and scoring described in Fig. S32. Bands show 68% confidence intervals over trials; dashed horizontal lines indicate chance.

Figure S35: LLM content effects: Llama and OLMo models. Direct accuracy under the five context conditions, with the instruction and scoring described in Fig. S32. Bands show 68% confidence intervals over trials; dashed horizontal lines indicate chance.
Recovery with reasoning. We examined whether reasoning could overcome interference on reversed-context trials across the same models and dimensions (Figs. S36–S39). At 1,024 tokens, accuracy on reversed-context trials exceeded direct accuracy by at least 10 percentage points in 89 of 110 model-dimension combinations. At a budget of 256 tokens, accuracy was higher for adjacent than the most distant pairs in 98 of 110 combinations, consistent with more distant comparisons requiring more reasoning.

Figure S36: Recovery with reasoning: Qwen3 models. Context-consistent accuracy on congruent and reversed trials by reasoning budget. Darker lines indicate larger symbolic distances (1–6). Zero denotes direct answers; positive budgets score prefixes of the same generated trace, up to 1,024 tokens. Lines show accuracy at each budget, without taking a running maximum. Each series contains 120 trials at distance one, decreasing to 20 at distance six. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S37: Recovery with reasoning: DeepSeek, Phi, and gpt-oss models. Congruent- and reversed-context accuracy by reasoning budget, formatted as in Fig. S36. Darker lines indicate larger distances. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S38: Recovery with reasoning: Qwen2.5, GLM, Gemma, and Mistral models. Congruent- and reversed-context accuracy by reasoning budget, formatted as in Fig. S36. Darker lines indicate larger distances. Bands show 68% confidence intervals over trials; dashed lines indicate chance.

Figure S39: Recovery with reasoning: Llama and OLMo models. Congruent- and reversed-context accuracy by reasoning budget, formatted as in Fig. S36. Darker lines indicate larger distances. Bands show 68% confidence intervals over trials; dashed lines indicate chance.
Reasoning requirements under content conditions. Figures S40–S43 show the reasoning budget required to reach 90% of maximum accuracy under congruent, reversed, and shuffled contexts for all models and dimensions. Among model-dimension combinations with an estimate at both distances, the budget was larger at distance six than at distance one in 57 of 66 combinations under reversed contexts and 60 of 66 under shuffled contexts, and in 52 of 89 under congruent contexts.

Figure S40: LLM reasoning requirements under content conditions: Qwen3 models. Smallest reasoning budget reaching 90% of each series' maximum accuracy, by distance, under congruent, reversed, and shuffled contexts; zero denotes a direct answer. Shuffled distances are measured in the ordering shown. Each series contains 120 trials at distance one, decreasing to 20 at distance six. Crosses mark distances where accuracy was not reliably above chance at any tested budget (the 95% Wilson lower bound on maximum accuracy did not exceed .5), so no budget is reported. Bands show ±1 bootstrap SE over trials, bounded by zero and 1,024 tokens.

Figure S41: LLM reasoning requirements under content conditions: DeepSeek, Phi, and gpt-oss models. Budget estimates are defined as in Fig. S40. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.

Figure S42: LLM reasoning requirements under content conditions: Qwen2.5, GLM, Gemma, and Mistral models. Budget estimates are defined as in Fig. S40. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.

Figure S43: LLM reasoning requirements under content conditions: Llama and OLMo models. Budget estimates are defined as in Fig. S40. Bands show ±1 bootstrap SE over trials. Crosses mark distances where accuracy was not reliably above chance at any tested budget, so no budget could be estimated.
Additional mechanism results. To supplement the LLM results shown in Fig. 4C, we performed additional experiments investigating the mechanisms underlying each strategy in Qwen3-32B, and repeated the main interventions on two further dimensions (Fig. S44; procedures in Appendix B.3). Figure S44A shows the held-out pairwise ordering accuracy of the rank direction (probe accuracy) at each layer for country, city, and US state population. Ranks were decodable above chance from every layer for all three dimensions, and became more decodable over the first several layers before leveling off.
In the main text (Fig. 4C), we report results for US state population, averaged over distances. Figure S44B shows IWL test accuracy at each symbolic distance, for both erasing and inverting the rank direction. As in the transformers, erasing the rank direction reduced IWL performance and largely removed the SDE shown by the intact model (Fig. S44B, green). Unlike in the transformers, however, inverting the rank direction did not drive responses below chance or reverse the distance effect (Fig. S44B, pink). We also experimented with writing a random unrelated ordering along the rank direction (Fig. S44C). This shifted direct answers only slightly toward the unrelated ordering, and agreement after reasoning remained near chance. These results are consistent with the fact that incongruent accuracy rarely dipped far below chance in these models (Fig. S32), and suggest that the LLM's direct answers depend on the rank direction, but that, unlike in the transformers trained from scratch, the presence of interference (whether from incongruent examples in context or from inverted or arbitrary rank directions) drives behavior toward chance rather than toward specific prepotent responses.
Finally, Fig. S44D,E shows the interventions of Fig. 4C for country and city population. In all dimensions, erasing the rank direction reduced IWL accuracy but left accuracy after reasoning intact, whereas ablating context-reading heads reduced accuracy after reasoning on reversed-context and ICL trials but had little effect on IWL accuracy. Erasing a random direction or ablating random heads had little effect.

Figure S44: LLM mechanism results: Qwen3-32B. (A) Pairwise ordering accuracy of the rank direction on held-out items, by layer, for three different real-world dimensions. (B) Direct IWL test accuracy for US state population when the rank direction is intact, erased, or inverted, or a random direction is erased. (C) Agreement with another ordering written along the rank direction on reversed-context trials for US state population, answering directly or after 1,024 reasoning tokens; the control shows full-strength writes along a random direction. (D, E) The interventions of Fig. 4C for country population and city population. Bands and error bars show binomial SE over trials; dashed lines indicate chance.
Reasoning traces. To examine whether the larger reasoning budgets required at larger distances (Figs. 2N and 3L) reflected additional inferences being made in context, we counted the inferences composed in the reasoning chains of Qwen3-32B and Qwen2.5-32B-Instruct on ICL and reversed-context trials (Fig. S45). An inference combines two relations that share an item (e.g., A > B and B > C give A > C), so a query at distance d requires d - 1 inferences. At each budget, we counted how many of these inferences the relations in the chain had composed, counting only relations consistent with the ordering shown and ignoring restatements of the query. On the ICL test, both models had composed at least 90% of the required inferences at every distance by 512 tokens. Under a reversed context, Qwen3-32B reached the same level by 512 tokens, whereas Qwen2.5-32B-Instruct fell short of it at every distance, increasingly so at larger distances.
Traces S1–S4 show one correct and one incorrect reversed-context trial per model at distance four. In both of its traces, Qwen3-32B listed all 10 relations, combined them into longer chains until the queried items were connected, and then rechecked each step; in the incorrect trial, the chain reached the correct conclusion, but the answer read after the scoring cue did not follow it. Qwen2.5-32B-Instruct generated shorter chains, and in the incorrect trial it joined two chains through a relation not given in the context (Texas > Kansas, the real-world relation).


C
Qwen3-32B, Reversed context

D
Qwen2.5-32B-Instruct, Reversed context

Figure S45: Composed inferences in LLM reasoning chains. Mean number of inferences that the reasoning chain had composed by each reasoning budget, on (A, B) the ICL test and (C, D) a reversed context (US state population), for Qwen3-32B (left) and Qwen2.5-32B-Instruct (right). Darker lines indicate larger symbolic distances (2–6; distance one requires no inference); dotted lines mark the number required at each distance. Bands show SE over trials.
Example reasoning traces. Traces S1–S4 are the trials described above (reversed context, US state population, distance four, 1,024-token budget). For each model and outcome, we chose the trial whose chain length was closest to the median among chains that ended within 1,024 tokens and, for correct trials, composed all three required inferences. Only one of Qwen3-32B’s seven incorrect trials ended within 1,024 tokens, so Trace S2 is that trial. Each prompt is shown verbatim, including the chat template, followed by the chain as generated (Appendix B.3). Trace S1. Qwen3-32B, correct answer. Prompt <|im_start|>system In the following question, > means "has a larger population" and < means "has a smaller population". Answer whether the statement is true or false. Base your answer only on the comparisons given — not on outside knowledge.<|im_end|> ,→ ,→ <|im_start|>user Alabama > Indiana Florida > Texas Kansas > Oklahoma Illinois > New York New Mexico > Kansas Indiana > New Jersey New York > Florida Texas > California New Jersey > Illinois Oklahoma > Alabama Is it true or false that Oklahoma > Illinois?<|im_end|> <|im_start|>assistant Reasoning chain (693 tokens) <think> Okay, let's see. I need to figure out if Oklahoma has a larger population than Illinois based on the given comparisons. Let me start by listing all the provided statements to see if I can create a chain of comparisons that connects Oklahoma and Illinois. ,→ ,→ First, the given statements are:
- Alabama > Indiana
- Florida > Texas
- Kansas > Oklahoma
- Illinois > New York
- New Mexico > Kansas
- Indiana > New Jersey
- New York > Florida
- Texas > California
- New Jersey > Illinois
- Oklahoma > Alabama Hmm, let's try to map these out step by step. Maybe I can create a hierarchy or order the states based on ,→ these relations. Starting with statement 1: Alabama > Indiana. So Alabama is larger than Indiana. Statement 6: Indiana > New Jersey. So Indiana is larger than New Jersey. Combining these two, Alabama > ,→ Indiana > New Jersey. Statement 10: Oklahoma > Alabama. So Oklahoma is larger than Alabama. Therefore, Oklahoma > Alabama > ,→ Indiana > New Jersey. Now, statement 3: Kansas > Oklahoma. So Kansas is larger than Oklahoma. So Kansas > Oklahoma > Alabama > ,→ Indiana > New Jersey. 95
Statement 5: New Mexico > Kansas. So New Mexico > Kansas > Oklahoma > Alabama > Indiana > New Jersey.
Now, looking at statement 4: Illinois > New York.
Statement 7: New York > Florida. So Illinois > New York > Florida.
Statement 2: Florida > Texas. So Illinois > New York > Florida > Texas.
Statement 8: Texas > California. So Illinois > New York > Florida > Texas > California.
Statement 9: New Jersey > Illinois. Wait, this is interesting. New Jersey is larger than Illinois. But ← earlier, we had Indiana > New Jersey, and Alabama > Indiana. So combining these, Alabama > Indiana > ← New Jersey > Illinois. But statement 4 says Illinois > New York, and statement 7 says New York > ← Florida, etc. So putting that together: Alabama > Indiana > New Jersey > Illinois > New York > Florida → > Texas > California.
But wait, statement 9 is New Jersey > Illinois. So that would mean New Jersey is larger than Illinois. But ← statement 4 says Illinois > New York. So New Jersey > Illinois > New York. Then New York > Florida → (statement 7), and so on.
Now, the question is whether Oklahoma > Illinois. Let's see where Oklahoma stands. From earlier, we have ← Oklahoma > Alabama > Indiana > New Jersey > Illinois. Wait, no. Wait, Oklahoma is greater than Alabama ← (statement 10), and Alabama is greater than Indiana (statement 1), Indiana is greater than New Jersey ← (statement 6), and New Jersey is greater than Illinois (statement 9). So the chain would be Oklahoma > ← Alabama > Indiana > New Jersey > Illinois. Therefore, Oklahoma is greater than Illinois. So the answer → should be true.
But let me double-check to make sure I didn't miss any conflicting statements. Let's verify each step:
- Oklahoma > Alabama (10)
- Alabama > Indiana (1)
- Indiana > New Jersey (6)
- New Jersey > Illinois (9)
So yes, Oklahoma > Alabama > Indiana > New Jersey > Illinois. Therefore, Oklahoma > Illinois. So the ← statement is true.
</think>Trace S2. Qwen3-32B, incorrect answer.
Prompt
<|im_start|>system In the following question, > means "has a larger population" and < means "has a smaller population". Answer ← whether the statement is true or false. Base your answer only on the comparisons given - not on outside ← knowledge.<|im_end|>
<|im_start|>user New Mexico > Kansas Florida > Texas New Jersey > Illinois Kansas > Oklahoma Oklahoma > Alabama Illinois > New York Alabama > Indiana Texas > California New York > Florida Indiana > New Jersey
Is it true or false that Indiana > Florida?<|im_end|>
<|im_start|>assistantassistant<think>
</think><|im_start|>assistant
Reasoning chain (1,022 tokens) <think> Okay, let's see. I need to figure out if Indiana has a larger population than Florida based on the given comparisons. Let me start by listing all the provided statements and see if I can create a chain of comparisons that connects Indiana to Florida. ,→ ,→ First, the given statements are:
- New Mexico > Kansas
- Florida > Texas
- New Jersey > Illinois
- Kansas > Oklahoma
- Oklahoma > Alabama
- Illinois > New York
- Alabama > Indiana
- Texas > California
- New York > Florida
- Indiana > New Jersey So, the question is whether Indiana > Florida. Let's try to connect these. Starting from Indiana. From statement 10: Indiana > New Jersey. Then, from statement 3: New Jersey > Illinois. So combining these, Indiana > New Jersey > Illinois. Then, statement 6 says Illinois > New York. So now we have Indiana > New Jersey > Illinois > New York. Then, statement 9 says New York > Florida. So putting that together: Indiana > New Jersey > Illinois > New York > Florida. If that's the case, then Indiana would be greater than Florida. But wait, let me check if all these connections are valid. ,→ ,→ ,→ ,→ ,→ Wait, let me map each step carefully. From statement 10: Indiana > New Jersey. From statement 3: New Jersey > Illinois. So combining these two, Indiana > New Jersey > Illinois. So ,→ Indiana > Illinois. From statement 6: Illinois > New York. So Indiana > Illinois > New York. From statement 9: New York > Florida. So Indiana > Illinois > New York > Florida. Therefore, Indiana > Florida. That would make the statement true. But wait, let me check if there are any contradictions or other paths that might affect this. ,→ ,→ Alternatively, let's see if there's another path from Indiana to Florida. Let's see. From statement 7: Alabama > Indiana. So Alabama is greater than Indiana. Then, from statement 5: Oklahoma > Alabama. So Oklahoma > Alabama > Indiana. Then, statement 4: Kansas > Oklahoma. So Kansas > Oklahoma > Alabama > Indiana. Then, statement 1: New Mexico > Kansas. So New Mexico > Kansas > Oklahoma > Alabama
Indiana. But how does this connect to Florida? ,→ ,→ ,→ Looking at statement 2: Florida > Texas. And statement 8: Texas > California. So Florida > Texas > California. Then, statement 9: New York > Florida. So New York is greater than Florida. But earlier, we had Indiana > New York. So if Indiana > New York and New York > Florida, then by transitivity, Indiana Florida. That seems to hold. ,→ ,→ ,→ But wait, let me check if there's any conflicting information. For example, if there's a loop or ,→ contradiction. Let's see: From the chain Indiana > New Jersey > Illinois > New York > Florida, that's a direct path. But also, from the other side, we have New Mexico > Kansas > Oklahoma > Alabama > Indiana. So Indiana is less than New Mexico, Kansas, Oklahoma, Alabama. But that doesn't conflict with Indiana being greater than Florida, as long as those other regions are not connected to Florida in a way that would create a contradiction. ,→ ,→ ,→ Is there any other connection? Let's check all statements again. 97
Statement 2: Florida > Texas. Statement 8: Texas > California. So Florida > Texas > California. Statement ↪ 9: New York > Florida. So New York is above Florida. Then, from statement 6: Illinois > New York. So ↪ Illinois > New York > Florida. Then, from statement 3: New Jersey > Illinois. So New Jersey > Illinois ↪ > New York > Florida. Then, from statement 10: Indiana > New Jersey. So Indiana > New Jersey > Illinois ↪ > New York > Florida. Therefore, Indiana is indeed greater than Florida. So the answer should be true.
But wait, let me make sure there's no other path that would contradict this. For example, if there's a way ↪ to get from Indiana to Florida through another route that would show Indiana < Florida. Let's see.
From Indiana, we have statement 7: Alabama > Indiana. Then, statement 5: Oklahoma > Alabama. Then, ↪ statement 4: Kansas > Oklahoma. Then, statement 1: New Mexico > Kansas. But how does that connect to ↪ Florida? The only connection to Florida is through New York. So unless there's a connection between New ↪ Mexico or Kansas to Texas or something else, but I don't see that. The only other connection is ↪ statement 2: Florida > Texas, and statement 8: Texas > California. So Florida is above Texas, which is ↪ above California. But New York is above Florida (statement 9), and Indiana is above New York (from the ↪ chain). So no contradictions here. Therefore, the conclusion that Indiana > Florida is true based on ↪ the given statements.
</think>Trace S3. Qwen2.5-32B-Instruct, correct answer.
Prompt <|im_start|>system In the following question, > means "has a larger population" and < means "has a smaller population". Answer ↪ whether the statement is true or false. Base your answer only on the comparisons given - not on outside ↪ knowledge.<|im_end|> <|im_start|>user Indiana > New Jersey New York > Florida New Jersey > Illinois Oklahoma > Alabama Kansas > Oklahoma Texas > California Florida > Texas Alabama > Indiana Illinois > New York New Mexico > Kansas
Is it true or false that Florida > Indiana? Let's think step by step.<|im_end|> <|im_start|>assistantassistant<think>
</think>Reasoning chain (267 tokens) To determine if the statement "Florida > Indiana" is true or false based on the given comparisons, we need ↪ to establish a chain of relationships between these states.
Here are the relevant comparisons from the provided information:
- Indiana > New Jersey
- New Jersey > Illinois
- Illinois > New York (This is the reverse of what was given, so we know New York < Illinois)
- New York > Florida
- Florida > Texas
- Texas > California
- Alabama > Indiana
From the above, we can derive the following relationships:
-
From 1 and 2: Indiana > New Jersey > Illinois
-
From 3: Illinois > New York
-
Combining the above: Indiana > New Jersey > Illinois > New York
-
From 4: New York > Florida
-
Combining with the previous: Indiana > New Jersey > Illinois > New York > Florida
-
From 7: Alabama > Indiana
Now, let's check the relationship between Florida and Indiana:
- We have established that Indiana > New Jersey > Illinois > New York > Florida.
- This implies that Indiana > Florida.
Therefore, the statement "Florida > Indiana" is false.
Trace S4. Qwen2.5-32B-Instruct, incorrect answer.
Prompt <|im_start|>system In the following question, > means "has a larger population" and < means "has a smaller population". Answer ↔ whether the statement is true or false. Base your answer only on the comparisons given - not on outside ↔ knowledge.<|im_end|> <|im_start|>user New Mexico > Kansas New Jersey > Illinois Kansas > Oklahoma Florida > Texas New York > Florida Texas > California Illinois > New York Alabama > Indiana Oklahoma > Alabama Indiana > New Jersey
Is it true or false that New York > Alabama? Let's think step by step.<|im_end|> <|im_start|>assistant
Reasoning chain (311 tokens) To determine if the statement "New York > Alabama" is true or false based on the given comparisons, we need ↔ to establish a chain of relationships between these states.
- Florida > Texas
- Texas > California (This doesn't directly help us with New York or Alabama)
- New York > Florida
- From 1 and 3: New York > Florida > Texas
- Illinois > New York
- From 3 and 4: Illinois > New York > Florida > Texas
- New Jersey > Illinois
- From 4 and 5: New Jersey > Illinois > New York > Florida > Texas
- Kansas > Oklahoma
- Oklahoma > Alabama
- From 6 and 7: Kansas > Oklahoma > Alabama
- Alabama > Indiana
- From 7 and 8: Kansas > Oklahoma > Alabama > Indiana
- Indiana > New Jersey
- From 5, 8, and 9: New Jersey > Illinois > New York > Florida > Texas > Kansas > Oklahoma > Alabama > ↔ Indiana > New Jersey (This creates a loop, but we can still use the direct paths)
Now, let's focus on the relevant parts:
- New York > Florida > Texas > Kansas > Oklahoma > Alabama
From this chain, we can see that New York has a larger population than Alabama.
Therefore, the statement "New York > Alabama" is true.