Manuscript Offprint

arXiv:2609.37680

When Models Don't Manipulate Manifolds: The Geometry of a Comparison Task

Sai Sumedh R. Hindupur, Hadas Orgad, Thomas Fel, Demba Ba

ABSTRACT

One of the current premises of mechanistic interpretability research is that detailed accounts of the geometry of neural network representations can tell us how models perform computations, and how to effectively intervene on them. While low dimensional manifolds have been observed for multiple concepts in the literature (e.g. numbers encoded on helices, days of the week on a circle, ...), with structure believed to reflect properties of data and tasks, the extent to which models rely on them for computation, and how they manipulate them, remains unclear. We characterize precisely the geometry of computation in a number-comparison task, as an abstraction of comparison for decision making, and how models utilize geometry in an elegant fashion to implement it. Specifically, we study the causal geometry of number comparison in Qwen2.5-7B-Instruct, a capable and widely studied open-weight model, and find Qwen largely uses linear representations of numbers despite the presence of curved geometry. To compare two numbers, the model first encodes each number along a vector and adds the two representations using attention and the residual connection, bringing them into a shared space in the residual stream. Then, the model uses MLP neurons to compare the pair of numbers on local regions in this shared space, which correspond to smaller intervals of input numbers, and combines these to obtain the position of the maximum. In fact, this reliance on linear representations for comparison also persists when the model compares three numbers. Our findings demonstrate that the manifold hypothesis can co-exist with linear representations: while concepts that are ordered may have manifold structure in representations, the model may use an underlying linear structure of the concept in certain computations. 1^{1}

1 INTRODUCTION

How do language models represent concepts internally, and how do they use these representations to perform computations? The linear representation hypothesis (Park et al., 2023; Elhage et al., 2021) posited that models represent ordered concepts as one-dimensional subspaces, which found evidence across diverse applications (Zhu et al., 2024; Marks & Tegmark, 2024; Voynov & Babenko, 2020; Tigges et al., 2023; Lee et al., 2024). Recent work has challenged this perspective and found that these concepts live on low dimensional manifolds – a phenomenon known as the manifold hypothesis: examples include number helices (Kantamneni & Tegmark, 2025), curved manifolds for dates/years (Modell et al., 2025), character count manifolds (Gurnee et al., 2026), as well as age and temperature manifolds (Bhalla et al., 2026). Where does this manifold structure come from? Theoretical analyses suggest that the manifold structure arises from symmetries in data (Karkada et al., 2026) or task symmetries (Hwang & Park, 2026). These insights have also revealed how steering along manifolds can control model behavior (Wurgaft et al., 2026). However, given a specific computation, which aspects of the representation structure the model uses to perform the computation remains an open question. Does the model manipulate nonlinear concept manifolds, as Gurnee et al. (2026) show using character count manifolds on a line-breaking task, or does the model use simpler linear representations for certain tasks despite the presence of manifold structure?

1^{1}Our code is available at https://github.com/Sai-Sumedh/comparison-geometry

Input

Read numbers along lines

Bring numbers together

Output

The maximum of 3 and 7 is

Figure

Second

bigger

First

bigger

Compare

via MLPs

7

3

Figure 1: Linear number representations are used by language model Qwen for comparison. When asked to compare numbers, the model first represents them on a nonlinear manifold, but uses structure along a single linear direction in computation. It combines information about the two numbers by adding the corresponding linear representations using a single attention head and a residual connection, creating a shared space which enables comparison. On this shared space, the model identifies which number is larger using MLP neurons across two layers, and uses the answer position to read out the answer to the max task.

Elucidating how models manipulate internal representations to perform computations has become an active area of research. Framed as such, this question amounts to investigating the algorithmic level in Marr's levels of analysis (Marr, 2010), which claim that a system can be understood at the computational (abstract, behavioral), algorithmic (variables and how they are manipulated) and implementation levels (low-level implementation of the algorithm). Mechanistic interpretability research, despite having largely focused on finding circuits of computation, namely the implementation level, has also become interested in the algorithmic level (Geiger et al., 2021) which operates at a higher level of abstraction. Multiple examples of algorithmic understanding of models exist, including trigonometry on circular/ helical structures for addition (Kantamneni & Tegmark, 2025), an addition mechanism using Fourier features for multiple concepts such as week days, months, etc (Feucht et al., 2026), and explaining attention heads with python programs (Hayes et al., 2026). Our work contributes to this burgeoning and exciting line of work on algorithmic interpretability.

Motivated by the above lines of inquiry, we ask how language models implement comparison using representation geometry. Comparison is a widely useful operation for intelligent systems, and language models in particular. It is an integral component of weighing options and making decisions, especially using numerical or ordered concepts (which can be represented on a line; see (Gärdenfors, 2000)). For example, queries like "Which of these apartments is closest to my office?", "Which quarter had the worst sales in this five-year report?" require performing comparison of the specified objects using the specified attributes. Despite reports of nonlinear, helical representations of numbers (Kantamneni & Tegmark, 2025), the aspects of number representations models use for the purpose of comparison, and how do they manipulate them to implement the operation remains poorly understood.

Previous works have studied how models perform comparison. (Hanna et al., 2023) characterize in great detail a comparison circuit in GPT-2. However, they do not establish causal role of representation geometry in comparison by acknowledging that "GPT2's structured number representations may be relevant to its greater-than ability. However, our experiments struggle to prove this causally" (quoted from Hanna et al. (2023)). (El-Shangiti et al., 2025) found a linear subspace which causally affects model outputs, but their analysis does not concern the mechanism by which the model compares values represented in this subspace. (Yuchi et al., 2026) study mixed notation number comparison and compare behavioral accuracy with classifier performance. Taken together, these works have focused on circuit discovery, model performance, or probing accuracy: they however do not study causal representation geometry and how it is used by the model to perform comparison. We provide a detailed geometric account of the algorithm language models employ to compare numbers (Fig. 1). In addition to being descriptive, our account is causal: we can predict how causal interventions will affect model behavior.

Concretely, we make the following contributions:

• Reconciling linear representations and manifolds: We demonstrate how linear representations of numbers are causally involved in the model’s number comparison, despite the presence of underlying curved manifold structure.

• Algorithm for number comparison using linear representations: We further show how the model manipulates number representations to perform comparison: by additive mixing of

Algorithm 1 Pairwise Number Comparisons

Require: numbers y1,y2y_1, y_2 at times t=1,2t = 1, 2 resp.

if t=1t = 1 then store y1y_1 as xl1=uf1′(y1)\boldsymbol{x}_l^1 = \mathbf{u}f_1'(y_1) else if t=2t = 2 then store y2y_2 as xl2=v2f2(y2)\boldsymbol{x}_l^2 = \boldsymbol{v}_2 f_2(y_2) copy xl1\boldsymbol{x}_l^1, transform as v1f1(y1)\boldsymbol{v}_1 f_1(y_1), add to residual xl+12=xl2+v1f1(y1)\boldsymbol{x}_{l+1}^2 = \boldsymbol{x}_l^2 + \boldsymbol{v}_1 f_1(y_1) divide span(v1,v2\boldsymbol{v}_1, \boldsymbol{v}_2) into regions {Ri}\{\mathcal{R}_i\} compare y1,y2y_1, y_2 in {Ri}\{\mathcal{R}_i\} as Ci=I(y1>y2)C_i = \mathbb{I}(y_1 > y_2). I(xl+12∈Ri)\mathbb{I}(\boldsymbol{x}_{l+1}^2 \in \mathcal{R}_i) combine local comparisons {Ci}\{C_i\} to get ans=I(y1>y2)ans = \mathbb{I}(y_1 > y_2) end if

▷ Fig. 2 (a, b)

▷ Fig. 2 (c)

▷ Done by Attention Head(s), Fig. 2(b, d)

▷ Residual Stream, Fig. 3 (a–c)

▷ MLP neurons, Fig. 4(a, b)

▷ MLP neuron outputs, Fig. 4(b)

▷ later MLP neurons, Fig. 4(c, d)

individual number directions, followed by local comparisons (for specific intervals of input numbers) which are then combined to give the global comparison answer.

• Extension of the comparison algorithm to longer sequences of numbers: We show how the algorithm using linear number representations extends to three-length sequences.

References (88)