Abstract
Following OpenAI's introduction of the "thinking with images" concept, recent efforts have explored stimulating the use of visual information in the reasoning process to enhance model performance in perception and reasoning tasks. However, open-source work has largely lacked the feature-rich capabilities of proprietary models like O3, which perform diverse image manipulations and enhance logical reasoning through code. In this paper, we introduce Thyme (Think Beyond Images), a novel paradigm enabling Multimodal Large Language Models (MLLMs) to transcend existing approaches by autonomously generating and executing image processing and computational operations via executable code. Thyme facilitates on-the-fly manipulations (e.g., cropping, rotation, contrast enhancement) and mathematical computations with high autonomy. We activate this capability through a two-stage training strategy: Supervised Fine-Tuning (SFT) on a curated 500K-sample dataset, followed by a Reinforcement Learning (RL) phase using GRPO-ATS (Group Relative Policy Optimization with Adaptive Temperature Sampling). Our evaluations across nearly 20 benchmarks demonstrate that Thyme yields significant performance gains, particularly in high-resolution perception and complex reasoning tasks, allowing a 7B model to outperform much larger 32B competitors.
Introduction
Current MLLMs often treat visual input as a static, "one-shot" observation. While some models can generate auxiliary visual cues or simple crops, they generally lack the autonomy to perform diverse manipulations—such as rotating slanted text, enhancing contrast on dark signage, or performing multi-step mathematical calculations—without human intervention. This limitation restricts their effectiveness in fine-grained perception and complex logical tasks.
Thyme addresses this gap by integrating a secure code sandbox into the reasoning loop. This allows the model to dynamically adapt its own visual perception through executable Python code, effectively implementing a form of test-time compute scaling where the model can "think" longer and more precisely about visual data.
The Thyme Paradigm: Autonomous Visual Reasoning
The core of Thyme is its autonomous inference pipeline. When presented with a complex query, the model does not simply produce a text response; instead, it generates a reasoning chain that can include Python code. This code is executed in a secure Sandbox, which handles image processing (utilizing libraries like PIL or OpenCV) or numerical computation. The results—whether a processed image or a calculation—are fed back to the model for further reasoning or to formulate a final answer.
Unlike standard tool-use models, Thyme is not explicitly instructed when to use these tools. It assesses the difficulty of the task autonomously, deciding if it needs to "zoom in" on a small detail or correct an image's orientation to improve its perception.
Training Strategy: SFT and RL with GRPO-ATS
To enable these capabilities, we employ a two-stage training process:
- Supervised Fine-Tuning (SFT): The model is trained on a 500K-sample dataset to learn foundational coding skills for cropping, rotation, and mathematical logic. This includes 50k high-quality pairs for image operations and 15k for math-centric code.
- Reinforcement Learning (RL) with GRPO-ATS: To refine decision-making, we utilize Group Relative Policy Optimization. A key innovation is Adaptive Temperature Sampling (ATS), which dynamically sets the sampling temperature to 0.0 for code generation (prioritizing execution precision) and 1.0 for text reasoning (encouraging exploration). This prevents the model from "collapsing" into avoiding code due to high-temperature execution failures.
The RL stage utilizes a newly curated set of 10,000 high-resolution images (>2048 pixels) focusing on "needle-in-a-haystack" perception tasks, where target objects occupy less than 5% of the image area, necessitating autonomous zooming.
Experimental Results
Thyme-7B shows substantial improvements over its base model (Qwen2.5-VL-7B) and larger state-of-the-art competitors. On the MME-RealWorld benchmark, Thyme improved perception accuracy by over 10% overall, with gains as high as 25% in challenging domains like autonomous driving and monitoring.
Furthermore, by offloading mathematical logic to executable code, the model avoids common "mental" calculation errors, leading to consistent gains in benchmarks like MathVista and LogicVista. The paradigm effectively reduces hallucinations by allowing the model to verify its observations through iterative processing.
Conclusion
Thyme represents a significant step toward agentic visual perception in open-source MLLMs. By empowering models to autonomously manipulate their visual inputs and execute code, we bridge the gap between static perception and active reasoning. Future work will focus on scaling this paradigm to even stronger base models to unlock more sophisticated agentic behaviors and reliable tool use.
Summary updated