The model is based on Qwen2.5-VL-3B-Instruct and is fine-tuned using our proposed Adaptive Exploration Policy Optimization (AEPO) framework. AEPO is a novel reinforcement learning method designed to enhance the model's semantic alignment for GUI grounding tasks. It overcomes the exploration bottlenecks of standard RLVR methods by integrating a multi-answer generation strategy with a theoretically-grounded adaptive reward function, enabling more effective and efficient learning for complex GUI interactions.
Paper Overview
A fundamental challenge for GUI agents is robustly grounding natural language instructions, which requires not only precise spatial alignment (locating elements accurately) but also correct semantic alignment (identifying the functionally appropriate element). While existing Reinforcement Learning with Verifiable Rewards (RLVR) methods have enhanced spatial precision, they often suffer from inefficient exploration. This "confidence trap" bottlenecks semantic alignment, preventing models from discovering correct actions for difficult semantic associations.
To address this critical exploration problem, we introduce InfiGUI-G1, a series of models trained with Adaptive Exploration Policy Optimization (AEPO). AEPO overcomes the exploration bottleneck by integrating a multi-answer generation strategy to explore a diverse set of candidate actions in a single forward pass. This exploration is guided by a theoretically-grounded Adaptive Exploration Reward (AER) function, derived from first principles of efficiency (η=U/C), which provides rich, informative learning signals to dynamically balance exploration and exploitation.
Quick Start
Installation
First, install the required dependencies:
pip install transformers qwen-vl-utils
Example
python
1import json
2import math
3import torch
4import requests
5from io import BytesIO
6from PIL import Image, ImageDraw, ImageFont
7from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
8from qwen_vl_utils import process_vision_info, smart_resize
910MAX_IMAGE_PIXELS =5600*28*28111213defresize_image(width:int, height:int, max_pixels:int)->tuple[int,int]:14"""
15 Resize image to fit within max_pixels constraint while maintaining aspect ratio.
16 Applies smart_resize for final dimension optimization.
17 """18 current_pixels = width * height
1920if current_pixels <= max_pixels:21 target_width, target_height = width, height
22else:23 scale_factor = math.sqrt(max_pixels / current_pixels)24 target_width =round(width * scale_factor)25 target_height =round(height * scale_factor)2627# Apply smart_resize for final dimensions28 final_height, final_width = smart_resize(target_height, target_width)2930return final_width, final_height
313233defload_image(img_path:str)-> Image.Image:34"""Load image from URL or local path."""35if img_path.startswith("https://"):36 response = requests.get(img_path)37return Image.open(BytesIO(response.content))38else:39return Image.open(img_path)404142defvisualize_points(original_image: Image.Image, points:list,43 new_width:int, new_height:int,44 original_width:int, original_height:int)->None:45"""Draw prediction points on original image and save as output.png."""46 output_img = original_image.copy()47 draw = ImageDraw.Draw(output_img)48 font = ImageFont.load_default(size=100)4950for i, point_data inenumerate(points):51 coords = point_data['point_2d']5253# Map coordinates from resized image back to original image54 original_x =int(coords[0]/ new_width * original_width)55 original_y =int(coords[1]/ new_height * original_height)5657 label =str(i +1)5859# Draw circle60 circle_radius =2061 draw.ellipse([original_x - circle_radius, original_y - circle_radius,62 original_x + circle_radius, original_y + circle_radius],63 fill=(255,0,0))6465# Draw label66 draw.text((original_x +20, original_y -20), label, fill=(255,0,0), font=font)6768print(f"Point {i+1}: Predicted coordinates {coords} -> Mapped coordinates [{original_x}, {original_y}]")6970 output_img.save("output.png")71print(f"Visualization with {len(points)} points saved to output.png")727374defmain():75# Load model and processor76 model = Qwen2_5_VLForConditionalGeneration.from_pretrained(77"InfiX-ai/InfiGUI-G1-3B",78 torch_dtype=torch.bfloat16,79 attn_implementation="flash_attention_2",80 device_map="auto"81)82 processor = AutoProcessor.from_pretrained("InfiX-ai/InfiGUI-G1-3B", padding_side="left")8384# Load and process image85 img_path ="https://raw.githubusercontent.com/InfiXAI/InfiGUI-G1/main/assets/test_image.png"86 image = load_image(img_path)8788# Store original image and resize for model input89 original_image = image.copy()90 original_width, original_height = image.size
91 new_width, new_height = resize_image(original_width, original_height, MAX_IMAGE_PIXELS)92 resized_image = image.resize((new_width, new_height))9394# Prepare model inputs95 instruction ="shuffle play the current playlist"96 system_prompt ='You FIRST think about the reasoning process as an internal monologue and then provide the final answer.\nThe reasoning process MUST BE enclosed within <think> </think> tags.'97 prompt =f'''The screen's resolution is {new_width}x{new_height}.
98Locate the UI element(s) for "{instruction}", output the coordinates using JSON format: [{{"point_2d": [x, y]}}, ...]'''99100 messages =[101{"role":"system","content": system_prompt},102{103"role":"user",104"content":[105{"type":"image","image": resized_image},106{"type":"text","text": prompt}107]108}109]110111# Generate predictions112 text = processor.apply_chat_template([messages], tokenize=False, add_generation_prompt=True)113 image_inputs, video_inputs = process_vision_info([messages])114 inputs = processor(text=text, images=image_inputs, videos=video_inputs, padding=True, return_tensors="pt").to("cuda")115 generated_ids = model.generate(**inputs, max_new_tokens=512)116 output_text = processor.batch_decode(117[out_ids[len(in_ids):]for in_ids, out_ids inzip(inputs.input_ids, generated_ids)],118 skip_special_tokens=True,119 clean_up_tokenization_spaces=False120)121122# Parse and visualize results123 output_text = output_text[0].split("</think>")[-1].replace("```json","").replace("```","").strip()124 output = json.loads(output_text)125126if output:127 visualize_points(original_image, output, new_width, new_height, original_width, original_height)128129if __name__ =="__main__":130 main()
To reproduce the results in our paper, please refer to our repo for detailed instructions.
Results
Our InfiGUI-G1 models, trained with the AEPO framework, establish new state-of-the-art results among open-source models across a diverse and challenging set of GUI grounding benchmarks:
Model
MMBench-GUI
ScreenSpot-v2
UI-Vision
I2E-Bench
ScreenSpot-Pro
Qwen2.5-VL-3B
-
80.9
-
41.7
-
UI-R1-E-3B
-
-
-
69.1
33.5
Aguvis-7B
45.7
-
13.7
53.2
-
OS-Atlas-7B
41.4
85.1
9.0
58.6
-
Ours
InfiGUI-G1-3B
73.4
91.1
22.0
72.6
45.2
w/ Expl. Success
81.6
94.4
29.7
82.8
52.0
Evaluation
This section provides instructions for reproducing the evaluation results reported in our paper.
1. Getting Started
Clone the repository and navigate to the project directory:
The evaluation pipeline is built upon the vLLM library for efficient inference. For detailed installation guidance, please refer to the official vLLM repository. The specific versions used to obtain the results reported in our paper are as follows:
Python: 3.10.12
PyTorch: 2.6.0
Transformers: 4.50.1
vLLM: 0.8.2
CUDA: 12.6
The reported results were obtained on a server equipped with 4 x NVIDIA H800 GPUs.
3. Model Download
Download the InfiGUI-G1 models from the Hugging Face Hub into the ./models directory.
model_path: The first positional argument specifies the path to the downloaded model directory (e.g., ./models/InfiGUI-G1-3B).
--benchmark: Specifies the benchmark to evaluate. Available options include screenspot-pro, screenspot-v2, ui-vision, mmbench-gui, and i2e-bench.
--tensor-parallel: Sets the tensor parallelism size, which should typically match the number of available GPUs.
Evaluation results, including detailed logs and performance metrics, will be saved to the ./output/{model_name}/{benchmark}/ directory.
Citation Information
If you find this work useful, we would be grateful if you consider citing the following papers:
bibtex
1@misc{liu2025infiguig1advancingguigrounding,
2 title={InfiGUI-G1: Advancing GUI Grounding with Adaptive Exploration Policy Optimization},
3 author={Yuhang Liu and Zeyu Liu and Shuanghe Zhu and Pengxiang Li and Congkai Xie and Jiasheng Wang and Xueyu Hu and Xiaotian Han and Jianbo Yuan and Xinyao Wang and Shengyu Zhang and Hongxia Yang and Fei Wu},
4 year={2025},
5 eprint={2508.05731},
6 archivePrefix={arXiv},
7 primaryClass={cs.AI},
8 url={https://arxiv.org/abs/2508.05731},
9}
bibtex
1@article{liu2025infigui,
2 title={InfiGUI-R1: Advancing Multimodal GUI Agents from Reactive Actors to Deliberative Reasoners},
3 author={Liu, Yuhang and Li, Pengxiang and Xie, Congkai and Hu, Xavier and Han, Xiaotian and Zhang, Shengyu and Yang, Hongxia and Wu, Fei},
4 journal={arXiv preprint arXiv:2504.14239},
5 year={2025}
6}
bibtex
1@article{liu2025infiguiagent,
2 title={InfiGUIAgent: A Multimodal Generalist GUI Agent with Native Reasoning and Reflection},
3 author={Liu, Yuhang and Li, Pengxiang and Wei, Zishu and Xie, Congkai and Hu, Xueyu and Zhang, Shengyu and Han, Xiaotian and Yang, Hongxia and Wu, Fei},
4 journal={arXiv preprint arXiv:2501.04575},
5 year={2025}
6}
Acknowledgements
We would like to express our gratitude for the following open-source projects: VERL, Qwen2.5-VL and vLLM.