Skip to content

What to test before you trust a long prompt

Three local models each lost a fact in a different part of the document, and two facts far apart were often not combined. The one prediction that failed, and the checks I'd run.

3 min read

I ran a study of long-context recall on three local models: qwen3 8B, Llama 3.1 8B and Gemma 3 12B, at temperature 0. Each item was an invented fact planted in Wikipedia text from 1k to 16k tokens, sometimes with three look-alike facts nearby. Alone, the fact was found 98 to 100% of the time. Among look-alikes, it often wasn't.

Two results changed how I'd test a long prompt, and one of my predictions failed.

There was no safe place to put the fact

With the fact on its own, no depth was worse than any other. Start, middle, end: all the same.

With three look-alikes nearby, each model failed somewhere different.

  • Gemma lost the middle. At 8k it found the fact 95% of the time at the start and 25% in the middle. At 16k, the middle was 12%.
  • qwen3 lost the interior, and 75% depth was its worst at every length.
  • Llama had no clear middle dip. It did better at the start than the end, by 27.5 points pooled over 1k to 8k.

Recall with three near misses by where the fact sits in the document, one panel per model and one line per length from 1k to 16k. Gemma 3 12B dips to 12% in the middle at 16k; qwen3 8B dips at 25% and 75% depth at 16k; Llama 3.1 8B declines from start to end; the 30B thinking model stays at 95 to 100%.

The classic "lost in the middle" shape was clearest for Gemma. qwen3's dip was deepest at 75%, and Llama had none. If you order retrieved passages to put the important one first or last, check that it helps your model, and check it with look-alikes present. With an easy needle every depth looks fine.

Finding two facts is not the same as combining them

A two-hop question ("in which town was the designer of X born?") needs two facts: who designed X, and where that person was born. Next to each other, the models combined them 92 to 100% of the time.

At 10% and 90% of a 16k document, Llama managed 30% and 10% (one figure for each order), Gemma 35% and 20%, and qwen3 80% and 60%. Yet each model answered the second fact on its own at 75 to 100%. The loss is in connecting the two, not in finding either one.

The prediction that failed

I wrote thirteen predictions down before the full run. Twelve held. The one that didn't was about order: I expected two-hop to be harder when the birthplace comes before the person's link to X. A pilot on 6 items had shown that for two models.

On the full run it didn't hold for any of them. qwen3 moved by -12.5 points, with an interval that crossed zero, and Llama and Gemma went the other way, by +5.0 and +7.5. Six items were enough to check the code. They weren't enough to tell a pattern from chance.

The checks I'd run

  • Plant near misses. Facts of the same shape about similar things. A needle pass alone says little.
  • Leave the answer out on some items. With look-alikes present, Gemma named one of their people on 98% of items where the answer was missing.
  • Ask questions that need two facts far apart. Finding each is not the same as using both.
  • Test position only once the task is hard. And don't assume the shape is the same across models.
  • Measure the noise first. Here the identical prompt changed 0 to 1 answers in 200, so the effects above are real.

A larger thinking model did much better. qwen3 30B with thinking, on 20 items at 4k, found the fact among look-alikes 97% of the time and combined far-apart facts every time. That mixes size with thinking, on few items, and it took about 7 seconds a call against 3.

Limits

Small 4-bit models run locally, one prompt template, one kind of near miss, one fixed two-hop chain. The lengths stop at 16k, and the 16k cells rest on 16 to 20 items, so their intervals are wide. The answers were graded by code; a hand check of 80 sampled replies is drawn and not yet labelled. None of this says how hosted frontier models behave.

The full study is in the case study, and the code is on GitHub, where every number regenerates from cached model calls.

All writing
  • LLMs
  • Evaluation
  • Long context
  • Measuring LLM Systems

Get in touch

Questions about my work, a role, or a project idea. Send a message here or email me directly.

Srikarmks@gmail.com