Highlights Β· Environment Setup Β· Quick Start Β· Repository Structure Β· Acknowledgements Β· License Β· Citation
SpecEyes is a speculative perception and planning framework for agentic multimodal LLMs. It uses a lightweight vision-language model to quickly screen visual inputs and questions, then applies answer separability gating to either return the fast answer or defer to a stronger tool-using model. This repository provides evaluation code, judge scripts, confidence analysis, and result aggregation tools for SpecEyes.
| Direction | Description |
|---|---|
| Stateful Bottleneck Analysis | Reveal the sequential tool-use dependency limiting latency and concurrency in agentic MLLMs. |
| Agentic-Level Speculation | Propose speculative reasoning that skips full tool invocation loops for easy queries. |
| Answer Separability Gating | Introduce a new confidence metric based on top-K logit gaps to decide safe bypass. |
We recommend Python 3.11. Install the PyTorch build matching your CUDA version first, then install the project requirements:
pip install -r requirements.txt
Recommended optional packages:
flash-attn: useful for higher throughput on supported GPUsvllm==0.12.0: recommended in a separate environment for the judge model serviceThis repository also relies on a patched image-loading behavior in qwen-vl-utils. After installing qwen-vl-utils, run:
python scripts/patch_qwen_vl_utils.py
Download the datasets and models into the following directories, or pass explicit paths at runtime:
data/vstardata/HR-Benchdata/POPEChenShawn/DeepEyes-7BKwai-Keye/Thyme-RLQwen/Qwen3-VL-2B-InstructQwen/Qwen2.5-72B-Instruct# Deepeyes baseline
python eval_code_deepeyes/SpecEyes.py --baseline
# Deepeyes with confidence gating
python eval_code_deepeyes/SpecEyes.py --score_threshold 0.98
# Thyme baseline
python eval_code_thyme/SpecEyes.py --baseline
# Thyme with confidence gating
python eval_code_thyme/SpecEyes.py --score_threshold 0.98
For the code-reasoning variant, replace SpecEyes.py with SpecReason.py.
bash scripts/start_qwen2.5_72b_vllm.sh
The default judge endpoint is http://localhost:23333/v1. Override it with --api_url if needed.
bash scripts/run_judges.sh
You can also run them manually:
python judge_code/judge_vstar.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_hr.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_pope.py --input_folder eval_results_qwen3vl-2b-Instruct
# Run batched small-model inference
python scripts/small_model_batch_inference.py
# Judge the generated outputs
python judge_code/judge_vstar.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_hr.py --input_folder eval_results_qwen3vl-2b-Instruct
# Analyze judge results
python scripts/analyze_small_confidence.py --input_folder judge_results_qwen3vl-2b-Instruct
python scripts/analyze_small_conf_percentage.py --input_folder judge_results_qwen3vl-2b-Instruct
SpecEyes/
βββ data/
β βββ vstar/
β βββ HR-Bench/
β βββ POPE/
βββ eval_code_deepeyes/
βββ eval_code_thyme/
βββ judge_code/
βββ scripts/
βββ vis/
βββ eval_results_deepeyes/
βββ eval_results_thyme/
βββ ...
Core directories:
| Path | Description |
|---|---|
eval_code_deepeyes/ | SpecEyes and SpecReason evaluation code built on Deepeyes |
eval_code_thyme/ | SpecEyes and SpecReason evaluation code built on Thyme |
judge_code/ | Judge scripts using a vLLM OpenAI-compatible endpoint |
scripts/small_model_batch_inference.py | Batched small-model inference and confidence signal export |
scripts/gather_result.py | Aggregation of speedup, and accuracy results |
scripts/analyze_small_confidence.py | Confidence-distribution and performance analysis |
vis/ | Plotting and visualization utilities used in the paper |
Additional notes:
eval_code_thyme/sandbox.py is a localized sandbox copy used by the Thyme evaluation pipelineeval_code_thyme/temp_processed_images/.gitignoreThis repository benefits from code references from the DeepEyes repository. We sincerely thank the authors and maintainers for their open-source contributions, which helped inform parts of our implementation and experimentation workflow.
This repository is released under Apache-2.0. See LICENSE for the full license text.
The repository also includes notes about third-party code and patches, including:
eval_code_thyme/sandbox.pyqwen-vl-utilsSee THIRD_PARTY_NOTICES.md for the relevant attribution and redistribution notes. If you redistribute or modify those third-party-related components, you should also follow the corresponding upstream license requirements.
If you use this repository, please cite the corresponding paper:
@article{huang2026,
title={SpecEyes: Accelerating Agentic Multimodal LLMs via Speculative Perception and Planning},
author={Huang, Haoyu and Huang, Jinfa and Wan, Zhongwei and Zheng, Xiawu and Ji, Rongrong and Luo, Jiebo},
journal={arXiv preprint arXiv:2603.23483},
year={2026}
}
5 commits
Python
94.2%
Shell
5.8%
Highlights Β· Environment Setup Β· Quick Start Β· Repository Structure Β· Acknowledgements Β· License Β· Citation
SpecEyes is a speculative perception and planning framework for agentic multimodal LLMs. It uses a lightweight vision-language model to quickly screen visual inputs and questions, then applies answer separability gating to either return the fast answer or defer to a stronger tool-using model. This repository provides evaluation code, judge scripts, confidence analysis, and result aggregation tools for SpecEyes.
| Direction | Description |
|---|---|
| Stateful Bottleneck Analysis | Reveal the sequential tool-use dependency limiting latency and concurrency in agentic MLLMs. |
| Agentic-Level Speculation | Propose speculative reasoning that skips full tool invocation loops for easy queries. |
| Answer Separability Gating | Introduce a new confidence metric based on top-K logit gaps to decide safe bypass. |
We recommend Python 3.11. Install the PyTorch build matching your CUDA version first, then install the project requirements:
pip install -r requirements.txt
Recommended optional packages:
flash-attn: useful for higher throughput on supported GPUsvllm==0.12.0: recommended in a separate environment for the judge model serviceThis repository also relies on a patched image-loading behavior in qwen-vl-utils. After installing qwen-vl-utils, run:
python scripts/patch_qwen_vl_utils.py
Download the datasets and models into the following directories, or pass explicit paths at runtime:
data/vstardata/HR-Benchdata/POPEChenShawn/DeepEyes-7BKwai-Keye/Thyme-RLQwen/Qwen3-VL-2B-InstructQwen/Qwen2.5-72B-Instruct# Deepeyes baseline
python eval_code_deepeyes/SpecEyes.py --baseline
# Deepeyes with confidence gating
python eval_code_deepeyes/SpecEyes.py --score_threshold 0.98
# Thyme baseline
python eval_code_thyme/SpecEyes.py --baseline
# Thyme with confidence gating
python eval_code_thyme/SpecEyes.py --score_threshold 0.98
For the code-reasoning variant, replace SpecEyes.py with SpecReason.py.
bash scripts/start_qwen2.5_72b_vllm.sh
The default judge endpoint is http://localhost:23333/v1. Override it with --api_url if needed.
bash scripts/run_judges.sh
You can also run them manually:
python judge_code/judge_vstar.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_hr.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_pope.py --input_folder eval_results_qwen3vl-2b-Instruct
# Run batched small-model inference
python scripts/small_model_batch_inference.py
# Judge the generated outputs
python judge_code/judge_vstar.py --input_folder eval_results_qwen3vl-2b-Instruct
python judge_code/judge_hr.py --input_folder eval_results_qwen3vl-2b-Instruct
# Analyze judge results
python scripts/analyze_small_confidence.py --input_folder judge_results_qwen3vl-2b-Instruct
python scripts/analyze_small_conf_percentage.py --input_folder judge_results_qwen3vl-2b-Instruct
SpecEyes/
βββ data/
β βββ vstar/
β βββ HR-Bench/
β βββ POPE/
βββ eval_code_deepeyes/
βββ eval_code_thyme/
βββ judge_code/
βββ scripts/
βββ vis/
βββ eval_results_deepeyes/
βββ eval_results_thyme/
βββ ...
Core directories:
| Path | Description |
|---|---|
eval_code_deepeyes/ | SpecEyes and SpecReason evaluation code built on Deepeyes |
eval_code_thyme/ | SpecEyes and SpecReason evaluation code built on Thyme |
judge_code/ | Judge scripts using a vLLM OpenAI-compatible endpoint |
scripts/small_model_batch_inference.py | Batched small-model inference and confidence signal export |
scripts/gather_result.py | Aggregation of speedup, and accuracy results |
scripts/analyze_small_confidence.py | Confidence-distribution and performance analysis |
vis/ | Plotting and visualization utilities used in the paper |
Additional notes:
eval_code_thyme/sandbox.py is a localized sandbox copy used by the Thyme evaluation pipelineeval_code_thyme/temp_processed_images/.gitignoreThis repository benefits from code references from the DeepEyes repository. We sincerely thank the authors and maintainers for their open-source contributions, which helped inform parts of our implementation and experimentation workflow.
This repository is released under Apache-2.0. See LICENSE for the full license text.
The repository also includes notes about third-party code and patches, including:
eval_code_thyme/sandbox.pyqwen-vl-utilsSee THIRD_PARTY_NOTICES.md for the relevant attribution and redistribution notes. If you redistribute or modify those third-party-related components, you should also follow the corresponding upstream license requirements.
If you use this repository, please cite the corresponding paper:
@article{huang2026,
title={SpecEyes: Accelerating Agentic Multimodal LLMs via Speculative Perception and Planning},
author={Huang, Haoyu and Huang, Jinfa and Wan, Zhongwei and Zheng, Xiawu and Ji, Rongrong and Luo, Jiebo},
journal={arXiv preprint arXiv:2603.23483},
year={2026}
}
5 commits
Python
94.2%
Shell
5.8%