Raphoo/linear-mech-vlms

Code for "Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models"

19

stars

4

commits

Python

primary language

Feb 16, 2026

updated

README

Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models

This repository contains the implementation of the paper "Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models" (ICLR 2026). In this work, we show that VLMs such as LLaVA, LLaMA, Qwen, Gemma, and InternVL perform spatial reasoning via spatial IDs. We perform rigorous causal interventions and steering analyses to illustrate the IDs' function.

If you find this repository useful, please consider citing our work!

@article{kang2026spatiotemporalreasoning,
      title={Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models}, 
      author={Raphi Kang and Hongqiao Chen and Georgia Gkioxari and Pietro Perona},
      journal={ICLR},
      year={2026},
      url={https://arxiv.org/abs/2601.12626}, 
}

Experiments

FigureDescriptionDirectory
Figure 2Adversarial Steering - Belief Swappingadversarial_steering/
Figure 4Mirror and Attribute Swappingmirror_attr_swapping/
Figure 5Spatial IDs in a Gridspatial_id_derivation/
Figure 6Arbitrary Spatial Steeringarbitrary_steering/
Figure 7Depth Diagnosisdepth_diagnosis/
Figure 8AGround Truth Spatial ID Deviationground_truth_deviation/
Figure 8BImage Masking (D-RISE) Sensitivityground_truth_deviation/
Figure 9Accuracy vs. Steerabilityadversarial_steering/
Figure 10Temporal IDs in Video Modelstemporal_models/

Please refer to the README of each experiment for detailed instructions.

Environment

All experiments use the conda environment defined in environment.yml with the exception of temporal_models. For temporal models, use temporal_models/environment.yml.

Contributors

Raphoo

3 commits

chenhongqiao

1 commits

Raphoo/linear-mech-vlms

Code for "Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models"

19

stars

4

commits

Python

primary language

Feb 16, 2026

updated

README

Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models

This repository contains the implementation of the paper "Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models" (ICLR 2026). In this work, we show that VLMs such as LLaVA, LLaMA, Qwen, Gemma, and InternVL perform spatial reasoning via spatial IDs. We perform rigorous causal interventions and steering analyses to illustrate the IDs' function.

If you find this repository useful, please consider citing our work!

@article{kang2026spatiotemporalreasoning,
      title={Linear Mechanisms for Spatiotemporal Reasoning in Vision Language Models}, 
      author={Raphi Kang and Hongqiao Chen and Georgia Gkioxari and Pietro Perona},
      journal={ICLR},
      year={2026},
      url={https://arxiv.org/abs/2601.12626}, 
}

Experiments

FigureDescriptionDirectory
Figure 2Adversarial Steering - Belief Swappingadversarial_steering/
Figure 4Mirror and Attribute Swappingmirror_attr_swapping/
Figure 5Spatial IDs in a Gridspatial_id_derivation/
Figure 6Arbitrary Spatial Steeringarbitrary_steering/
Figure 7Depth Diagnosisdepth_diagnosis/
Figure 8AGround Truth Spatial ID Deviationground_truth_deviation/
Figure 8BImage Masking (D-RISE) Sensitivityground_truth_deviation/
Figure 9Accuracy vs. Steerabilityadversarial_steering/
Figure 10Temporal IDs in Video Modelstemporal_models/

Please refer to the README of each experiment for detailed instructions.

Environment

All experiments use the conda environment defined in environment.yml with the exception of temporal_models. For temporal models, use temporal_models/environment.yml.

Contributors

Raphoo

3 commits

chenhongqiao

1 commits

Languages

Python

74.2%

Jupyter Notebook

23.1%

Shell

2.8%