Born Attention: un'attenzione esatta con stato costante, ispirata alla misura quantisticaBorn Attention: exact attention with constant state, inspired by quantum measurement
Marcel Crasmaru propone pesi di attenzione pari al modulo quadro di un prodotto scalare complesso. Il calcolo diventa lineare e la memoria in decodifica resta costante: 6,4 MB per livello contro 3,2 GB.
Marcel Crasmaru proposes attention weights equal to the squared modulus of a complex dot product. Computation becomes linear and decoding memory stays constant: 6.4 MB per layer against 3.2 GB.

Marcel Crasmaru ha pubblicato su arXiv la Born Attention, una variante dell'attenzione in cui i pesi sono il modulo quadro del prodotto scalare tra query e chiave, come la probabilità di una misura quantistica. L'autore la presenta come un'attenzione esatta, non come un'approssimazione di quella tradizionale. Con questa scelta si può riscrivere in forma ricorrente senza approssimazioni: il costo cresce linearmente con la lunghezza del testo e, in decodifica, lo stato ha dimensione costante.
A un milione di token la decodifica usa 6,4 MB per livello e 0,12 millisecondi per token, contro 3,2 GB di cache e 2,26 millisecondi per FlashAttention-2. Il punto di pareggio è tra 16.000 e 32.000 token, e a 128.000 il metodo è oltre quattro volte più veloce: il vantaggio compare quindi solo sui testi lunghi. I modelli provati sono però piccoli, da 3,5 a 43 milioni di parametri, e in un test reale restano dietro al softmax di 0,12-0,77 nats.
Marcel Crasmaru has published Born Attention on arXiv, a variant of attention whose weights are the squared modulus of the dot product between query and key, like the probability of a quantum measurement. The author presents it as exact attention, not as an approximation of the traditional kind. With this choice it can be rewritten in recurrent form with no approximation: cost grows linearly with text length and, in decoding, the state has constant size.
At one million tokens decoding uses 6.4 MB per layer and 0.12 milliseconds per token, against 3.2 GB of cache and 2.26 milliseconds for FlashAttention-2. The break-even point is between 16,000 and 32,000 tokens, and at 128,000 the method is over four times faster: the advantage therefore appears only on long texts. The models tried are small, though, from 3.5 to 43 million parameters, and on a real stream they trail softmax by 0.12-0.77 nats.
L'attenzione softmax, il meccanismo centrale dei transformer, ha un costo che cresce con il quadrato della lunghezza del testo. In decodifica, inoltre, il modello deve conservare la cache di tutte le chiavi e i valori già visti, e la cache cresce con ogni token. Per questo si cercano varianti lineari. Marcel Crasmaru, in un paper su arXiv, ne propone una ispirata alla fisica quantistica e presenta come esatta.
L'idea sta nella regola di Born, che in meccanica quantistica dà la probabilità di una misura come modulo quadro di un prodotto scalare. Nella Born Attention i pesi sono proprio |⟨Q,K⟩|², con query e chiavi complesse. Si tratta di un nucleo polinomiale di grado due. Una mappa di caratteristiche a matrice densità permette di riscriverlo senza approssimazioni, senza ricorrere a trucchi che di solito rendono approssimata l'attenzione lineare.
La conseguenza è una ricorrenza causale esatta con costo O(Td²), dove T è la lunghezza e d la dimensione. In decodifica lo stato ha dimensione costante, indipendente da T, e le posizioni rotazionali sono mantenute in modo esatto. A un milione di token un livello usa 6,4 MB, contro 3,2 GB della cache di FlashAttention-2. Il tempo scende a 0,12 millisecondi per token, contro 2,26.
Sui tempi di calcolo il vantaggio dipende dalla lunghezza. Il punto di pareggio con FlashAttention-2 è tra 16.000 e 32.000 token: sotto, l'implementazione ottimizzata del softmax resta più rapida. A 128.000 token il nuovo metodo è oltre quattro volte più veloce. Gli autori riconoscono che un'altra attenzione lineare, la GLA, è circa 4,4 volte più veloce della Born Attention.
Sulla qualità i risultati sono più sfumati. Su PG-19 a 128.000 token la versione con decadimento è davanti di 0,32 nats. Su un flusso di dati reale, però, resta dietro al softmax: di 0,12 nats con mille token di contesto e di 0,77 con sedicimila. I nats misurano l'errore di previsione, e un divario di quella entità è visibile. Il confronto è più che altro una prova di fattibilità.
Il limite principale è la scala. I modelli provati hanno da 3,5 a 43 milioni di parametri e sono stati addestrati per non più di cinquemila passi. Non sappiamo come il metodo si comporti a miliardi di parametri, né se il vantaggio di memoria sopravviva all'addestramento completo. Il valore del lavoro sta nella dimostrazione teorica: un'attenzione non lineare nei pesi può comunque avere stato costante in decodifica.
Softmax attention, the central mechanism of transformers, has a cost that grows with the square of text length. In decoding, moreover, the model must keep a cache of all keys and values already seen, and the cache grows with every token. That is why linear variants are sought. Marcel Crasmaru, in an arXiv paper, proposes one inspired by quantum physics and presents it as exact.
The idea lies in the Born rule, which in quantum mechanics gives the probability of a measurement as the squared modulus of a dot product. In Born Attention the weights are exactly |⟨Q,K⟩|², with complex queries and keys. It is a polynomial kernel of degree two. A density-matrix feature map allows it to be rewritten without approximation, with none of the tricks that usually make linear attention approximate.
The consequence is an exact causal recurrence with cost O(Td²), where T is the length and d the dimension. In decoding the state has constant size, independent of T, and rotary positions are kept exactly. At one million tokens a layer uses 6.4 MB, against the 3.2 GB of FlashAttention-2's cache. Time drops to 0.12 milliseconds per token, against 2.26.
On compute time the advantage depends on length. The break-even point with FlashAttention-2 is between 16,000 and 32,000 tokens: below that, the optimised softmax implementation stays faster. At 128,000 tokens the new method is over four times faster. The authors acknowledge that another linear attention, GLA, is about 4.4 times faster than Born Attention.
On quality the results are more nuanced. On PG-19 at 128,000 tokens the version with decay is ahead by 0.32 nats. On a real data stream, however, it stays behind softmax: by 0.12 nats at one thousand tokens of context and 0.77 at sixteen thousand. Nats measure prediction error, and a gap of that size is visible. The comparison is mostly a proof of feasibility.
The main limit is scale. The models tried have from 3.5 to 43 million parameters and were trained for no more than five thousand steps. We do not know how the method behaves at billions of parameters, nor whether the memory advantage survives full training. The value of the work lies in the theoretical demonstration: an attention that is non-linear in its weights can still have constant state in decoding.
Fonti
- Testata SyncAI.news: Born Attention is Linear syncai.news
- Fonte originale arXiv: Born Attention is Linear arxiv.org
Articoli rivisti con l’intelligenza artificiale. A cura di Alessandro Patassini.Articles reviewed with artificial intelligence. Edited by Alessandro Patassini.




























