Vì sao nó bỏ qua phần giữa tài liệu dài của tôi?
Lost in the middle: thiên lệch vị trí trong ngữ cảnh dài · Cơ bản · 5 phút · attention, context, rag · học sau Self-attention, Context window
Lost in the middle (lạc ở giữa): mô hình ngôn ngữ dùng thông tin ở đầu hoặc cuối một prompt dài tốt hơn hẳn cùng thông tin đó đặt ở giữa. Độ chính xác theo vị trí vẽ thành chữ U, kể cả khi mọi thứ vừa cửa sổ ngữ cảnh.
1 Đoán trước
2 Xem
Where the answer sits
1 / 420 Wikipedia passages, one holds the answer. Move it:
GPT-3.5-Turbo right: 75.8%
- passage 1 of 2075.8%
- passage 5 of 2057.2%
- passage 10 of 2053.8%
- passage 15 of 2055.4%
- passage 20 of 2063.2%
- white line: 56.1% with no passages at all
measured with GPT-3.5-Turbo and others on 2,655 NaturalQuestions-Open questions · Liu et al., TACL 2024 · checked 2026-10-22
Same 20 passages, same question. Only the answer’s place changes, and the middle loses.
Di chuyển đoạn văn hữu ích duy nhất và độ chính xác vẽ thành chữ U: cao ở đầu, khá cao ở cuối, thấp nhất ở giữa.
Self-attention (cơ chế tự chú ý) có thể với tới mọi đoạn như nhau. Các mô hình được đo thì không: chúng dựa vào phần đầu và phần cuối. Bài báo so sánh với hiệu ứng vị trí trong trí nhớ con người. Cửa sổ lớn hơn không chữa được: GPT-3.5-Turbo (16K) vẽ cùng đường cong với bản 4K.
4 Bạn là model
Bạn là GPT-3.5-Turbo, đang đọc 20 đoạn văn. Không có đoạn nào, bạn đạt 56,1%. Với bốn vị trí của đoạn chứa đáp án, hãy quyết định: nó giúp bạn, hay bạn làm tệ hơn cả khi không có gì?
you are GPT-3.5-Turbo · 20 passages · with none you score 56.1%
The answer is in passage 1 of 20.
Liu et al., TACL 2024, Tables 1 and 6 · checked 2026-10-22
You are the model. Does this passage help you, or hurt?5 Kiểm tra
Ba thói quen giúp ích. Đặt phần quan trọng lên đầu, hoặc nhắc lại ở cuối. Đặt câu hỏi ở cuối cùng, sau tài liệu. Và gửi ít hơn: 50 đoạn thay vì 20 chỉ thêm 1,5 điểm. Cần nhiều chi tiết trong một file dài, hãy hỏi từng cái một.
7 Nói lại bằng lời bạn
8 Nhiệm vụ · 5 phút
Trong Google AI Studio (miễn phí), chọn Gemini 3.8 Flash và dán một bài viết dài. Giấu một dòng bịa ở giữa (“The office cat is called Pickle.”) rồi hỏi tên con mèo. Sau đó giấu năm chi tiết bịa rải khắp bài và hỏi cả năm. Nó bỏ sót cái nào, và chuyển chúng lên đầu hoặc xuống cuối có giúp không?
Ba câu nhanh
Rút ngẫu nhiên từ bộ câu hỏi của bài; lần sau sẽ khác.
Xong chưa?
Đọc thêm
Nguồn
- https://arxiv.org/abs/2307.03172 (v3, 2023-11-20; checked 2026-10-22), published as TACL vol. 12, pp. 157–173, 2024 (https://aclanthology.org/2024.tacl-1.9/): multi-document QA on 2,655 NaturalQuestions-Open queries, Wikipedia passages of at most 100 tokens, one with the answer, distractors retrieved by Contriever; accuracy = any correct answer appears in the output
- Same paper, Table 1 (closed-book): GPT-3.5-Turbo 56.1%, GPT-3.5-Turbo (16K) 56.0%, Claude-1.3 48.3%, MPT-30B-Instruct 31.5%, LongChat-13B (16K) 35.0%
- Same paper, Table 6 (20 passages, Index 0/4/9/14/19 = passages 1/5/10/15/20): GPT-3.5-Turbo 75.8/57.2/53.8/55.4/63.2; GPT-3.5-Turbo (16K) 75.7/57.3/54.1/55.4/63.1; Claude-1.3 59.9/55.9/56.8/57.2/60.1; Claude-1.3 (100K) 59.8/55.9/57.0/57.4/60.0; MPT-30B-Instruct 53.7/51.8/52.2/52.7/56.3; LongChat-13B (16K) 68.6/57.4/55.3/52.5/55.0
- Same paper, Table 5 (10 passages) GPT-3.5-Turbo (16K) 76.9/61.0/62.5; Table 7 (30 passages) 73.4/55.1/50.5/50.9/51.8/54.9/63.7; Table 3: 20 passages average 2,946.2 tokens for GPT-3.5-Turbo; §2.3 4K and 16K curves “nearly superimposed”; §5: 50 instead of 20 retrieved documents improves GPT-3.5-Turbo by 1.5% and Claude-1.3 by 1%; §6 serial-position effect, “self-attention … is technically equally capable of retrieving any token”
- https://arxiv.org/abs/2403.05530 (Gemini 1.5 report, checked 2026-10-22), abstract: “near-perfect retrieval (>99%) up to at least 10M tokens”
- https://ai.google.dev/gemini-api/docs/long-context (last updated 2026-10-15, checked 2026-10-22): put the query “at the end of the prompt (after all the other context)”; with multiple needles “the model does not perform with the same accuracy”; “~99% on a single query”
- https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices (checked 2026-10-22): “Place your long documents and inputs near the top of your prompt”; “Queries at the end can improve response quality by up to 30 percent in tests, especially with complex, multidocument inputs”
- https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash (checked 2026-10-22): input token limit 1,048,576; aifree.dev catalog google-gemini-developer-api-free-tier verified 2026-10-12, models include gemini-3.8-flash
- The 22-point gap (75.8 − 53.8) and “about 3,000 tokens” (2,946) are arithmetic and rounding from the tables above
Đăng Oct 22, 2026 · cập nhật Oct 22, 2026