arXiv Science⌕ Search

arXiv · 2611.38402

Direct access attention: associative recall at a fraction of the compute of softmax, linear attention and state-space models

Abstract

Direct access attention replaces context search with a learned integer lookup. Each token is projected to a $d_k$-dimensional code whose signs select one of $2^{d_k}$ memory cells. Its value is written to that cell; a query with matching signs retrieves it in $O(d_k+d_v)$ operations per head, independent of context length $T$. Softmax attention compares each query with every context key, costing $O(T(d_k+d_v))$ operations per head and separating $2^{O(d_k)}$ pairs. Linear attention superposes pairs in a fixed-width matrix, costing $O(d_k d_v)$ operations, independent of $T$, but separating only $O(d_k)$ pairs per head. Direct access replaces the product of key and value widths with their sum and provides $2^{d_k}$ cells, at the cost of storing $2^{d_k} d_v$ values per head. An efficient differentiable training algorithm factorises address learning into $d_k$ independent bit probabilities. This lets gradients adjust addresses; at inference, each bit becomes a definite binary choice, enabling integer lookup. Training and inference agree when these probabilities approach zero or one. Because cross-entropy alone does not reliably produce such certainty, we add an address-entropy penalty after the model has learned to match queries to the correct keys. On in-context associative recall, one-layer models with matched parameter counts achieve perfect accuracy at every tested task size, from 8 to 512 stored pairs, using either direct access or softmax attention. At 512 pairs, linear attention achieves 0.340 accuracy; a selective state-space model with the same state size performs at chance beyond 32 pairs. Direct access preserves softmax's accuracy while reducing attention-route decoding cost by three orders of magnitude.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Simon Dennis, Rivaan Patil, Hao Guo, Kevin Shabahang. 2026-11-28. Direct access attention: associative recall at a fraction of the compute of softmax, linear attention and state-space models. https://arxiv.science/abs/2611.38402

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

The Causal Case Against Algorithmic Discrimination: A Framework for Fairness Auditing in Law

As Artificial Intelligence (AI) increasingly influences decisions in critical societal sectors, understanding and establishing causality becomes essential for evaluating the fairness of automated systems. This article explores the significance of causal reasoning in addressing algorithmic discrimination, emphasizing both legal and societal perspectives. By reviewing landmark cases and regulatory frameworks, particularly within the European Union, we illustrate the challenges inherent in proving causal claims when confronted with opaque AI decision-making processes. The discussion outlines practical obstacles and methodological limitations in applying causal inference to real-world fairness scenarios, proposing actionable solutions to enhance transparency, accountability, and fairness in algorithm-driven decisions.

cs.LG↗

Implicit Dynamical Flow Fusion (IDFF) for Generative Modeling

Conditional Flow Matching (CFM) generates high-quality samples by learning a deterministic transport from noise to data, but typically requires more than a hundred network function evaluations (NFEs) per sample. We propose Implicit Dynamical Flow Fusion (IDFF), which augments the CFM vector field with $K$th-order score-derivative terms and attains comparable sample quality while requiring significantly fewer NFEs. At first order ($K=1$), the method reduces to a Langevin-augmented flow, and we prove that the marginal $p_t$ is preserved exactly in continuous time; the empirical NFE reduction is therefore a statement about discretization robustness, not about continuous-time acceleration, and we make that reading explicit. For $K=2$, we further provide an error analysis that justifies the optional second-order curvature correction we introduce, showing that its deviation is bounded by the weighted score-matching loss already minimized by our objective; the bound is formulated for general $K$ and guarantees that this correction cannot worsen the order of the overall scheme. The practical enabler behind both regimes is a re-parameterization identity: every higher-order marginal derivative can be obtained from the learned first-order score by automatic differentiation, so no additional networks are trained. Empirically, IDFF reduces NFEs by an order of magnitude with no loss in sample quality. On CIFAR-10 the $K=1$ configuration achieves an FID of 2.78 at 10 NFEs, the best result at that budget among the CFM variants we retrain at a matched backbone and training budget, and on par with methods that need over a hundred evaluations. For time-series modelling, IDFF performs strongly on molecular-dynamics simulation and sea-surface-temperature forecasting at a fraction of the compute. Code is available: https://github.com/MrRezaeiUofT/Implicit_Dynamical_Flow_Fusion_for_Genereative_Modeling.

cs.LG↗

Sampling with Adaptive Variance for Multimodal Distributions

Motivated by our previous work on adaptive diffusion for global optimization, we propose and analyze a class of adaptive sampling algorithms for multimodal distributions on a bounded domain. These algorithms share the structure of classical overdamped Langevin dynamics. We first demonstrate that this class of linear dynamics with adaptive diffusion coefficients and vector fields can be interpreted and analyzed as weighted Wasserstein gradient flows of the Kullback--Leibler (KL) divergence between the current distribution and the target Gibbs distribution. This directly leads to the exponential convergence of both the KL and $χ^2$ divergences, with rates depending on the weighted Wasserstein metric and the Gibbs potential. We then show that a derivative-free version of the dynamics can be used for sampling without evaluating the gradient of the Gibbs potential. For Gibbs distributions with nonconvex potentials, this approach can achieve much faster convergence than the classical overdamped Langevin dynamics. A comparison of the mean transition times between local minima of a nonconvex potential further highlights the sampling advantage of the derivative-free dynamics in this setting.

cs.LG↗