## GUI-AIMA: Aligning Intrinsic Multimodal Attention with a Context Anchor for GUI Grounding [Shijie Zhou](https://scholar.google.com/citations?user=eEjr-isAAAAJ&hl=en)*1  [Viet Dac Lai](https://laiviet.github.io/)2  [Hao Tan](http://www.cs.unc.edu/~airsplay/)2  [Jihyung Kil](https://heendung.github.io/)2  [Wanrong Zhu](https://wanrong-zhu.com/)2 
[Changyou Chen](https://cse.buffalo.edu/~changyou/)1 [Ruiyi Zhang](https://zhangry868.github.io/)2† 1 University at Buffalo  2 Adobe Research
* Majority work done while SZ is at University at Buffalo  † Leadership

📄 arXiv Paper  🤗 GUI-AIMA-3B  🤗 GUI-AIMA-lite-3B  

## Release - [2025/11/05] 🔥 **GUI-AIMA-lite** now **supports FlashAttention-2**, faster and significantly more memory-efficient than previous Eager attention implementations. While "output_attentions = Ture" is not supported by FlashAttention, we resolve it by mixing FlashAttention and Eager attention implementations. - [2026/03/27] 🔥 Update **smz8599/GUI-AIMA-3B** with stronger desktop grounding capacity. It achieves **61.5%** and **68.1%** on ScreenSpot-Pro and OSWorld-G in 2-step manner. ## Table of Contents - [Main Results](#main-results) - [Architecture](#architecture) - [Installation](#installation) - [Model Training](#model-training) - [Data preparation](#data-preparation) - [Training](#training) - [Evaluation on GUI Grounding Benchmarks](#evaluation-on-gui-grounding-benchmarks) - [Acknowledgements](#acknowledgements) - [Citation](#citation) ## Main Results There are two variants of GUI-AIMA: [GUI-AIMA-3B](https://huggingface.co/smz8599/GUI-AIMA-3B) and [GUI-AIMA-lite-3B](https://huggingface.co/smz8599/GUI-AIMA-lite-3B). Based on GUI-AIMA-lite-3B, GUI-AIMA-3B is extra trained with 250k data from [GroundCUA](https://huggingface.co/datasets/ServiceNow/GroundCUA). 1-step inference of GUI-AIMA achieves **53.8%**, **62.8%**, **60.0%**, **79.1%**, **92.1%** on ScreenSpot-pro, OSWorld-G, UI-Vision, MMBench-GUI-L2 and ScreenSpot-v2. With 2-step zoom-in inference, it can achieve **61.5%** and **68.1%** on ScreenSpot-pro and OSWorld-G. We trained GUI-AIMA for one-step center points predictions. However, **GUI-AIMA can be inferenced in the 2-step fashion without further fine-tuning**: (step 1) 1st inferece to determine rough grounding areas; (step 2) crop and zoom-in the rough grounding areas for 2nd preciser grounding inference. The 2-step inference is very helpful for GUI grounding on high-resolution screenshots, such as samples in ScreenSpot-pro and OSWorld-G. ## Architecture
Figure 1. **GUI-AIMA** utilize the inherent attention of MLLMs for patch-wise GUI grounding. It simplifies the vanilla attention grounding requiring proper aggregation between all query tokens' grounding vectors by adding a learnable ANCHOR token as the context anchor of query. The multi-head aggregation on attention vectors between ANCHOR and visual tokens is adequate for grounding.
Figure 2. **GUI-AIMA** proposes an effective multi-head weighting approach by measuring the uniformity between global query-visual pattern and head-wise query-visual pattern. ## Installation 1. Environment: ```bash git clone https://github.com/sjz5202/GUI-AIMA cd GUI-AIMA conda create -n gui_aima python=3.10 conda activate gui_aima pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu124 pip install -e . ``` ## Model Training ### Data preparation #### For GUI-AIMA-lite 1. Download the GUI-Actor data from [here](https://huggingface.co/datasets/cckevinn/GUI-Actor-Data). 2. Download the UGround single-round dialogue json data from [here](https://huggingface.co/datasets/smz8599/UGround-single). 2. Download the GTA1 data without the web part from [here](https://huggingface.co/datasets/smz8599/GTA_data_no_web). OR [smz8599/gui-aima-data](https://huggingface.co/datasets/smz8599/gui-aima-data) for your convenience. ### Training 1. Single-node training: ```bash bash scripts/sft_single_node.sh ``` 2. Multi-node training (for reference, need adjusted for your environment): ```bash bash scripts/sft_multi_node.sh ``` ## Evaluation on GUI Grounding Benchmarks We provide evaluation scripts on ScreenSpot-Pro, OSWorld-G, UI-Vision, MMBench-GUI-L2 and ScreenSpot-v2 under the `eval/` folder: `eval_ss_pro.sh`, `eval_osworld_g.sh`, `eval_ui_vision.sh`, `eval_mmbench_l2.sh`, `eval_ss_v2.sh`. For ScreenSpot-Pro and OSWorld-G, we provide 2-step inference in `eval_ss_pro.sh` and `eval_osworld_g.sh`, which determines the focusing area at the 1st step and zoom-in the focusing area for grounding at the 2nd step without extra model training. Evaluation datasets are available from [ScreenSpot-Pro](https://huggingface.co/datasets/likaixin/ScreenSpot-Pro), [OSWorld-G](https://github.com/xlang-ai/OSWorld-G), [UI-Vision](https://huggingface.co/datasets/ServiceNow/ui-vision), [MMBench-GUI-L2](https://huggingface.co/datasets/OpenGVLab/MMBench-GUI) and [ScreenSpot-v2](https://huggingface.co/datasets/HongxinLi/ScreenSpot_v2). The data path in each evaluation script needs to be adjusted. Single sample example usage is available in `eval/example_inference.py`. ## Acknowledgements GUI-AIMA is built upon the following projects. - [GUI-Actor](https://github.com/microsoft/GUI-Actor) - [TAG](https://github.com/HeimingX/TAG.git) - [GTA1](https://github.com/Yan98/GTA1) - [GroundCUA](https://github.com/ServiceNow/GroundCUA) - [Transformers](https://github.com/huggingface/transformers) - [Qwen2.5-VL](https://github.com/QwenLM/Qwen2.5-VL) - [AGUVIS](https://github.com/xlang-ai/aguvis) - [OS-Atlas](https://github.com/OS-Copilot/OS-Atlas) - [SeeClick](https://github.com/njucckevin/SeeClick) Thanks for their great work! ## Citation ```bibtex @article{zhou2025gui, title={Gui-aima: Aligning intrinsic multimodal attention with a context anchor for gui grounding}, author={Zhou, Shijie and Lai, Viet Dac and Tan, Hao and Kil, Jihyung and Zhu, Wanrong and Chen, Changyou and Zhang, Ruiyi}, journal={arXiv preprint arXiv:2511.00810}, year={2025} } ```