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.


翻译:暂无翻译

0
下载
关闭预览

相关内容

深度学习中Attention Mechanism详细介绍:原理、分类及应用
深度学习与NLP
10+阅读 · 2019年2月18日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
跨越注意力:Cross-Attention
我爱读PAMI
172+阅读 · 2018年6月2日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
VIP会员
最新内容
《评估人机编队性能的标准指标》
专知会员服务
8+阅读 · 11月30日
《美陆军装甲排的自动化任务分配模型》59页
专知会员服务
6+阅读 · 11月30日
乌克兰海陆空无人力量
专知会员服务
3+阅读 · 11月30日
超越技术:美战争部的AI变革管理
专知会员服务
7+阅读 · 11月27日
北约400亿美元反无人机能力投资建设
专知会员服务
7+阅读 · 11月25日
反小型无人机系统方案评估(27页)
专知会员服务
15+阅读 · 11月25日
相关VIP内容
相关资讯
深度学习中Attention Mechanism详细介绍:原理、分类及应用
深度学习与NLP
10+阅读 · 2019年2月18日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
跨越注意力:Cross-Attention
我爱读PAMI
172+阅读 · 2018年6月2日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员