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.
Understanding Input Selectivity in Mamba: Impact on Approximation Power, Memorization, and Associative Recall Capacity
Apple(苹果公司);Work done while at Apple(在苹果公司的工作);Mila Research Institute, Montreal, Canada(蒙特利尔加拿大米尔研究所);Flatiron Institute, New York, USA(纽约美国Flatiron研究所)
MetaLA: Unified Optimal Linear Approximation to Softmax Attention Map
The Hong Kong Polytechnic University(香港理工大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);UC Santa Cruz(加州大学圣克鲁兹分校);Shanghai AI Lab(上海人工智能实验室)
Instituto Superior Técnico & Instituto de Telecomunicações, Universidade de Lisboa, Portugal(里斯本大学理工学院及电信研究所,葡萄牙);Champalimaud Research, Lisbon, Portugal(Champalimaud研究,葡萄牙里斯本);TransPerfect, Lisbon, Portugal(TransPerfect,葡萄牙里斯本);Carnegie Mellon University, Pittsburgh, USA(卡内基梅隆大学,美国匹兹堡)
Distributed Associative Memory via Online Convex Optimization
KCLIP, CIIPS, Department of Engineering, King’s College London, London WC2R 2LS, UK(KCLIP、CIIPS、工程系、伦敦国王学院,伦敦 WC2R 2LS,英国);Communication Systems Department, EURECOM, 06904 Sophia Antipolis, France(通信系统部门、EURECOM、法国索菲亚抗皮斯,06904);Intelligent Networked Systems Institute, Northeastern University London, London E1 8PH, UK(智能网络系统研究所、伦敦东北大学、伦敦 E1 8PH,英国)
Tensor Cache: Eviction-conditioned Associative Memory for Transformers
Massachusetts Institute of Technology, Cambridge, MA, USA(麻省理工学院);IBM Research, Cambridge, MA, USA(IBM研究院);University of Toronto, Toronto, Canada(多伦多大学)
Native Hybrid Attention for Efficient Sequence Modeling
Tsinghua University(清华大学);Shanghai AI Laboratory(上海人工智能实验室);The Hong Kong University of Science and Technology (Guangzhou)(香港科学与技术大学(广州));The Chinese University of Hong Kong(香港中文大学)