Papers › MuDAF: Long-Context Multi-Document Attention Focusing through Contrastive Learning on...

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

19 Feb 2025arXiv:2502.13963archive 2025-07-28

Weihao Liu, Ning Wu, Shiping Yang, Wenbiao Ding, Shining Liang, Ming Gong, Dongmei Zhang

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2502.13963")

Code

Syntology Ran 6 of 14 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 6 ran with no contract checked.

By repository: official repository: 14 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

NeosKnight233/MuDAF officialmentioned on GitHubjaxApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested; 6 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6ran
8unverified

Licence: 0 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from NeosKnight233/MuDAF. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_relative_import_files NeosKnight233/MuDAF/transformers/dynamic_module_utils.py official repository ran Apache-2.0 (permissive) · 518f6a89865f25d2 · report
get_relative_imports NeosKnight233/MuDAF/transformers/dynamic_module_utils.py official repository ran Apache-2.0 (permissive) · 4af5faa701d0f2c9 · report
infer_metric_tags_from_eval_results NeosKnight233/MuDAF/transformers/modelcard.py official repository ran Apache-2.0 (permissive) · dd8f7751ef859581 · report
parse_keras_history NeosKnight233/MuDAF/transformers/modelcard.py official repository ran Apache-2.0 (permissive) · e6632a5722f0840d · report
quick_gelu NeosKnight233/MuDAF/transformers/modeling_flax_utils.py official repository ran fingerprinted Apache-2.0 (permissive) · a66d2b78670c85e1 · report
rename_key_and_reshape_tensor NeosKnight233/MuDAF/transformers/modeling_flax_pytorch_utils.py official repository ran Apache-2.0 (permissive) · 30d50ff2ced6b7a3 · report
convert_pytorch_state_dict_to_flax NeosKnight233/MuDAF/transformers/modeling_flax_pytorch_utils.py official repository unverified Apache-2.0 (permissive) · 8518c46881e53b67 · report
dtype_byte_size NeosKnight233/MuDAF/transformers/modeling_flax_utils.py official repository unverified Apache-2.0 (permissive) · 5e01aab2a01fb6db · report
flax_shard_checkpoint NeosKnight233/MuDAF/transformers/modeling_flax_utils.py official repository unverified Apache-2.0 (permissive) · 80d41fe6d81de3dd · report
get_imports NeosKnight233/MuDAF/transformers/dynamic_module_utils.py official repository unverified Apache-2.0 (permissive) · a263b94a95ef749c · report
is_hf_dataset NeosKnight233/MuDAF/transformers/modelcard.py official repository unverified Apache-2.0 (permissive) · ec7b1528a936234d · report
prepare_fa2_from_position_ids NeosKnight233/MuDAF/transformers/modeling_flash_attention_utils.py official repository unverified Apache-2.0 (permissive) · a77b72cc8d5c90f0 · report
read_field NeosKnight233/MuDAF/transformers/modeling_gguf_pytorch_utils.py official repository unverified Apache-2.0 (permissive) · befefbd3afa0731c · report
reverse_permute_weights NeosKnight233/MuDAF/transformers/modeling_gguf_pytorch_utils.py official repository unverified Apache-2.0 (permissive) · bb3c4ecbbdf8a9c1 · report

Tasks

Contrastive LearningQuestion AnsweringRetrieval

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AttentionSoftmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections