Abstract
Transformers stop learning graph search as graphs grow, and learn the card game SET only after many distinct questions, although attention can represent both. We read these failures, and the uneven record of higher-order attention, from what a layer sums over: each layer we study computes the partition function of a family of witnesses and reads it at a temperature. We prove two laws. By the size law, existence is read correctly at every size, in the worst case, if and only if inverse temperature times margin is at least the logarithm of the number of candidates. By the depth law, layers over two-step walks reach exactly steps: a construction reaches that far, and from anonymous initial states no such network reaches further, for every . Layers built on these laws, and on two principles that we test, learn where Transformers fail. One propagator layer trained on 49-vertex graphs answers every question at every search depth on 250-vertex graphs. Given the modulus 3, exponential Newton computes the softmax of 2-simplicial attention over pairs exactly in operations for clocks; with six clocks it learns SET from as few deals as 2-simplicial attention and transfers from 8- to 20-card tables. On CLRS-30 without hints, a 186,000-parameter block of OR-join and power-mean channels matches (within half a point) or beats a model of at least 73 million parameters on 9 of 12 graph tasks of the official test set, and on 8 of 12 with freshly drawn test graphs. The same account explains where pair layers did not help and where parallel layers must loop.
1Introduction
The record of higher-order attention is uneven, and no account predicts it. Transformers trained to find paths in graphs stop converging as the graphs grow1, although attention can represent connectivity at logarithmic depth2. Layers that keep a state for every pair of elements and update it through a third element are the core of protein structure prediction3 and of systematic compositional parsing4. In language modelling, 2-simplicial attention, which attends to pairs of tokens5, yields small gains in average loss6,7, and larger ones on mathematics, coding, reasoning and logic6. Which tasks reward such layers has so far been settled by experiment.
The difference lies in what a layer sums over. Softmax attention8 sums over single tokens, and each token computes its key from its own state before the query that reads it is known. When a task’s answer is a sum over pairs, walks or subsets of tokens, a layer that sums over single tokens can answer only if each token has already computed those structures in its state. Trained Transformers do exactly this for search: each vertex holds the set of vertices it reaches, and successive layers merge these sets1. The sets grow with the graph, and fewer and fewer training runs converge. We call the objects that a task’s answer sums over (tokens, pairs, walks, subsets) its witnesses.
Each layer we study can be written as computing the partition function of a family of witnesses, a sum in which each witness’s weight is a product over its parts, and reading it through a link at a temperature (Fig. 1a–c; Table 1). The form is not universal: a learned non-linear map of a pooled sum, as in Deep Sets9, is not one of its read-outs, and linear attention fits it only with signed potentials, outside the size law below. Three principles follow. First, match the family. We hypothesise that a layer learns a task easily when the answer is a read-out of its family’s partition function. Second, use a closed form. A product sums over subsets, a matrix inverse over walks and a determinant over spanning trees; we hypothesise that such a layer learns in one step what stacked layers learn by composition, at less cost, and that closed forms, being parallel, mark where layers must loop. Third, read the sum at low temperature through exponential gates, with a margin that grows with the logarithm of the family’s size. Only the third is a theorem, the size law (Theorem 2), which we check in full in Lean10,11 together with the construction of a depth law for stacked two-step walks (Theorem 1); the experiments test the first two.
We build layers from these principles and test them where Transformers fail. By the depth law, layers over two-step walks reach a goal exactly steps away: a construction reaches that far, and from anonymous initial states no network of their class reaches further, for every . Trained pair states, which start from vertex names, fall off near the same depth. The propagator removes this limit. It computes the closed form over walks of every length, , in one linear solve, from gates computed on a pair state. One such layer, trained on graphs of 49 vertices, answers every question of the search benchmark of Saparov et al.1 at every search depth on graphs of 250 vertices, in each of three runs. Newton attention computes the sum over subsets of partners through Newton’s identities12, at a cost linear in their number. Exponential Newton computes the softmax of 2-simplicial attention over pairs exactly, in operations, when the scores are sums of clocks (characters of ) and the modulus 3 is given. With six clocks it learns SET from as few deals as 2-simplicial attention and transfers from tables of 8 cards to tables of 20.
The same principles map the graph tasks of CLRS-3013. Where a closed form exists, one looped block of OR-join and power-mean channels with 186,000 parameters, trained without hints, matches or beats FloydNet14, a model of at least 73 million parameters, on 9 of 12 tasks of the official test set and 8 of 12 on freshly drawn test graphs. Where the output follows lexicographic depth-first order, which is P-complete15,16, errors grow with depth; on depth-first search they fall as the layer is looped more often, while on strongly connected components looping barely helps. In language modelling and chess, where most witnesses are single tokens, pair layers add little. Our positive results are on synthetic and algorithmic tasks, with small models.
2Families, closed forms and temperature
A family layer assigns to each query a family of witnesses. A witness is a finite set of parts, such as a token, a pair of tokens or an edge between two vertices. Each part carries a potential , and each witness may carry a value. From these the layer forms the partition function and the value moment,
and reads them through one of four links,
The temperature is the scale of the log-potentials. Softmax attention is the family of single tokens with and for queries and keys of rank , read as an average,
Table 1 places the others. The 2-simplicial join5,6, here the join, sums over ordered pairs of tokens. AlphaFold’s triangle update3, triangle attention4 and the OR join sum over two-step walks , the propagator over walks of every length, and Newton attention over subsets. A potential that couples several partners, as the join’s trilinear score does, must be enumerated or expanded.
Table 1 | The layer zoo. Each layer as a family, the closed form of its sum, its cost for all queries (or all pairs) and its read-out (2). Separate pair layers and looped ones are a family only after their threshold or OR. The Kirchhoff layer was tested only as a read-out, on Prim’s algorithm (Section 6).
| Layer | Family | Closed form of | Cost | Read-out |
|---|---|---|---|---|
| Softmax attention | single tokens | a sum | average | |
| 2-simplicial join | ordered pairs of tokens | none (enumerated) | average | |
| Pair layer, sum over | two-step walks | matrix product | count, scale | |
| Triangle attention | two-step walks | none (enumerated over ) | , memory | average |
| OR join | two-step walks | matrix product | , memory | OR |
| pair layers, or one looped times | walks of at most steps | repeated squaring | OR, threshold | |
| Propagator | walks of every length | one solve, | OR, free energy | |
| Newton attention | -subsets | per channel | count; trained as a mean | |
| Exponential Newton | unordered pairs, clock energies | characters (Proposition 3) | average | |
| Kirchhoff layer | spanning trees | determinant | marginals |
The first principle, a hypothesis, is to match the family. In one step a layer computes a read-out of its partition function and nothing else, so any other structure the answer needs must already be in its partners’ states. In SET the cards are the elements of , and three cards form a set when they sum to zero, that is, when each of the four attributes is the same on all three or different on all three. A deal is a card in hand and eight table cards, and the question is whether two table cards complete a set with the card in hand. Single tokens are the wrong family for it.
Proposition 1 (No single-card scores rank SET’s pairs)
Let a layer score each pair of table cards by , the sum of two lookup scores, for some function of the card in hand and one table card. For every , every and every table size there is a deal on which a pair that does not complete a set with scores at least as high as a pair that does.
Such separations between pair and single-element set networks are known17.
The second principle, also a hypothesis, is to use a closed form. Three families have one:
They sum over subsets, with coefficients from power sums by Newton’s identities in linear time; over walks, in one solve when the spectral radius of is below one; and over the spanning arborescences directed away from a root , through the in-degree Laplacian with row and column removed18. Counting simple paths, by contrast, is #P-hard19. Closed forms suffice for low cost but are not necessary20,21. They are parallel. Inverses and determinants lie in NC22, as do repeated squaring and Newton’s recursion, whereas lexicographic depth-first order is P-complete15. So, unless NC = P, no stack of polylogarithmically many such layers computes it on all graphs, and a looped layer must run more than polylogarithmically many times (Proofs).
Depth composes short families into longer ones, and for two-step walks the reach of layers is exactly steps.
Theorem 1 (Depth law)
Let a pair state over the vertices of a directed graph with goal start from the adjacency matrix with and without self-loops, the transpose of the matrix with self-loops and a marker of . (i) For every and there are weights, depending only on , for layers of (10) applied to the state itself rather than its normalised copy, with five channels and residual ReLU MLPs of width 4 with biases, the first layers one layer repeated, whose read-out at is positive exactly when is a child of from which is reached in at most steps. (ii) Let each of layers update by any function of and the multiset , and let each pair’s initial state be a function of its atomic type alone (equality, edges and markers; Proofs). For every , no such network separates at a goal steps beyond from one steps behind it, both goals on a directed path of vertices (Proofs give the general condition). So, from such initial states, the largest distance from to the goal that layers decide on every graph is exactly .
Lean PairSearch.pair_states_search_sharp, PairSearch.pair_states_search_looped
Part (i) is repeated squaring23 in a pair layer without the normalisation. Part (ii) follows from the correspondence of such layers with the folklore two-dimensional Weisfeiler–Leman test24 and an exact description of its colours on paths (Proofs). It covers anonymous initial states, which depend only on each pair’s atomic type, and not initial states that identify vertices, such as our models’ vertex names, with which two rounds of an injective update already see the whole graph. The summed pair layer, triangle attention and the OR join belong to the class. The propagator does not, since its update reads , a function of the whole state; its closed form removes the depth limit, at a cost in margin that grows with path length (below).
The third principle is the size law.
Theorem 2 (Size law)
Let be a finite nonempty family with scores , a level , a margin and , such that every witness is true, , or false, . Let . If , some witness is true exactly when . If no witness is true, , with equality when every score is . Hence, for and scores free within the margin, some threshold on decides existence on every input if and only if
with the strict threshold at equality. Under the same condition, when a true witness exists, the softmax weight on the true witnesses is at least one half.
Lean Framework.size_law_iff, Framework.size_law_equality, Framework.gated_existence, Framework.gated_existence_log, Framework.background_le, Framework.tight, Framework.softmax_existence
For single tokens this is the known requirement that logits grow with the logarithm of the length25–27. The sufficient half is a union bound; what is new is the statement for families and its worst-case tightness. Ordered pairs, , need twice the growth in , and -subsets times. For walks of every length, without the row cap of Section 3, the total walk weight of the edge gates takes the place of , and a witness of steps with hop weight carries only , so the margin also pays a path-length cost (Proofs). A signed sum whose false witnesses cancel only approximately errs with probability at least once there are of them, each leaving an independent residual of size , whereas exact cancellation by group characters works at every size (Proofs). A read-out divided by the number of candidates, with its threshold fixed at one size, fails at larger sizes at any precision.
3Learning to search
Transformers do not learn this search as graphs grow, even given our models’ input. We use the task, generator, test sets and Transformer code of Saparov et al.1. A question is a directed acyclic graph written as an edge list in random order, a start, a goal and the path so far; the answer is the next vertex on a path to the goal. The lookahead of a question is the number of steps needed to tell the correct branch from the others. The benchmark’s Transformer, run from its authors’ code with every step queried, converged in none of ten runs at 31 to 100 vertices, each trained to at least 5.2 million examples (Supplementary Table 1). Its authors trained it on far more examples, 236 million per run, on the first-step variant, where 5 of 14 seeds converged at 31 vertices, 2 at 41 and 1 at 49. A Transformer over our models’ pooled vertex names, with their initial pair features in its attention and read-out, converged in all three runs at 49 vertices and in none of three at 125 within 10 million examples (Fig. 2d).
A pair state, whose layers sum over two-step walks, learns where these Transformers do not. Over the same names, eight summed pair layers with 39,000 to 49,000 parameters converged in all twelve runs on graphs of 49 to 125 vertices, each within 1.3 million examples (Fig. 2d), and each answers at least 98.6% of test questions at every lookahead. Stopped at convergence, they answer only 65 to 91% of the benchmark’s random graphs, and 96.6 to 97.5% at 49 vertices when trained to 3 million examples like the propagator (Supplementary Table 1).
The propagator computes the closed form of the walk family in one layer. In each of four channels it forms gates and a source from the normalised pair state , caps every row of , and solves for the walk sum,
with . The cap keeps each row sum of at most , so the spectral radius stays below one on any graph, cyclic ones included28, and the walk sum converges. With gates set by hand on reversed edges and the source on the goal, exactly when the goal can be reached from . Trained on balanced graphs of up to 49 vertices, the layer of 28,472 parameters converged in all three runs within about a million examples. In every run it answers every test question at every lookahead at 75, 100, 125 and 250 vertices (at 250, 200 questions at each of 124 lookaheads), and 99.0 to 100% of the benchmark’s random graphs of that size (Supplementary Table 2). Looped triangle attention, trained to the same sizes, answers at least 99% at every lookahead at 250 vertices in one run of three, and in four of fifteen runs across five training variants (Fig. 2e).
Each trained run recovers the hand-built layer, plus one extra gate. On a 250-vertex question, the channel carrying the answer has median gates, after the cap, of 0.97 to 0.98 on reversed edges and below on forward edges and non-edges, within the that the hand-built capped layer tolerates, and its source sits on the pair of the current vertex and the goal (0.999), so walks start at the goal (Fig. 2a–c). The extra gate, on the question’s own pair of start and goal (0.22 to 0.78), is closed in the construction. Measured without the cap, the propagator trains on 6.0 and 6.9 times as many examples per second as the looped OR join at 125 and 250 vertices, with 0.39 and 0.52 of its memory (Methods).
4Learning SET
Transformers memorise SET before they learn it. A four-layer Transformer of 535,000 parameters trained on 32,768 deals answers 98% of its training deals and 54% of new ones, and it first passes 90% on new deals at 524,288 deals (Fig. 3a). Given enough distinct questions, it learns the rule. With 27 cards in hand in training and 221,184 deals, a four-layer Transformer of 66,000 parameters answers 93% of deals whose card in hand it never held. With nine or fewer cards in hand in training, the join and both Transformers are at chance on new cards in hand (43 to 56%); the join stays at chance with 12 cards in hand and transfers only in part with 18 or 21 (59 to 87%). As Proposition 1 leads one to expect, attention must learn which cards pair for each card in hand.
The join, whose family is the pairs of table cards, learns from far fewer deals and computes with clocks. One join layer with 62,000 parameters passes 90% at 8,192 deals, 64 times fewer than the large Transformer, and, trained on 55,296 deals with 27 cards in hand, answers 99.6% of deals with new cards in hand. In joins trained with all 81 cards in hand, 82 to 94% of the variance of the score over all triples of cards lies on the eight characters of that vary along one attribute. These are four clocks, one per attribute, each turning a third of a circle when its attribute’s value increases by one (Fig. 3b). The softmax’s exponential turns the sum of the four clocks into their product, which is large only when every attribute is the same or all different on the three cards, an AND over the attributes (Fig. 3c).
Newton attention computes the subset family’s closed form. In each channel each card carries a complex feature , and the sum over unordered pairs of partners follows from two power sums by Newton’s identities12, as in universal set networks29,
Its cost is therefore linear in the number of tokens: measured on a GPU, its time and memory per step stay flat from 9 to 4,096 tokens, whereas the join runs out of memory at 1,024 (Fig. 3d).
Proposition 2 (Characters count set pairs at linear cost)
Let be the card in hand and the table cards. There are 40 characters of , one from each pair of conjugate non-trivial characters, such that for every and every table the number of unordered pairs of table cards that complete a set with is
Lean Newton.set_count, Newton.newton_identities
Trained as the join (Methods), a Newton layer of 55,714 parameters first passes 90% at 32,768 deals, four times as many as the join needs. In all 17 runs that reach 97%, its channels hold 38 to 40 of the 40 characters of Proposition 2. Unlike the join’s exponential, Newton’s read-out is linear in each channel and must find the 40 characters one by one. Read out as trained, with each pair feature divided by the number of pairs and then by a per-deal root mean square, the layer fails on tables of 16 cards (73 to 76%), as Section 2 predicts for read-outs divided by the number of candidates. A model of these two divisions, fitted on 8-card deals alone (Methods), moves the trained read-out’s threshold from 0.54 sets to a predicted 1.76 to 1.79 sets on 16 cards (measured, 1.76 to 1.77), so every deal with exactly one set is called negative (Fig. 3e). Trained on 8- and 12-card tables, it answers at least 95.5% at 16 cards and 92.8% at 20 (92.4% at 16 in a repeat with the same seeds; Supplementary Table 4), so from two sizes it learns a threshold that depends on size. Read as a count, the layer is exact at every size, but that form did not train to the rule (85% on 8-card tables; Supplementary Table 6).
Exponential Newton computes the join’s own softmax over pairs exactly, in operations for clocks. At SET’s table sizes this exceeds the pair terms it replaces, and we have not timed it on long sequences. On the exponential of a clock takes three values, so it has an exact three-term Fourier series. For clocks with hours (Proposition 3),
with , the Jacobi–Anger expansion30 folded onto . Four clocks give all 81 characters, with weights fixed by (Fig. 3c). The expansion extends to any finite abelian group , at cost , given the group (Proofs). Trained as the join, but with the modulus 3 given where the join learns its clocks, the layer first passes 90% at 8,192 deals, the join’s budget, and answers 69% at 2,048 against the join’s 51% (Fig. 3a). With four learned clocks, 10 of 12 models clocked one attribute twice and another not at all, and their errors on larger tables fall on deals holding a pseudo-set, a pair that completes a set on the three clocked attributes but not the fourth, which leaves a zero margin that no temperature fixes. With six clocks (729 channels) the layer passes 99% at 8,192 deals (99.9% and 100.0% in two repeats with the same seeds). Trained on 8-card tables, with the learning rate chosen on held-out cards in hand (Methods), it answers at least 97% of deals with new cards in hand on 16- and 20-card tables, on each of three seeds in both repeats, at its trained temperature (Fig. 3e).
Proposition 3 (Jacobi–Anger on )
Equation (9) holds exactly for every and . Hence, for a join whose score on the card in hand and table cards and is with clock hours , the partition function and output of the softmax over the distinct pairs of table cards are sums over channels of Newton’s , computed in operations.
5How far a layer generalises
Layers read through exponential gates transfer to larger inputs, as the propagator and exponential Newton do (Figs. 2e, 3e), and layers read by normalising over the candidates, such as Newton’s mean, do not when trained at one size. Trained at 49 vertices and tested at 125, the looped OR join answers at least 99.6% and looped triangle attention at least 99.2% at every lookahead, whereas the looped pair layer that sums over the middle vertex with the fixed factor answers 61 to 73%, averaged over lookaheads, after iterations (Supplementary Table 2). Triangle attention averages too, but divides by the total weight, not the number of candidates, as the softmax form of Theorem 2 requires.
The margin that size requires grows with the logarithm of the number of candidates. We measured the critical on 42 instances of four hand-set layers (Fig. 4a; Methods). The worst case of Theorem 2, , lies 1.2 to 4.1 nats above the measured value for the SET layers and the OR join. Evaluated on the realised scores, the theorem’s own condition bounds over the false witnesses, which is about when competitors sit at the margin and the rest far below. With in place of (for SET, the pairs one attribute away from a set; Methods), every critical value lies within 0.3 nats of the prediction, except the OR join’s beyond 200 vertices (0.8 nats at 1,600). For the propagator, lies 0.1 to 1.4 nats below the measured value, because the margin also pays the path-length term . The same logarithm sets the temperatures of hand-set layers. The looped OR join needs an input gain rising from 13.5 at 50 vertices to 17.8 at 1,600, and exponential Newton is exact on tables of 8 to 40 cards, the largest that can lack a set, at for table pairs, while its 8-card temperature answers 66.7% at 32 cards; with six attributes the rule is right to 364 cards and the 8-card temperature fails from 48 (Fig. 4c).
Trained pair states search about as deep as the depth law allows. Theorem 1 puts the exact reach of layers at steps from the child of the current vertex, which is lookahead : the construction answers every lookahead up to , and from anonymous initial states no network of the class decides lookahead on every graph (Fig. 4b, d). Pair states over names of layers, with from 2 to 8 at 49 vertices and from 4 to 6 at 100, answer at least 95% at every lookahead up to in every run, or up to the deepest in the test set (Fig. 4b). At 100 vertices accuracy falls just past the bound, as predicted before the runs: four layers answer 28 to 36% at lookahead 17 and five layers 18 to 58% at 33. Some trained models beat the worst case. The two-layer models answer lookahead 5, and two four-layer runs at 49 vertices that never converged answer 87 to 98% beyond lookahead 16. These models start from vertex names, on graphs that are not paths, which part (ii) does not cover, so their match to is empirical.
6What the principles predict elsewhere
Where a closed form exists, a small looped pair layer matches a deep one. CLRS-3013 trains on graphs of up to 16 nodes and tests on 64; we train without hints, with the library’s generator and scorer. Our layer is one looped block of width 128 and 186,000 parameters, with OR-join channels, power-mean channels and a learned shift, iterated eight times at 64 nodes. We chose its design at width 32 on the official 64-node test graphs and ran the width-128 layer once (Methods), so we also report freshly drawn test graphs. On the official test file it matches (within half a point) or beats FloydNet without hints14, a pair-state network with about 73 million parameters at its smallest depth, on 9 of 12 tasks; it is below on Bellman–Ford (0.9 points), Prim’s algorithm (2.1) and strongly connected components (2.2), and matches on Dijkstra by 0.01 points (Fig. 5a). On 128 freshly drawn test graphs per task it matches or beats FloydNet on 8 of 12, Dijkstra falling 0.003 points short (Supplementary Table 3). FloydNet is compared across protocols: its scores are from its paper (online training, 32 to 80 layers), ours from 80,000 steps on a fixed pool of graphs, three seeds and final parameters. On Floyd–Warshall, whose answer is a pair, the two pair-state models score 96.2% (FloydNet) and 98.3% (ours), and the no-hint models of Bevilacqua et al.31 and Rodionov and Prokhorenkova32 40.8% and 42.2%.
Where the output follows lexicographic depth-first order, a parallel layer must loop (Section 2), and on depth-first search accuracy rises with the loop count. The depth-first search (DFS) task of CLRS-30 outputs parents in the lexicographic DFS forest, which is P-complete15, and its strongly connected components task outputs a representative per component.
Proposition 4 (The component representative is P-complete)
The representative that CLRS-30 assigns to a strongly connected component is the component’s first vertex discovered by lexicographic depth-first search. Deciding whether a given vertex is the representative of its component is P-complete.
The errors sit where the theory puts them. Every wrong component pointer points inside the correct component. Accuracy is 98.8 to 100% where the representative is the component’s smallest index, which a parallel rule finds, and 66.5 to 70.4% where the first DFS pass fixes it. DFS is right on every node up to depth 7 in the true tree and on 67 to 72% of nodes at depths 32 to 63. Topological sort, which is DFS on acyclic graphs and lies in NC by a result of de la Torre and Kruskal33, scores 99.9%. Trained with 4 to 24 loops instead of 4 to 8 and looped 34 times at 64 nodes, the same layer’s DFS accuracy rises from 80.5% to 90.7% (mean of three seeds, 89.8 to 92.4), increasing with each loop up to the training maximum and nearly flat after it, against FloydNet’s 75.1% without hints (Fig. 5a, b). The same change on strongly connected components, registered with the prediction that only the order-dependent representatives would gain, kept every wrong pointer inside its component and the smallest-index representatives at 98.8%, but raised the order-dependent ones only from 69.0% to 72.8%, within the spread of seeds, and overall accuracy levels off near 14 loops (89.0% at 34, against FloydNet’s 90.1%). The account locates these errors; at this width, more loops do not remove them.
The remaining errors on weighted tasks sit at near ties, where the margin of Theorem 2 is small. On Bellman–Ford and Dijkstra, the median relative margin of the decisions the layer gets wrong is 0.5 to 0.6%, against 20.5% over all decisions; on Kruskal’s algorithm the two medians are 1.3% and 42% (Fig. 5c). Prim’s algorithm is the exception, and the principles do not explain it. Its errors are not near ties (median 30% against 51% over all decisions), two thirds of them point to the node’s own child, the right tree edge in the wrong direction, and they grow with depth in the tree. Two registered fixes from the spanning-tree family of Table 1, a Kirchhoff read-out and the same read-out with a learned shift of its conductances, leave the errors in place (97.20% and 96.84%, against 97.57% without them; Methods).
In language modelling and chess most witnesses are single tokens, and joins add little. In an 8-layer language model of 51 million parameters, a join over the previous 16 tokens, added in every second block, gains 0.011 nats per token after 200 million tokens of FineWeb-Edu34, and two more layers gain 0.026 (Fig. 5d). In chess, joins beside or in place of attention never gain more than 0.1 points of accuracy on the solving move of Lichess puzzles (Supplement). On the 6,681 puzzles about pins, skewers, x-rays and discovered attacks, whose motifs pair two pieces on a line and where the first principle predicts a gain, joins beside attention score 84.6 to 85.3% against 85.0%. The trained joins show why. Their interaction share, the fraction of the score variance over pairs that is not a sum of one score per partner, relative to random scores, is 0.98 to 1.02 on SET and 0.11 to 0.29 in chess (Fig. 5d), where scores remain mostly sums of lookups on single squares. A share near one shows that a join is used, not that it is needed: chess joins whose keys have their mean over the squares subtracted reach 1.03 and still add nothing. We trained the language models at one scale, budget and window; joins over long contexts gain more35, a regime we did not test.
7Discussion
Whether higher-order attention helps depends on the family a layer sums over, not on its arity. A layer over pairs helps when a task’s witnesses are pairs or are composed from them, as in search and SET, and not when they are single tokens, as in our language and chess models. Depth composes families at an exact rate. Over two-step walks, layers reach steps and, from anonymous initial states, no further, for every ; our trained pair states stop near the same depth. Much of that depth emulates a family that has a closed form: eight pair layers compose two-step walks into the reach that one propagator layer reads from . Where no parallel closed form exists, as for lexicographic depth-first order, depth is the right tool, and the depth needed grows with the input. Sequential order can also be moved out of the layer into an external working memory, and when each step reads only a bounded view of that memory, exactness at all input lengths becomes a finite check36. Temperature decides how far an answer carries: exponential gates with a logarithmic margin transfer to larger inputs, and read-outs normalised over the candidates, trained at one size, do not.
Each piece of this account has a precedent, including attention as an expectation with its own partition function37, one description for Boolean, counting and tropical values20, dynamic programming smoothed at a temperature38, the noisy-OR and Bernoulli–Poisson links of the OR join39–41 and differentiable chaining of relations42–44, algorithmic alignment45–47, logits scaled against the dispersion of single-token attention25–27,48, exponential against polynomial energies in associative memories49,50, sums over distinct tuples of neighbours at linear cost51, and resolvents, fixed points and path sums over a given graph52–57. New here are the account across witness families, the two laws in that form, the reduction for strongly connected components, three layers (Newton attention, exponential Newton and the propagator, the first layer we know of to compute a resolvent from gates on a pair state) and the registered tests.
The principles point to the families language needs. Parses are trees and spans, families with inside–outside and matrix-tree closed forms37,58. A pair state over the entities a text names, rather than over its tokens, would place the search layers of this paper inside a language model.
Methods
For every search, CLRS-30 and SET experiment, the design, predictions, budget and stopping rule were written down before its runs; Supplementary Tables 5 and 6 list every registered outcome, including failures.
Search benchmark
We cloned the code of Saparov et al.1 (commit 2c3f32b, with its header library at commit 1f3b022) and compiled its C++ generator. Training examples are drawn fresh in batches of 256 from its balanced distribution, with maximum lookahead for graphs of vertices and every step of the path queried. Test sets come from the authors’ own evaluation code, loaded at run time: 1,000 questions per lookahead up to 75 vertices, 500 at 100 and 125, and 200 at 250, together with the benchmark’s random graphs. Every test question is excluded from training. A run converges when its training accuracy, counting any valid next vertex, is at least 99.5% on two consecutive checks. Test accuracy counts the single next vertex on the shortest useful path, which is unique in every test question.
Models
Pair state over vertex names. Tokens are embedded at width 32. Each token’s context, mixed with its two neighbours, is pooled into the vertex name it writes. The state of a pair of names starts from bilinear scores between the pooled contexts and from learned products of nearby tokens. With the state normalised over its channels and the normalised state after the first update, the summed pair layer is
with matrices , and , a sigmoid gate and a GELU MLP of width 32. Triangle attention replaces the equal-weight sum by a softmax over of , in four heads. Each name is scored by for the current vertex . The model has 39,504 parameters at 49 vertices and 49,232 at 125, since each added vertex adds a token embedding and three position embeddings of width 32. Looped models iterate one block times, with drawn from 5 to 8 for each batch, and are scored after iterations. They have no position embeddings, and the names of each training question are drawn at random from a table of 128, or of 256 for tests above 125 vertices.
OR join. The sum of (10) is replaced, with no factor , by
one matrix product per channel. In the hand-set construction the input sigmoids have gain and are centred at one half, and a closing gate keeps each relation channel from re-counting once it is set.
Propagator. Equation (6) runs in four channels on the normalised state . The solve runs in float32, and no walk is formed. The eight features and of the four channels enter through a linear map and a gate, followed by the per-pair MLP. The gate biases start at and the source biases at , and is fixed in every channel. The layer is applied once and has 28,472 parameters with names from 256. The fixed and the row cap were added after two earlier registered designs without them lost accuracy at 250 vertices, in one and two of three runs (Supplementary Table 5). The speed and memory figures are for one training step (forward and backward, bfloat16, batch 32, H100) of the uncapped layer against blocks of the looped OR join with one term. The cap adds one row sum and one division. On the 250-vertex question of Fig. 2a, the walk sum without the cap has a pole at a background gate of .
Transformer over names. The same pooled names and the same starting pair features, with a token state per name of width 64 and eight blocks of four-head attention between names, with ReLU MLPs of width 128. The pair features enter every block’s attention as a learned bias per head. So that the control reads what the pair states read, the read-out adds , the normalised starting pair feature of the current vertex and the candidate, with initialised to zero, so that the control’s function at initialisation is unchanged. It has about 298,000 parameters. The benchmark’s own Transformer is run from its authors’ unmodified code and settings.
Newton attention. In each of channels, token carries . The power sums over a token’s partners, with its own term removed, give and by (7). The features for are divided by their root mean square over channels and read by a linear map. A deal is a sequence of tokens (a start token, the table cards and the card in hand), so every card has partners, the other cards. The read-out’s steps are scaled by , which is at : the join’s output fan-in over Newton’s, the per-layer rate of maximal update parametrisation59, which leaves the function at initialisation unchanged. The layer has 55,714 parameters.
Exponential Newton. The join’s input map and its MLP head are kept. The layer reads categorical clocks over from through a map and a softmax over the three hours of each clock, with one learned (a softplus, starting at 2). The weight of the pair for the card in hand is the expectation, over independent hours , and , of . Its value is , of rank 128. The softmax over the unordered pairs of table cards is computed as the channels of (9), each with its pair sums from Newton’s , and is floored at . The layer has 63,183 parameters with four clocks and 63,765 with six, against 62,018 for the join. The six-clock layer was trained through the explicit pair-weight matrix, which is the same function and is cheaper at eight partners, and was scored in the linear channel form. The two forms, and a float64 sum over all pairs, agree within 0.5 points on every test set.
Size-law check
Each of 42 hand-set instances is evaluated on a grid of in steps of 0.5 nats, with the critical value found by bisection. Exponential Newton on SET uses 600 set-free deals per table of 8 to 40 cards (four attributes) and 200 per table of 8 to 364 cards (six attributes), with threshold one half; one attribute off a set costs . The OR join is one hand-set layer on random acyclic graphs of 50 to 1,600 vertices with edge probability , read with threshold on . The propagator, without the cap and with , runs on random acyclic graphs of 50 to 800 vertices with a uniform background gate on non-edges, and must separate reachable from unreachable pairs with one threshold. The competitors at the margin, over the threshold, are: twice the number of pairs one attribute away from a set in the worst set-free deal (SET); the middle vertices linked to exactly one end of an unreachable pair, divided by (OR join); and plus the largest background walk weight in units of the weakest true walk, with and (propagator), which is the Sherman–Morrison threshold (Proofs). For the worst case of Theorem 2 we use (SET), (OR join) and (propagator).
Newton’s 16-card threshold. From 8 to 16 cards one set’s term shrinks by and the per-deal root mean square by 0.44, so the normalised term falls to about half, while the normalised baseline of the other pairs grows 2.3 times. We fitted the baseline and the per-set term by least squares on 8-card deals and took the normaliser and the rest of the drive from unlabelled 16-card deals, before scoring any 16-card deal.
Training and evaluation
Search models are trained with AdamW at learning rate after 2,000 warm-up steps, weight decay 0.01, gradient clipping at 1 and batch 256, with bfloat16 matrix products and float32 accumulation, on one H100 per run. Pair states over names stop on convergence, with a cap of 10 million examples; looped layers and the propagator train for 3 million examples without stopping. The depth sweep trains pair states over names with two to eight layers at 49 vertices (two or three seeds each) and four to six layers at 100 vertices (two seeds each). The final parameters are scored; no checkpoint is selected.
CLRS-30
Data come from the benchmark’s library (dm-clrs 2.0.3). The test split holds 32 graphs of 64 nodes per task, the same graphs as the published file; the validation split holds 32 graphs of 16. Training uses a pool of 400,000 graphs per task of 4 to 16 nodes, with edge probability from 0.1 to 0.9 (halved for articulation points, bridges and Kruskal’s algorithm) and node positions redrawn each time, as in the library’s example script. The pair state has width 128 and starts from the adjacency, the edge weights through an MLP, the node positions and the source marker. Its block computes the OR join on half of the channels and a power mean 60 on the other half. Both sides use input sigmoids shifted by a learned multiple of (32 parameters), and the block has a gate and a per-pair MLP of width 312. We selected the block at width 32 (13,342 parameters, 40,000 steps) on the official test graphs. Of three registered designs, the third, which differs from the second only in the shift, came within a point of looped triangle attention on 11 of 12 tasks (the second on 8), and trained on three new seeds and scored on 128 fresh graphs per task it was within a point on 10 of 12. The width-128 layer was then run once, with its predictions registered. The layer has 186,232 parameters (186,361 on the three tasks whose answer marks nodes or edges). It is iterated times, drawn from 4 to 8 per batch, for 80,000 steps of 32 graphs, with AdamW at , 2,000 warm-up steps, a cosine schedule to 1% and weight decay 0.01. The final parameters are scored at the registered with the library’s evaluation function, on the official test file and on 128 fresh graphs per task drawn by the library’s test sampler at seed 20,261,109. Node pointers are a softmax over of a read-out of ; Floyd–Warshall’s pair pointers are a softmax over of a bilinear score of and ; marks are linear read-outs of and . The two Kirchhoff tests on Prim’s algorithm add, after the loop, four heads of conductances (a sigmoid of a linear map of the normalised pair state, on input edges only, in the second test shifted by a learned multiple of ), ground their Laplacian at the source with added, invert it in one solve and feed a potential difference and an effective-resistance feature per pair through a gate to the pointer read-out (204,412 and 204,416 parameters; the same job otherwise, each run once on three seeds); with conductance 1 on the true tree edges the read-out is exact on all 2,048 official test nodes, whereas each trained model’s best head orients 1,990 to 2,005 of them. The DFS loop test changes only , drawn from 4 to 24 in training and set to at test. The error analyses use the official test file at ; a decision’s relative margin is how much worse the best alternative’s path weight or distance is than the true choice’s. Published scores are from each paper’s own table.
SET
A deal has eight table cards and one card in hand, all distinct, and half the deals contain a set pair. Each card is a token of four one-hot attributes; the card in hand carries a flag, and there are no position embeddings. Every model starts from of width 96 and answers from the card in hand. The join has one head of rank 64 over the 56 ordered pairs of distinct table cards and an MLP of width 192 on ; it has 62,018 parameters. The Transformers have four layers and four heads, at widths 44 (65,606 parameters) and 128 (534,914). Training uses Adam at a constant rate with clipping at 1 and batch 128, for 12,000 updates up to 32,768 deals, 24,000 at 131,072 and 48,000 at 524,288. For each model and budget we pick the rate with the best validation accuracy summed over three seeds, and we report accuracy on 1,024 new deals. For accuracy on cards in hand never held, models train with 27 cards in hand on 55,296 deals for 24,000 updates. For the six-clock exponential Newton, the 54 cards never held in training are split once into 27 for validation and 27 for test; the rate is picked on validation-card deals, on new seeds 3 to 5, and the reported accuracy is on test-card deals at 8, 16 and 20 table cards. Picking the rate on the training cards in hand instead chose, on seeds 0 to 2, a rate at which one seed memorised its cards (Supplementary Table 6); on seeds 3 to 5 both choices give the same rate. Every SET job was run twice with the same seeds. The clock share is the fraction of the Fourier power of the per-query centred score tensor over all triples that lies on the eight single-attribute characters. A Newton channel’s character is found when it holds at least half of the channel’s power.
Lean
Theorem 1(i), Theorem 2 and Proposition 2 are checked in Lean 4.35 with Mathlib v4.35.010,11, with no sorry and only the axioms propext, Classical.choice and Quot.sound. The declarations are named beside each statement. The Lean statement of Theorem 1(i) is the layer of (10) on the unnormalised state, with its gate, its scale and a ReLU MLP with biases. Theorem 2 is checked in full, both halves of (5) and the equality case (size_law_iff, size_law_equality). Not formalised are Theorem 1(ii), which is proved on paper and checked computationally; the corollaries after Theorem 2; and Propositions 1, 3 and 4, which are proved below and checked numerically.
Compute and code
Search runs used one NVIDIA H100 each (the propagator trained for 160 to 188 s), CLRS-30 runs one NVIDIA L4 each (2,404 to 2,570 s per run; 6,286 to 6,406 s with 4 to 24 loops), and SET runs one NVIDIA A10G. All analyses of trained models were run on a CPU from saved parameters. The training code, the loader for the benchmark’s test sets, the Lean files and the results behind every figure and table are available under the Apache 2.0 licence at https://github.com/NeoVand/witnesses. The trained models run in the browser at https://neovand.github.io/witnesses, which also holds a tutorial for students.
AI usage
AI systems were used extensively in this work. The idea, the detailed research direction, the experiment design and the choice of problems are the author’s. The proofs, including the Lean formalisations, were produced by AI systems under the author’s direction, and the code was implemented by AI systems. The statements named with Lean declarations are machine-checked, and each reported result was checked against the saved output of its run. The author began this line of work in 2023 with cubic (2-simplicial) attention, arrived at independently, before recent work brought it to scale6.
AProofs
Theorem 1 (depth law)
Part (i). Write for 1 if holds and 0 otherwise and for the adjacency matrix. Let if can be reached from in at most steps, so that and
since a walk of at most steps splits at a middle vertex into two walks of at most steps, and conversely. Let if can be reached from in at most steps, so that and , since .
The state has five channels, , initialised to , , , and ; channel will hold in every row. In each layer, take , so the gate is . Let map channel to , to and to with weight , and let map to , to and to with weight 1, with all other entries 0. The triangle term of (10) then adds to , to and to . Each of these channels then holds a non-negative integer , and three ReLU units with bias subtract , leaving . Since , the term of each sum equals the residual, so exactly when the sum is at least 1. By (12), channel holds after layer and channel its transpose. Channel holds in every row, because . The last layer has a fourth unit, , added to , where is channel before its threshold. Since , this unit is 0 when and when , and exactly when . With selecting , the score is positive exactly when is a child of from which is reached in at most steps. The weights depend only on , through and , not on the graph or on , and the first layers are one layer. This is PairSearch.pair_states_search_sharp, and pair_states_search_looped puts the weights before .
Part (ii). Let the update at be for any functions ; the summed pair layer, triangle attention and the OR join, each with its gate, normalisation over channels and per-pair MLP, are of this form. Folklore 2-WL colours pairs by , with over all vertices, starting from the atomic type of : equality, edges in both directions and the goal and current markers on either end. Suppose two graphs on the same number of vertices have given by one function of the atomic type, as the theorem assumes. By induction on , is one function of on both graphs, because sees only and the multiset over , which are images of and of its multiset under the same function. So pairs of equal colour after rounds get equal outputs24, and it suffices to give two paths, one with a reachable goal and one without, in which has the same colour .
Windows. On the directed path with vertices and edges , let be the set of markers at , with for . Write , and for the labelled window , . The census of a path is the multiset , of total multiplicity . The window invariant of a pair with is
is the atomic type, since and a pair with has no edge; determines ; and determines for .
Census. If the four points , , and are pairwise more than apart, depends only on and . A window of positions then holds at most one of the four, so the census has one window for each offset of and of in , windows at each end of the path and plain ones.
Equal invariant and equal census give equal colour. Let and be labelled paths whose censuses are equal if , so that . We show by induction on that implies ; for both are the atomic type. Let , and , so that ; the censuses at smaller radii are equal too, so the hypothesis holds at , and it gives because determines . It remains to match the middle vertices, that is, to find a bijection with and for every . On let and for . The two rules agree where the balls overlap, since then and , and otherwise the balls are disjoint in both paths. maps vertices to vertices, because records which positions of are off the path. For , each of and is near at level with its segment inside , or far with windows of radius inside that set (and then far in as well), so both invariants are read from at offsets fixed by and , and equal those read from . For both pairs are far, with invariants and , so need only preserve . The windows of are the census minus the windows of , which has already matched, so the two remainders are equal multisets, and a window-preserving bijection between them completes . The induction hypothesis then makes the multisets equal in and , and .
The length condition. Let and be paths on the same vertices with the same current vertex and child , the goal steps beyond in and steps behind in , both goals on the path. Let , , and . In both paths the points , , and are then pairwise at least apart, so the two censuses are equal. records and the labels on , which lie on the path and hold and no goal in either. So is the same in and , and no network of the class separates them. At the conditions ask for with at least steps after the first vertex and at least steps before the last; the path of vertices with at vertex meets them. So no network of the class decides on every graph whether a goal steps from is reached. The construction of part (i) starts from initial states of this kind with layers of this class and decides every goal within steps, so the reach is exactly for every . Exact joint refinements of the two paths corroborate this: for the pair has the same colour at and different colours at , and (checks/fwl_sym.py), and for , on six such pairs of paths per , equal invariants with equal censuses give equal colours at every pair and round (checks/fwl_invariant.py).
Theorem 2 (size law)
If some is true, its term alone is and all terms are positive, so . If none is, every term is at most , so (background_le), with equality when every score is (tight). When , that is, when , the two cases are separated by the threshold 1 (gated_existence, gated_existence_log). Conversely, let and let the scores be free within the margin. The false inputs then reach , and the true inputs come arbitrarily close to while staying above it, with one score at and the rest tending to . So some threshold separates all inputs if and only if ; at equality the threshold must be strict, , which every true input passes because its other terms are positive (size_law_iff, size_law_equality). For and the two inputs coincide, which is why the statement needs . For the softmax read-out, let be the true and the false witnesses, with some witness of at level and . Then , so (softmax_existence).
Family sizes. For tokens, ordered pairs and -subsets, is , about and about , which gives the schedules in the text.
Walks. For the layer without the row cap, write , with non-negative edge gates of spectral radius and a non-negative background on non-edges with the rank-one majorant entrywise. Let , , and , the total walk weight of the edge gates. Since grows entrywise with , it is at most its value at , which by the Sherman–Morrison formula61 is when ; at the series has a pole. A false pair , with , has value at most , and a true pair joined by a walk of steps whose gates are all at least has value at least . One threshold separates them if , that is, if , and only then when . Since , a sufficient condition is : the margin pays for the family through and for the path through .
Cancellation. A signed read-out computes , where is the number of true witnesses, the set of false witnesses and the residual of a false witness, and decides . Let with independent uniform signs and , so that and . If , Paley–Zygmund on with gives , and hence . By symmetry, , an error with no true witness (), and , an error with one (). Independent signs illustrate approximate cancellation; they are not a worst case over all signed read-outs. With exact characters every is zero, and only rounding remains, which bits control for -subsets.
Proposition 1
Fix and . Pick a card , set , pick a card , and set . Each card has exactly one completion with , so the four cards are distinct, none equals , and complete sets, and and do not (the completion of is ). Fill the table with any other distinct cards. If every set pair scored strictly above every other pair, would give , and would give , a contradiction. The same argument applies on every deal with two or more set pairs.
Proposition 2
For a character , , so . The sum of over all 81 characters is 81 if and 0 otherwise, so summing over gives . The trivial character contributes , and , so the other 80 terms pair into twice the real parts of 40. Each costs two power sums by (7), so the count costs per channel. In Lean this is Newton.set_count, an instance of the general count over any finite abelian group and any subset size (Newton.count_eq).
Proposition 3
The function on takes the values and . Its Fourier coefficients are , which gives and . Inversion gives , and the product over the clocks gives (9). These coefficients are the Jacobi–Anger series 30 (equation 10.35.1) folded modulo 3, . With , each factorises over the three cards, and summing over gives of the per-card factors. For the value , the pair sum is per channel, with the per-card factor; this is again linear. For categorical clocks the expectation over independent hours factorises, and is replaced by its mean under each card’s distribution. Against brute force over all pairs on SET deals of 8 to 64 cards, the 81-channel form agrees to within in float64 for (to from 16 cards on). The argument uses only that the score depends on the three cards through their sum in : for any finite abelian group and any potential of the sum, Fourier inversion over the characters, each a product over the three cards, gives the same expansion at cost , and the Lean count Newton.count_eq holds for every such group. What must be given is the group.
Proposition 4
The output. The library runs Kosaraju’s two passes: a lexicographic DFS of , then a DFS of the transpose in order of decreasing finish time of the first pass. It writes each vertex’s representative as the root of its tree in the second pass. That root is the component’s vertex with the latest finish time in the first pass, which by the white-path theorem is the component’s first vertex discovered in the first pass. This identification matches the library’s output on all 2,048 test nodes.
Hardness. Deciding whether is discovered before in lexicographic DFS from vertex 0 is P-complete15, also on instances in which every vertex is reachable from 0 and . Given such an instance, relabel each vertex as , and add a vertex , a vertex and the edges , , and . Then is a sink component. When the search discovers , its first white child is , which has the smallest index. The original order is unchanged, because and reach only each other. So the first-discovered vertex of , its representative, is exactly when is discovered before . The construction is computable in logarithmic space. Against the library’s own function on 400 random digraphs of 5 to 29 vertices, the gadget gives the right answer in 400 of 400. The partition into components is in NC through transitive closure; only the representative is P-complete.
Topological sort. In a DAG, the library-order DFS parent of is the second-to-last vertex of the lexicographically least path to from the smallest vertex that reaches it. Prefixes of lexicographically least paths are lexicographically least, so a (lex-min, concatenation) path algebra composes them in squarings, and reverse postorder follows by an Euler tour; both are in NC, as de la Torre and Kruskal33 show. The lemma gives the library’s DFS parent on all 2,048 nodes of the topological-sort test graphs.
Polylogarithmic depth. Each closed form of (4), repeated squaring in a semiring and Newton’s recursion is computable in polylogarithmic parallel time22. A layer that applies one of them and pointwise maps, with arithmetic on polynomially many bits, is in NC, and so is a stack of polylogarithmically many such layers. Deciding whether is visited before in lexicographic DFS is P-complete15, and DFS parent pointers determine that order in NC by an Euler tour. So, unless NC = P, no such stack with weights computable from in NC computes lexicographic DFS on all graphs; for arbitrary weights at each size the same holds unless P NC/poly. A looped layer run polynomially many times is outside this argument, and nothing here fixes its loop count at the depth.
BSupplement
Supplementary Table 1 | Search on the benchmark of Saparov et al.1. Runs that converged (training accuracy at least 99.5% on two consecutive checks) within the cap, examples to convergence, the lowest test accuracy over lookaheads on the benchmark’s balanced test sets, and accuracy on its random graphs, over converged runs. Every step of the path is queried unless noted; random-graph accuracy is over every step, and over the first step for first-step models. Where a cell lists one value per run, each column is sorted independently. Runs marked “to 3 million”, and the propagator, train for 3 million examples whenever they converge. Runs that did not converge ended at these training accuracies: pair state over positions, 90% and 62%; without the offset embedding, 99.2% for a run that misses the criterion, and two runs that answer only the first one or two lookaheads; Transformer over names at 125 vertices, 60 to 66%; benchmark’s Transformer, 3 to 39% at 5.2 million examples, 44 to 45% at 15.7 million, and 4 to 9% with relative positions.
| Model | Vertices | Converged | Examples (millions) | Worst lookahead | Random graphs |
|---|---|---|---|---|---|
| Pair state over names (39–49k) | 49 | 3 of 3 | 0.64–0.77 | 99.2–99.9% | 79–91% |
| 75 | 3 of 3 | 0.77 | 99.6–99.7% | 78–90% | |
| 100 | 3 of 3 | 0.77–0.90 | 98.6–99.4% | 65–85% | |
| 125 | 3 of 3 | 1.0–1.3 | 99.0–100% | 66–86% | |
| Pair state over names, to 3 million | 49 | 3 of 3 | 0.64–0.77 | 99.8–100% | 96.6–97.5% |
| Pair state over names, half random graphs | 49 | 3 of 3 | 0.51–0.64 | 99.9–100% | 100% |
| Pair state over names, first step only | 31 | 3 of 3 | 0.51 | 99.9–100% | 94–99% |
| 41 | 3 of 3 | 0.51–0.64 | 99.9–100% | 96–99% | |
| 49 | 3 of 3 | 0.64 | 99.9–100% | 93–95% | |
| Triangle attention over names (44k) | 49 | 3 of 3 | 0.51–0.64 | 99.1–99.5% | 73–94% |
| Propagator, one layer (28k) | 49 | 3 of 3 | 0.90–1.02 | 99.8–100% | 100% |
| Pair state over positions (27–29k) | 31 | 3 of 3 | 1.7–2.6 | 98.0–99.4% | 57–88% |
| 41 | 2 of 3 | 3.1, 4.6 | 86.6, 99.5% | 76, 96% | |
| 49 | 2 of 3 | 3.1, 4.0 | 98.8, 99.6% | 64, 72% | |
| Pair state over positions, no offset embedding | 31 | 0 of 3 | > 5 | — | — |
| Pair state over positions, first step only | 31 | 2 of 3 | 2.2 | 99.7, 99.8% | 94, 100% |
| Transformers | |||||
| Transformer over names (298k) | 49 | 3 of 3 | 1.7–3.2 | 92.8–97.6% | 96.1–99.4% |
| 125 | 0 of 3 | > 10 | — | — | |
| Benchmark’s Transformer, authors’ code | 31 | 0 of 3 | > 15.7 | — | — |
| 41 | 0 of 3 | > 5.2 | — | — | |
| 49 | 0 of 3 | > 5.2 | — | — | |
| 100 | 0 of 1 | > 5.2 | — | — | |
| Benchmark’s Transformer, relative positions | 31 | 0 of 3 | > 5.2 | — | — |
| 49 | 0 of 3 | > 5.2 | — | — |
Supplementary Table 2 | Size generalisation from 49 to 125 vertices. Models trained on balanced graphs of up to 49 vertices with no position embedding and vertex names drawn from 128 (256 for the propagator and where noted), then tested on graphs of 125 vertices (†), on which none was trained. Looped layers are scored after iterations, eight at 49 vertices and nine at 125; eight-layer models and the propagator are applied once. Every run converged and trains for 3 million examples (6 million for the Transformers, which here have no read-out pair feature); the examples column gives where it met the convergence criterion. Accuracy in %: worst, the lowest over lookaheads; mean, averaged over lookaheads; random, on the random graphs. The OR join replaces the sum over the middle vertex by (11), with the first eight terms of its series or the first term alone. At 250 vertices the propagator answers every question at every lookahead in all three runs and 99.0 to 100% of the random graphs; the five trainings of looped triangle attention with names from 256, each adding a change to the one before, leave 4 of their 15 runs at least 99% at every lookahead.
| Model | Examples (millions) | Worst at 49 | Worst at 125† | Mean at 125† | Random at 125† |
|---|---|---|---|---|---|
| Pair state, eight layers (37k) | 0.64 | 100 | 0.2–58.6 | 49.4–77.9 | 91.2–98.2 |
| Pair state, looped, sum (25k) | 0.51–0.64 | 100 | 24.0–52.0 | 61.3–73.4 | 87.6–97.2 |
| Pair state, looped, triangle attention (25k) | 0.64 | 99.6–100 | 99.2–100 | 99.8–100 | 90.6–99.8 |
| Same, half random graphs | 0.51 | 100 | 94.8–100 | 99.8–100 | 99.8–100 |
| Same, 256 names, five trainings | 0.51–1.15 | 99.8–100 | 35.2–100 | 88.7–100 | 86.2–100 |
| Pair state, looped, OR join, eight terms (25k) | 0.64 | 99.9–100 | 99.6–100 | 100 | 99.6–100 |
| Pair state, looped, OR join, one term (25k) | 0.64–0.77 | 100 | 100 | 100 | 99.4–100 |
| Propagator, one layer (28k) | 0.90–1.02 | 99.8–100 | 100 | 100 | 99.4–100 |
| Transformer over names, looped (66k) | 2.0–2.7 | 98.4–99.2 | 47.4–49.8 | 73.9–80.8 | 78.8–87.8 |
| Transformer over names, eight layers (296k) | 2.0–4.4 | 95.3–98.4 | 35.8–38.4 | 61.9–66.9 | 78.8–85.2 |
Supplementary Table 3 | CLRS-30 graph tasks without hints. Accuracy (micro-F1, %) on graphs of 64 nodes after training on graphs of up to 16. Ours: the looped block of OR-join and power-mean channels of width 128 (186,232 parameters; 186,361 on the three tasks whose answer marks nodes or edges, scored by the F1 of the marked class as the library does), eight loops, mean and range of seeds 0, 1 and 2, on the official test file (32 graphs per task, FloydNet’s test set) and on 128 graphs per task drawn by the library’s test sampler at seed 20,261,109. DFS, 34 loops: trained with 4 to 24 loops. Prim’s two Kirchhoff rows add a read-out after the loop (Methods). Published scores are from each paper’s own table: FloydNet without hints14 (32 to 80 layers, about 73 million parameters at 32), the no-hint models of Bevilacqua et al.31 (Bev.) and Rodionov and Prokhorenkova32 (Rod.), and, trained with hints (h), Triplet-GMPNN62 (Trip.), the Edge Transformer63 (ET) and FloydNet. Ours matches (within half a point) or beats FloydNet without hints on 9 of 12 tasks on the official file and 8 of 12 on the fresh draw, where Dijkstra’s 98.897 falls 0.003 short. Without hints, Bellman–Ford and Dijkstra have the same test inputs and answers. —: not run or not reported (FloydNet with hints ran out of memory on four tasks).
| Task | Ours, official | Ours, fresh | Floyd. | Bev. | Rod. | Trip. (h) | ET (h) | Floyd. (h) |
|---|---|---|---|---|---|---|---|---|
| BFS | 100.0 (100.0–100.0) | 100.0 (100.0–100.0) | 100.0 | 99.9 | 100.0 | 99.7 | 99.8 | 100.0 |
| DFS | 80.5 (79.3–82.1) | 80.4 (79.3–81.8) | 75.1 | 33.9 | 34.5 | 47.8 | 65.6 | 100.0 |
| DFS, 34 loops | 90.7 (89.8–92.4) | — | ||||||
| Topological sort | 99.9 (99.9–100.0) | 100.0 (100.0–100.0) | 99.8 | 84.3 | 94.6 | 87.3 | 98.7 | 100.0 |
| Articulation points | 99.8 (99.6–100.0) | 99.9 (99.8–100.0) | 100.0 | 82.0 | 94.5 | 88.3 | 93.1 | — |
| Bridges | 100.0 (100.0–100.0) | 100.0 (100.0–100.0) | 100.0 | 95.6 | 98.9 | 94.0 | 92.0 | — |
| Strong components | 87.9 (86.7–88.9) | 85.7 (85.0–86.9) | 90.1 | 57.6 | 66.4 | 43.4 | 65.8 | — |
| Strong components, 34 loops | 89.0 (86.7–90.6) | 86.5 (85.3–87.7) | ||||||
| MST (Kruskal) | 99.4 (99.4–99.5) | 99.6 (99.5–99.6) | 99.6 | 92.3 | 92.9 | 89.8 | 84.1 | — |
| MST (Prim) | 97.6 (96.7–98.7) | 97.5 (96.8–98.0) | 99.7 | 85.3 | 85.7 | 86.4 | 93.0 | 99.7 |
| Prim, Kirchhoff read-out | 97.2 (96.6–97.7) | 97.1 (96.4–97.7) | ||||||
| Prim, read-out with shift | 96.8 (95.9–97.4) | 96.6 (95.6–97.2) | ||||||
| Bellman–Ford | 99.1 (99.0–99.1) | 98.7 (98.6–98.8) | 100.0 | 93.3 | 95.2 | 97.4 | 90.0 | 99.6 |
| Dijkstra | 98.9 (98.7–99.2) | 98.9 (98.8–99.0) | 99.4 | 95.0 | 97.0 | 96.0 | 91.9 | 97.7 |
| DAG shortest paths | 99.8 (99.7–99.9) | 99.8 (99.7–99.8) | 100.0 | 97.6 | 98.2 | 98.2 | 97.6 | 96.8 |
| Floyd–Warshall | 98.3 (97.8–99.0) | 98.3 (97.7–98.9) | 96.2 | 40.8 | 42.2 | 48.5 | 61.5 | 64.2 |
Supplementary Table 4 | SET. Accuracy (%) on 1,024 new deals for seeds 0, 1 and 2 of each layer at the learning rate with the best validation accuracy summed over the seeds (the first of two runs of each job), and for the join and the Transformers the mean of three seeds. Parameters: Newton 55,714; exponential Newton 63,183 with four clocks and 63,765 with six; join 62,018; Transformers 65,606 and 534,914. New cards in hand: 27 cards in hand in training and 55,296 deals of eight table cards, scored on deals whose card in hand was never held, at 8, 16 and 20 table cards; six-clock exponential Newton here on seeds 3, 4 and 5 with the rate picked on held-out cards in hand (Methods). Newton on 8 and 12 cards: the same layer trained on both table sizes, new cards in hand; with its own cards in hand it scores 95.5 to 97.0 at 16 and 94.1 to 97.4 at 20, and in the second run its lowest seed scores 92.4 at 16. —: not run.
| Training deals | Newton | Exp. Newton, 4 clocks | Exp. Newton, 6 clocks | Join | Transf. (66k) | Transf. (535k) |
|---|---|---|---|---|---|---|
| 2,048 | 55.3, 60.8, 57.0 | 55.9, 94.7, 57.0 | — | 50.8 | 51.1 | 51.0 |
| 8,192 | 80.7, 90.3, 84.3 | 99.3, 99.3, 100.0 | 100.0, 99.8, 99.9 | 99.8 | 51.5 | 52.2 |
| 32,768 | 98.4, 99.1, 96.9 | 100.0, 99.9, 99.9 | — | 100.0 | 53.5 | 53.8 |
| 131,072 | 100.0, 99.4, 99.5 | — | — | 100.0 | 64.3 | 57.9 |
| 524,288 | — | — | — | 100.0 | 86.5 | 99.9 |
| New cards in hand, 8 cards | 99.6, 99.9, 99.9 | 90.4, 100.0, 100.0 | 99.7, 100.0, 97.1 | 99.6 | 52.2 | 52.0 |
| New cards in hand, 16 cards | 75.0, 75.4, 75.6 | 82.1, 98.3, 98.3 | 97.9, 100.0, 98.1 | — | — | — |
| New cards in hand, 20 cards | — | 81.3, 97.2, 97.8 | 97.0, 99.8, 98.4 | — | — | — |
| Newton on 8 and 12 cards, at 16 | 96.7, 96.3, 96.2 | |||||
| Newton on 8 and 12 cards, at 20 | 95.6, 92.8, 95.5 |
Supplementary Table 5 | Registered predictions and their outcomes: search. Each prediction was written before its runs.
| Test | Prediction | Outcome |
|---|---|---|
| Benchmark’s Transformer, 41 and 49 vertices | registered for 15 million examples | stopped for cost at 2.1 to 3.1 million, at chance |
| Pair state over names, 49 to 125 vertices | converges | 12 of 12 |
| Depth law at 100 vertices | cut-offs at lookaheads 16 and 32 | held in every run |
| Transformer over names | converges at 49 on 3 of 3; at most 1 of 3 at 125 | passed (3 of 3; 0 of 3) |
| Propagator, pilot | one layer reaches 90% training accuracy within 512,000 examples | failed (82%); main runs went ahead with one layer, as disclosed in the register |
| Propagator, learned | 3 of 3 converge; mean at least 99% at 125 on 2 of 3; at least 95% at 250 on 2 of 3 | passed all three (2 of 3 at 125 and at 250) |
| Propagator, every channel started near one | at least 95% at 250 on 3 of 3 | failed (1 of 3: spectral radius past one) |
| Propagator, row cap (first attempt) | as the next row | no result: a division by gave non-finite gradients; fixed and rerun |
| Propagator, row cap | 3 of 3 converge; at least 99% at 125 and at 250 on 3 of 3 | passed (every lookahead 100% at 250) |
| Propagator speed | at least twice the looped OR join’s at 125 | passed (6.0 times) |
| OR join memory | at most a quarter of triangle attention’s at 125 | failed (0.36) |
| Looped summed layer | at least 95% at 100 and 125 | failed (at its best iteration count, 89 to 99% and 63 to 77%; 61 to 73% at 125 after the rule’s nine iterations) |
Supplementary Table 6 | Registered predictions and their outcomes: SET and CLRS-30. Each prediction was written before its runs. Every SET job was run twice with the same seeds.
| Test | Prediction | Outcome |
|---|---|---|
| Newton, 32,768 deals | at least 97% on every seed (no step correction) | failed (95.9, 96.7, 72.9) |
| Newton, rank 256 | 97% on every seed; 38 of 40 characters on every seed | failed (50.0 on one seed; 0 characters) |
| Newton with step correction | 97% on six seed-runs at 32,768 | failed by one (96.9) |
| Newton, 8,192 deals | mean 90% | failed (85.1, 88.7); passed at 32,768 and below on average, and with new cards in hand |
| Newton, count form | 95% at 16 cards and 8-card accuracy kept | failed: 85% at 8 cards, 73 to 79% at 16 |
| Newton, trained on 8- and 12-card tables | 95% at 16, 90% at 20, 8-card accuracy kept | passed on the run designated for grading (lowest 95.5 and 92.8); the second run falls to 92.4 at 16 |
| Exponential Newton, four clocks | 99% at 8 cards with new cards in hand; 95% at 16 and 20; 90% by 8,192 deals; four clocks of rank 4 | failed (mean 96.8), failed (lowest 81.3), passed (99.5 at 8,192), failed (rank 3 in 10 of 12 models) |
| Exponential Newton, errors of rank-3 models | at least 80% on deals holding a pseudo-set pair | passed (99.4% and 100%) |
| Exponential Newton, six clocks | rank 4 in 5 of 6 models; 95% at 16 and 20 on 3 of 3; 99% at 8,192 deals | passed (5 of 6), failed (52.3 on one seed at the lower rate, picked on own cards), passed (99.9) |
| Exponential Newton, rate picked on held-out cards | 99% at 8 cards on 3 of 3; 95% at 16 and 20 on 3 of 3 | failed (97.1 on one seed), passed (lowest 97.0) |
| OR join on CLRS-30, width 32, designs 1 to 3 | within a point of triangle attention on at least 9 of 12 | failed (7), failed (8), passed (11) |
| OR join on CLRS-30, width 32, fresh graphs and seeds | 10 of 12 within a point | passed |
| CLRS-30, width 128 | match or beat FloydNet on 8 of 12; on 12 of 12; DFS above 75.1; Floyd–Warshall at least 96.2; Prim at least 99.0 (FloydNet: 99.65); SCC at least 90.1 | passed (9), failed (9), passed (80.5), passed (98.3), failed (97.6), failed (87.9) |
| CLRS-30, DFS with 4 to 24 loops | at least 90% on 2 of 3; mean above 80.5 | failed (1 of 3; the others 89.9 and 89.8), passed (90.7) |
| CLRS-30, strong components with 4 to 24 loops | order-dependent representatives up at least 10 points; smallest-index ones within 1 point; mean at least 90.1; every wrong pointer inside its component | failed (+3.8, to 72.8), passed (98.75), failed (89.0), passed (675 of 675) |
| CLRS-30, Kirchhoff read-out on Prim | mean at least 99.0; at most 32 errors pointing to the node’s own child (98 without); at least 99.65; error rate at depth 8 or more no higher than at depth 0 to 4; mean at least 97.57 | failed (97.20), failed (123), failed, failed (4.6% against 0.7%), failed |
| CLRS-30, Kirchhoff read-out with a learned shift on Prim | mean at least 99.0; at most 32 errors pointing to the node’s own child; error rate at depth 8 or more no higher than at depth 0 to 4; mean at least 97.57; learned shift at least 1.7 | failed (96.84), failed (122), failed (5.2% against 0.7%), failed, failed (0.43) |
Random graphs and token positions
Stopped at convergence, pair states over names answer fewer random-graph questions, because balanced training rarely asks about later steps or merging paths; trained on, or with half of the training graphs random, they answer 96.6 to 100%. A learned embedding of the offset between positions was necessary for the pair state over token positions, which reads exactly the tokens the benchmark’s Transformer reads; the same option did not help the benchmark’s Transformer.
What the trained pair state holds
A linear probe (ridge regression) on the 16 normalised channels of any entry decodes whether reaches the goal within 32 steps, the goal channel of the construction of Theorem 1, with an AUC of 0.97 to 1.00 after the fifth iteration of a looped pair layer. The relation the construction squares, reachability between pairs, is decoded less well: for horizons of four or more steps the AUC stays at 0.76 to 0.90 after the last iteration. Applied to the state after each layer of an eight-layer pair state over names at 49 vertices, the model’s own read-out answers at least 90% up to lookahead one after each of the first five layers, and up to five, nine and 24, the deepest in the test set, after layers 6, 7 and 8.
Search from a description in English
We described 49-vertex test graphs in English, one sentence per road. Qwen3-8B64 extracted the edge list, eight sentences at a time, with 99.9% precision and recall, and a looped triangle-attention layer trained only on the benchmark’s tokens then answered 97 to 100% at every lookahead. Answering alone, the language model reached 90 to 100% with a reasoning budget of 16,384 tokens and near chance beyond two steps without reasoning.
Language models and chess
Language. A pre-LayerNorm GPT decoder of width 512 with 8 layers, 8 heads of width 64, GELU MLPs of width 2,048, context 256, rotary position embeddings on queries and keys, tied input and output embeddings and no dropout (50,975,744 parameters), trained on GPT-2 tokens of FineWeb-Edu34 with every 100th document held out. Training takes 12,208 steps of 64 sequences of 256 tokens (200,015,872 tokens) with Adam, clipping at 1, decoupled weight decay 0.1, a peak rate of after 200 warm-up steps and a cosine decay to a tenth, on one H100. The join sits after attention in blocks 2, 4, 6 and 8, with four heads of key rank 32 and value width 120 over the ordered pairs of the 16 previous tokens, a softmax over the 240 pairs and a zero-initialised output (54,715,392 parameters in all; with two more layers instead, 57,280,512). Test loss is token-weighted cross-entropy on the first 256 tokens of 1,024 held-out documents, and gains are paired by seed (seeds 0 and 1, the same data order).
Chess. The models read the 64 squares of Lichess puzzle positions, mirrored so that the side to move is White, as 65 tokens (piece and square embeddings, and one token for castling and en passant), and score the solving move with a bilinear head over legal moves. They have width 256, eight heads of width 32, pre-LayerNorm, GELU MLPs of width 1,024 and no biases (6,450,176 parameters at eight layers). The 6,193,530 puzzles are split by puzzle into 50,000 for test, 20,000 for validation and the rest for training (14,178,137 positions, one per solver move). Training uses AdamW with weight decay 0.01, clipping at 1 and batch 512, a warm-up to over at most 1,000 steps and a cosine decay to , for 20,000 updates on all the data, 10,000 on 10% and 4,000 on 1%; the final weights are scored on the first move of each test puzzle. Joins replacing attention sit in blocks 3 and 6; joins beside attention read the same input in blocks 3 and 6 and add their output to attention’s. Joins replacing two of eight attention layers lowered first-move accuracy by 0.6 points; joins beside attention came within 1.0 point of eight attention layers and were never more than 0.1 points above it. Most settings have one seed, and differences below about 0.3 points are within the spread of the two seeds of eight-layer attention.
References
- Saparov, A. et al. Transformers Struggle to Learn to Search. In International Conference on Learning Representations (2025). arxiv.org/abs/2412.04703
- Sanford, C., Hsu, D. & Telgarsky, M. Transformers, Parallel Computation, and Logarithmic Depth. In International Conference on Machine Learning, 43276–43327 (2024). arxiv.org/abs/2402.09268
- Jumper, J. et al. Highly accurate protein structure prediction with AlphaFold. Nature 596, 583–589 (2021). doi.org/10.1038/s41586-021-03819-2
- Bergen, L., O’Donnell, T. J. & Bahdanau, D. Systematic Generalization with Edge Transformers. In Advances in Neural Information Processing Systems (2021). arxiv.org/abs/2112.00578
- Clift, J., Doryn, D., Murfet, D. & Wallbridge, J. Logic and the 2-Simplicial Transformer. In International Conference on Learning Representations (2020). arxiv.org/abs/1909.00668
- Roy, A. et al. Fast and Simplex: 2-Simplicial Attention in Triton. Preprint at arXiv:2507.02754 (2025). arxiv.org/abs/2507.02754
- Das, A., Gupta, D. & Gupta, D. Linearized 2-Simplicial Attention. Preprint at arXiv:2608.09307 (2026). arxiv.org/abs/2608.09307
- Vaswani, A. et al. Attention Is All You Need. In Advances in Neural Information Processing Systems, 5998–6008 (2017). arxiv.org/abs/1706.03762
- Zaheer, M. et al. Deep Sets. In Advances in Neural Information Processing Systems (2017). arxiv.org/abs/1703.06114
- de Moura, L. & Ullrich, S. The Lean 4 Theorem Prover and Programming Language. In Automated Deduction – CADE 28, 625–635 (2021).
- The mathlib Community. The Lean Mathematical Library. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, 367–381 (2020).
- Macdonald, I. G. Symmetric Functions and Hall Polynomials. 2nd edn, Oxford University Press (1995).
- Veličković, P. et al. The CLRS Algorithmic Reasoning Benchmark. In International Conference on Machine Learning (2022). arxiv.org/abs/2205.15659
- Yu, J., Zeng, M. & Ye, Q. FloydNet: A Learning Paradigm for Global Relational Reasoning. Preprint at arXiv:2601.19094 (2026). arxiv.org/abs/2601.19094
- Reif, J. H. Depth-First Search is Inherently Sequential. Information Processing Letters 20, 229–234 (1985). doi.org/10.1016/0020-0190(85)90024-9
- Greenlaw, R., Hoover, H. J. & Ruzzo, W. L. Limits to Parallel Computation: P-Completeness Theory. Oxford University Press (1995).
- Zweig, A. & Bruna, J. Exponential Separations in Symmetric Neural Networks. In Advances in Neural Information Processing Systems, 33134–33145 (2022). arxiv.org/abs/2206.01266
- Koo, T., Globerson, A., Carreras, X. & Collins, M. Structured Prediction Models via the Matrix-Tree Theorem. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), 141–150 (2007).
- Valiant, L. G. The Complexity of Computing the Permanent. Theoretical Computer Science 8, 189–201 (1979).
- Goodman, J. Semiring Parsing. Computational Linguistics 25, 573–606 (1999).
- Chakrabarti, S., Pitassi, T. & Alman, J. Poly-attention: a general scheme for higher-order self-attention. In International Conference on Learning Representations (2026). arxiv.org/abs/2602.02422
- Csanky, L. Fast Parallel Matrix Inversion Algorithms. SIAM Journal on Computing 5, 618–623 (1976).
- Fischer, M. J. & Meyer, A. R. Boolean Matrix Multiplication and Transitive Closure. In 12th Annual Symposium on Switching and Automata Theory, 129–131 (1971).
- Maron, H., Ben-Hamu, H., Serviansky, H. & Lipman, Y. Provably Powerful Graph Networks. In Advances in Neural Information Processing Systems, 2156–2167 (2019). arxiv.org/abs/1905.11136
- Chiang, D. & Cholak, P. Overcoming a Theoretical Limitation of Self-Attention. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 7654–7664 (2022). arxiv.org/abs/2202.12172
- Nakanishi, K. M. Scalable-Softmax Is Superior for Attention. arXiv preprint arXiv:2501.19399 (2025). arxiv.org/abs/2501.19399
- Hayase, T. & Karakida, R. A Unified Framework for Critical Scaling of Inverse Temperature in Self-Attention. arXiv preprint arXiv:2605.12697 (2026). arxiv.org/abs/2605.12697
- Gerschgorin, S. Über die Abgrenzung der Eigenwerte einer Matrix. Bulletin de l’Académie des Sciences de l’URSS. Classe des sciences mathématiques et naturelles (Izvestiya Akademii Nauk SSSR), 749–754 (1931).
- Segol, N. & Lipman, Y. On Universal Equivariant Set Networks. In International Conference on Learning Representations (2020). arxiv.org/abs/1910.02421
- Olver, F. W. J., Lozier, D. W., Boisvert, R. F. & Clark, C. W. NIST Handbook of Mathematical Functions. Cambridge University Press (2010).
- Bevilacqua, B. et al. Neural Algorithmic Reasoning with Causal Regularisation. In International Conference on Machine Learning (2023). arxiv.org/abs/2302.10258
- Rodionov, G. & Prokhorenkova, L. Neural Algorithmic Reasoning Without Intermediate Supervision. In Advances in Neural Information Processing Systems (2023). arxiv.org/abs/2306.13411
- de la Torre, P. & Kruskal, C. P. Fast Parallel Algorithms for All-Sources Lexicographic Search and Path-Algebra Problems. Journal of Algorithms 19, 1–24 (1995).
- Penedo, G. et al. The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale. In Advances in Neural Information Processing Systems (2024). doi.org/10.52202/079017-0970
- Sieberling, O. et al. Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling. arXiv:2609.36529 (2026). arxiv.org/abs/2609.36529
- Mohsenvand, M. Sketchpad: Certified Exact Arithmetic with a Small Vision-Language Model. Preprint at arXiv:2611.04434 (2026). arxiv.org/abs/2611.04434
- Kim, Y., Denton, C., Hoang, L. & Rush, A. M. Structured Attention Networks. In International Conference on Learning Representations (2017). arxiv.org/abs/1702.00887
- Mensch, A. & Blondel, M. Differentiable Dynamic Programming for Structured Prediction and Attention. In International Conference on Machine Learning, 3462–3471 (2018). arxiv.org/abs/1802.03676
- Pearl, J. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann (1988).
- Yang, J. & Leskovec, J. Overlapping Community Detection at Scale: A Nonnegative Matrix Factorization Approach. In Proceedings of the Sixth ACM International Conference on Web Search and Data Mining, 587–596 (2013). doi.org/10.1145/2433396.2433471
- Zhou, M. Infinite Edge Partition Models for Overlapping Community Detection and Link Prediction. In Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, 1135–1143 (2015). arxiv.org/abs/1501.06218
- Dong, H. et al. Neural Logic Machines. In International Conference on Learning Representations (2019). arxiv.org/abs/1904.11694
- Cohen, W. W. TensorLog: A Differentiable Deductive Database. Preprint at arXiv:1605.06523 (2016). arxiv.org/abs/1605.06523
- Yang, F., Yang, Z. & Cohen, W. W. Differentiable Learning of Logical Rules for Knowledge Base Reasoning. In Advances in Neural Information Processing Systems (2017). arxiv.org/abs/1702.08367
- Xu, K. et al. What Can Neural Networks Reason About?. In International Conference on Learning Representations (2020). arxiv.org/abs/1905.13211
- Xu, K. et al. How Neural Networks Extrapolate: From Feedforward to Graph Neural Networks. In International Conference on Learning Representations (2021). arxiv.org/abs/2009.11848
- Dudzik, A. & Veličković, P. Graph Neural Networks are Dynamic Programmers. In Advances in Neural Information Processing Systems (2022). arxiv.org/abs/2203.15544
- Veličković, P., Perivolaropoulos, C., Barbero, F. & Pascanu, R. Softmax is not Enough (for Sharp Size Generalisation). In International Conference on Machine Learning, 61190–61211 (2025). arxiv.org/abs/2410.01104
- Krotov, D. & Hopfield, J. J. Dense Associative Memory for Pattern Recognition. In Advances in Neural Information Processing Systems, 1172–1180 (2016). arxiv.org/abs/1606.01164
- Ramsauer, H. et al. Hopfield Networks is All You Need. In International Conference on Learning Representations (2021). arxiv.org/abs/2008.02217
- Ho, C. H., Gutleb, T. S. & Ortner, C. Atomic Cluster Expansion without Self-Interaction. Journal of Computational Physics 515, 113271 (2024). arxiv.org/abs/2401.01550
- Gasteiger, J., Bojchevski, A. & Günnemann, S. Predict then Propagate: Graph Neural Networks meet Personalized PageRank. In International Conference on Learning Representations (2019). arxiv.org/abs/1810.05997
- Gu, F., Chang, H., Zhu, W., Sojoudi, S. & El Ghaoui, L. Implicit Graph Neural Networks. In Advances in Neural Information Processing Systems, 11984–11995 (2020). arxiv.org/abs/2009.06211
- Liu, J., Kawaguchi, K., Hooi, B., Wang, Y. & Xiao, X. EIGNN: Efficient Infinite-Depth Graph Neural Networks. In Advances in Neural Information Processing Systems, 18762–18773 (2021). arxiv.org/abs/2202.10720
- Johnson, D. D., Larochelle, H. & Tarlow, D. Learning Graph Structure With A Finite-State Automaton Layer. In Advances in Neural Information Processing Systems (2020). arxiv.org/abs/2007.04929
- Lahoti, A., Marwah, T., Puduppully, R. & Gu, A. Chimera: State Space Models Beyond Sequences. Transactions on Machine Learning Research (2025). arxiv.org/abs/2510.12111
- Zhu, Z., Zhang, Z., Xhonneux, L.-P. & Tang, J. Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction. In Advances in Neural Information Processing Systems (2021). arxiv.org/abs/2106.06935
- Liu, Y. & Lapata, M. Learning Structured Text Representations. Transactions of the Association for Computational Linguistics 6, 63–75 (2018). arxiv.org/abs/1705.09207
- Yang, G. et al. Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer. In Advances in Neural Information Processing Systems (2021). arxiv.org/abs/2203.03466
- Li, G., Xiong, C., Thabet, A. & Ghanem, B. DeeperGCN: All You Need to Train Deeper GCNs. Preprint at arXiv:2006.07739 (2020). arxiv.org/abs/2006.07739
- Sherman, J. & Morrison, W. J. Adjustment of an Inverse Matrix Corresponding to a Change in One Element of a Given Matrix. The Annals of Mathematical Statistics 21, 124–127 (1950).
- Ibarz, B. et al. A Generalist Neural Algorithmic Learner. In Proceedings of the First Learning on Graphs Conference, 2:1–2:23 (2022). arxiv.org/abs/2209.11142
- Müller, L., Kusuma, D., Bonet, B. & Morris, C. Towards Principled Graph Transformers. In Advances in Neural Information Processing Systems (2024). doi.org/10.52202/079017-4026
- Qwen Team. Qwen3 Technical Report. Preprint at arXiv:2505.09388 (2025). arxiv.org/abs/2505.09388