arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.05258cs.CLcs.LG
收藏

差分 Transformer

Differential Transformer

Microsoft Research(微软研究院);Tsinghua University(清华大学)

Tianzhu Ye, Li Dong, Yuqing Xia, Yutao Sun, Yi Zhu, Gao Huang, Furu Wei

AI总结:

针对Transformer易将注意力过度分配给无关上下文的问题,提出Diff Transformer,通过计算两个独立softmax注意力图的差值来消除噪声并放大相关上下文注意力,在多项任务中显著提升性能并增强鲁棒性。

摘要:

Transformer倾向于将注意力过度分配给无关上下文。在这项工作中,我们引入了Diff Transformer,它在放大对相关上下文注意力的同时消除噪声。具体而言,差分注意力机制将注意力分数计算为两个独立的softmax注意力图之间的差值。这种减法消除了噪声,促进了稀疏注意力模式的涌现。语言建模的实验结果表明,Diff Transformer在扩大模型规模和训练token数量的各种设置下均优于Transformer。更引人注目的是,它在实际应用中提供了显著优势,例如长上下文建模、关键信息检索、缓解幻觉、上下文学习和减少激活异常值。由于较少受到无关上下文的干扰,Diff Transformer能够在问答和文本摘要中缓解幻觉。对于上下文学习,Diff Transformer不仅提高了准确性,而且对顺序排列更具鲁棒性,这曾被视为一个长期的鲁棒性问题。这些结果确立了Diff Transformer作为推进大型语言模型的高效且极具前景的架构的地位。

英文摘要:

Transformer tends to overallocate attention to irrelevant context. In this work, we introduce Diff Transformer, which amplifies attention to the relevant context while canceling noise. Specifically, the differential attention mechanism calculates attention scores as the difference between two separate softmax attention maps. The subtraction cancels noise, promoting the emergence of sparse attention patterns. Experimental results on language modeling show that Diff Transformer outperforms Transformer in various settings of scaling up model size and training tokens. More intriguingly, it offers notable advantages in practical applications, such as long-context modeling, key information retrieval, hallucination mitigation, in-context learning, and reduction of activation outliers. By being less distracted by irrelevant context, Diff Transformer can mitigate hallucination in question answering and text summarization. For in-context learning, Diff Transformer not only enhances accuracy but is also more robust to order permutation, which was considered as a chronic robustness issue. The results position Diff Transformer as a highly effective and promising architecture to advance large language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑