arXiv:2509.25153cs.LGstat.ML2025-09被引 8

单层注意力可高效识别稀疏弱信号,比线性模型更省信号强度。

High-Dimensional Analysis of Single-Layer Attention for Sparse-Token Classification

  • 用单层注意力机制自适应选择关键词元,提升稀疏信号检测能力。
  • 仅两次梯度更新即实现信号对齐,测试误差随序列长度对数增长。
  • 适用于需要高效处理长序列中稀疏异常的场景,如医学影像分析。

我们理论研究了在长序列极限下,单层注意力分类器如何通过选择性关注信息性词元来检测微弱、罕见且稀疏分布的特征。正样本在随机选择的词元子集中嵌入微弱信号向量,负样本为纯噪声。结果表明,当信号强度随序列长度L仅以对数速度增长时,注意力分类器理论上可实现测试误差趋近于零;而线性分类器需信号强度达到√L量级。在高维学习框架下(样本数与嵌入维度同比增长),我们证明仅两次梯度更新即可使注意力查询权重与隐藏信号实现非平凡对齐,从而生成聚焦于重要词元的注意力图。进一步推导出测试误差与训练损失的精确渐近表达式,并量化了分类器的容量——即通常可被完美分离的最大数据集规模,解释了自适应词元选择相对于非自适应线性基线的优势。

原文摘要 · Abstract (English)

When and how can an attention mechanism learn to selectively attend to informative tokens, thereby enabling detection of weak, rare, and sparsely located features? We address these questions theoretically in a sparse-token classification model in which positive samples embed a weak signal vector in a randomly chosen subset of tokens, whereas negative samples are pure noise. In the long-sequence limit, we show that a simple single-layer attention classifier can in principle achieve vanishing test error when the signal strength grows only logarithmically in the sequence length $L$, whereas linear classifiers require $\sqrt{L}$ scaling. Moving from representational power to learnability, we study training at finite $L$ in a high-dimensional regime, where sample size and embedding dimension grow proportionally. We prove that just two gradient updates suffice for the query weight vector of the attention classifier to acquire a nontrivial alignment with the hidden signal, inducing an attention map that selectively amplifies informative tokens. We further derive an exact asymptotic expression for the test error and training loss of the trained attention-based classifier, and quantify its capacity -- the largest dataset size that is typically perfectly separable -- thereby explaining the advantage of adaptive token selection over nonadaptive linear baselines.

注意力机制稀疏信号高维分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。