NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Needle In A Multimodal Haystack

Weiyun Wang, Shuibo Zhang, Yiming Ren, Yuchen Duan, Tiantong Li, Shuo Liu, Mengkang Hu, Zhe Chen, Kaipeng Zhang, Lewei Lu, Xizhou Zhu, Ping Luo, Yu Qiao, Jifeng Dai, Wenqi Shao, Wenhai Wang

TL;DR

Researchers have introduced MM-NIAH (Needle In A Multimodal Haystack), the first benchmark specifically designed to test how well Multimodal Large Language Models (MLLMs) can find and use specific information buried in massive, interleaved image-text documents. The results serve as a wake-up call: while models are getting better at parsing long-form text, they struggle significantly with "image needles," often failing to even count the number of pictures in a document as the context grows.

What Problem Does This Paper Address?

We’ve seen Large Language Models (LLMs) boast increasingly massive context windows—sometimes reaching millions of tokens. To test these capabilities, researchers rely on "Needle In A Haystack" tests, where a single fact is hidden in a sea of text. However, the multimodal cousins of these models (MLLMs) haven't faced a similar stress test for long-context documents that mix text and images.

Comparison of multimodal benchmarks, highlighting the long-context interleaved nature of MM-NIAH compared to SEED-Bench-2 and MVBench.

Existing benchmarks like SEED-Bench 2 or BLINK focus heavily on short contexts, while video benchmarks like MVBench are predominantly vision-centric. In the real world, we need models that can parse a 100-page technical manual or a lengthy, interleaved blog post. This paper addresses the lack of a systematic evaluation for long-context multimodal understanding, revealing that simply having a large context window doesn't mean a model can actually "see" everything inside it.

Methods

The authors constructed "multimodal haystacks" by concatenating interleaved image-text sequences from the OBELICS dataset. They then injected "needles"—specific pieces of information—at various depths and context lengths, ranging from 1k to 72k tokens.

An example of a text needle hidden within an interleaved image-text document in the MM-NIAH benchmark.

The benchmark is structured around two types of needles and three types of tasks:

  • Needle Types:
    • Text Needles: A specific fact or statement inserted into the text.
  • Image Needles: A specific image (often a unique cartoon style) or a minute detail within an image.
  • Task Types:
    • Retrieval: Find a single fact or image.
  • Counting: Identify and count multiple needles scattered throughout the document.
  • Reasoning: Connect cues from multiple needles to answer a complex question.

To ensure a fair comparison of "vision" versus "text" tokens, the researchers used a patch-based approach (similar to InternVL-1.5) where each image patch is treated as 256 tokens. This maintained a ratio of roughly one image per 2k text tokens.

Datasets and Evaluation Targets

  • Background Haystack: Interleaved image-text sequences from the OBELICS dataset.
  • Image Needles: Custom images generated by DALLE-3 (for retrieval and counting tasks) and reasoning-specific images sourced from the BLINK benchmark.
  • Evaluated Models: The paper tests leading proprietary models including GPT-4V and Gemini-1.5-Flash, alongside open-source heavyweights like InternVL-1.5, LLaVA-1.6, VILA, and IDEFICS2.

Key Insights and Ideas

  • The "Vision Gap": Models are significantly worse at finding image needles than text needles. While some models can successfully locate a text needle at 32k tokens, their performance on image needles often craters much earlier.
  • Counting is Hard: MLLMs struggle to even recognize the exact number of images in a long document. As the number of images exceeds five, the accuracy of even advanced models like Gemini-1.5-Flash drops below 10%.
  • Lost in the Multimodal Middle: The famous "lost in the middle" phenomenon—where models perform best at the beginning and end of a document—is alive and well in MLLMs, particularly for text needles.
  • RAG is a Double-Edged Sword: Retrieval-Augmented Generation (RAG) significantly boosts performance for text needles but is largely ineffective for image needles. This suggests current RAG systems aren't optimized for retrieving specific visual sub-components within a long interleaved stream.
  • Training Data Isn't Everything: Models pre-trained on interleaved data (like IDEFICS2) didn't necessarily outperform those trained on simple image-text pairs when it came to long-context comprehension.

Key Results

The performance gap between humans and AI remains vast. Human experts achieved near-perfect scores (~98.9% accuracy) across all tasks and lengths.

In contrast:

  • Gemini-1.5-Flash was the top performer among the tested models, with an overall average of 55.3%, but its performance still degraded notably as context length increased.
  • InternVL-1.5 (without RAG) scored 42.4%. When augmented with RAG, it jumped to 50.1%, primarily due to gains in text retrieval.
  • Open-source models like LLaVA-1.6-34B and VILA-13B showed decent performance at 1k-4k contexts but saw their accuracy drop to near zero as they approached 16k-24k tokens.

Limitations and Future Work

The authors acknowledge that MM-NIAH is strictly a "needle" test—the answers only relate to the specific inserted needles, not the background "haystack" itself. This means the benchmark tests retrieval and local reasoning rather than a holistic understanding of a long document's overarching narrative or theme.

Future work aims to:

  1. Construct evaluation data where the questions relate to the entirety of the long multimodal document.
  2. Improve the "instruction-following" capabilities of models in long contexts to prevent them from generating gibberish when overwhelmed by high token counts.
  3. Enhance the robustness of MLLMs so they retain the long-context capabilities of their underlying LLM backbones.

Summary updated

BibTeX
@inproceedings{wang2024needle,
  author = {Weiyun Wang and Shuibo Zhang and Yiming Ren and Yuchen Duan and Tiantong Li and Shuo Liu and Mengkang Hu and Zhe Chen and Kaipeng Zhang and Lewei Lu and Xizhou Zhu and Ping Luo and Yu Qiao and Jifeng Dai and Wenqi Shao and Wenhai Wang},
  title = {{Needle In A Multimodal Haystack}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=U2pNwSuQqD},
}
Figure