Papers › Never Lost in the Middle: Mastering Long-Context Question Answering with...

Never Lost in the Middle: Mastering Long-Context Question Answering with Position-Agnostic Decompositional Training

15 Nov 2023arXiv:2311.09198archive 2025-07-28

Junqing He, Kunhao Pan, Xiaoqun Dong, Zhuoyang Song, Yibo Liu, Qianguo Sun, Yuxin Liang, Hao Wang, Enming Zhang, Jiaxing Zhang

While large language models (LLMs) are equipped with longer text input capabilities than before, they are struggling to seek correct information in long contexts. The "lost in the middle" problem challenges most LLMs, referring to the dramatic decline in accuracy when correct information is located in the middle. To overcome this crucial issue, this paper proposes to enhance the information searching and reflection ability of LLMs in long contexts via specially designed tasks called Attention Strengthening Multi-doc QA (ASM QA). Following these tasks, our model excels in focusing more precisely on the desired information. Experimental results show substantial improvement in Multi-doc QA and other benchmarks, superior to state-of-the-art models by 13.7% absolute gain in shuffled settings, by 21.5% in passage retrieval task. We release our model, Ziya-Reader to promote related research in the community.

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="2311.09198")

Code

Syntology Ran 15 of 17 code samples harvested from 2 repositories linked to this paper; 2 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 3 ran · our draft was wrong; 10 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 14 ran; community (archive-listed): 2 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

hejunqing/never-lost-in-the-middle officialmentioned in papermentioned on GitHubpytorchMIT report
qihoo360/360zhinao mentioned on GitHubpytorchApache-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

17 samples harvested; 15 ran; 1 honoured the contract we drafted; 2 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.

1ran · honoured contract
1ran · violated contract
3ran · our draft was wrong
10ran
2unverified

Licence: 0 of the 17 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

add_eod hejunqing/never-lost-in-the-middle/LongBench/src/new_utils.py official repository ran fingerprinted MIT (permissive) · afdae69731929a72 · report
build_chat hejunqing/never-lost-in-the-middle/Lost_Retrieval/src/pred_single.py official repository ran MIT (permissive) · 251720ea85d2ca71 · report
build_chat hejunqing/never-lost-in-the-middle/LongBench/src/baichuan_pred_shuffle.py official repository ran MIT (permissive) · 7024e12377186e51 · report
build_chat hejunqing/never-lost-in-the-middle/LongBench/src/pred_chatglm.py official repository ran MIT (permissive) · 7439724189daf2cb · report
build_chat2 hejunqing/never-lost-in-the-middle/Lost_Retrieval/src/pred_single.py official repository ran MIT (permissive) · 619fcfb88a0948e5 · report
build_chat_baichuan hejunqing/never-lost-in-the-middle/LongBench/src/pred_shuffle_reader.py official repository ran MIT (permissive) · 9cea8a9dc64a79cc · report
count_score hejunqing/never-lost-in-the-middle/LongBench/src/metrics.py official repository ran · honoured contract fingerprinted MIT (permissive) · b349b79d9cc2934b · report
get_pred hejunqing/never-lost-in-the-middle/LongBench/src/baichuan_pred_shuffle.py official repository ran MIT (permissive) · 9ac0485160d687f7 · report
normalize_answer hejunqing/never-lost-in-the-middle/LongBench/src/metrics.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · e7e75981cb464788 · report
normalize_zh_answer hejunqing/never-lost-in-the-middle/LongBench/src/metrics.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 8c5c581f9264c810 · report
parse_args hejunqing/never-lost-in-the-middle/LongBench/src/pred_chatglm.py official repository ran MIT (permissive) · 36753478d8bfe1e1 · report
post_process hejunqing/never-lost-in-the-middle/LongBench/src/pred_chatglm.py official repository ran · violated contract fingerprinted MIT (permissive) · 4489113b536ca6eb · report
replace_head hejunqing/never-lost-in-the-middle/LongBench/src/new_utils.py official repository ran MIT (permissive) · 372ffbf8201660a5 · report
shorten hejunqing/never-lost-in-the-middle/LongBench/src/new_utils.py official repository ran MIT (permissive) · 6653c42aad855a65 · report
build_chat hejunqing/never-lost-in-the-middle/LongBench/src/pred_shuffle_reader.py official repository unverified MIT (permissive) · 0af745ab8b003692 · report
preprocess qihoo360/360zhinao/Reranking/finetune.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 8b733c9fc590e4c1 · report
preprocess qihoo360/360zhinao/Reranking/flag_models.py community (archive-listed) unverified Apache-2.0 (permissive) · a30e2612231ea545 · report

Tasks

Passage RetrievalQuestion AnsweringRetrieval

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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