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
Existing multimodal reasoning methods struggle to preserve linguistic flexibility while maintaining reliable visual grounding. MentalThink addresses this gap with a think-with-SVG pipeline and two-stage SFT-plus-RL training, achieving superior performance across spatial reasoning benchmarks, including 76.0% on MindCube.
Problem
Existing MLLM reasoning paradigms trade linguistic flexibility for limited visual grounding or rely on reasoning that remains fundamentally linguistic.
Method
MentalThink trains MLLMs to generate, render, and interpret SVG intermediate representations through progressive SFT and multi-turn RL.
Results
MENTALTHINK achieves superior performance across spatial understanding and reasoning benchmarks, improving MindCube accuracy from 36.0% to 76.0%.
Takeaways & Limitations
SVG functions as an executable mental scratchpad that grounds multimodal reasoning in precise geometric structures and provides a verifiable visual abstraction.
Takeaways & Limitations
Spontaneous activation of this ability is difficult because high-quality reasoning data interwoven with valid, meaningful SVG code is scarce.
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 with a think-with-SVG pipeline that externalizes visual reasoning through executable, interpretable vector graphics. Its two-stage SFT-plus-RL framework supports iterative visual inspection and refinement, achieving strong spatial reasoning performance and eliciting sophisticated reasoning patterns.
- Motivation: MentalThink addresses weak visual grounding in language-centric reasoning by representing spatial layouts, object geometry, and hierarchies with structured SVG.SVG provides a complete, compositional visual language while retaining linguistic and symbolic compatibility.
- Motivation: SVG’s code-based format lets MLLMs reuse hierarchical and compositional priors from pretrained text, markup, and programming-language knowledge.The representation aligns natively with LLM architectures because models are pretrained on corpora such as HTML and XML.
- Method: The think-with-SVG pipeline has models generate SVG as an intermediate representation of internal visual reasoning within an explicit and interpretable mental-imagery paradigm.MENTALTHINK is realized through a progressive two-stage training framework.
- Results: 55.1% on VSIBench and 76.0% on MindCube demonstrate MENTALTHINK’s strong performance on spatial understanding and reasoning benchmarks.Qualitative analysis also identifies dynamic perspective taking, reflective visual refinement, and compositional scene construction.
2. Related Works
Related work progresses from language-based Chain-of-Thought reasoning to multimodal rationales and visual intermediate representations. Existing visual methods improve spatial localization but can lose fine-grained shape information, while SVG has mainly served as a generation target or evaluation medium.
- Chain-of-Thought (CoT) Reasoning: Chain-of-Thought prompting decomposes complex problems into intermediate reasoning steps, helping models maintain logical coherence and reduce error propagation.The passage attributes this development to Wei et al. (2022).
- Chain-of-Thought (CoT) Reasoning: Multimodal CoT extends this approach by interleaving textual explanations with visual features for complex multimodal reasoning tasks.The cited works include Zhao et al. (2023), Yu et al. (2023a), Zhang et al. (2023), Wei et al. (2025), Meng et al. (2025), and Xiaomi & Team (2025).
- Think-with-Image: Think-with-image methods use external image tools or auxiliary visuals as intermediate reasoning steps, while alternative methods generate cognitive maps or bounding-box layouts.These approaches use SFT or RL for tool calling and explicitly model spatial relationships through internal visual representations.
- Think-with-Image: Cognitive maps and bounding-box layouts improve localization but often simplify complex visual details into sparse primitives, losing fine-grained shape information.The passage motivates the proposed think-with-SVG pipeline as a response to this limitation.
- SVG in LLM & MLLM: SVG has traditionally been used by LLMs and MLLMs as a generation target or spatial-understanding benchmark, with recent work generating icons, charts, and artistic designs.SVG-rendering tasks also assess code-generation capabilities concerning spatial coordinates.
3. Think-with-SVG Reasoning Framework
The think-with-SVG framework extends multimodal reasoning with structured SVG states that connect symbolic thought to deterministic visual representations. MentalThink trains this capability through syntactic alignment followed by multi-turn reinforcement learning for iterative visual reasoning and self-correction.
- Motivation: Existing multimodal chain-of-thought remains fundamentally linguistic, verbalizing visual interpretations instead of reasoning within a visual space.MentalThink addresses this limitation by replacing or augmenting linguistic thought steps with structured visual-symbolic representations.
- Structured Visual Language: SVG serves as a structured visual language composed of primitive elements, explicit attributes, and hierarchical grouping or transformations.Its syntax enforces structural and semantic precision while supporting deterministic mapping, compositional scene construction, and parametric visual control.
- SVG-Augmented Reasoning: SVG-augmented reasoning interleaves linguistic steps ℓ_i with optional SVG code σ_i, enabling adaptive code generation when mental imagery is needed.The resulting representations allow MLLMs to perform mental rendering and native visual reasoning without external tools or specialized visual encoders.
- SVG Rendering Environment: The rendering environment creates a feedback loop in which the model generates SVG, renders it deterministically, and conditions subsequent reasoning on the resulting visual representation.The pipeline maps structured code through document and geometric representations into visual output, supporting iterative inspection and refinement.
- Two-Stage Training: MentalThink uses a progressive two-stage framework: SFT first teaches syntactically valid SVG states, while GRPO-based multi-turn RL optimizes strategic reasoning and self-correction.The RL stage maximizes expected trajectory return through interaction with the SVG rendering environment, with rewards for renderable syntax and final answer correctness.
4. Experiments
Experiments evaluate MENTALTHINK with a two-stage SFT–RL pipeline across spatial benchmarks and component ablations. Results show large gains from SVG reasoning data, general spatial data, and iterative RL, including 76.0% on MindCube and 55.1% average on VSIBench.
- Implementation and evaluation: MENTALTHINK is evaluated against proprietary, open-source general, and spatial-specific models using the Qwen2.5-VL-7B backbone.The benchmark suite includes VSIBench, MMSI-Bench, OmniSpatial, MindCube, SpatialViz, and ViewSpatial.
- Data synthesis and training: 200k SFT samples target visual-syntactic alignment, SVG-mediated thought externalization, and fundamental spatial perception, followed by RL on VSIBench and MindCube prompts.SVG data are teacher-student constructed and filtered for structural validity and basic visual integrity.
- Benchmark results: 76.0% MindCube accuracy improves from 36.0%, while VSIBench and ViewSpatial improve by +24.1% and +25.7%, respectively.MindCube requires complex 3D mental rotation and spatial manipulation.
- SFT–RL synergy: RL boosts MindCube by +1.8% and SpatialViz by +4.5% beyond SFT, complementing SFT’s role in generating valid SVG.The paper characterizes SFT as drawing a mental image and RL as thinking in a mental image.
- Ablation studies: 13.4% average-score gain from 31.0% to 44.4% follows the addition of SVG-Reasoning data, with Appearance Order rising from 28.2 to 56.0.Object Size also increases from 37.2 to 55.9.
- Ablation studies: 55.1% average score is reached by the full RL configuration, while general spatial data raises the average from 44.4 to 53.9 and Room Size from 31.9 to 58.4.RL also increases Relative Direction from 47.1 to 51.4 and Appearance Order reaches 66.7.
5. Analysis and Discussion
Across controlled comparisons, think-with-SVG outperforms text- and box-based reasoning on MindCube and VSIBench, with the largest relative gains on VSIBench. Its executable spatial workspace supports adaptive effort, perspective transformation, hypothesis revision, and globally coherent scene construction.
- Different Thinking Paradigms: Under matched teacher, input, and supervision conditions, think-with-SVG outperforms Think-with-Text and Think-with-BBox on MindCube and VSIBench.The paradigms differ only in their intermediate reasoning representation.
- Different Thinking Paradigms: Structured, executable spatial representations provide a more effective inductive bias for complex multi-step visual reasoning.
- System 1 vs. System 2 Behavior via Adaptive Reasoning: Complex visual reasoning triggers System 2 behavior, with SVG invocation reaching 63.7%, token length reaching 544.5 versus 109.2, and average turns increasing to 1.64.These changes indicate adaptive allocation of additional inference effort to rigorous visual grounding.
- Dynamic Perspective Taking: Think-with-SVG enables dynamic perspective taking by encoding egocentric forward and left–right axes to transform camera-centric observations into agent-centric relations.The model anchors a coordinate frame on the man in green and projects the man in white into it.
- Reflective Visual Refinement: Iterative SVG updates support reflective visual refinement by correcting left–right relations after detecting an orientation mismatch.The room layout is initially constructed around the TV and table, then revised according to the user’s facing direction.
- Compositional Scene Construction: Compositional SVG scene construction aligns multiple views around a fixed door reference, enabling inference of the backpack’s front-left relation from global consistency.The table and backpack are integrated into a shared spatial layout rather than inferred from one view alone.
6. Limitation and Conclusion
MentalThink presents 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 spatial reasoning performance. The approach remains limited by scarce high-quality chain-of-thought data interwoven with valid, meaningful SVG code, requiring sophisticated data synthesis and reinforcement strategies.
- Conclusion: SVG provides a structured visual-symbolic representation that bridges symbolic reasoning and visual perception.The paper treats SVG as an executable “mental scratchpad.”
- Conclusion: MentalThink grounds model thoughts in precise geometric structures and achieves state-of-the-art performance across multiple spatial reasoning benchmarks.These capabilities are enabled by the think-with-SVG pipeline.
- Limitation: Spontaneously activating and exploring this SVG-based ability remains a non-trivial challenge.The limitation concerns the model’s ability to use the capability without externally supplied support.
- Limitation: High-quality chain-of-thought data interwoven with valid, meaningful SVG code is scarce in standard pre-training corpora.This scarcity makes naturally occurring data insufficient for training the capability.
- Limitation: Bridging this data gap requires sophisticated data synthesis and reinforcement strategies.The paper presents the work as a foundational step toward neurosymbolic multimodal systems.
A. Appendix · A.1. Data Pipeline
MentalThink’s appendix describes a teacher–student data pipeline that generates SVG reasoning traces and reconstruction targets from MindCube and visually demanding VSIBench training items. It uses separate prompts for visual reasoning and SVG reconstruction, with visualization principles emphasizing modeling, exploration, pattern recognition, and solution construction.
- A.1. Data Pipeline: The teacher–student pipeline uses Gemini 3 to generate SVG-based reasoning traces that support structured reasoning demonstrations and reconstruction targets.These data underpin the paper’s two-stage training recipe.
- A.1. Data Pipeline: 50k Visual Thought Externalization examples come from MindCube’s 10k and VSIBench’s 40k training splits, retaining VSIBench items requiring strong visual reasoning.The VSIBench subset is drawn from a 590k-example training set after excluding corrupted or visually invalid samples.
- A.1. Data Pipeline: Two prompt templates generate the SVG reasoning and reconstruction data.The reconstruction prompt asks for precise, standalone SVG code that faithfully reproduces a provided image.
- A.1. Data Pipeline: SVG is treated as a thinking instrument whose complexity should match the problem rather than serve as decoration.The guidance explicitly recommends simple graphics for simple problems and requires each modification to contribute new reasoning.
- A.1. Data Pipeline: The reasoning workflow models core elements, explores transformations and decompositions, annotates patterns, and constructs solution paths with SVG.It covers sequential, structural, and dynamic problems through sequences, architectures, and transformations.
- A.1. Data Pipeline: Each SVG thinking step explains its design intent, observations, and resulting change in understanding.The prompts frame visualization as a way to make complexity simple, implicit information explicit, and abstract ideas concrete.
- A.1. Data Pipeline: The reconstruction instructions require attention to visual elements, geometry, colors, text, spatial relationships, valid rendering, and scalable organization.They specify appropriate SVG elements, viewBox and dimensions, semantic groups, precise paths, and browser-renderable standalone code.
- A. Appendix: The appendix uses MindCube and VSIBench under their original licenses, does not redistribute raw data, and reports results on official evaluation splits.Samples failing corruption or basic visual-integrity checks are excluded.
A.2. Thinking with Different Patterns
This section compares three controlled intermediate reasoning representations—text, bounding boxes, and executable SVGs—while holding task inputs, outputs, and supervision constant. The text and box variants constrain reasoning to natural-language scene interpretation or normalized spatial boxes, respectively.
- Thinking Pattern Abstraction: Three system-prompt variants induce distinct thinking patterns while sharing identical task inputs, output requirements, and supervision signals.The variants differ only in the form of their intermediate reasoning representation.
- Thinking Pattern Abstraction: The three thinking patterns are text-based natural language, box-based spatial bounding boxes, and SVG-based executable vector graphics.Text uses Prompt C, box-based reasoning uses Prompt D, and SVG reasoning uses the SVG Reasoning prompt.
- Text-based Reasoning: Text-based reasoning permits only verbal descriptions of objects, spatial relations, reasoning steps, and explicit uncertainty, excluding coordinates, boxes, SVG, diagrams, and precise measurements.Its think section is intended to interpret the visual scene verbally.
- Bounding-box Reasoning: Box-based reasoning represents relevant objects with axis-aligned boxes using normalized coordinates in [0, 1000] and infers spatial relationships from them.Each object follows the format ObjectName: bbox(x_min, y_min, x_max, y_max), while SVG, curves, paths, and free-form drawings are prohibited.
A.3. More Case Studies
The section presents additional case studies of MentalThink’s SVG reconstruction and think-with-SVG reasoning capabilities. One example evaluates viewpoint-based spatial reasoning from four bottle images aligned with room walls.
- Case-study overview: The case studies illustrate both SVG reconstruction and think-with-SVG capabilities.The reconstruction example is shown in Figure 4, while the think-with-SVG examples appear in Figures 5 and 6.
- Viewpoint-based reasoning: A spatial question uses four bottle images from front, left, back, and right viewpoints to ask what lies left of the bottle from the sofa’s position.Each camera is aligned with room walls and partially captures the surroundings.
- Viewpoint-based reasoning: The viewpoint question offers three candidate answers: a table with chairs, a bicycle and TV, or white walls and windows.The options are labeled A, B, and C, respectively.