Davis Geometric

Spectral geometry / Transformer attention

A pulse goes in.
The structure lights up.

A network can hide its organization in thousands of connections. A heat kernel asks a simpler question: if a pulse starts here, where can it spread—and what slows it down?

A language model builds an answer by repeatedly combining information from its context. My research asks how those connections are organized: which token positions stay closely coupled, which groups exchange information easily, and how that organization changes across layers and attention heads.

Independent research Bee Rosa Davis · December 2025 preprint · Interactive companion

The question behind the picture

Language depends on relationships, not just nearby words.

Consider: “The key to the cabinets is missing.” The verb agrees with key, even though cabinets is closer. A useful representation has to preserve relationships that are not obvious from word order alone.

Attention is one way a transformer combines context: each head forms a weighted mixture of information from token positions. Those weights make a network. The heat kernel lets me inspect the organization of that network without having to read thousands of weights one at a time.

The illustration below isolates one question: does a network mostly keep information within local groups, or does it readily connect those groups? It uses constructed graphs so the mechanism is easy to see; the recorded language-model measurements come later.

Start here / What is a heat kernel?

A map of how a small disturbance spreads.

In everyday language

Touch one spot on a metal plate with something hot. At first, the heat stays near that spot. Over time it spreads. The plate’s shape and its ability to conduct heat determine where it goes.

A heat kernel describes the response to that tiny, concentrated starting pulse. It tells you how much of the response appears at each destination after a chosen amount of time. Repeat that question for every possible starting spot, and you have a complete map of how the system spreads a disturbance.

On this page, the plate becomes a network. The lines conduct a mathematical pulse between dots. Strong and weak connections leave different patterns, making the network’s organization visible.

Technical definition · The heat equation, its kernel, and the graph version

For a finite graph, choose a positive-semidefinite Laplacian L. The diffusion equation is du/dt = −Lu, with initial state u(0) = u₀. Its solution is u(t) = K(t)u₀, where K(t) = exp(−tL) is the heat-kernel matrix. The exponential is a matrix exponential, not an entry-by-entry operation.

With column-vector states, Kᵢⱼ(t) is the response at position i to a unit impulse initially placed at position j. At t = 0, K(0) = I: nothing has spread yet. The identity K(t + s) = K(t)K(s) means that diffusing for s and then t is equivalent to diffusing for their sum.

In this study, A contains attention weights, W = (A + Aᵀ)/2 makes them symmetric, and D is diagonal with Dᵢᵢ = ΣⱼWᵢⱼ. For positive degrees, the symmetric normalized Laplacian is L = I − D⁻½WD⁻½. If Lφₖ = λₖφₖ with orthonormal eigenvectors, then Kᵢⱼ(t) = Σₖ exp(−tλₖ)φₖ(i)φₖ(j). Large-eigenvalue modes fade quickly; small-eigenvalue modes persist. This is the link between the animation and spectral geometry.

The normalized symmetric kernel does not generally have columns summing to one. To display a conserved probability pulse, this companion uses P(t) = D½K(t)D⁻½. Thus the displayed percentage at i for a pulse starting at j is 100 × Pᵢⱼ(t). P and K have the same diagonal and trace. The two constructed graphs have positive degrees even when the connections between their groups are removed.

On a Riemannian manifold, the analogous kernel Hₜ(x,y) solves the heat equation for the chosen Laplace–Beltrami operator and boundary conditions: u(t,x) = ∫ Hₜ(x,y)u₀(y) dvol(y). The graph uses a finite sum in place of the integral. Its relationship to a continuous geometry depends on how the graph and operator are constructed.

See how the study builds this operator from attention ↓ · Read the paper’s mathematical formulation

01 / Same starting point · same clock · different connections

How strongly are two groups of tokens connected?

In a language model, attention connects token positions—words or parts of words. Here, each dot stands for a position, and each line is a weighted connection. The two clusters are groups of positions that are strongly connected within themselves. The brown lines between the groups are the “bridges.” They represent weaker or stronger coupling between groups in a symmetric view of attention.

On the left, those links have low weights: a test pulse spreads within its starting group before much reaches the other group. On the right, the same links have higher weights, so the groups exchange the pulse sooner. Watch the “Reached the other group” percentage to see the difference. This is a controlled illustration of connectivity, not a recording of words moving through an LLM.

A

Weak connections between groups

Small weights on the brown links · slower exchange
Brown links connect the groups Node 1: 7.87% of the pulse 01 Node 2: 12.30% of the pulse 02 Node 3: 7.81% of the pulse 03 Node 4: 12.38% of the pulse 04 Node 5: 18.02% of the pulse 05 · pulse Node 6: 12.24% of the pulse 06 Node 7: 7.87% of the pulse 07 Node 8: 12.30% of the pulse 08 Node 9: 7.81% of the pulse 09 Node 10: 0.22% of the pulse 10 Node 11: 0.14% of the pulse 11 Node 12: 0.05% of the pulse 12 Node 13: 0.32% of the pulse 13 Node 14: 0.20% of the pulse 14 Node 15: 0.07% of the pulse 15 Node 16: 0.22% of the pulse 16 Node 17: 0.14% of the pulse 17 Node 18: 0.05% of the pulse 18 TOKEN GROUP A TOKEN GROUP B
Reached the other group
1.4%
Still at the starting node
18.0%
Spectral gap λ₁
0.0071
B

Strong connections between groups

Larger weights on the brown links · faster exchange
Brown links connect the groups Node 1: 6.93% of the pulse 01 Node 2: 10.02% of the pulse 02 Node 3: 6.74% of the pulse 03 Node 4: 10.98% of the pulse 04 Node 5: 14.84% of the pulse 05 · pulse Node 6: 9.87% of the pulse 06 Node 7: 6.93% of the pulse 07 Node 8: 10.02% of the pulse 08 Node 9: 6.74% of the pulse 09 Node 10: 2.90% of the pulse 10 Node 11: 1.55% of the pulse 11 Node 12: 0.57% of the pulse 12 Node 13: 3.93% of the pulse 13 Node 14: 2.14% of the pulse 14 Node 15: 0.83% of the pulse 15 Node 16: 2.90% of the pulse 16 Node 17: 1.55% of the pulse 17 Node 18: 0.57% of the pulse 18 TOKEN GROUP A TOKEN GROUP B
Reached the other group
16.9%
Still at the starting node
14.8%
Spectral gap λ₁
0.0896

The nearby group fills first. Weak connections between groups delay the exchange between groups.

Reading this as an attention pattern: the left graph keeps the two token groups more separate at this scale. The right graph allows faster exchange between them. In a model, that distinction could matter when an answer needs a relationship spanning both groups.

Pulse at a node 0% 5% 25% 100%

Constructed graphs, not recorded transformer attention. Color and node size show pulse probability on a shared scale. Moving dots indicate net diffusion direction; they are not tokens traveling through a model. Crossing lines do not create extra nodes.

02 / A different view of the same calculation

Neighborhoods become visible at different scales.

Every possible starting point

Read one column from top to bottom: it shows where a pulse from that starting node ends up. Near time zero, the bright diagonal means each pulse stays where it began. Later, bright square blocks reveal groups that exchange mostly with themselves. Broader color across the blocks shows exchange between groups.

Weak connections between groups

Starting node → From 1 to 1: 10.11% From 2 to 1: 9.01% From 3 to 1: 7.63% From 4 to 1: 9.05% From 5 to 1: 7.87% From 6 to 1: 6.71% From 7 to 1: 7.80% From 8 to 1: 6.81% From 9 to 1: 6.02% From 10 to 1: 0.17% From 11 to 1: 0.06% From 12 to 1: 0.03% From 13 to 1: 0.13% From 14 to 1: 0.05% From 15 to 1: 0.02% From 16 to 1: 0.13% From 17 to 1: 0.05% From 18 to 1: 0.02% From 1 to 2: 14.10% From 2 to 2: 14.34% From 3 to 2: 13.79% From 4 to 2: 12.32% From 5 to 2: 12.30% From 6 to 2: 12.05% From 7 to 2: 10.66% From 8 to 2: 10.42% From 9 to 2: 10.40% From 10 to 2: 0.41% From 11 to 2: 0.18% From 12 to 2: 0.10% From 13 to 2: 0.32% From 14 to 2: 0.14% From 15 to 2: 0.08% From 16 to 2: 0.30% From 17 to 2: 0.13% From 18 to 2: 0.08% From 1 to 3: 7.75% From 2 to 3: 8.94% From 3 to 3: 9.86% From 4 to 3: 6.80% From 5 to 3: 7.81% From 6 to 3: 8.82% From 7 to 3: 6.11% From 8 to 3: 6.75% From 9 to 3: 7.56% From 10 to 3: 0.47% From 11 to 3: 0.26% From 12 to 3: 0.17% From 13 to 3: 0.39% From 14 to 3: 0.22% From 15 to 3: 0.15% From 16 to 3: 0.35% From 17 to 3: 0.19% From 18 to 3: 0.13% From 1 to 4: 14.17% From 2 to 4: 12.32% From 3 to 4: 10.48% From 4 to 4: 14.50% From 5 to 4: 12.38% From 6 to 4: 10.34% From 7 to 4: 14.17% From 8 to 4: 12.32% From 9 to 4: 10.48% From 10 to 4: 0.23% From 11 to 4: 0.08% From 12 to 4: 0.04% From 13 to 4: 0.20% From 14 to 4: 0.07% From 15 to 4: 0.03% From 16 to 4: 0.23% From 17 to 4: 0.08% From 18 to 4: 0.04% From 1 to 5: 17.79% From 2 to 5: 17.76% From 3 to 5: 17.38% From 4 to 5: 17.88% From 5 to 5: 18.02% From 6 to 5: 17.50% From 7 to 5: 17.79% From 8 to 5: 17.76% From 9 to 5: 17.38% From 10 to 5: 0.49% From 11 to 5: 0.21% From 12 to 5: 0.11% From 13 to 5: 0.45% From 14 to 5: 0.20% From 15 to 5: 0.11% From 16 to 5: 0.49% From 17 to 5: 0.21% From 18 to 5: 0.11% From 1 to 6: 10.61% From 2 to 6: 12.17% From 3 to 6: 13.73% From 4 to 6: 10.44% From 5 to 6: 12.24% From 6 to 6: 14.09% From 7 to 6: 10.61% From 8 to 6: 12.17% From 9 to 6: 13.73% From 10 to 6: 0.60% From 11 to 6: 0.33% From 12 to 6: 0.21% From 13 to 6: 0.58% From 14 to 6: 0.32% From 15 to 6: 0.20% From 16 to 6: 0.60% From 17 to 6: 0.33% From 18 to 6: 0.21% From 1 to 7: 7.80% From 2 to 7: 6.81% From 3 to 7: 6.02% From 4 to 7: 9.05% From 5 to 7: 7.87% From 6 to 7: 6.71% From 7 to 7: 10.11% From 8 to 7: 9.01% From 9 to 7: 7.63% From 10 to 7: 0.13% From 11 to 7: 0.05% From 12 to 7: 0.02% From 13 to 7: 0.13% From 14 to 7: 0.05% From 15 to 7: 0.02% From 16 to 7: 0.17% From 17 to 7: 0.06% From 18 to 7: 0.03% From 1 to 8: 10.66% From 2 to 8: 10.42% From 3 to 8: 10.40% From 4 to 8: 12.32% From 5 to 8: 12.30% From 6 to 8: 12.05% From 7 to 8: 14.10% From 8 to 8: 14.34% From 9 to 8: 13.79% From 10 to 8: 0.30% From 11 to 8: 0.13% From 12 to 8: 0.08% From 13 to 8: 0.32% From 14 to 8: 0.14% From 15 to 8: 0.08% From 16 to 8: 0.41% From 17 to 8: 0.18% From 18 to 8: 0.10% From 1 to 9: 6.11% From 2 to 9: 6.75% From 3 to 9: 7.56% From 4 to 9: 6.80% From 5 to 9: 7.81% From 6 to 9: 8.82% From 7 to 9: 7.75% From 8 to 9: 8.94% From 9 to 9: 9.86% From 10 to 9: 0.35% From 11 to 9: 0.19% From 12 to 9: 0.13% From 13 to 9: 0.39% From 14 to 9: 0.22% From 15 to 9: 0.15% From 16 to 9: 0.47% From 17 to 9: 0.26% From 18 to 9: 0.17% From 1 to 10: 0.17% From 2 to 10: 0.26% From 3 to 10: 0.47% From 4 to 10: 0.15% From 5 to 10: 0.22% From 6 to 10: 0.39% From 7 to 10: 0.13% From 8 to 10: 0.19% From 9 to 10: 0.35% From 10 to 10: 9.86% From 11 to 10: 8.94% From 12 to 10: 7.75% From 13 to 10: 8.82% From 14 to 10: 7.81% From 15 to 10: 6.80% From 16 to 10: 7.56% From 17 to 10: 6.75% From 18 to 10: 6.11% From 1 to 11: 0.10% From 2 to 11: 0.18% From 3 to 11: 0.41% From 4 to 11: 0.08% From 5 to 11: 0.14% From 6 to 11: 0.32% From 7 to 11: 0.08% From 8 to 11: 0.13% From 9 to 11: 0.30% From 10 to 11: 13.79% From 11 to 11: 14.34% From 12 to 11: 14.10% From 13 to 11: 12.05% From 14 to 11: 12.30% From 15 to 11: 12.32% From 16 to 11: 10.40% From 17 to 11: 10.42% From 18 to 11: 10.66% From 1 to 12: 0.03% From 2 to 12: 0.06% From 3 to 12: 0.17% From 4 to 12: 0.02% From 5 to 12: 0.05% From 6 to 12: 0.13% From 7 to 12: 0.02% From 8 to 12: 0.05% From 9 to 12: 0.13% From 10 to 12: 7.63% From 11 to 12: 9.01% From 12 to 12: 10.11% From 13 to 12: 6.71% From 14 to 12: 7.87% From 15 to 12: 9.05% From 16 to 12: 6.02% From 17 to 12: 6.81% From 18 to 12: 7.80% From 1 to 13: 0.21% From 2 to 13: 0.33% From 3 to 13: 0.60% From 4 to 13: 0.20% From 5 to 13: 0.32% From 6 to 13: 0.58% From 7 to 13: 0.21% From 8 to 13: 0.33% From 9 to 13: 0.60% From 10 to 13: 13.73% From 11 to 13: 12.17% From 12 to 13: 10.61% From 13 to 13: 14.09% From 14 to 13: 12.24% From 15 to 13: 10.44% From 16 to 13: 13.73% From 17 to 13: 12.17% From 18 to 13: 10.61% From 1 to 14: 0.11% From 2 to 14: 0.21% From 3 to 14: 0.49% From 4 to 14: 0.11% From 5 to 14: 0.20% From 6 to 14: 0.45% From 7 to 14: 0.11% From 8 to 14: 0.21% From 9 to 14: 0.49% From 10 to 14: 17.38% From 11 to 14: 17.76% From 12 to 14: 17.79% From 13 to 14: 17.50% From 14 to 14: 18.02% From 15 to 14: 17.88% From 16 to 14: 17.38% From 17 to 14: 17.76% From 18 to 14: 17.79% From 1 to 15: 0.04% From 2 to 15: 0.08% From 3 to 15: 0.23% From 4 to 15: 0.03% From 5 to 15: 0.07% From 6 to 15: 0.20% From 7 to 15: 0.04% From 8 to 15: 0.08% From 9 to 15: 0.23% From 10 to 15: 10.48% From 11 to 15: 12.32% From 12 to 15: 14.17% From 13 to 15: 10.34% From 14 to 15: 12.38% From 15 to 15: 14.50% From 16 to 15: 10.48% From 17 to 15: 12.32% From 18 to 15: 14.17% From 1 to 16: 0.13% From 2 to 16: 0.19% From 3 to 16: 0.35% From 4 to 16: 0.15% From 5 to 16: 0.22% From 6 to 16: 0.39% From 7 to 16: 0.17% From 8 to 16: 0.26% From 9 to 16: 0.47% From 10 to 16: 7.56% From 11 to 16: 6.75% From 12 to 16: 6.11% From 13 to 16: 8.82% From 14 to 16: 7.81% From 15 to 16: 6.80% From 16 to 16: 9.86% From 17 to 16: 8.94% From 18 to 16: 7.75% From 1 to 17: 0.08% From 2 to 17: 0.13% From 3 to 17: 0.30% From 4 to 17: 0.08% From 5 to 17: 0.14% From 6 to 17: 0.32% From 7 to 17: 0.10% From 8 to 17: 0.18% From 9 to 17: 0.41% From 10 to 17: 10.40% From 11 to 17: 10.42% From 12 to 17: 10.66% From 13 to 17: 12.05% From 14 to 17: 12.30% From 15 to 17: 12.32% From 16 to 17: 13.79% From 17 to 17: 14.34% From 18 to 17: 14.10% From 1 to 18: 0.02% From 2 to 18: 0.05% From 3 to 18: 0.13% From 4 to 18: 0.02% From 5 to 18: 0.05% From 6 to 18: 0.13% From 7 to 18: 0.03% From 8 to 18: 0.06% From 9 to 18: 0.17% From 10 to 18: 6.02% From 11 to 18: 6.81% From 12 to 18: 7.80% From 13 to 18: 6.71% From 14 to 18: 7.87% From 15 to 18: 9.05% From 16 to 18: 7.63% From 17 to 18: 9.01% From 18 to 18: 10.11% 1 1 9 9 10 10 18 18 Destination node Outlined column: your selected pulse

How long do different patterns persist?

A network has characteristic patterns of variation, called modes. Diffusion smooths out the fast ones first. Slow modes describe differences that persist, such as one group remaining more concentrated than another. The heat trace adds their remaining weights into one curve.

Weak / removed connections Strong connections between groups
Heat trace Z(t) · sum of return probabilities 1 2 6 12 18 0 0.5 5 40 160 Diffusion time · logarithmic spacing of 1 + t

At t = 0 the trace is 18. In the long-time limit it approaches 1 for a connected graph, or 2 when the two groups are disconnected. The finite right edge of the plot is not that limit.

The spectral gap describes the slowest nonconstant mode’s decay rate. The narrow-bridge graph has a smaller gap: the difference between its two groups takes longer to disappear. Applied to attention, this gives a measurable description of integration and separation. Neither is automatically better—local processing may benefit from separation, while a task requiring a distant relationship may need stronger exchange.

03 / From language to a graph

What does this tell us about LLM cognition?

Here, cognition means how a model organizes and transforms contextual information while producing a continuation. Attention patterns offer one observable part of that process. A heat kernel turns those patterns into questions we can compare across prompts, layers and heads.

01

Read the attention

A node represents a token position—a word or part of a word. For one head in one layer, the attention weights describe how that position mixes information from the available context. A different prompt can produce a different graph.

02

Build the diffusion operator

The study makes an undirected view of those weighted connections and constructs a normalized Laplacian: an operator describing how differences across connected positions can smooth out. Its spectrum tells us which patterns fade quickly and which persist.

03

Compare several scales

Short diffusion times emphasize nearby relationships. Longer times reveal how groups connect to the wider context. Comparing these profiles across layers can show how the organization of attention changes as token representations are updated.

W = (A + Aᵀ) / 2   →   L = I − D⁻½ W D⁻½   →   K(t) = exp(−tL)

This suggests concrete research questions. Does a head mostly bind a small group of positions? Does another connect those groups? Does a prompt requiring a distant relationship change that pattern? These are hypotheses about computational roles that can be tested by changing or removing the head and checking the output.

The analysis uses a symmetric view of attention, so it discards direction. Attention weights also omit the content of value vectors, feed-forward computations and residual updates. The diffusion picture is a probe of one part of the model, not a replay of its complete computation.

The calculation behind the pulse

The symmetric normalized kernel K is not generally a probability-transition matrix. This page displays P(t) = D½ K(t) D⁻½, so each column sums to one. Its diagonal and trace equal those of K. This keeps the pulse conserved while using the paper’s normalized Laplacian and spectrum.

For each graph, all 18 eigenpairs are retained. Independent matrix-exponential checks verify the spectral calculation, positivity, mass conservation and the disconnected case. At equilibrium, probability is proportional to node degree; it need not be uniform.

04 / A practical research question

Which attention heads are worth keeping?

A transformer uses many attention heads in parallel. If you want a smaller model, you need to decide which ones to keep. A head can have large or variable attention weights without providing a distinctive pattern of connectivity.

Compare how the heads connect things.

Two heads can have very different-looking weight matrices yet organize connections in similar ways. Conversely, a small set of weights may provide the only strong link between two groups. Heat-kernel profiles offer a way to compare these patterns across scales, rather than rank a head only by how large or variable its weights are.

The next step is an intervention: mask the selected heads, run the model, and measure what changed. Similar descriptors alone do not prove that two heads are interchangeable.

The useful output is a testable comparison: identify a geometric difference, intervene on the component, and check whether the difference matters for model performance.

05 / Security implications · A proposed extension

When the text being read tries to take charge.

You ask an assistant to summarize a document. Inside the document, someone has inserted instructions telling it to abandon your request. The security question is simple: can the assistant read those words without treating them as orders? This is the trust boundary that prompt injection tries to cross.

Reading is necessary. Obeying is different.

A model has to attend to a document to summarize it. Strong connections to its words are therefore expected—even when the document discusses an attack. Attention alone cannot tell us whether the model has confused source material with an authorized instruction.

My security question is whether changes in the geometry of attention help distinguish ordinary reading from a successful redirection. We could compare the same task with a clean document, an injected version, and a harmless quotation of the same instruction.

01 / Observe

Locate the change.

Label token spans by their source: task instruction, retrieved document and generated response. Compare diffusion profiles across heads and layers to find where the relationships change. Keep these labels: a heat trace alone loses the identity of the positions involved.

02 / Test

Connect it to behavior.

Compare successful attacks with resisted attacks and benign examples. Test selected heads through controlled interventions. A changed spectral gap becomes useful only if it helps explain or predict the behavior we care about.

03 / Evaluate

Measure the false alarms.

Evaluate on unseen documents, attack styles and models. Report missed attacks, false alarms on legitimate work and the cost of monitoring. Include attackers that adapt to the proposed detector.

The potential benefit: an internal signal that helps investigators locate a failure, or helps a monitoring system decide when to pause an action for review. This requires access to model attention, which many hosted APIs do not expose. Any resulting monitor would complement tool permissions and data-access controls; a geometric score cannot grant authority.

There is precedent for investigating attention in this setting: Hung and colleagues’ Attention Tracker (NAACL 2025) studies shifts toward injected instructions. It is a different method, and its results do not validate a heat-kernel detector. Anthropic’s browser-agent research also illustrates why defenses must be tested against adaptive attacks.

Research direction for this companion. The deposited study does not establish prompt-injection detection, attack attribution or prevention of data theft. No attack-detection performance is measured by the animation above.

06 / From the recorded study

What did the model measurements show?

One model, five reported layer positions.

Table 4 reports a larger spectral gap in the middle of GPT-2 Medium than at its entry and exit. In the corresponding diffusion analysis, a larger gap means the slowest nonconstant mode fades faster. This motivates a question about the model: are middle layers organizing context differently from the layers that receive and finish the representation? The profile identifies where to investigate; interventions are needed to establish what those layers do.

Spectral gap λ₁ · GPT-2 Medium 0 0.25 0.5 0.75 1 0.73 L0 0.77 L6 0.84 L12 0.84 L18 0.68 L23 Layer index · dashed segments only guide the eye
Transcribed from Table 4, page 8. Five reported values; no extra measurements have been interpolated. Open the figure ↗

Individual prompts, with the small sample kept visible.

The prompt experiment asks a different question: does attention organize itself differently for familiar facts and invented subjects? Compare “The capital of France is” with “The capital of Zorblania is.” The first refers to something real; the second invents an entity. The study compares three prompts of each kind per model.

Each dot below is a saved initial_effort value: a summary of how uneven a short-scale heat-kernel signal is across token positions early in generation. The name is the paper’s; the number is a geometric descriptor, not a measurement of mental effort.

0.000 0.002 0.004 0.006 0.008 GPT-2 Factual GPT-2 · The capital of France is · 0.0060834028102890285 GPT-2 · The chemical symbol for water is · 0.003691545801936792 GPT-2 · The speed of light is approximately · 0.004191535613048878 Invented GPT-2 · The capital of Zorblania is · 0.002148021446397529 GPT-2 · The chemical symbol for magicium is · 0.00260273028058021 GPT-2 · The flobnax constant is approximately · 0.0025079788804717785 GPT-2 Medium Factual GPT-2 Medium · The capital of France is · 0.007835264469689296 GPT-2 Medium · The chemical symbol for water is · 0.0051945046394313325 GPT-2 Medium · The speed of light is approximately · 0.005318766258054237 Invented GPT-2 Medium · The capital of Zorblania is · 0.0032488940061079414 GPT-2 Medium · The chemical symbol for magicium is · 0.0037098502564462325 GPT-2 Medium · The flobnax constant is approximately · 0.0028411036251852844 TinyLlama 1.1B Factual TinyLlama 1.1B · The capital of France is · 0.004382170783712877 TinyLlama 1.1B · The chemical symbol for water is · 0.003304588025786769 TinyLlama 1.1B · The speed of light is approximately · 0.003213049916511245 Invented TinyLlama 1.1B · The capital of Zorblania is · 0.0026013039786961993 TinyLlama 1.1B · The chemical symbol for magicium is · 0.0021043257440421692 TinyLlama 1.1B · The flobnax constant is approximately · 0.0019312166436355955 Stored initial_effort · plotted from deposited JSON, one dot per prompt
Replotted from the three deposited JSON files. “Factual” and “invented” describe the prompt categories, not verified labels for generated-answer correctness. Open the figure ↗

The factual prompts have larger values in these saved cases: their short-scale diffusion signatures are more uneven by this descriptor. That supports investigating whether familiar and invented subjects elicit different attention organization. It does not yet identify the cause of that difference or show that a generated answer is correct.

All 36 saved records—including forced correct and incorrect completions—received the same PATTERN_MATCHING classification. The useful next step is to test whether a richer profile predicts behavior on held-out prompts, while controlling wording, tokenization and sequence length.

Inspect the prompt measurements and source details
Source model Prompt Category Initial effort
GPT-2 The capital of France is Factual 0.006083
GPT-2 The chemical symbol for water is Factual 0.003692
GPT-2 The speed of light is approximately Factual 0.004192
GPT-2 The capital of Zorblania is Invented entity 0.002148
GPT-2 The chemical symbol for magicium is Invented entity 0.002603
GPT-2 The flobnax constant is approximately Invented entity 0.002508
GPT-2 Medium The capital of France is Factual 0.007835
GPT-2 Medium The chemical symbol for water is Factual 0.005195
GPT-2 Medium The speed of light is approximately Factual 0.005319
GPT-2 Medium The capital of Zorblania is Invented entity 0.003249
GPT-2 Medium The chemical symbol for magicium is Invented entity 0.003710
GPT-2 Medium The flobnax constant is approximately Invented entity 0.002841
TinyLlama 1.1B The capital of France is Factual 0.004382
TinyLlama 1.1B The chemical symbol for water is Factual 0.003305
TinyLlama 1.1B The speed of light is approximately Factual 0.003213
TinyLlama 1.1B The capital of Zorblania is Invented entity 0.002601
TinyLlama 1.1B The chemical symbol for magicium is Invented entity 0.002104
TinyLlama 1.1B The flobnax constant is approximately Invented entity 0.001931

Model names follow the deposit filenames: the records themselves use “gpt2” in the model field in all three files. Table 9’s reported means align with the TinyLlama file rather than the GPT-2 file named in its caption. This chart uses the individual deposited values and file identities.

The local validation script computes a scaled variance of the heat-kernel diagonal at t = 0.1, then summarizes an early window of the generation trajectory. This “effort” descriptor is not an energy measurement or a direct observation of retrieval. Prompt wording, tokenization and sequence length remain possible confounds.

08 / What this lens establishes

A way to inspect structure—and ask sharper questions.

Exact mathematics

For the defined graph, the kernel, spectrum and diffusion behavior are determined by its weights. The companion’s graphs and calculations are reproducible.

Recorded experiments

The paper reports attention profiles and a pruning comparison in GPT-2-family models, plus small prompt studies in GPT-2 and TinyLlama. The graphs above are teaching examples, separate from those records.

The next experiment

Test whether descriptors predict the effect of removing a head on held-out tasks, across seeds and model families. Prediction needs that comparison; a striking heat map alone cannot establish it.

How to read “curvature” and “fingerprint” in this study

The heat trace is a spectral descriptor, not a unique identity: different graphs can share a spectrum. The paper’s curvature quantities should likewise be read as experimental proxies, not automatically as a manifold’s scalar curvature.

For a finite graph, K(t) = I − tL + O(t²), so the literal limit 6 ∂ₜ log Kᵢᵢ(t) at zero equals −6Lᵢᵢ. It does not by itself extract the scalar-curvature term in a manifold heat-kernel expansion. The local validation code uses the different diagonal-variance descriptor described above.

Davis, B. R. (2025). Spectral Geometry of Transformer Cognition: Heat Kernel Analysis Reveals Functional Organization in Language Models. Zenodo, v1. Published December 2, 2025.