ReFocus: Visual Editing as a Chain of Thought for Structured Image Understanding

1University of Pensylvania  2Virginia Tech  3Microsoft 

What is ReFocus?

ReFocus performs visual chain of thought via input-image editing to help multimodal reasoning.

Given an example image and question, ReFocus equips GPT-4 with editing tools. ReFocus can edit the input image until an answer is reached. In the above example, some extra columns are masked and important rows are boxed.

Further, we collect a training dataset for such refocus reasoning processes and release the model.

Abstract

Structured image understanding, such as interpreting tables and charts, requires strategically refocusing across various structures and texts within an image, forming a reasoning sequence to arrive at the final answer. However, current multimodal large language models (LLMs) lack this multihop selective attention capability. In this work, we introduce ReFocus, a simple yet effective framework that equips multimodal LLMs with the ability to generate ``visual thoughts'' by performing visual editing on the input image through code, shifting and refining their visual focuses. Specifically, ReFocus enables multimodal LLMs to generate Python codes to call tools and modify the input image, sequentially drawing boxes, highlighting sections, and masking out areas, thereby enhancing the visual reasoning process. We experiment upon a wide range of structured image understanding tasks involving tables and charts. ReFocus largely improves performance on all tasks over GPT-4o without visual editing, yielding an average gain of 11.0% on table tasks and 6.8% on chart tasks. We present an in-depth analysis of the effects of different visual edits, and reasons why ReFocus can improve the performance without introducing additional information. Further, we collect a 14k training set using ReFocus, and prove that such visual chain-of-thought with intermediate information offers a better supervision than standard VQA pairs, reaching consistent gain over the same model trained with QA data.

More Examples

Notice that the left side images are original inputs, and right side ones are edited images by ReFocus.

Quantitative Results

ReFocus substantially improves performance on almost all tasks over GPT-4-turbo and GPT-4o without refocusing, setting a new state of the art on chart and table tasks.

Finetune with ReFocus


1. We collect a training dataset using ReFocus upon ChartQA, and release the data.

2. We finetune Phi-3.5-vision with the collected dataset and release the model.
3. Our finetuned model sets the new standard, outperforming the same base model finetuned with QA data or textual chain-of-thought (CoT) data.

Finetuned Model Output Examples

BibTeX


        @article{fu2025refocus,
          title={ReFocus: Visual Editing as a Chain of Thought for Structured Image Understanding},
          author={Xingyu Fu and Minqian Liu and Zhengyuan Yang and John Corring and Yijuan Lu and Jianwei Yang and Dan Roth and Dinei Florencio and Cha Zhang},
          journal={arXiv preprint arXiv:2501.05452},
          year={2025}
        }