Introduction
AGILE (Agentic jiGsaw Interaction Learning) transforms Vision-Language Models (VLMs) into active agents that solve jigsaw puzzles by generating executable Python code. By interacting with an environment through actions like swapping, cropping, and zooming, VLMs significantly improve their spatial reasoning and fine-grained perception. This approach leads to massive gains in puzzle-solving capabilities and a 3.1% average boost across diverse general vision benchmarks.
The Challenge: Perceptual Gaps and Data Scarcity
Despite their prowess in image captioning and general QA, modern VLMs are surprisingly "blind" to structural relationships. When faced with a simple $2 \times 2$ jigsaw puzzle, even state-of-the-art models often perform no better than random chance. This reveals a fundamental deficiency in core visual perception and spatial reasoning.
The authors identify two main hurdles:
- Perceptual Gaps: Models struggle to recognize how visual components fit together at a granular level.
- Data Scarcity: High-quality Reinforcement Learning (RL) data for multimodal tasks is rare. Human-labeled data is expensive and doesn't scale, while automated synthesis often lacks the "verifiable" ground truth needed for robust RL.
Methodology: The AGILE Framework
The authors propose AGILE, a framework that treats jigsaw solving as an iterative, agentic process rather than a single-turn prediction task.
1. The Agentic Loop
Instead of just outputting a final arrangement, the model (based on Qwen2.5-VL-7B) interacts with a Python-based environment. At each step, the model generates code to perform specific actions to test hypotheses and verify alignments.
- Swap & Observe: Exchange two tiles to test a hypothesis and receive the updated visual state of the puzzle.
- Crop & Zoom: Focus on specific edges or regions of interest to verify alignment (e.g., checking if text continues naturally across a seam).
2. Training Paradigm
The training process is split into two main phases to bootstrap and then refine the model's agentic capabilities.
- Cold-Start (SFT): The model is first fine-tuned on 1.6K high-quality trajectories collected from Gemini 1.5 Pro to learn the basic "tool-use" pattern of invoking Python APIs.
- Reinforcement Learning (GRPO): The model is then optimized using Group Relative Policy Optimization. The reward function evaluates three components:
- Accuracy: Did it successfully solve the puzzle?
- Format: Did it follow the required
<think>,<code>, and<answer>structure? - Step Penalty: A penalty for taking too many moves, encouraging efficient solving.
Datasets and Evaluation
- Training Data: 1.6K expert trajectories for the cold start and 15.6K images for the RL phase. These images cover high-res visual search, OCR, real-world scenes, and structured diagrams.
- Jigsaw Benchmarks: A custom test set of 300 images partitioned into $2 \times 2$ and $3 \times 3$ grids.
- General Benchmarks: To test generalization, the authors evaluated on 9 diverse benchmarks, including HRBench (high-res understanding), MMVP (fine-grained recognition), MMMU (visual reasoning), and HallusionBench (hallucination detection).
Key Insights
- Jigsaws as a "Proxy Task": Jigsaw puzzles are an ideal RL environment because the ground truth is mathematically certain, the difficulty is easily tunable (by increasing grid size), and the data can be generated programmatically at an infinite scale.
- Action-Driven Perception: By forcing the model to act (zoom/crop), it learns to attend to local features it would otherwise overlook in a standard global-view inference.
- The "Curriculum" Effect: Training on $2 \times 2$ puzzles naturally improved performance on $3 \times 3$ puzzles. Further training on $3 \times 3$ puzzles acted as a curriculum that boosted general reasoning scores even higher.
- Superiority over General QA: Models trained on 10K jigsaw samples + 10K general QA samples outperformed models trained on 20K general QA samples alone. This suggests that the structured, verifiable nature of jigsaw tasks provides a richer learning signal than standard captioning or VQA.
Key Results
- Jigsaw Mastery: On $2 \times 2$ puzzles, AGILE boosted accuracy from a dismal 9.5% to 82.8%. On the much harder $3 \times 3$ puzzles, accuracy rose from 0.4% to 20.8%.
- Generalization: The model didn't just learn to solve puzzles; it achieved an average 3.1% improvement across 9 general vision benchmarks.
- Specific Gains: Notable improvements were seen in HRBench4K (+4.2%) and VStarBench (+4.2%), proving that the "zoom and crop" training directly improved the model's ability to handle high-resolution visual search and spatial relations.
Limitations and Future Work
- Context Window Constraints: In $3 \times 3$ settings, the multi-turn trajectories can become very long, sometimes exceeding the model's maximum context window.
- Computational Cost: Agentic interaction is inherently slower and more computationally expensive than single-turn inference.
- Scaling Complexity: While $3 \times 3$ is a start, real-world puzzles are far more complex. Future work could explore more efficient interaction mechanisms or memory modules to handle larger grid sizes without exceeding context limits.
Summary updated