Cost-Aware Visual Reasoning with Learned Operation Necessity, Calibrated Abstention, and Mediation-Based Validation
CaVIR teaches a vision–language model to decide when a tool is worth using and which tool gives the best value for its cost, to abstain when it is not confident enough, and to causally validate that a tool call actually contributed to the answer.
Modern visual-reasoning models call tools (zoom-in, code execution, sketching) to solve hard problems, but they do not learn whether a given tool is actually needed. CaVIR learns a single score, V-VON (Value-based Visual Operation Necessity), that estimates the net benefit of a tool minus its cost, and uses it to:
CaVIR is built as a four-stage training pipeline. Only cold-start dataset construction is implemented so far; the remaining stages are in progress.
The only implemented module. It runs a fixed data-generator VLM as a visual-reasoning agent over a VQA dataset, letting it reason step by step and call tools, and records the resulting traces as JSONL for downstream supervised fine-tuning.
Location: dataset_construction/
host.py — agent orchestrator: drives the VLM through reasoning/tool-calling cycles via MCP.dataset.py — dataset loading and image pre-processing.run.sh — entry point.server/ — MCP tool servers:
code_execution_tool.py): run_code in a sandboxed interpreter.image_processing_tool.py): crop_zoomin, mark_dots, draw_bbox, crop_ocr_image, imaginate_editing.Supported source datasets: docvqa, chartqa_1, chartqa_2, infographics_vqa.
cd dataset_construction
./run.sh # defaults to the docvqa dataset
./run.sh chartqa_1 # choose a dataset
Outputs (traces and intermediate tool results) are written to dataset_construction/outputs/<dataset>_<timestamp>/.
Set these in dataset_construction/.env (loaded automatically by run.sh):
| Variable | Description |
|---|---|
DIRECT_BASE_URL | Base URL of the OpenAI-compatible VLM server (e.g. vLLM). |
DIRECT_API_KEY | API key for that server. |
MODEL_NAME | Data-generator model to serve as the agent. |
run.sh also accepts CONCURRENCY, SAMPLE, and OUTPUT_DIR as environment overrides.
| Role | Model |
|---|---|
| Policy (trained) | Qwen3.5-4B |
| Scorer (trained) | Qwen3.5-2B |
| Data generator (fixed) | Qwen3.6-35B-A3B |
Python
99.1%
Cost-Aware Visual Reasoning with Learned Operation Necessity, Calibrated Abstention, and Mediation-Based Validation
CaVIR teaches a vision–language model to decide when a tool is worth using and which tool gives the best value for its cost, to abstain when it is not confident enough, and to causally validate that a tool call actually contributed to the answer.
Modern visual-reasoning models call tools (zoom-in, code execution, sketching) to solve hard problems, but they do not learn whether a given tool is actually needed. CaVIR learns a single score, V-VON (Value-based Visual Operation Necessity), that estimates the net benefit of a tool minus its cost, and uses it to:
CaVIR is built as a four-stage training pipeline. Only cold-start dataset construction is implemented so far; the remaining stages are in progress.
The only implemented module. It runs a fixed data-generator VLM as a visual-reasoning agent over a VQA dataset, letting it reason step by step and call tools, and records the resulting traces as JSONL for downstream supervised fine-tuning.
Location: dataset_construction/
host.py — agent orchestrator: drives the VLM through reasoning/tool-calling cycles via MCP.dataset.py — dataset loading and image pre-processing.run.sh — entry point.server/ — MCP tool servers:
code_execution_tool.py): run_code in a sandboxed interpreter.image_processing_tool.py): crop_zoomin, mark_dots, draw_bbox, crop_ocr_image, imaginate_editing.Supported source datasets: docvqa, chartqa_1, chartqa_2, infographics_vqa.
cd dataset_construction
./run.sh # defaults to the docvqa dataset
./run.sh chartqa_1 # choose a dataset
Outputs (traces and intermediate tool results) are written to dataset_construction/outputs/<dataset>_<timestamp>/.
Set these in dataset_construction/.env (loaded automatically by run.sh):
| Variable | Description |
|---|---|
DIRECT_BASE_URL | Base URL of the OpenAI-compatible VLM server (e.g. vLLM). |
DIRECT_API_KEY | API key for that server. |
MODEL_NAME | Data-generator model to serve as the agent. |
run.sh also accepts CONCURRENCY, SAMPLE, and OUTPUT_DIR as environment overrides.
| Role | Model |
|---|---|
| Policy (trained) | Qwen3.5-4B |
| Scorer (trained) | Qwen3.5-2B |
| Data generator (fixed) | Qwen3.6-35B-A3B |
Python
99.1%