All summaries · 2026-09-10

MM-SVGEdit: A Multimodal-Driven SVG Editing for UI Design

Shibo Yang, Yuqing Gao, Zipeng Liu

arXiv:2609.06116 · abstract · pdf · summarized by meta/muse-spark-1.3-contributor on 2026-09-10

The one-paragraph version

This paper introduces MM-SVGEdit, a system for editing user interface designs that are stored as Scalable Vector Graphics, which means images described as editable code listing shapes, text, and positions rather than as fixed pixels. The core problem is that manual editors are precise but slow and hard to learn, while asking a Large Language Model, meaning an AI model trained to follow language instructions, to rewrite the graphics code directly is easy to ask for but often picks the wrong element or breaks the layout. The authors split every edit into two steps: first find which element or elements to change, called visual grounding, then apply the change in a controlled way. For both steps the user can either point directly with mouse and keyboard or type natural language, and can mix them. To make language work, they build two helpers: Agent Locator, a small open model fine-tuned to map an instruction plus graphics code to element IDs, and Agent Modifier, which turns the instruction into a narrow function call, meaning a pre-defined editing command with fixed arguments like which ID to move and by how far, that a separate engine then executes. Trained and tested on a self-made dataset of 14,476 instruction-and-answer pairs covering 11 kinds of edits, the fine-tuned locator and the function-call modifier beat direct code rewriting on accuracy while using far fewer tokens and responding faster.

The problem they're solving, and why it matters

Traditional Scalable Vector Graphics editing lives in professional desktop tools like Illustrator and Inkscape, or in code libraries like Snap.svg. Both assume you know design concepts like nodes and paths, or you can debug graphics code. That excludes non-designers and still forces experts into tedious dragging, aligning, and parameter tweaking.

Recent Large Language Model approaches promised to fix this by letting you say, for example, move the Login button 50 pixels to the right. But language alone is vague. Which button is the Login button if there are several? How far is slightly to the right? And when the model rewrites the whole graphics file at once, it can invent syntax errors, drop elements, or restyle things you did not ask to change. You also lose fine control because you can only re-prompt and hope.

The authors argue neither manual precision nor language flexibility alone is enough for interface work, where layouts must stay aligned, styles must stay consistent, and edits are often local and iterative. They focus specifically on structured, browser-renderable interface graphics for lightweight prototyping, not on replacing full design environments like Figma. What is missing, in their view, is a workflow that lets you point when pointing is clearer, speak when speaking is faster, and always check what the model thinks you mean before it changes anything.

The key idea, in plain words

Find it first, then change it, and let the human help at either point.

Instead of asking one model to read an instruction and rewrite the entire picture, the system separates deciding what to edit from deciding how to edit it. In the first stage, visual grounding, the goal is only to return identifiers, like Text-1 or Rect-5, for the target elements in the graphics code. In the second stage, modification, the goal is only to apply a narrow, pre-approved operation to those confirmed identifiers.

Both stages accept two kinds of input: direct manipulation, meaning selecting or dragging with mouse and keyboard, and natural language handled by an AI agent. That creates four practical patterns the paper illustrates with concrete cases. You can drag a button yourself for sub-pixel placement. You can type change all button backgrounds to blue and add a 2-pixel border and let the model do the batch work. You can box-select five scattered text labels with the mouse, then type unify font size to 16 pixels, so language acts only on your selection. Or you can let the model pre-highlight all card components, then click to remove false positives before applying a style.

The second half of the key idea is to never let the model freely rewrite the graphics. It may only fill in the arguments of small editing functions, such as change color, move position, delete element, or add element. A deterministic editing engine then runs those functions only on the confirmed targets and shows the result plus a log for verification. This constrains what can go wrong and makes the model's reasoning visible as code you or the interface can inspect.

How it actually works, step by step

The system is described as four layers: a User Interaction Layer with canvas, input box, and preview; an Intelligent Reasoning Layer with the two agents; an Editing Engine Layer built on the open-source SVGEdit framework; and a Data Persistence Layer with templates and history. An editing round flows like this.

First, source graphics must exist in editable form. Because public interface datasets like Rico, with over 66,000 mobile screens and view hierarchies, and mrtoy, with bounding boxes and labels for mobile elements, are bitmap-based, meaning stored as pixel grids that are hard to edit element by element, the authors convert them to vector form. They extract attributes like position, size, color, and category, map them to standard vector tags, rebuild hierarchy, assign a unique ID to each element, check that the result follows the vector specification, and filter for mobile layouts. They report over 85 percent reconstruction accuracy for medium-complexity screens, though the paper does not fully define how that percentage was measured.

Second, they define what edits to support. They list 11 core categories: position, scaling, style, text, border, visibility, layer order, element insertion or removal, rotation, layout arrangement, and advanced conditional or relative positioning. For single-target and multi-target cases separately they expand these into sub-types and example phrasings. They note one test graphic can support up to 38 distinct instructions, which helps generate varied training data.

Third, they generate ground truth, meaning correct answers for training. They traverse elements and prompt GPT-4o, a large commercial model, to write a plausible instruction for each element ID using templates, treating the ID as given rather than asking the model to guess the ID from language. This direction is easier and avoids inventing wrong IDs. They then filter with DeepSeek-R1, another large model, plus manual checking, to remove ambiguous or inconsistent pairs. The result is 14,476 high-quality question-answer pairs, each containing a vector interface, an instruction targeting one or more elements, and the correct target IDs. For 213 instructions they additionally create fully edited vector files by model generation plus manual verification to evaluate end-to-end edits.

Fourth, Agent Locator is trained. Starting from Qwen2.5-7B-Instruct, a lightweight open 7-billion-parameter instruction-following model chosen for handling long structured text, they use LoRA, which stands for Low-Rank Adaptation, a parameter-efficient fine-tuning method that freezes most of the model and trains only small added matrices in the attention layers. This runs on a single 24-gigabyte graphics card. They use 5,000 of the 14,476 pairs split 9 to 1 into training and test, training the model to output the correct ID given the graphics code and instruction, with Cross-Entropy Loss, meaning a standard penalty for predicting the wrong ID, driving updates until loss stabilizes.

Fifth, Agent Modifier executes. Once target IDs are known from manual selection or Agent Locator, a Specification Module tells the model which functions exist, what arguments each takes, and rules like least privilege and single responsibility, for example text change may only pass ID and new text. The model first extracts element metadata if needed, then generates compliant function calls under those constraints. The interface shows which elements will change for user confirmation. Only after confirmation does the Execution Module parse and run the calls, check the output is valid, and return the modified graphics and log.

What they showed — results, honestly, with limitations

All quantitative results reported are on the authors' own datasets, not on an independent public benchmark, so they show internal improvement rather than general leadership.

For locating targets, on 500 held-out test samples covering diverse styles and all 11 categories, the fine-tuned Qwen2.5-7B reached 94.2 percent accuracy on single-target cases and 93.4 percent on multi-target cases, for about 92 percent on a mixed set. The base unfine-tuned version scored 54.9 percent single and 62.8 percent multi in their table. The fine-tuned small model also scored above the large models they compared against in this test: DeepSeek-R1 at 82.2 percent single and 68.3 percent multi, DeepSeek-V3 at 88.6 percent single and 65.8 percent multi, and GPT-4o at 88.1 percent single and 60.0 percent multi. That is a large gain, but it is expected that tuning on the same distribution as the test helps, and it does not prove the same gain on other interface styles.

For applying edits, they compared direct prompting, where the model rewrites the vector code, versus function calling across five models. Function calling won on accuracy in every case they list: DeepSeek-V3.2 from 89.7 to 97.2 percent, GPT-4o from 90.6 to 95.5 percent, Gemini 2.5 Flash from 96.1 to 98.6 percent, Claude-3-Haiku from 85.5 to 87.8 percent, and Qwen3-32B from 76.1 to 87.3 percent. The pattern matters: weaker open models gain a lot, plus 11.2 points for Qwen3-32B, while an already strong model like Gemini gains only 2.5 points.

For efficiency, function calling cut token consumption, meaning the amount of text the model must read and write, and wall-clock response time substantially in the two cases detailed: Claude-3-Haiku from 2,010 to 178 tokens, a 91.1 percent drop, and 18.8 to 2.6 seconds, an 85.9 percent drop; Qwen3-32B from 2,517 to 706 tokens, 72.0 percent lower, and 71.3 to 21.3 seconds, 70.1 percent faster. The paper frames this as making real-time iteration feasible with minimal overhead.

Limitations are stated by the authors and should be taken seriously. The pipeline depends on element IDs embedded in the file; without them extra preprocessing is needed. Experiments use structured mobile layouts, with irregular or highly complex graphics untested. Gains shrink for top-tier models on accuracy alone, though efficiency gains remain. It is also unclear or unsupported in the text when the paper claims improved efficiency and user-perceived control: there is no detailed user study with participant counts or control ratings presented, only accuracy, token, and time metrics plus interface descriptions, so the control claim rests on workflow design rather than measured user data.

Why this might matter to me

If you care about spatial reasoning in language and vision models, this is a concrete case where pure language grounding fails on phrases like the icon to the right of the button, and the fix is to split refer and act. The locator must resolve vague spatial descriptions to exact IDs in structured code, while the modifier must turn relative moves like up by 15 pixels into exact numeric arguments. That separation makes errors diagnosable, which is useful for probing where spatial understanding actually breaks.

For world models and text-to-CAD and parametric geometry, the analogy is direct. Like a CAD sketch or parametric model, the interface here is not pixels but named entities with constraints and parameters. The lesson is to have the model predict discrete references plus constrained parameter edits rather than regenerating geometry, which preserves topology and style. The specification module with least-privilege functions is essentially a tiny parametric kernel, and the same pattern could apply to extrudes, mates, or dimension edits where overwriting the whole model would be unsafe.

For 3D generation and scene representation, the work suggests a path from single-shot generation to iterative scene editing. You could treat objects in a scene graph like elements in this vector file: first ground which chair or wall by language plus clicking, then emit a function call to move, rescale, or restyle only that node. The reported token and latency savings matter here because 3D scenes are large, and re-emitting an entire scene each turn is wasteful. The open question this paper leaves you is generalization beyond tidy mobile layouts to messy, irregular, or occluded 3D arrangements, where IDs are missing and spatial relations are truly three-dimensional.

Terms worth knowing

Scalable Vector Graphics: an image format that describes a picture as code for shapes, text, positions, colors, and hierarchy, so individual parts stay selectable and editable, unlike a bitmap that stores only pixels.

Visual grounding: the task of mapping a language description to the correct visual element, here returning the element's ID given the graphics file and instruction.

Agent Locator: the paper's fine-tuned model for the grounding stage; input is graphics plus instruction, output is target IDs.

Agent Modifier: the paper's editing stage that takes graphics plus instruction plus target IDs and outputs modified graphics, via constrained function calls rather than free rewriting.

Function calling: a method where the model may only produce calls to pre-defined functions with specified arguments, which a separate engine then executes, reducing free-form errors.

Specification Module and Execution Module: the two parts of the modifier; the first defines allowed functions and argument rules, the second runs the generated calls and validates the result.

LoRA: Low-Rank Adaptation, a fine-tuning technique that leaves most model weights frozen and trains only small added matrices, saving memory and reducing overfitting.

Direct prompting versus direct editing: baselines in the paper where the model directly rewrites the whole graphics file from an instruction, without the locate-then-call constraint.

Rico and mrtoy: existing public mobile interface datasets based on screenshots plus annotations; used here as raw material converted into editable vector form.