Source-linked AI summary
The Geometry of Contextual Relations: Language Models Address Facts by Order of Mention
Yufa Zhou
TL;DR
Reasoning across contextual facts requires preserving who fills each relational role, but how language models organize those bindings in their representations remains an open question. The paper measures hidden-state changes as questions switch between facts and formalizes the resulting direction as an ordinal vector. It finds that models address facts by mention order, with shared addresses that transfer across contexts, occupy a low-rank subspace, and emerge during pretraining.
Problem
Reasoning across contextual facts requires preserving who fills each relational role, but how language models organize those bindings in their representations remains an open question.
Source: §1 · p. 2Method
The authors measure hidden-state changes when questions switch between facts and average those changes into an ordinal steering vector.
Source: §1 · p. 2Results
Across Qwen, Gemma, and Llama, questions address facts by mention order rather than names, and the shared addresses transfer, form a low-rank subspace, and emerge early.
Source: §1 · p. 2Takeaways & Limitations
A question says where to look while context supplies the fact’s content, a separation learned from next-token prediction alone.
Source: §8 · p. 9Evidence comes from templated lists and short paragraphs with one token-position edit at one block; long documents and multi-step reasoning remain next steps.
Source: §8 · p. 10
Abstract
from arXiv · showhide
Human reasoning depends on how objects are related within propositions. \textit{How do relations organize the language representations of contextual contents?} We give an LLM a list of facts in its context (e.g., \emph{Alice eats an apple. Bob eats a pear.}) and measure how its hidden state changes when the question switches from what Alice eats to what Bob eats. Averaged over many lists, this change is a steering vector, which we call the \emph{ordinal vector}. It points to a fact by its \emph{order of mention}, the order in which the facts were stated in the context. We find that LLMs represent the fact a question asks about by its order of mention, not by the name the question contains. We state this as the \textit{ordinal addressing hypothesis}: each order of mention has a \emph{fact address} in the model's state, shared by all contexts, and a question moves the state to the fact address of the fact it asks about, while the context supplies what that fact says. Across Qwen, Gemma, and Llama, fact addresses are (1) \emph{ordered by mention}: query states are organized by the order of facts, not of names, even when one fact has multiple subjects; (2) \emph{steerable}: added to a question about the first fact of a new list, the ordinal vector makes the model answer with the second fact of that list; (3) \emph{low-rank}: they span a low-rank subspace in which the first-mentioned fact is the easiest to reach, surprisingly similar to human recall; and (4) \emph{emergent}: they are shared in late-middle layers, hold from 1.5B to 32B parameters, and form early in pretraining. Language models reach a stated fact by where it was mentioned, deepening our understanding of LLM reasoning.
1. Introduction
The paper asks how relations organize contextual representations and finds that language models locate facts by their order of mention. It proposes shared fact addresses: the question selects where to look, and the context supplies what is there.
1. Introduction
- The ordinal vector measures the averaged hidden-state change when a question switches between facts, revealing that models address facts by order of mention.The authors formalize this as a shared fact address for each mention order.Source: §1 · p. 2
- Query states follow the queried fact’s order, not the named person, even when one fact has two subjects.The query change keeps its direction across new names and reverses when the facts are reversed.Source: §1 · p. 2
- An ordinal vector transfers across contexts, selecting a designated fact while the receiving context supplies its content.The reported transfer spans new names, contents, and relations, short paragraphs, and models from 1.5B to 32B parameters.Source: §1 · p. 2
- Fact addresses span a low-rank subspace in which later addresses crowd together and the first-mentioned fact is easiest to reach.The authors note a similarity to human retrieval, where first-mentioned participants are easiest to retrieve.Source: §1 · p. 2
- Addresses are shared in a late-middle depth window and emerge early in pretraining, after questions initially organize by named person.In OLMo-2-7B, the shift to order-based organization occurs by 42B tokens, before reliable answers.Source: §1 · p. 2
- The proposed division is that a question says where to look and the context says what is there, learned from next-token prediction alone.This separates contextual structure from the fact’s content.Source: §1 · p. 2
2. Related Work
Prior work studies internal mechanisms, contextual binding, and representation geometry. This paper distinguishes its focus on the question state across contexts and geometry set by fact order.
2. Related Work
- Mechanistic interpretability uses internal components and causal interventions to explain behavior, while activation addition and function vectors show that example-derived activations can alter new inputs.Related work also studies binding identifiers, propositional probes, and positional and lexical contributions to bound-entity retrieval.Source: §2 · pp. 2–3
- Prior binding studies locate order in bound-token states within one context; this work studies the question’s state across contexts and an address that counts facts rather than entities.The authors describe this as a geometric account of retrieval noise in the middle of long lists.Source: §2 · p. 3
- Representation research links semantic contrasts, concept hierarchies, and structured-input trajectories to shared geometry, whereas this paper’s geometry is set by fact order rather than word meaning.Source: §2 · p. 3
3. Order of Mention and Fact Addresses
This section formalizes fact retrieval as addressing: a query state shifts to a shared address indexed by mention order, and the context supplies the fact. It derives predictions for invariance, transfer, linear structure, and noisy readout, then tests the first prediction across models.
3. Order of Mention and Fact Addresses
- A context lists facts by mention order, each with a binding identity, and a question identifies the fact whose content supplies the answer.The query state is the residual stream at the last prompt token; the ordinal vector is the mean hidden-state change between questions for different fact orders.Source: §3 · p. 3
- The ordinal-addressing hypothesis assigns a shared address to each fact order, so changing the queried fact shifts the state by the same address difference across contexts.The context offset and binding identity provide context-specific content; the address component is shared.Source: §3 · p. 3
- Mean cosines with the ordinal vector are 0.93, 0.88, and 0.92 in Qwen, Gemma, and Llama, while reversed-arrangement cosines are −0.93, −0.82, and −0.85, respectively.Eleven further models show the same signs; the weakest reversal cosine is −0.44 in base Gemma-3-4B.Source: Figure 2 · p. 4, §3 · p. 5
- Under the hypothesis, query changes are invariant to names and contents, reverse when facts switch order, and query states depend on fact order rather than entities or token distances.A shared relation component cancels in within-context differences.Source: §3 · pp. 4–5
- Adding the ordinal vector to a receiver’s query state selects the designated fact, whose content supplies the answer; every query change lies in a shared subspace of dimension at most n−1.Ordinal vectors compose by adding the address differences between successive fact orders.Source: §3 · pp. 4–5
- With Gaussian state noise and nearest-address readout, transfer probability rises with the target address’s nearest-neighbor spacing, so isolated addresses are reached more reliably.The proposition gives lower and upper bounds that increase with the minimum distance to another address.Source: §3 · p. 5
4. Questions Are Organized by Order of Mention
Query states track the order of the fact being asked about rather than the queried person, including when fact order and name order diverge.
4. Questions Are Organized by Order of Mention
- Fact-address templates explain 66%, 29%, and 49% of held-out query-dependent variance in Qwen, Gemma, and Llama, while person templates explain none.At the main blocks, adding the named person contributes at most 0.10 to the fact-address template’s R².Source: §4 · p. 5, Figure 3 · p. 6
- When one fact has two subjects, states match fact order rather than name order in 99.2%, 96.2%, and 96.2% of cases in Qwen, Gemma, and Llama.For two-place facts, fact-by-slot templates have held-out R² of 0.82, 0.65, and 0.70 in those models.Source: §4 · p. 6
- For two-place facts, query states follow the fact and the requested argument slot, not the queried person.The fact-by-slot template has held-out R² of 0.82, 0.65, and 0.70 in Qwen, Gemma, and Llama.Source: §4 · p. 6
5. The Fact Address Transfers across Contexts
Ordinal vectors calibrated on other contexts can shift a query toward the designated fact in a new context, whose own facts supply the answer content.
5. The Fact Address Transfers across Contexts
- 84.1%, 53.9%, and 36.2% of cases select the designated fact in 64 new word sets for Qwen, Gemma, and Llama, respectively.The Table 1A random-direction rate is at most 0.01%.Source: §5 · pp. 6–7, Table 1 · p. 7
- Ordinal vectors also transfer to short paragraphs with varied verbs among unrelated sentences, selecting the designated fact in 44.5%, 42.4%, and 14.0% of cases.The rates are for Qwen, Gemma, and Llama, respectively.Source: §5 · p. 6
- With all directions scaled to one length, vectors calibrated with the facts select the designated answer in 71.3%, 41.7%, and 10.3% of cases.Directions computed without the facts select none from the question alone and at most 3.9% from a list of names.Source: §5 · pp. 6–7
- Replacing a receiver’s query state with a donor state selects the receiver’s fact at the donor question’s mention order in 80.9%, 72.0%, and 51.3% of cases.It rarely produces the donor’s complete answer: the state carries which fact to read, not what the donor read.Source: §5 · pp. 6–7
- Transfer follows receiving fact order, not names, relation, or token distance; recalibration after rearrangement raises Qwen person-change transfer from 9.0% to 69.7%.Across six relations, an eats-calibrated vector comes within five percentage points of each relation’s own vector.Source: §5 · p. 7
6. Fact Addresses Are Low-Rank
Fact addresses occupy a shared low-rank subspace and form an ordered sequence whose spacing is associated with how easily each fact is reached.
6.1. Fact addresses span a shared low-rank subspace
- The three-dimensional address subspace captures 69%, 33%, and 52% of held-out change norm in Qwen, Gemma, and Llama, within 1–8 points of the best three-dimensional subspace.A random three-dimensional subspace captures 0.1%.Source: §6.1 · p. 7
- Address subspaces for six relations nearly coincide, and ordinal vectors estimated on disjoint word sets compose along a path with cosine 0.99, 0.97, and 0.98.The cosine values are for Qwen, Gemma, and Llama, respectively.Source: §6.1 · p. 7
6.2. Later addresses crowd together, and the first is easiest to reach
- In lists up to eight facts, later address links shorten, and greater distance from the nearest neighbor predicts better transfer (R² = 0.82 within models).Transfer is highest for fact 1 at 82–95% in Qwen, declines toward the middle, and usually rises slightly at the last fact, resembling human recall’s primacy curve.Source: §6.2 · pp. 7–8, Figure 4 · p. 8
7. Where and When the Fact Address Is Shared
The fact address is an intermediate representation shared across contexts in a depth window, and its organization by mention order develops during pretraining.
7. Where and When the Fact Address Is Shared
- Within one word set, the query state carries first the named person, then the fact address, then requested content; address sharing is probed using ordinal-vector and donor-state interventions at every block.Recorded outcomes include the receiver’s selected fact under each intervention and the donor’s own first answer token.Source: §7 · p. 8
7.1. The shared address occupies a depth window
- In the depth window, the ordinal vector selects receiver facts before donor states alone carry the address and donor answer tokens take over.In Gemma, ordinal-vector selection drops from 44.3% at block 22 to zero at block 23 while the ceiling remains 96%; the donor’s first token reaches 67.0% at block 23.Source: §7.1 · p. 8, Figure 5 · p. 9
7.2. The fact address forms during pretraining
- By 42B tokens, OLMo-2-7B query changes reverse from cosine +0.98 to −0.61 as fact-address R² rises from 0.00 to 0.52, before the model answers reliably.At 5B tokens it answers only half the questions; the depth profile forms later, with all three stages first co-occurring at 839B tokens.Source: §7.2 · pp. 8–9
- Shared-address blocks first appear at 42B tokens but are absent at 105B and 3.9T; content blocks appear from 416B, and only the released model has one contiguous profile.Transfer at block 16 peaks at 210B tokens at 50.1% against a 56.8% ceiling, then declines as the depth profile moves away from it.Source: §7.2 · p. 9
8. Discussion
The paper argues that models learn to address facts by their order of mention, with the context supplying the content. This structure emerges during pretraining and resembles signatures of human recall, but the evidence is bounded to short contexts.
8. Discussion
- Order-of-mention organization emerges during pretraining after questions first organize by named person; the full depth profile forms later.In OLMo-2-7B, the switch occurs by 42B tokens, before reliable answering, while the full profile settles later.Source: §8 · p. 9, Figure 6 · p. 10
- First-mentioned facts are easiest to reach, while later fact addresses crowd together, resembling serial recall.The paper contrasts this pattern with linear concept representations: a fact address marks a place in context, not a meaning.Source: §8 · p. 10
- The evidence comes from templated lists and short paragraphs; long documents and multi-step reasoning remain natural next steps.The ordinal vector moves Llama’s answers less often in paragraphs and with two-subject facts, while long lists also draw on lexical and reflexive retrieval.Source: §8 · p. 10
9. Conclusion
The paper concludes that questions address stated facts by order of mention, while context supplies their content. Its appendices document the shared protocol and supporting analyses, including tests of invariance and query-state organization.
9. Conclusion
- Language models address stated facts by order of mention: questions move state to a shared fact address, while context supplies what is stated there.The addresses steer answers in new contexts, span a low-rank subspace, are shared in a late-middle depth window, and form early in pretraining.Source: §9 · p. 10
Appendix Contents
- The appendices provide a shared protocol, with each later part opening with the main-text claim it supports.Appendix A gives the protocol.Source: Appendix Contents · p. 14
A. Setup
- The protocol calibrates a query-state change on some word sets, adds it once to new-word-set contexts, and judges the complete answer.It edits the last prompt-token state at one block, recomputes later blocks on the receiving context, and scores complete normalized answer strings.Source: A. Setup · p. 15
B. Invariance and Reversal in Two-Fact Contexts
- Across new name pairs, query changes keep their direction within an arrangement and nearly reverse when fact order reverses.Mean cosine with the same-arrangement ordinal vector is 0.93, 0.88, and 0.92 for Qwen, Gemma, and Llama; cross-arrangement cosines are −0.93, −0.82, and −0.85.Source: B. Invariance and Reversal in Two-Fact… · p. 16
C. Questions Are Organized by Order of Mention
- The query-dependent state is organized by the queried fact’s order of mention, not by the named person, including coordinated-subject and two-argument facts.Section 4 tests this query-state geometry and its implications across those fact forms.Source: C. Questions Are Organized by Order of… · p. 16
C.1. Query-State Geometry
Query states are organized by the order of mention of the queried fact, and this organization extends to facts with coordinated subjects and two-place relations. The paper then tests how fact addresses transfer across contexts and rearranged facts.
C.1. Query-State Geometry
- Fact-address templates explain held-out query-state variance at the main blocks, while person templates explain none.The fact-address template’s R² is 0.66, 0.29, and 0.49 for Qwen, Gemma, and Llama; person-template R² is −0.01 in all three.Source: §C.1 · pp. 16–17
C.2. Coordinated Subjects: The Order of Facts, Not of Names
- With coordinated subjects, query states align more closely with the queried fact’s order than with the queried person’s name order.Fact-order templates are closer in 99.2% of Qwen, 96.2% of Gemma, and 96.2% of Llama cases; fact-order vectors select the designated content in 65.3%, 34.0%, and 12.1%.Source: §C.2 · pp. 17–18
C.3. Two-Place Relations
- For two-place relations, query states are organized by fact and argument slot, and changes in either coordinate transfer to new names.Fact-by-slot templates explain held-out variance of 0.82, 0.65, and 0.70 for Qwen, Gemma, and Llama; queried-person templates explain nothing.Source: §C.3 · pp. 18–19, Figure 8 · p. 19
D. The Fact Address Transfers across Contexts
- The fact address transfers across contexts: the ordinal vector selects the receiver’s designated fact, whereas directions computed without facts select at most 3.9%.Whole donor-state replacement improves designated-answer rates over replacing with the donor’s own-question state by 79.1, 58.1, and 45.2 percentage points for Qwen, Gemma, and Llama.Source: D. The Fact Address Transfers across… · p. 19, §D.1 · pp. 19–20
D.1. What the Facts and Whole Donor States Contribute
- A whole donor state carries which fact to read, not the donor’s content.Its paired gain over the donor’s own-question state is positive for every donor; complete donor answers are rare at the main blocks.Source: §D.1 · p. 20
D.2. Rearranged Facts
- When facts are rearranged, choosing the ordinal vector by their new orders of mention recovers most of the recalibrated rate in Qwen and nearly all of it for Llama’s person changes.It more than doubles Gemma’s rates, though a larger gap to recalibration remains; Llama’s relation changes do not act even when recalibrated.Source: §D.2 · p. 20, Table 2 · p. 20
D.3. Six Relations
Ordinal vectors transfer across relations and continue to follow fact order when token distances change. The section also frames low-rank structure and crowding among fact addresses as the next set of analyses.
D.3. Six Relations
- Across six relations, vectors from other relations perform nearly as well as the receiving relation’s own vector, and fact-address templates explain query states better than person templates.A rescaled eats vector comes within five points of each relation’s own vector; cross-relation ordinal-vector cosine ranges from 0.79 to 0.96, versus 0.18 to 0.38 for mismatched vectors.Source: §D.3 · p. 21, Figure 9 · p. 21
D.4. Order of Mention versus Token Distance
- Transfer persists across length conditions, and when order and token distance predict different facts, the ordinal vector favors the fact at the calibrated order.The advantage over absolute-distance predictions is 72.1 points in Qwen, 58.9 in Gemma, and 28.4 in Llama; mixed-length calibration gives the same verdict.Source: §D.4 · pp. 21–22, Figure 10 · p. 22
E. Fact Addresses Are Low-Rank
- The low-rank analyses concern a shared subspace in which addresses crowd together in longer lists, remain fixed once their fact is read, and predict how person and relation changes combine.These are the claims this section sets out to analyze.Source: E. Fact Addresses Are Low-Rank · p. 22
E.1. The Address Subspace
Across these analyses, fact addresses occupy a compact shared geometry whose transfer weakens for later-mentioned facts and whose expression varies across list prefixes and model depth.
E.1. The Address Subspace
- The three-dimensional address subspace holds 69%, 33%, and 52% of held-out query-change share in Qwen, Gemma, and Llama, respectively.These shares are near the best three-dimensional subspace’s 70%, 41%, and 60%.Source: §E.1 · pp. 22–23
E.2. Longer Lists
- Ordinal-vector transfer exceeds random at list lengths of four, six, and eight, and is highest for the first-mentioned fact (82–95% in Qwen).Transfer falls toward the middle and rises again at the last fact in eight of the nine lists.Source: §E.2 · p. 23, Figure 11 · p. 24
E.3. Prefixes of a List
- For nonfinal facts, prefix-derived address vectors closely match their eight-fact counterparts (median cosine 0.99; minimum 0.95).The last fact of a prefix deviates slightly, with a recency effect in Llama.Source: §E.3 · p. 24
E.4. Person and Relation Do Not Add
- Person–relation interactions are 54%, 59%, and 51% of joint-change norm in Qwen, Gemma, and Llama, despite nearly orthogonal person and relation changes.The address-derived interaction need not vanish and can change with fact arrangement.Source: §E.4 · pp. 24–25
F. Where and When the Fact Address Is Shared
- The address is shared as a difference only within a depth window; later whole states retain it before donor content takes over.Past the window, states align with their own answer’s output direction.Source: §F.1 · pp. 25–26
F.1. The Depth Window
- At Gemma block 22, a receiver asked about its first fact answers with its own second fact after a donor’s fact-two state; by block 33, donor wording intrudes.The block-33 answer begins with the donor’s first word and continues with receiver content.Source: §F.1 · p. 26
F.2. Pretraining Checkpoints
Checkpoint analyses trace when order-based addressing emerges, then test its scope across model sizes and base versus instruction-tuned weights.
F.2. Pretraining Checkpoints
- Reversed-order cosine falls from +0.98 at 5B tokens to −0.61 at 42B, while the depth profile settles only late in training.At 17B tokens, fact-address templates explain 0.29 of variance while correct answers remain at the four-way guessing rate of 24.9%.Source: §F.2 · pp. 27–28, Table 4 · p. 27
G.1. Model Scale
- Across tested model sizes, ordinal vectors select designated facts in 34.6–84.1% of cases; relative to the ceiling, they reach 68–87% in Qwen2.5 and 46% in Qwen3-8B.The tested Qwen2.5 sizes range from 1.5B to 32B parameters.Source: §G.1 · p. 28, Table 5 · p. 29
G.2. Base and Instruction-Tuned Weights
- Qwen2.5-3B-Instruct selects 72.2% with a plain prompt versus 48.0% in its chat template, while the ceiling falls from 90.3% to 66.1%.Base Qwen weights carry the address about as strongly as tuned weights, while the Llama base model is weaker.Source: §G.2 · pp. 28–29
G.3. Facts Stated in Prose
Fact addresses transfer from templated lists to prose, though selection rates are lower in paragraphs and less of their state geometry lies in the list-derived address span.
G.3. Facts Stated in Prose
- 44.5%, 42.4%, and 14.0% of prose cases select designated facts in Qwen, Gemma, and Llama, versus 80.5%, 52.2%, and 29.3% on matched lists.The ordinal vectors were calibrated on main-text lists and evaluated on paragraphs with new names and contents.Source: §G.3 · p. 29, Table 7 · p. 30
- Paragraph-calibrated vectors select 41.1%, 24.1%, and 12.2% on list receivers, while list-calibrated vectors outperform paragraph-calibrated vectors on prose receivers.For prose receivers, list-calibrated vectors select 44.0%, 43.4%, and 10.2%, compared with 40.2%, 32.3%, and 8.5% for paragraph-calibrated vectors.Source: §G.3 · p. 29
- Prose and list fact-address templates point in similar directions (cosines 0.76, 0.81, and 0.84), though less prose-state norm lies in the list-address span.The three-dimensional span holds 35%, 17%, and 34% of squared prose-state norm in Qwen, Gemma, and Llama, respectively.Source: §G.3 · p. 29