acceptodds
Under review as a conference paper at ICLR 2027

What the Exponential Adds: Softmax, Hard Attention, and Exact Counting

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 , where excludes one appended end marker: the first averages the indicator, and the second uses this average as the score for . 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 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 , a property no unmasked softmax network built from affine maps and ReLUs recognizes. Finally, replacing 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 requires degree at least . Among positive count triples of length , the degree-ten Taylor replacement's disagreement fraction tends to about , yet it flips a length- decision.

open until 14 Dec 2026

est. 32% chance this paper gets accepted at ICLR 2027.

Reject 68%Accept 32%

What do you think this paper will get?

All positions stay anonymous.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.