Table of Contents
Fetching ...

The Geometry of Thought: Disclosing the Transformer as a Tropical Polynomial Circuit

Faruk Alpay, Bilge Senturk

TL;DR

The paper addresses how Transformer self-attention computes in the high-confidence regime, showing that the tropical limit ($β → ∞$) of softmax attention yields a tropical matrix–vector product. By applying Maslov dequantization, it formalizes that a single attention layer performs a max-plus operation, and multiple layers correspond to a dynamic programming accumulation along a path in a latent token graph, akin to Bellman-Ford updates. Key contributions include a rigorous demonstration of the tropical limit, explicit expressions for multi-layer outputs $Y^{(L)} = A^{⊗L} ⊗ V^{(0)}$ with a path-based expansion, and a geometric interpretation via tropical polytopes and hypersurfaces that links to chain-of-thought reasoning. The work provides a principled bridge between idempotent mathematics and neural reasoning, offering insights into why step-by-step prompting can aid internal reasoning and outlining future directions to relate finite-$β$ regimes to tropical optimization in practical models.

Abstract

We prove that the Transformer self-attention mechanism in the high-confidence regime ($β\to \infty$, where $β$ is an inverse temperature) operates in the tropical semiring (max-plus algebra). In particular, we show that taking the tropical limit of the softmax attention converts it into a tropical matrix product. This reveals that the Transformer's forward pass is effectively executing a dynamic programming recurrence (specifically, a Bellman-Ford path-finding update) on a latent graph defined by token similarities. Our theoretical result provides a new geometric perspective for chain-of-thought reasoning: it emerges from an inherent shortest-path (or longest-path) algorithm being carried out within the network's computation.

The Geometry of Thought: Disclosing the Transformer as a Tropical Polynomial Circuit

TL;DR

The paper addresses how Transformer self-attention computes in the high-confidence regime, showing that the tropical limit () of softmax attention yields a tropical matrix–vector product. By applying Maslov dequantization, it formalizes that a single attention layer performs a max-plus operation, and multiple layers correspond to a dynamic programming accumulation along a path in a latent token graph, akin to Bellman-Ford updates. Key contributions include a rigorous demonstration of the tropical limit, explicit expressions for multi-layer outputs with a path-based expansion, and a geometric interpretation via tropical polytopes and hypersurfaces that links to chain-of-thought reasoning. The work provides a principled bridge between idempotent mathematics and neural reasoning, offering insights into why step-by-step prompting can aid internal reasoning and outlining future directions to relate finite- regimes to tropical optimization in practical models.

Abstract

We prove that the Transformer self-attention mechanism in the high-confidence regime (, where is an inverse temperature) operates in the tropical semiring (max-plus algebra). In particular, we show that taking the tropical limit of the softmax attention converts it into a tropical matrix product. This reveals that the Transformer's forward pass is effectively executing a dynamic programming recurrence (specifically, a Bellman-Ford path-finding update) on a latent graph defined by token similarities. Our theoretical result provides a new geometric perspective for chain-of-thought reasoning: it emerges from an inherent shortest-path (or longest-path) algorithm being carried out within the network's computation.
Paper Structure (4 sections, 3 theorems, 15 equations, 2 figures)

This paper contains 4 sections, 3 theorems, 15 equations, 2 figures.

Key Result

Lemma 1

For any real numbers $x_1, x_2, \dots, x_n$, one has

Figures (2)

  • Figure 1: Visualization of the tropical limit on the probability simplex. As the inverse temperature $\beta$ increases, a softmax probability distribution (orange path) concentrates toward a vertex (a one-hot vector). The dashed lines represent the tropical hypersurface (decision boundaries) where coordinate scores are tied. These boundaries partition the simplex into regions where one component dominates. In the limit $\beta \to \infty$, the system flows deterministically to the vertex with the maximum score.
  • Figure 2: A toy illustration of tropical multi-hop reasoning. Each node represents a token. Directed edges are labeled with attention scores $A_{ij}$. In the tropical limit, a two-layer attention stack selects the path of length 2 maximizing the total weight. To compute the state at token 3, the model compares the direct edge (weight 5) against two-hop paths. The optimal path $0 \to 1 \to 3$ (highlighted in orange) has total weight $8$, surpassing the alternatives. This mirrors the Bellman--Ford algorithm.

Theorems & Definitions (7)

  • Definition 1: Idempotent Semirings and Tropical Arithmetic
  • Lemma 1: Maslov Dequantization: $\mathop{\mathrm{softmax}}\limits \to \max$
  • proof
  • Theorem 1: Tropical Limit of Self-Attention
  • proof
  • Corollary 1: Multi-Layer Tropical Path
  • proof