What the Exponential Adds: Softmax,\\Hard Attention, and Exact Counting
Keep the title, authors and abstract in paper.json
potentialpaper · 2026-11-23 20:32 UTC · ff39573d47f2 ·
.potentialpaper/metadata.json modified
+++ b/.potentialpaper/metadata.json@@ -1,19 +1,5 @@{- "layout": 5,- "identifiers": [- {- "scheme": "openreview",- "value": "wjRBj2g6Qp"- }- ],- "title": "What the Exponential Adds: Softmax,\\\\Hard Attention, and Exact Counting",- "authors": [],- "abstract": "Hard-attention models simplify the study of transformer expressivity, but their conclusions need not transfer directly to softmax. Averaging hard attention (AHAT) averages values at the highest-scoring positions. Without positional encodings or masking, its rational-parameter version recognizes exactly the counting properties defined by Boolean combinations of polynomial inequalities with rational coefficients. Softmax recognizes strictly more. Two layers decide whether $\\#a>\\#c\\,e^{\\#b/(n+1)}$, where $n$ excludes one appended end marker: the first averages the $b$ indicator, and the second uses this average as the score for $c$. No semialgebraic description captures this property. The same network works when each position attends to itself and earlier positions, answering an open question. More generally, replace $e^u$ by a continuous positive function on a fixed closed interval containing all scores, keeping the remaining operations semialgebraic. Unmasked networks can recognize a nonsemialgebraic counting property exactly when this function is nonsemialgebraic on that interval; polynomial replacements therefore cannot recognize our example. Masking provides another route: three layers attending equally to earlier positions compare a count with $1+1/2+\\cdots+1/(n-1)$, a property no unmasked softmax network built from affine maps and ReLUs recognizes. Finally, replacing $e^u$ by one polynomial keeps outputs of a fixed network with bounded inputs, affine/ReLU updates and an affine readout within any prescribed tolerance at every length. Preserving every decision of even our two-layer network at length $n$ requires degree at least $(1-o(1))\\log n/\\log\\log n$. Among positive count triples of length $n$, the degree-ten Taylor replacement's disagreement fraction tends to about $3\\times10^{-11}$, yet it flips a length-$1080$ decision.",- "year": 2027,- "venue": "ICLR 2027 (under review)",- "source": "openreview",- "license": {- "metadata": "CC0-1.0",- "abstract": "CC0-1.0"- }+ "layout": 6,+ "kind": "paper",+ "key": "ec549e42-f1a0-467b-8f92-b877b8c6e9e1"}
paper.json added
+++ b/paper.json@@ -0,0 +1,9 @@+{+ "title": "What the Exponential Adds: Softmax,\\\\Hard Attention, and Exact Counting",+ "authors": [],+ "abstract": "Hard-attention models simplify the study of transformer expressivity, but their conclusions need not transfer directly to softmax. Averaging hard attention (AHAT) averages values at the highest-scoring positions. Without positional encodings or masking, its rational-parameter version recognizes exactly the counting properties defined by Boolean combinations of polynomial inequalities with rational coefficients. Softmax recognizes strictly more. Two layers decide whether $\\#a>\\#c\\,e^{\\#b/(n+1)}$, where $n$ excludes one appended end marker: the first averages the $b$ indicator, and the second uses this average as the score for $c$. No semialgebraic description captures this property. The same network works when each position attends to itself and earlier positions, answering an open question. More generally, replace $e^u$ by a continuous positive function on a fixed closed interval containing all scores, keeping the remaining operations semialgebraic. Unmasked networks can recognize a nonsemialgebraic counting property exactly when this function is nonsemialgebraic on that interval; polynomial replacements therefore cannot recognize our example. Masking provides another route: three layers attending equally to earlier positions compare a count with $1+1/2+\\cdots+1/(n-1)$, a property no unmasked softmax network built from affine maps and ReLUs recognizes. Finally, replacing $e^u$ by one polynomial keeps outputs of a fixed network with bounded inputs, affine/ReLU updates and an affine readout within any prescribed tolerance at every length. Preserving every decision of even our two-layer network at length $n$ requires degree at least $(1-o(1))\\log n/\\log\\log n$. Among positive count triples of length $n$, the degree-ten Taylor replacement's disagreement fraction tends to about $3\\times10^{-11}$, yet it flips a length-$1080$ decision.",+ "license": {+ "metadata": "CC0-1.0",+ "abstract": "CC0-1.0"+ }+}