MMNeedle is a stress test for long-context multimodal reasoning. Each example contains a sequence of haystack images created by stitching MS COCO sub-images into 1×1, 2×2, 4×4, or 8×8 grids. Given textual needle descriptions (derived from MS COCO captions), models must predict which haystack image and which sub-image cell matches the caption—or report that the needle is absent.
This dataset card accompanies the official Hugging Face release so researchers no longer need to download from Google Drive or regenerate the benchmark from MS COCO.
sequence_length): either a single stitched image or a set of 10 stitched images.grid_rows, grid_cols): {1, 2, 4, 8} with square layouts.needles_per_query): {1, 2, 5}. Each query provides that many captions.Every example stores the full list of haystack image paths, the ground-truth
needle locations (image_index, row, col), the MS COCO image IDs for the
needles, the natural-language captions, and a has_needle boolean.
from datasets import load_dataset
ds = load_dataset("Wang-ML-Lab/MMNeedle", split="test")
example = ds[0]
print(example.keys())
# dict_keys(['id', 'sequence_length', 'grid_rows', 'grid_cols', 'needles_per_query',
# 'haystack_images', 'needle_locations', 'needle_image_ids',
# 'needle_captions', 'has_needle'])
Each entry in haystack_images is a PIL-compatible image object. needle_captions
contains one string per requested needle (even for negative examples, where the
corresponding location is (-1, -1, -1)).
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier combining configuration and sample id. |
sequence_length | int | Number of stitched haystack images shown to the model. |
grid_rows, grid_cols | int | Dimensions of the stitched grid (each cell is 256×256 px). |
needles_per_query | int | Number of captions provided for the sample (1, 2, or 5). |
haystack_images | list of Image | Ordered haystack images for the sequence. |
needle_locations | list of dict | One dict per caption with image_index, row, and col (−1 when absent). |
needle_image_ids | list of string | MS COCO filenames that generated each caption. |
needle_captions | list of string | MS COCO captions used as the needle descriptions. |
has_needle | bool | True if at least one caption corresponds to a haystack cell. |
(image_index, row, col) triples.needle_locations to compute accuracy for positives and the
false-positive rate for negatives.See the repository’s needle.py for a reference implementation.
All stitched haystack images inherit the Creative Commons Attribution 4.0 License from MS COCO. Attribution at minimum should cite both MMNeedle and MS COCO.
@article{wang2024mmneedle,
title={Multimodal Needle in a Haystack: Benchmarking Long-Context Capability of Multimodal Large Language Models},
author={Wang, Hengyi and Shi, Haizhou and Tan, Shiwei and Qin, Weiyi and Wang, Wenyuan and Zhang, Tunyu and Nambi, Akshay and Ganu, Tanuja and Wang, Hao},
journal={arXiv preprint arXiv:2406.11230},
year={2024}
}
@article{lin2014microsoft,
title={Microsoft COCO: Common Objects in Context},
author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C. Lawrence},
journal={ECCV},
year={2014}
}
6 commits
MMNeedle is a stress test for long-context multimodal reasoning. Each example contains a sequence of haystack images created by stitching MS COCO sub-images into 1×1, 2×2, 4×4, or 8×8 grids. Given textual needle descriptions (derived from MS COCO captions), models must predict which haystack image and which sub-image cell matches the caption—or report that the needle is absent.
This dataset card accompanies the official Hugging Face release so researchers no longer need to download from Google Drive or regenerate the benchmark from MS COCO.
sequence_length): either a single stitched image or a set of 10 stitched images.grid_rows, grid_cols): {1, 2, 4, 8} with square layouts.needles_per_query): {1, 2, 5}. Each query provides that many captions.Every example stores the full list of haystack image paths, the ground-truth
needle locations (image_index, row, col), the MS COCO image IDs for the
needles, the natural-language captions, and a has_needle boolean.
from datasets import load_dataset
ds = load_dataset("Wang-ML-Lab/MMNeedle", split="test")
example = ds[0]
print(example.keys())
# dict_keys(['id', 'sequence_length', 'grid_rows', 'grid_cols', 'needles_per_query',
# 'haystack_images', 'needle_locations', 'needle_image_ids',
# 'needle_captions', 'has_needle'])
Each entry in haystack_images is a PIL-compatible image object. needle_captions
contains one string per requested needle (even for negative examples, where the
corresponding location is (-1, -1, -1)).
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier combining configuration and sample id. |
sequence_length | int | Number of stitched haystack images shown to the model. |
grid_rows, grid_cols | int | Dimensions of the stitched grid (each cell is 256×256 px). |
needles_per_query | int | Number of captions provided for the sample (1, 2, or 5). |
haystack_images | list of Image | Ordered haystack images for the sequence. |
needle_locations | list of dict | One dict per caption with image_index, row, and col (−1 when absent). |
needle_image_ids | list of string | MS COCO filenames that generated each caption. |
needle_captions | list of string | MS COCO captions used as the needle descriptions. |
has_needle | bool | True if at least one caption corresponds to a haystack cell. |
(image_index, row, col) triples.needle_locations to compute accuracy for positives and the
false-positive rate for negatives.See the repository’s needle.py for a reference implementation.
All stitched haystack images inherit the Creative Commons Attribution 4.0 License from MS COCO. Attribution at minimum should cite both MMNeedle and MS COCO.
@article{wang2024mmneedle,
title={Multimodal Needle in a Haystack: Benchmarking Long-Context Capability of Multimodal Large Language Models},
author={Wang, Hengyi and Shi, Haizhou and Tan, Shiwei and Qin, Weiyi and Wang, Wenyuan and Zhang, Tunyu and Nambi, Akshay and Ganu, Tanuja and Wang, Hao},
journal={arXiv preprint arXiv:2406.11230},
year={2024}
}
@article{lin2014microsoft,
title={Microsoft COCO: Common Objects in Context},
author={Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C. Lawrence},
journal={ECCV},
year={2014}
}
6 commits