Introduction
Recent advancements in Large Language Models (LLMs) have raised a compelling question: can models trained exclusively on text understand the visual world? This research, presented at WACV, explores using Scalable Vector Graphics (SVG) as a transparent, text-based bridge between the visual and linguistic domains. Unlike traditional vision-language models that rely on "black box" embeddings, this approach leverages the structured, XML-based nature of SVGs to enable LLMs to "see" and reason through code.
The SVG Bridge: Methods and Generation
The core methodology involves converting raster images into SVG representations. SVGs describe images using geometric primitives—such as lines, circles, and polygons—along with attributes like coordinates and colors. Because this information is stored as structured text, it is natively readable by LLMs like GPT-4.
Beyond simple recognition, this bridge allows for "Visual Prompting." By providing examples of SVG transformations (A → B), LLMs can perform zero-shot image generation and editing. For instance, a model can follow instructions to "make the stem brown" or "colorize this apple" by directly modifying the underlying SVG code, demonstrating a surprising degree of generative capability without traditional pixel-based training.
Benchmarking Visual Reasoning
To evaluate the depth of this understanding, the researchers utilized several benchmarks, most notably Sort-of-CLEVR. This dataset tests relational reasoning across varying levels of complexity, from simple attribute identification (Unary) to complex spatial relationships (Ternary).
The study also introduced SVG-QA, a new dataset comprising over 2,300 high-quality question-answer pairs. These tasks require the model to understand not just the geometry, but the semantic category and functional usage of objects described in vector format. A key technique used across these tasks was Chain-of-Thought (CoT) prompting, encouraging the model to "think" through spatial coordinates before answering.
Key Results and Robustness
The findings demonstrate that LLMs possess a significant "blind" visual reasoning capability. On the Sort-of-CLEVR dataset, GPT-4 with CoT achieved an accuracy of 89%, significantly outperforming specialized Relation Networks (75%).
A major advantage of the SVG representation is its inherent robustness to distribution shifts. In tests using Colored-MNIST (CMNIST-B), where background noise and color shifts often cause standard convolutional neural networks (CNNs) to fail, SVG-based LLMs maintained high performance. While a ConvNeXt model's accuracy plummeted to 32.6%, a fine-tuned LLM (Vicuna) maintained 92.9% accuracy by focusing on the structural descriptions rather than pixel-level noise.
Limitations and Future Outlook
While SVGs provide a powerful structural prior, they are currently limited to icons, diagrams, and simple shapes. Converting complex photographic content into SVG often results in a significant loss of detail or generates code that exceeds the token limits of current LLMs. Future research aims to develop hybrid models that combine the discrete structural advantages of SVG with continuous representations for fine-grained visual perception.
Summary updated