title: Differential Transformer
summary: 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.
paper_authors._id: 6704b2ac5c2dc85588281674
paper_authors.name: Tianzhu Ye
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2024-10-08T08:17:20.876Z
paper_authors._id: 64ac0605091ff88865352b44
paper_authors.avatarUrl: /avatars/fac6c81110646251cfa694425927e74f.svg
paper_authors.fullname: ytz
paper_authors.type: user
paper_authors.user: ytz20
paper_authors._id: 6704b2ac5c2dc85588281675
paper_authors.name: Li Dong
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2024-10-08T15:17:21.573Z
paper_authors._id: 5df85abada6d0311fd3d5408
paper_authors.avatarUrl: /avatars/2331cf703c1b5d3a62e2050b1a6eb108.svg
paper_authors.fullname: Li Dong
paper_authors.type: user
paper_authors.user: unilm
paper_authors._id: 6704b2ac5c2dc85588281676
paper_authors.name: Yuqing Xia
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-10-08T09:05:55.411Z
paper_authors._id: 6369e01864aad59d4d4501ac
paper_authors.avatarUrl: /avatars/bcbd3f9d0d194eeccd061c4fa6a6e283.svg
paper_authors.fullname: Yuqing Xia
paper_authors.type: user
paper_authors.user: yuqxia
paper_authors._id: 6704b2ac5c2dc85588281677
paper_authors.name: Yutao Sun
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-10-08T09:06:13.378Z
paper_authors._id: 6300ef4779c5ddbc6cf83e1a
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/1661005591657-noauth.jpeg
paper_authors.fullname: Yutao Sun
paper_authors.type: user
paper_authors.user: sunyt32
paper_authors._id: 6704b2ac5c2dc85588281678
paper_authors.name: Yi Zhu
paper_authors._id: 6704b2ac5c2dc85588281679
paper_authors.name: Gao Huang
paper_authors._id: 6704b2ac5c2dc8558828167a
paper_authors.name: Furu Wei
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-10-08T09:07:03.147Z
paper_authors._id: 6368c512fbfe97c16a40baba
paper_authors.avatarUrl: /avatars/1c23bc7c0b6d9225699ce27647623d7a.svg
paper_authors.fullname: Furu Wei
paper_authors.type: user
paper_authors.user: thegenerality
paper_title: Differential Transformer
paper_summary: 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.
paper_ai_keywords: Diff Transformer differential attention mechanism softmax attention maps sparse attention patterns language modeling scaling up model size training tokens semantic (The duplication of "much" in the original text makes it unclear; if "much" was meant to be used as part of a term, please clarify. Otherwise, it is excluded.) long-context modeling key information retrieval hallucination mitigation in-context learning activation outliers question answering text summarization order permutation