Attention at scale: Transolver

Attention grows with the square of the points; slices, latents and linear schemes keep it tractable.

Outcome: Explain Transolver's physics attention: slice, attend among slices, deslice; compare linear-cost schemes (slices, latents, linear attention, anchors) and say what they all give up; read the ablation evidence on what makes Transolver work; weight sums over mesh points by the area or volume each point stands for.

Builds on Self-attention and the transformer, Cross-attention and latent space

Plain attention costs N2N^2. Latent models avoid it by compressing first. Transolver (Wu et al. 2024) takes another route: group the points with learned weights, intended to gather points in a similar physical state, and let the groups attend to each other. Nothing forces a group to mean anything physical. It is a common baseline, for example in the CarBench benchmark.

Figure 6-5. Pairwise interactions per layer on a log scale, for the number of mesh points set above: full attention grows with N², the other three roughly with N.

Physics attention, step by step

  1. Slice. A linear layer gives every point a score for each of MM slices (32 or 64 in the paper’s experiments); a softmax over the MM scores turns them into weights that sum to 1. A point in the stagnation region might belong 80 % to one slice, a point in the wake mostly to another. Slices are not regions of space: points far apart can share a slice.
  2. Slice tokens. Each slice token is the weighted mean of all point features, weighted by membership. NN points become MM tokens. Cost N×MN \times M.
  3. Attend. Ordinary multi-head self-attention among the MM slice tokens. Cost M2M^2.
  4. Deslice. Each point receives the mix of slice tokens given by its own weights. Cost N×MN \times M again.
wi=softmax⁡(xiWs)zj=∑i=1Nwij xi∑i=1Nwijz′=MultiHead⁡(z)xi′=∑j=1Mwij zj′\begin{aligned} w_i &= \operatorname{softmax}(x_i W_s) \\ z_j &= \frac{\sum_{i=1}^{N} w_{ij}\, x_i}{\sum_{i=1}^{N} w_{ij}} \\ z' &= \operatorname{MultiHead}(z) \\ x_i' &= \sum_{j=1}^{M} w_{ij}\, z_j' \end{aligned}
(6-6)
xix_i: the features of point ii, a row of dd numbers; WsW_s: the slicing layer, d×Md \times M; wijw_{ij}: the weight of point ii in slice jj, with ∑jwij=1\sum_j w_{ij} = 1; zjz_j: slice token jj; MultiHead is Equation 6-3 among the MM slice tokens.
mesh points → statesslices attend
Figure 6-6. Transolver: points are softly assigned to a few learned slices, and attention runs among the slices.

A Transolver model is a stack of transformer blocks in which this layer replaces ordinary self-attention.

Other routes to linear cost

Slices are one of a family of schemes that avoid the N×NN \times N matrix in the same way: the points exchange information through a small intermediate set, at a cost of about N×MN \times M. The schemes differ in what that set is.

  • Learned tokens. Latent queries read the points by cross-attention, once at the input (last lesson) or in every layer, as in FLARE (Puri et al. 2025). Slices are learned tokens too, filled by a weighted mean instead of attention.
  • Sampled points. A few thousand of the mesh points, the anchors, attend to each other, and all other points read them (next lesson).
  • A coarse grid. A local graph operator gathers the points onto the tokens of a coarse grid, a transformer works on those, and a second graph operator returns to the points: the layout of GINO with attention in the middle, as in GAOT.
  • No intermediate set: linear attention. The softmax over tokens is dropped, and each query and each key is transformed on its own: by a positive feature map such as elu⁡(x)+1\operatorname{elu}(x) + 1 (Katharopoulos et al. 2020), or by a normalisation. The product can then be regrouped as in Equation 6-7, and the intermediate object is a d×dd \times d matrix.
(Q~K~⊤) V=Q~ (K~⊤V)\big(\tilde{Q} \tilde{K}^\top\big)\, V = \tilde{Q}\, \big(\tilde{K}^\top V\big)
(6-7)
Q~\tilde{Q}, K~\tilde{K}: the transformed queries and keys, N×dN \times d. On the left, Q~K~⊤\tilde{Q} \tilde{K}^\top is N×NN \times N; on the right, K~⊤V\tilde{K}^\top V is a small d×dd \times d matrix, so the N×NN \times N matrix is never formed. With a feature map, each output row is also divided by its sum of weights, the matching entry of Q~ (K~⊤1)\tilde{Q}\,(\tilde{K}^\top \mathbf{1}) with 1\mathbf{1} a column of NN ones, regrouped the same way. GNOT is one model with a linear-cost normalised attention of this kind.

In all of them, two points no longer exchange information directly but through MM tokens, or through a d×dd \times d matrix, so a sharp coupling between two particular points has to survive that bottleneck or be carried by local layers. How much this costs in accuracy depends on the problem and has to be measured.

Later models keep the slices and change what surrounds them. Transolver++ (Luo et al., 2025) sharpens the slice assignment and splits the points of one mesh across several GPUs (graphics processors), which only need to exchange their partial sums for the slice tokens; its authors report meshes of over a million points. GeoTransolver (Adams et al. 2025) adds cross-attention from the slices to a shared description of the geometry and the operating condition, reused in every block.

Ablation

The overall score of a model of several parts does not say which part earns the accuracy. An ablation does.

DefinitionAblation

A test that removes or replaces one part of a model, retrains it, and compares the error.

Reading a surrogate paper works through one such test of Transolver, in which the slicing, not the attention among slice tokens, carried most of the accuracy.

Example 6-5. Slice, attend, deslice in PyTorch
import torch
from torch import nn

class PhysicsAttention(nn.Module):
    def __init__(self, d=128, M=64, heads=8):
        super().__init__()
        # A score per point for each of the M slices.
        self.to_slices = nn.Linear(d, M)
        self.attn = nn.MultiheadAttention(
            d, heads, batch_first=True)

    def forward(self, x):                 # x: (B, N, d)
        # (B, N, M): each point's weights sum to 1.
        w = self.to_slices(x).softmax(dim=-1)1
        # Slice tokens: weighted means of points, (B, M, d).
        s = w.transpose(1, 2) @ x2
        s = s / (w.sum(dim=1)[..., None] + 1e-6)3
        # Attention among the M slice tokens only.
        s = self.attn(s, s, s, need_weights=False)[0]
        # Deslice: back to every point, (B, N, d).
        return w @ s4

x = torch.randn(2, 100_000, 128)
print(PhysicsAttention()(x).shape)        # (2, 100000, 128)
  1. Softmax over the last axis, the MM slices: the wiw_i of Equation 6-6.
  2. (B, M, N) times (B, N, d): for each slice, the weighted sum of all point features, the numerator of zjz_j.
  3. Divide by each slice’s total weight; the 1e-6 guards against a slice that almost no point belongs to.
  4. Deslice: (B, N, M) times (B, M, d), each point’s own mix of the slice tokens.

Example 6-5 prints torch.Size([2, 100000, 128]): 100,000 points in and out, with attention only among 64 slice tokens.

A sum over points is an integral

Each slice token of Equation 6-6 is a mean in which every point counts once. But a mesh point stands for a piece of surface or volume, and meshers make those pieces small where the flow changes fast. Counted once each, the points of a refined region outweigh the rest, and under refinement the mean converges to an average weighted by the mesher’s point density, so the model’s output depends on the mesher. Weighted by the area or volume aia_i each point stands for, the same mean is a quadrature of an integral over the surface or volume, as in the area-weighted error of Equation 3-3:

zj=∑i=1Nai wij xi∑i=1Nai wijz_j = \frac{\sum_{i=1}^{N} a_i\, w_{ij}\, x_i}{\sum_{i=1}^{N} a_i\, w_{ij}}
(6-8)
aia_i: the area (in 2D, the length) or volume of the cell that point ii stands for; wijw_{ij}, xix_i, zjz_j as in Equation 6-6. With all aia_i equal it is the slice token of Equation 6-6.

The same rule holds for any sum over points inside a model, in pooling, attention or a loss. In a softmax over points, weighting point ii by aia_i is the same as adding log⁡ai\log a_i to its score. When only a sample of the points is used, the weights change again (training on industrial meshes). With one mesher and one refinement rule the effect stays hidden; it shows when the model meets meshes graded differently. Figure 6-7 shows it on a Joukowski airfoil, small enough to compute exactly.

|error| of mean Cpcells N110⁻³10⁻⁶10⁻⁹166425610244096counted onceweighted by length
Figure 6-7. The exact potential-flow pressure coefficient on a Joukowski airfoil at 4°, computed on this page, on meshes of NN cells packed near the leading edge by the same grading law (inset, N=48N = 48; at N=96N = 96 the longest cell is 51 times the shortest). The mean CpC_p over the surface is taken from CpC_p at each cell’s midpoint, with every cell counted once (thin line) and with every cell weighted by its length (thick line). Plotted is the absolute error against the converged weighted mean, −0.1949. The counted mean stays 0.21 off at every NN: it converges to a mean weighted by the mesher’s density. The weighted mean falls as N−2N^{-2}, to 1.6 × 10−9 at N=4096N = 4096.