MuDAF: Long-Context Multi-Document Attention Focusing through Contrastive Learning on Attention Heads

Weihao Liu, Ning Wu, Shiping Yang, Wenbiao Ding, Shining Liang +2 more
2/19/2025
cs.CL
transformer-attentioncontrastive-ssl

No official code found. Best implementation: NeosKnight233/MuDAF (6 stars, Apache-2.0, last commit 2025-02-20).

Abstract

Large Language Models (LLMs) frequently show distracted attention due to irrelevant information in the input, which severely impairs their long-context capabilities. Inspired by recent studies on the effectiveness of retrieval heads in long-context factutality, we aim at addressing this distraction issue through improving such retrieval heads directly. We propose Multi-Document Attention Focusing (MuDAF), a novel method that explicitly optimizes the attention distribution at the head level through contrastive learning. According to the experimental results, MuDAF can significantly improve the long-context question answering performance of LLMs, especially in multi-document question answering. Extensive evaluations on retrieval scores and attention visualizations show that MuDAF possesses great potential in making attention heads more focused on relevant information and reducing attention distractions.

View on arXivView PDF

Code Implementations(1)

NeosKnight233/MuDAFCommunity100%
Apache-2.0
61C, C++Feb 13, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{liu2025mudaf,
  title  = {MuDAF: Long-Context Multi-Document Attention Focusing through Contrastive Learning on Attention Heads},
  author = {Weihao Liu and Ning Wu and Shiping Yang and Wenbiao Ding and Shining Liang and Ming Gong and Dongmei Zhang},
  year   = {2025},
  eprint = {2502.13963},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.13963v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.13963.svg)](https://codeofpaper.com/paper/2502.13963)

Discussion