PyVision-RL: Forging Open Agentic Vision Models via RL

Shitian Zhao, Shaoheng Lin, Ming Li, Haoquan Zhang, Wenshuo Peng, Kaipeng Zhang, Chen Wei

Multimodal Large Language Models (MLLMs) have made incredible strides in understanding images and video, yet they often remain passive consumers of visual data. When researchers attempt to train these models to actively use tools—such as cropping an image or clipping a video—via Reinforcement Learning (RL), they frequently encounter a phenomenon known as interaction collapse.

Interaction collapse occurs when a model learns that the path of least resistance to a reward is to skip tool usage entirely, opting instead to guess a quick, often incorrect answer. Compounding this issue is the sheer computational weight of video processing; feeding thousands of frames into a model often overwhelms it with irrelevant data.

To address these challenges, researchers have introduced PyVision-RL, a novel reinforcement learning framework designed to sustain multi-turn reasoning and prevent interaction collapse. By treating Python as a primitive tool, PyVision-RL has produced open-weight models—PyVision-Image and PyVision-Video—that achieve state-of-the-art performance while drastically reducing computational overhead.

The PyVision-RL Framework

Built on top of the Qwen2.5-VL-7B architecture, PyVision-RL avoids a fixed menu of narrow tools (like "Zoom" or "Crop"). Instead, it empowers the model to write Python code to manipulate visual data dynamically. The framework relies on three core innovations to stabilize training and encourage agentic behavior:

1. Accumulative Tool Reward

To combat interaction collapse, the training objective must explicitly value the process of reasoning, not just the final answer. PyVision-RL introduces an accumulative tool reward: the model receives a small bonus for every valid tool call it makes, provided the final answer is correct. This incentivizes the model to "show its work" and engage in sustained, multi-turn interactions rather than rushing to a conclusion.

2. Oversampling–Filtering–Ranking

Training agentic models is notoriously unstable. To ensure the model learns effectively, the researchers generate a massive pool of "rollouts" (attempts at a task). They filter out attempts that crashed or failed, and then rank the remaining rollouts by difficulty. Difficulty is cleverly proxied using the standard deviation of the rewards. If a prompt always yields a correct answer (low variance) or always yields an incorrect one, the model learns little. The "sweet spot" for learning is found in moderately difficult examples where the model's success varies, maximizing the informational value of the training step.

3. On-Demand Context Construction (for Video)

Standard video models typically sample frames uniformly (e.g., one frame per second), which is highly inefficient. PyVision-Video takes a radically different approach: it is initially given only the video's metadata. To see the video, the model must write Python code to fetch specific frames it deems relevant to the user's prompt. This mimics how a human might scrub through a timeline to find a specific event, ensuring the model only processes what it actually needs.

Key Results and Efficiency Gains

The models were trained using a "cold start" of 7K high-quality synthetic Supervised Fine-Tuning (SFT) examples, followed by extensive RL training on tens of thousands of visual and spatial reasoning samples. The results across a gauntlet of benchmarks are highly compelling:

  • State-of-the-Art Image Reasoning: PyVision-Image set new benchmarks for open-weight models, outperforming the previous best model (DeepEyes-v2) by +9.6% on WeMath and +6.9% on V*.
  • Superior Video Understanding: PyVision-Video achieved a 44.0% accuracy on the challenging VSI-Bench, a significant leap over the 38.0% baseline of the base Qwen2.5-VL-7B model.
  • Massive Efficiency Improvements: By leveraging on-demand context construction, PyVision-Video used an average of only 5,000 visual tokens per sample. In stark contrast, the baseline model consumed 45,000 tokens. This represents a 9x reduction in computational cost, proving that models can be more accurate by looking at less, but more relevant, data.

Limitations and Future Directions

While PyVision-RL represents a major step forward for open agentic vision models, it is not without limitations.

First, because the model relies on writing and executing Python code, it requires a secure sandbox environment. Improper deployment could theoretically expose host systems to security risks. Second, the framework currently relies on a "cold start" dataset generated by proprietary models like GPT-4o; bootstrapping this agentic behavior entirely from scratch remains an open challenge. Finally, the model's success is bottlenecked by its ability to write bug-free code. Future iterations will need more robust error-recovery mechanisms to help the model gracefully recover when its own code fails.

Ultimately, PyVision-RL demonstrates that multi-turn reasoning and tool use are not inherent weaknesses of multimodal architectures, but rather behaviors waiting to be unlocked by the right training incentives.

Summary updated

BibTeX
@inproceedings{zhao2026pyvision,
  author = {Shitian Zhao and Shaoheng Lin and Ming Li and Haoquan Zhang and Wenshuo Peng and Kaipeng Zhang and Chen Wei},
  title = {{PyVision-RL: Forging Open Agentic Vision Models via RL}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=EFq5Ml9rqv},
}
Figure