arXiv ScienceSearch

arXiv · 2609.25802

Latest Exact Match Attention

Abstract

We introduce latest exact match attention (LEMA), an attention variant for transformers where queries and keys are binarized and each query attends only to the latest exactly matching key. We prove that LEMA transformers with chain of thought can simulate word-RAMs, as was recently shown for the less restrictive rightmost hard attention. In contrast to prior hard attention variants, the restriction to exact matches enables an efficient converse direction: word-RAMs can simulate LEMA transformers at a cost per token independent of the context length. Together, these results yield a close correspondence between the two computational models in terms of both compute and memory. Beyond the theory, we propose a training method for LEMA transformers that handles their non-differentiable operations with a straight-through estimator for the binarization and a soft attention surrogate annealed towards LEMA. On a synthetic associative recall task, LEMA models trained this way use their growing state to store and recall a large number of associations, outperforming gated DeltaNet (GDN) with its fixed state size. As a first scaling test, we train LEMA language models with up to 834 million parameters. They match softmax transformers of around half their size in loss and, on repeated rare phrases and a needle-retrieval task, remain behind softmax transformers but recall across longer distances than GDN models of comparable size. Finally, we implement dictionary-based inference for LEMA transformers and show constant generation speed comparable to GDN despite their growing state, with the dictionaries residing in main memory rather than VRAM. Code is available at https://github.com/moritzbroe/latest_exact_match_attention.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Moritz Brösamle. 2026-09-22. Latest Exact Match Attention. https://arxiv.org/abs/2609.25802

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Analysis of Regularized Learning in Banach Spaces for Linear-functional Data

This article delves into the study of the theory of regularized learning in Banach spaces for linear-functional data. It encompasses discussions on representer theorems, pseudo-approximation theorems, and convergence theorems. Regularized learning is designed to minimize regularized empirical risks over a Banach space. The empirical risks are calculated by utilizing training data and multi-loss functions. The input training data are composed of linear functionals in a predual space of the Banach space to capture discrete local information from multimodal data and multiscale models. Through the regularized learning, approximations of the exact solution to an unidentified or uncertain original problem are globally achieved. In the convergence theorems, the convergence of the approximate solutions to the exact solution is established through the utilization of the weak* topology of the Banach space. The theorems of regularized learning are utilized in the interpretation of classical machine learning, such as support vector machines and artificial neural networks.

cs.LG

On Minimal Depth in Neural Networks

Understanding the relationship between the depth of a neural network and its representational capacity is a central problem in deep learning theory. In this work, we develop a geometric framework to analyze the expressivity of ReLU networks with the notion of depth complexity for convex polytopes. The depth of a polytope recursively quantifies the number of alternating convex hull and Minkowski sum operations required to construct it. This geometric perspective serves as a rigorous tool for deriving depth lower bounds and understanding the structural limits of deep neural architectures. We establish lower and upper bounds on the depth of polytopes, as well as tight bounds for classical families. These results yield two main consequences. First, we provide a purely geometric proof of the expressivity bound by Arora et al. (2018), confirming that $\lceil \log_2(n+1)\rceil$ hidden layers suffice to represent any continuous piecewise linear (CPWL) function. Second, we prove that, unlike general ReLU networks, convex polytopes do not admit a universal depth bound. Specifically, the depth of cyclic polytopes in dimensions $n \geq 4$ grows unboundedly with the number of vertices. This result implies that Input Convex Neural Networks (ICNNs) cannot represent all convex CPWL functions with a fixed depth, revealing a sharp separation in expressivity between ICNNs and standard ReLU networks.

cs.LG

DeepSPoC: A Deep Learning Based Sequential Propagation of Chaos

Classical particle methods based on propagation of chaos (PoC) have been developed for solving mean-field stochastic differential equations and their associated nonlinear Fokker--Planck equations. However, direct PoC implementations are difficult to apply to high-dimensional problems because they require simulating and storing large numbers of interacting particles, often with high particle-particle interaction costs. Motivated by these limitations, we build on the recently proposed sequential propagation of chaos (SPoC) framework, which replaces the fully interacting particle system in PoC with a sequential interaction mechanism. Based on this structure, we present DeepSPoC, a neural particle method that embeds a neural density representation into the sequential particle dynamics. DeepSPoC simulates particles batch by batch, while the neural network represents the evolving empirical law and is substituted into the coefficients of the mean-field SDE, thereby replacing direct particle-particle interactions with particle-network interactions. In DeepSPoC, a recently developed normalizing flow model called KRnet is used to approximate the empirical measure of particles. Compared with direct particle implementations, DeepSPoC substantially reduces memory consumption and evaluates interaction terms more efficiently, thereby improving scalability for high-dimensional problems. We apply DeepSPoC to a wide range of mean-field equations and verify its effectiveness and computational advantages.

cs.LG