Source-linked AI summary
MentalThink: Shaping Thoughts in Mental SVG World
Kangheng Lin, Jisheng Yin, Dingming Li, En Yu, Yana Wei, Han Zhou, Liang Zhao, Hongyu Zhou, Hongbo Peng, Jianjian Sun, Zheng Ge, Xiangyu Zhang, Daxin Jiang, Jingyu Wang
TL;DR
MLLM reasoning often verbalizes visual interpretation rather than reasoning within a visual space. MentalThink uses SVG as an intermediate representation for iterative visual reasoning and achieves superior performance across spatial reasoning benchmarks, including 76.0% on MindCube.
Problem
Existing MLLM reasoning often remains linguistic, with limited structured spatial representation for grounding reasoning in visual structure.
Source: §1 · p. 1, §3.1 · p. 3Method
MentalThink uses an SVG-based visual-symbolic pipeline, training models to generate, render, and reason about visual representations through SFT followed by multi-turn RL for iterative inspection and revision.
Source: §1 · p. 2, §3.2 · p. 4Results
Takeaways & Limitations
The findings position think-with-SVG as a verifiable visual workspace for dynamic perspective taking, visual reflection, and compositional scene construction.
Source: §1 · p. 2High-quality reasoning data interwoven with valid, meaningful SVG code is scarce in standard pre-training corpora, making spontaneous activation of this capability challenging.
Source: §6 · p. 8
Abstract
from arXiv · showhide
We introduce MentalThink, a visual-symbolic reasoning paradigm that equips Multimodal LLMs (MLLMs) with an executable mechanism for "mental" visualization. The core of MentalThink is a think-with-SVG pipeline, where the model learns to generate, render, and interpret scalable vector graphics (SVG) code as an intermediate visual representation for multi-turn reasoning. By creating structured vector sketches, the model can externalize spatial hypotheses, inspect them through deterministic rendering, and reason within a constrained geometric space, effectively mimicking the human process of mental imagery. We instantiate this paradigm through a two-stage training framework, combining Supervised Fine-Tuning (SFT) for SVG syntactic alignment with multi-turn Reinforcement Learning (RL) to encourage iterative inspection, revision, and refinement of intermediate visual hypotheses. Extensive evaluations demonstrate that MentalThink achieves superior performance on spatial understanding and reasoning benchmarks (e.g., 55.1% on VSIBench, 76.0% on MindCube), showing that executable vector graphics provide a verifiable visual workspace for dynamic perspective taking, visual reflection, and compositional scene construction.
1. Introduction
MentalThink equips multimodal LLMs to reason through executable SVGs, using a two-stage training process to create and refine visual hypotheses. The introduction reports strong benchmark results and describes spatial reasoning patterns elicited by this approach.
Background
- Mental imagery supports constructing and manipulating mental models for understanding relationships, planning, and problem solving, while recent LLMs show structured reasoning through verbal traces (Wei et al., 2025; Gandhi et al., 2025).The introduction presents visual thinking as a promising frontier for AI.Source: §1 · p. 1
Problem
- Text-only reasoning can drift from geometric reality, while explicit layouts or external tools risk reducing scenes to sparse primitives or separating visual imagination from reasoning (Liu et al., 2025a; Li et al., 2026; Yin et al., 2025; Zhang et al., 2025b).The introduction frames the goal as retaining linguistic flexibility while grounding reasoning in visual structure.Source: §1 · p. 1
Motivation
- SVGs offer compositional visual layouts with geometry and spatial hierarchies, while their code form aligns with LLMs’ learned markup and programming-language priors (Han et al., 2025).Generating valid vector commands requires structural understanding rather than surface-level pattern matching.Source: §1 · pp. 1–2
Approach
- MentalThink uses SFT to teach SVG externalization, then multi-turn RL to encourage iterative inspection, revision, and correction of visual hypotheses.The pipeline uses SVG as an intermediate representation for internal visual reasoning.Source: §1 · p. 2
Results
- MentalThink achieves 55.1% on VSIBench and 76.0% on MindCube, with qualitative analyses showing dynamic perspective taking, visual refinement, and compositional scene construction.The authors suggest that think-with-SVG provides an efficient, verifiable abstraction for multimodal reasoning.Source: §1 · p. 2
2. Related Works
Prior reasoning methods extend chain-of-thought to multimodal tasks and use external tools or internal visual representations, but face limits in visual grounding, verification, or detail. MentalThink instead uses SVG as an intermediate reasoning medium for constructing, inspecting, and refining visual hypotheses.
Chain-of-Thought (CoT) Reasoning
- CoT breaks complex problems into intermediate steps, with SFT used to externalize reasoning and RL to scale it (Wei et al., 2022; Yue et al., 2023; Yu et al., 2023b; OpenAI, 2024; DeepSeek-AI et al., 2025).This decomposition is described as supporting long-horizon logical coherence and reducing error propagation.Source: §2 · p. 2
- Multimodal CoT interleaves textual rationales with visual features, but remains language-centric and can lack geometric grounding and rigorous self-validation (Zhao et al., 2023; Yu et al., 2023a; Zhang et al., 2023; Wei et al., 2025; Meng et al., 2025; Xiaomi & Team, 2025; Liu et al., 2025a).Textual reasoning may drift from image geometry, producing semantically plausible but visually incorrect hallucinations.Source: §2 · p. 2
Think-with-Image
- External-tool “think-with-image” methods add image manipulation or auxiliary visuals as reasoning steps, but rigid APIs can break end-to-end differentiability (Hu et al., 2024).Examples include zooming, cropping, and generating auxiliary visuals.Source: §2 · p. 2
- Internal cognitive maps and bounding-box layouts improve localization but can reduce complex visual details to sparse primitives, losing fine-grained shape information (Yin et al., 2025; Li et al., 2025a; Yang et al., 2025e).MentalThink proposes structured, machine-readable SVGs to bridge symbolic reasoning and visual grounding without black-box external tools.Source: §2 · p. 3
SVG in LLM & MLLM
- MentalThink uses SVG as an intermediate reasoning modality—not merely a final output—so models can construct, inspect, and refine mental sketches for complex multimodal decisions.Earlier LLM/MLLM work used SVG for generation or benchmarking rather than as a medium of thought (Xing et al., 2024; Yang et al., 2025d).Source: §2 · p. 3
3. Think-with-SVG Reasoning Framework
MentalThink extends multimodal chain-of-thought with optional structured SVG sketches that can be rendered and inspected during reasoning. Its training recipe combines supervised syntactic alignment with multi-turn reinforcement learning for iterative visual reasoning.
3.1. Preliminaries: Multimodal CoT
- Multimodal CoT represents reasoning as sequential steps that may incorporate visual information, but remains fundamentally linguistic rather than reasoning within visual space.It verbalizes interpretations of visual data instead of constructing and manipulating visual representations.Source: §3.1 · p. 3
3.2. Think-with-SVG: A Structured Visual Reasoning Pipeline
- Think-with-SVG augments linguistic reasoning with optional structured SVG code, whose primitives, attributes, and groups encode precise, compositional visual hypotheses.The model iteratively generates, renders, and reasons about these representations through visual feedback, enabling native visual reasoning without external tools or specialized visual encoders.Source: §3.2 · pp. 3–4
3.3. MentalThink Training Recipe
- MentalThink first uses supervised fine-tuning to teach syntactically valid SVG, then applies multi-turn GRPO reinforcement learning to develop strategic reasoning and self-correction.During interaction, rendered images update the reasoning context; rewards encourage renderable SVG syntax and a correct final answer.Source: §3.3 · pp. 4–5
4. Experiments
MENTALTHINK is evaluated on spatial benchmarks against proprietary, general open-source, and spatial-specific models, with results showing gains from SVG-based reasoning and its two-stage training. Ablations attribute complementary improvements to SVG reasoning data, general spatial data, and multi-turn RL.
4.1. Experimental Setup
- MENTALTHINK uses Qwen2.5-VL-7B and is compared with proprietary models, general open-source MLLMs, and spatial-specific models.The backbone choice is intended to isolate gains from the think-with-SVG paradigm rather than model scaling.Source: §4.1 · p. 5
- The SFT corpus contains approximately 200k samples: 50k each for Visual-Syntactic Alignment and Visual Thought Externalization, plus 100k for Fundamental Spatial Perception.SVG reasoning and reconstruction data use a teacher-student pipeline with structural-validity and basic visual-integrity checks; RL uses VSIBench and MindCube training prompts.Source: §4.1 · p. 5
4.2. Main Results
- RL is crucial for complex reasoning beyond SFT’s ability to generate valid SVGs, which establishes the capacity to draw a mental image.The comparison of SFT and RL stages supports the two-stage pipeline: SFT establishes SVG generation, while RL develops reasoning logic.Source: §4.2 · p. 6
4.3. Ablation Studies
- Adding SVG-Reasoning data raises average VSIBench performance from 31.0% to 44.4%, with Appearance Order increasing from 28.2 to 56.0 and Object Size from 37.2 to 55.9.The ablation attributes these gains to structured SVG reconstruction supporting more granular layout perception.Source: §4.3 · p. 7, Table 2 · p. 7
- General Spatial Perception Data raises average performance from 44.4 to 53.9, while Room Size increases by 26.5 points, from 31.9 to 58.4.The passage attributes the additional gains to broad spatial priors and diverse spatial exposure.Source: §4.3 · p. 7
- RL raises the average VSIBench score to 55.1%, with Relative Direction rising from 47.1 to 51.4 and Appearance Order reaching 66.7.The RL stage encourages iterative refinement of hypotheses, improving challenging reasoning beyond SFT-only performance.Source: §4.3 · p. 7
- The full MENTALTHINK configuration achieves peak performance across all VSIBench metrics.The integrated pipeline combines spatial data with iterative reinforcement learning.Source: §4.3 · p. 7, Table 2 · p. 7
5. Analysis and Discussion
MentalThink’s SVG workspace outperforms text- and box-based reasoning in controlled comparisons, adapts reasoning effort to task complexity, and supports revisable spatial reasoning across perspective-taking and scene-construction cases.
5.1. Empirical Analysis of Think-with-SVG
- In matched settings, Think-with-SVG consistently outperforms Think-with-Text and Think-with-BBox on MindCube and VSIBench, with the largest relative gains on VSIBench.The comparison varies only the intermediate reasoning representation; the results suggest structured, executable spatial representations provide a more effective inductive bias for complex multi-step visual reasoning.Source: Table 3 · p. 7, §5.1 · p. 7
- Perception tasks elicit System 1 intuition, whereas complex visual reasoning triggers System 2 effort, with increased SVG use, tokens, and turns.Perception tasks average 1.19 turns and 18.5% SVG invocation; reasoning tasks show 63.7% SVG invocation, 544.5 versus 109.2 tokens, and 1.64 average turns.Source: §5.1 · pp. 7–8
5.2. Case Analysis: Emergent Spatial Reasoning via Think-with-SVG
- Case analyses show SVG reasoning externalizes spatial hypotheses for dynamic perspective taking, iterative visual correction, and globally coherent multi-view scene construction.Examples anchor an egocentric frame on the man in green, revise room-layout relations after detecting an orientation mismatch, and align a table and backpack relative to a door.Source: §5.2 · p. 8, Figure 3 · p. 8
6. Limitation and Conclusion
MentalThink treats SVG as an executable mental scratchpad that bridges symbolic reasoning and visual perception, grounding models’ thoughts in precise geometric structures and achieving state-of-the-art performance across spatial reasoning benchmarks. Spontaneous activation remains difficult because suitable training data are scarce, motivating sophisticated data synthesis and reinforcement strategies.
6. Limitation and Conclusion
- MentalThink uses SVG as an executable mental scratchpad that bridges symbolic reasoning and visual perception, grounding thoughts in precise geometric structures and achieving state-of-the-art performance across spatial reasoning benchmarks.The conclusion presents explicit visual imagery as a foundation for more robust and interpretable machine reasoning.Source: §6 · p. 8
- Spontaneously activating and exploring this ability remains challenging because standard pre-training corpora lack high-quality chain-of-thought data interwoven with valid, meaningful SVG code.Naturally occurring data alone are insufficient; sophisticated data synthesis and reinforcement strategies are required.Source: §6 · p. 8
- The work aims to provide a foundation for neurosymbolic multimodal systems and future exploration of explicit visual imagery for more robust, interpretable machine reasoning.Source: §6 · p. 8
A. Appendix · A.1. Data Pipeline
MentalThink’s data pipeline uses a teacher-student process to generate SVG reasoning demonstrations and reconstruction targets for its two-stage training recipe. Its prompts guide visual reasoning with SVG and train faithful image-to-SVG reconstruction.
A.1. Data Pipeline
- Gemini 3 serves as teacher, generating SVG reasoning traces that provide structured demonstrations and reconstruction targets for the two-stage training recipe.Source: §A.1 · p. 14
- The 50k Visual Thought Externalization examples come from MindCube’s 10k and a visually demanding 40k subset of VSIBench training data.Source: §A.1 · pp. 14–15
- Prompt A treats SVG as a thinking instrument, scales graphic complexity to problem needs, and models entities, relationships, and constraints.Source: §A.1 · p. 14
- Its exploratory analysis directs SVG transformations, decomposition, and composition to deepen understanding.Source: §A.1 · p. 14
- Prompt A uses SVG to annotate patterns and show solution paths, while asking each thinking step to state design intent, observations, and changed understanding.Source: §A.1 · p. 14
- Prompt B asks the model to reconstruct an image as SVG code that faithfully reproduces its visual elements.Source: §A.1 · p. 14
- The pipeline retains original dataset licenses, does not redistribute raw data, reports on official evaluation splits, and excludes corrupted or visually invalid samples.Source: §A.1 · pp. 14–15
A.2. Thinking with Different Patterns
The section compares three intermediate reasoning representations using controlled system-prompt variants with identical task inputs, output requirements, and supervision. The variants differ only in representation: natural-language text, spatial bounding boxes, or executable SVG graphics.
A.2. Thinking with Different Patterns
- The controlled variants share task inputs, output requirements, and supervision signals, differing only in their intermediate reasoning representation.This design isolates how representation affects learning and generalization.Source: §A.2 · p. 15
- The three thinking patterns are natural-language text, spatial bounding boxes, and executable SVG graphics.The text- and box-based variants use Prompts C and D, while the SVG variant uses the SVG Reasoning prompt (Prompt A).Source: §A.2 · p. 15
A.3. More Case Studies
This subsection presents case studies intended to illustrate MENTALTHINK’s SVG reconstruction and think-with-SVG reasoning capabilities.
A.3. More Case Studies
- Figure 4 is cited as illustrating MENTALTHINK’s SVG reconstruction capability.Source: §A.3 · p. 15
- Figure 5 presents additional think-with-SVG reasoning case studies, marked as part 1 of 2.Source: §A.3 · p. 15, Figure 5 · p. 16
- Figure 6 presents additional think-with-SVG reasoning case studies, marked as part 2 of 2.Source: §A.3 · p. 15, Figure 6 · p. 17
Related papers
This paper cites
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning2025
- Gemini: A Family of Highly Capable Multimodal Models2023
- Spatial-MLLM: Boosting MLLM Capabilities in Visual-based Spatial Intelligence2025
- SpatialEvo: Self-Evolving Spatial Intelligence via Deterministic Geometric Environments2026