Skip to content
effl-labPublic

About

Official Implementation of "Understanding the Effects of Distractors on Reasoning Vision-Language Models (EMNLP 2026)"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Understanding the Effects of Distractors on Reasoning Vision-Language Models

Pohang University of Science and Technology (POSTECH)

The 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP 2026)

Jiyun Bae, Hyunjong Ok, Sangwoo Mo, Jaeho Lee

[Paper] | [Dataset] | [Project Page]

Test-time scaling under distractors

TL;DR: Textual distractors are known to intensify inverse scaling in reasoning LMs: models reason longer and get worse. We introduce Idis (Images with distractors), a VQA benchmark suite that varies distractor modality, number, and semantic relationship (aligned / conflicting / irrelevant) over perception-centric (ImageNet-9) and reasoning-centric (MathVerse) tasks. Visual distractors behave differently from textual ones: they lower accuracy without lengthening the reasoning trace, shifting the whole length–accuracy curve downward, while textual distractors in the prompt reproduce the LM-style inverse scaling. The fraction of distractor-related attributes verbalized in the trace, not its length, predicts the failure, and a simple attribute-guiding prompt reduces it.

Citation

If you find our work or dataset useful, please consider giving a star ⭐ and citing:

@inproceedings{bae2026idis,
  title     = {Understanding the Effects of Distractors on Reasoning Vision-Language Models},
  author    = {Bae, Jiyun and Ok, Hyunjong and Mo, Sangwoo and Lee, Jaeho},
  booktitle = {Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  year      = {2026}
}

Installation

We develop this codebase on Python 3.11, PyTorch 2.10 and vLLM 0.19 with CUDA 12.8.

conda create -n idis python=3.11 -y
conda activate idis
pip install -r requirements.txt

The DeepSeek-based attribute extractors (analysis/attribute_extraction/) need DEEPSEEK_API_KEY. The object-area analysis needs LangSAM. Rebuilding Idis-perception needs Gemini access, either Vertex AI (GOOGLE_CLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS) or the Gemini Developer API (GOOGLE_API_KEY).

Data Preparation

Idis construction

The pre-built benchmark (109k images, 70 GB) is hosted at huggingface.co/datasets/Vail-2000/Idis:

from huggingface_hub import snapshot_download
snapshot_download("Vail-2000/Idis", repo_type="dataset", local_dir="/path/to/Idis")

Idis-perception

Built on the original split of ImageNet-9 (4,050 images, 9 classes). Visual distractors are inserted with Gemini 2.5 Flash Image and validated by human annotators; typographic distractors render non-target class names into the image (typographic_overlay.py).

Either download the pre-built images from the Hugging Face Hub (Idis-perception/visual_distractor/ is the $IDIS_PERCEPTION tree below) or rebuild them. original/ is a copy of the ImageNet-9 class directories; the distractor cells are generated per class, count and semantic relationship:

export GOOGLE_CLOUD_PROJECT=<gcp-project>   # Vertex AI (with GOOGLE_APPLICATION_CREDENTIALS); or GOOGLE_API_KEY
export IMAGENET9=/path/to/backgrounds_challenge/original/val   # holds 00_dog ... 08_fish
export IDIS_PERCEPTION=/path/to/idis_perception

# 48,600 images = 9 classes x n=1..4 x {aligned, conflicting, irrelevant} x 450
for class_dir in "$IMAGENET9"/*/; do
    for n in 1 2 3 4; do
        for semantic in aligned conflicting irrelevant; do
            python idis_perception/build/gemini_edit.py --image-dir "$class_dir" \
                --out-root "$IDIS_PERCEPTION" --semantic "$semantic" --n "$n" --skip-existing
        done
    done
done

# human validation (App. A.3): replay the images an annotator rejected against the same cell
python idis_perception/build/gemini_edit.py --image-dir "$IMAGENET9/00_dog" --out-root "$IDIS_PERCEPTION" \
    --semantic aligned --n 4 --retry-from "$IDIS_PERCEPTION/failed-dog-4-aligned.jsonl"

# question files for inference/run_perception.py
python idis_perception/build/build_question_files.py --image-root "$IDIS_PERCEPTION" --include-original

# typographic distractors (App. A.1): each non-target class name rendered into every original image
python idis_perception/build/typographic_overlay.py --image-root "$IDIS_PERCEPTION"   # 32,400 images + meta/<class>-typographic.jsonl
idis_perception/
├── original/<class>/<stem>.JPEG                        # no-distractor baseline
├── <class>/<n>/{aligned,conflicting,irrelevant}/<stem>.png   # n = 1..4 visual distractors
├── typographic/<class>/<overlay>/<stem>.png            # typographic distractors (8 per image)
└── meta/<class>-<n>-<semantic>.jsonl                    # question files for run_perception.py
    meta/<class>-original.jsonl                          # baseline question files (--include-original)
    meta/<class>-typographic.jsonl                       # typographic question files

Idis-math

Built on the testmini split of MathVerse. Set MATHVERSE_ROOT to a directory holding testmini.json and testmini/images/. Irrelevant distractors are drawn from the table subset of LogicVista (LOGICVISTA_ROOT).

Either download the pre-built images from the Hugging Face Hub (Idis-math/visual_distractor/ and Idis-math/textual_distractor/ map to mathverse_aug/library/ and mathverse_aug/text_distractor/ below) or rebuild them:

export MATHVERSE_ROOT=/path/to/MathVerse LOGICVISTA_ROOT=/path/to/LogicVista_export
python idis_math/build/gen_visual_distractors.py --mode both      # aligned + conflicting
python idis_math/build/gen_irrelevant_distractors.py               # irrelevant (LogicVista tables)
python idis_math/build/gen_textual_distractors.py --num-distractors 4   # textual (Sonnet 4.5)
$MATHVERSE_ROOT/
├── testmini.json
├── testmini/images/
└── mathverse_aug/
    ├── library/{aligned,conflicting,irrelevant}/n{1..4}/...   (+ meta.jsonl per variant)
    └── text_distractor/n{1..4}/meta.jsonl

Waterbirds

Used for the prompt-strategy experiment (Sec. 6.3). Download from the official release and prepare a question JSONL with {"question_id", "image", "label", "background"} per row.

Evaluation

Four open-weight reasoning VLMs are supported (inference/models.py): Qwen/Qwen3-VL-8B-Thinking, zai-org/GLM-4.1V-9B-Thinking, internlm/Intern-S1-mini, Fancy-MLLM/R1-Onevision-7B-RL.

Idis-perception / Waterbirds — 5 samples per image (T = 0.7, top-p = 0.95), then scoring with each model's tokenizer for reasoning length:

python inference/run_perception.py --dataset Background_Challenge --prompt base \
    --model-path Qwen/Qwen3-VL-8B-Thinking --image-folder /path/to/idis_perception \
    --question-file meta/bird-4-conflicting.jsonl \
    --answers-file results/qwen3-thinking/qwen3-thinking-bird-4-conflicting.jsonl
python inference/score_perception.py --root results --out perception.xlsx

# attribute-guiding prompt (Sec. 6.3)
python inference/run_perception.py --dataset Background_Challenge --prompt strategy --greedy ...
python inference/run_perception.py --dataset waterbirds --prompt strategy --greedy ...
python inference/score_waterbirds.py --root results_waterbirds --out waterbirds.xlsx

Idis-math — vLLM batch inference, then a Qwen3.5-27B judge following the VLMEvalKit MathVerse protocol:

python inference/run_math_vllm.py --model-path Qwen/Qwen3-VL-8B-Thinking \
    --tasks "original:1,aligned:1,aligned:4,conflicting:4,irrelevant:4,text_distractor:4" \
    --num-samples 5 --temperature 0.7 --output-dir results_math/qwen3-thinking
python inference/judge_math.py --results-files results_math/qwen3-thinking/*.jsonl

Analysis

# attribute extraction from reasoning traces (Tables 6–8)
export DEEPSEEK_API_KEY=...
python analysis/attribute_extraction/extract_perception.py \
    --input results/qwen3-thinking/qwen3-thinking-bird-4-conflicting_s0.jsonl \
    --out_prefix attrs/qwen3-thinking-bird-4-conflicting --loop
python analysis/attribute_extraction/extract_math.py --input sentences/ --out_dir attrs_math/
python analysis/attribute_extraction/extract_waterbirds.py --input results_waterbirds/qwen3-thinking/part_01_s0.jsonl \
    --output attrs_waterbirds/qwen3-thinking-part_01.jsonl

# target / distractor pixel area with LangSAM (distractor area ratio)
python analysis/object_area/langsam_area.py --jsonl objects.jsonl --out-base area/

# attention blocking (Fig. 7a)
python analysis/attention_blocking/build_inputs.py --model qwen3-thinking \
    --parser-root attrs_sentence/ --traces-root results/ --output abf/inputs_qwen3-thinking.parquet
python analysis/attention_blocking/run_block_force.py --inputs abf/inputs_qwen3-thinking.parquet \
    --class-group dog,bird,vehicle --out-jsonl abf/qwen3-thinking/dbv.jsonl
python analysis/attention_blocking/analyze.py --root abf

License

This project is released under the MIT License. Datasets follow the licenses of their sources (ImageNet, MathVerse, LogicVista, Waterbirds).

Acknowledgements

Our code builds on MathVerse, VLMEvalKit, LogicVista, Backgrounds Challenge (ImageNet-9), Waterbirds, and Language Segment-Anything.

About

Official Implementation of "Understanding the Effects of Distractors on Reasoning Vision-Language Models (EMNLP 2026)"

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages