This repository contains the official implementation for the TMLR 2026 paper:
Can VLMs Reason Robustly? A Neuro-Symbolic Investigation Weixin Chen, Antonio Vergari, Han Zhao Paper link: https://arxiv.org/abs/2603.23867
VLC is a simple neuro-symbolic pipeline for visual deductive reasoning. A VLM first recognizes object concepts from an image, and an SDD circuit then executes the task rule exactly over the predicted concepts.
VLC/
config/ Prompt, few-shot, and rule files
eval/ Evaluation scripts
finetune/ Fine-tuning scripts
models/sdd.py Rule parser and SDD compiler
environment.yml Conda environment
Datasets and checkpoints are not included. They can be downloaded from https://drive.google.com/drive/folders/1m70uXTPRUwg6Q7yBiN7A55dBnC-KbyR4?usp=sharing. Add them as folders or symlinks under the repository root:
datasets/
MNMath_Add_3digit/{train,val,test}/
MNMath_Add_5digit/{train,val,test}/
MNMath_Add_7digit/{train,val,test}/
MNLogic_XOR_3digit/{train,val,test}/
MNLogic_XOR_5digit/{train,val,test}/
MNLogic_XOR_7digit/{train,val,test}/
KandLogic_3obj/{train,val,test}/
KandLogic_5obj/{train,val,test}/
KandLogic_7obj/{train,val,test}/
checkpoints/
MNMath_Add_3digit_Qwen_Qwen2.5-VL-7B-Instruct_End2end/
MNMath_Add_3digit_Qwen_Qwen2.5-VL-7B-Instruct_Comp/
MNLogic_XOR_3digit_Qwen_Qwen2.5-VL-7B-Instruct_End2end/
MNLogic_XOR_3digit_Qwen_Qwen2.5-VL-7B-Instruct_Comp/
KandLogic_3obj_Qwen_Qwen2.5-VL-7B-Instruct_End2end/
KandLogic_3obj_Qwen_Qwen2.5-VL-7B-Instruct_Comp/
Each split should contain matching .png images and .joblib labels. The labels are expected to follow the format used by the released datasets: label for the task target and meta.concepts for object concepts.
conda env create -f environment.yml
conda activate qwenIf you already have a compatible Qwen2.5-VL environment, make sure it includes pysdd, qwen-vl-utils, transformers, trl, peft, bitsandbytes, torch, and torchvision.
Run the fine-tuning jobs used for the main experiments:
bash finetune/finetune.bashThe script fine-tunes end-to-end VLMs and VLC's concept recognizers, respectively, on the smallest training task in each family: MNMath_Add_3digit, MNLogic_XOR_3digit, and KandLogic_3obj. Checkpoints are saved under checkpoints/.
To enable Weights & Biases logging:
REPORT_TO=wandb bash finetune/finetune.bashRun the three main experiment families:
bash eval/eval_mnmath.bash
bash eval/eval_mnlogic.bash
bash eval/eval_kandlogic.bashBy default, these scripts use:
MODEL_NAME_OR_PATH=Qwen/Qwen2.5-VL-7B-Instruct
LLM_NAME_OR_PATH=Qwen/Qwen2.5-7B-Instruct
SEEDS="0 1 2 3 4"
Override them from the command line if needed:
MODEL_NAME_OR_PATH=Qwen/Qwen2.5-VL-3B-Instruct SEEDS="0" bash eval/eval_mnmath.bashOutputs are written to:
results/eval/ Few-shot prompting, Prism, and VLC results
results/finetune/ Fine-tuned end-to-end and fine-tuned VLC results
@article{chen2026vlc,
title={Can VLMs Reason Robustly? A Neuro-Symbolic Investigation},
author={Chen, Weixin and Vergari, Antonio and Zhao, Han},
journal={Transactions on Machine Learning Research (TMLR)},
year={2026}
}