- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Why does your LLM ignore the middle of a long prompt?
Why does an LLM ignore information stuck in the middle of a long context — even when it's right there?
Picture one giant prompt with fifty documents glued together. The answer the user needs lives in document twenty-five — right in the middle. You ask the question and the model confidently misses it. Move that same doc to the very top, or the very bottom, and suddenly the answer is perfect. This is the lost-in-the-middle effect.
Why it happens: attention — the model's spotlight that picks which words matter most — is uneven across your prompt. It leans hard on the start (because intros usually carry the topic) and on the end (because your question usually sits there). The middle gets the dimmest light, so tokens in the middle get less weight in the final answer.
The fix has a name: reranking. After you fetch fifty docs, re-score them with a tiny reranker model that sorts by true relevance, not keyword match. Keep the top three, drop the rest, then place the best chunk at the very start and the next-best at the end. Now the spotlight lands exactly where the answer is.
Long context is not free attention. Rerank — then pack the edges.
Music: Markvard - Time [NCS Release] (NoCopyrightSounds)
https://ncs.io
#ai #llm #rag #reranking #attention #shorts #programming
Видео Why does your LLM ignore the middle of a long prompt? канала ProCode
Picture one giant prompt with fifty documents glued together. The answer the user needs lives in document twenty-five — right in the middle. You ask the question and the model confidently misses it. Move that same doc to the very top, or the very bottom, and suddenly the answer is perfect. This is the lost-in-the-middle effect.
Why it happens: attention — the model's spotlight that picks which words matter most — is uneven across your prompt. It leans hard on the start (because intros usually carry the topic) and on the end (because your question usually sits there). The middle gets the dimmest light, so tokens in the middle get less weight in the final answer.
The fix has a name: reranking. After you fetch fifty docs, re-score them with a tiny reranker model that sorts by true relevance, not keyword match. Keep the top three, drop the rest, then place the best chunk at the very start and the next-best at the end. Now the spotlight lands exactly where the answer is.
Long context is not free attention. Rerank — then pack the edges.
Music: Markvard - Time [NCS Release] (NoCopyrightSounds)
https://ncs.io
#ai #llm #rag #reranking #attention #shorts #programming
Видео Why does your LLM ignore the middle of a long prompt? канала ProCode
Комментарии отсутствуют
Информация о видео
29 мая 2026 г. 14:06:00
00:01:15
Другие видео канала











