Evaluating Multimodal Models on Graphic Reconstruction: Dimensions, Prompting, and Automation
This article breaks down what it takes for a multimodal model to turn an image into executable drawing code, and why "looks similar" is not a sufficient evaluation signal. It defines four measurable dimensions—structural fidelity, occlusion and depth inference, style and primitive selection, and compilability—then covers prompt and context design, common failure modes with their root causes, and a four-stage automated evaluation pipeline. The takeaway: explicit evaluation dimensions, an explicit coordinate system and layer order in the prompt, and a regression set built from failed samples.
1. The Core Problem: A Semantic Leap from Pixels to Drawing Instructions
Among the capabilities of multimodal models, “describe an image” is relatively mature, but “reconstruct an image as drawing code” remains a hard task. The former only requires a natural language description and leaves plenty of room for error; the latter requires the model to convert a 2D pixel array into structured vector drawing instructions, where the coordinates of every path, the control points of every curve, the solid or dashed attribute of every line, and the boundary and draw order of every filled region must all be precise and executable.
The difficulty comes from three semantic gaps:
- Dimensional gap: an image is a projection of a 3D scene onto a 2D plane, so the model has to infer depth, orientation, and front-to-back relationships.
- Representational gap: pixels are the result of continuous sampling, while vector instructions are a discrete symbol sequence, and there is no one-to-one mapping between them.
- Execution gap: drawing code has strict ordering semantics—what is drawn first and what is drawn later directly changes the final visual result—while the image itself carries no explicit order information.
For this reason, evaluating a multimodal model on this kind of task cannot rely on “does it look alike.” It has to look at combined performance across four dimensions: structural reconstruction, occlusion inference, style expression, and compilability.
2. Breaking Down the Capability: Four Measurable Evaluation Dimensions
2.1 Structural Fidelity
This measures whether the model correctly identifies the geometric relationships among the main subject, reference objects, and background. In engineering practice, a layered comparison works well: first compare the bounding box and aspect ratio of the overall silhouette, then the relative positions of key local parts, and finally the proportions of details. Layered comparison prevents “correct overall shape but drifting details” from being hidden by an aggregate score.
2.2 Occlusion and Depth Inference
Occlusion is the key signal for judging whether a model genuinely understands a 3D scene. If the model is only tracing pixels, the outline of an occluded object will be drawn incorrectly on top of the foreground; a model with structural understanding will actively truncate the occluded portion and use dashed lines, semi-transparent fills, or layer overdraw to express “present but not visible.”
2.3 Style and Primitive Selection
This covers distinguishing solid from dashed lines, separating fill from stroke, approximating gradients, and handling text and symbols. This dimension examines whether the model understands the conventions of the drawing language, rather than mechanically converting light-and-dark differences into dense lines.
2.4 Compilability and Execution Stability
The output drawing code must be handled correctly by a standard parser, with no syntax errors, no undefined variables, and no out-of-bounds coordinates. This is the most easily overlooked item, yet it is a veto criterion with the greatest impact on real deployment.
3. Prompt and Context Design
Model performance is highly sensitive to how the input is organized. In practice, it helps to split the task into a four-part constraint: observe, plan, generate, self-check.
Step 1: Describe only the spatial relationships and front-to-back occlusion you see. Do not write code.Step 2: List the layers, annotating the z-order and visibility of each layer.Step 3: Output drawing instructions in layer order, with all coordinates unified into the same coordinate system.Step 4: Self-check syntax, coordinate ranges, and layer order, and provide notes on corrections.
A few engineering details that are easy to miss:
- The coordinate system convention must be declared explicitly, including the origin position, the y-axis direction, the units, and the canvas size; otherwise the model will switch reference frames midway.
- Limit the size of a single output. Generating complex graphics in batches by layer can significantly reduce instruction drift in long sequences.
- Require the layer list before the code. This effectively forces the model to build an intermediate representation, and in testing it improves occlusion handling noticeably.
4. Common Failure Modes and Root Causes
| Failure symptom | Typical root cause | Mitigation |
|---|---|---|
| Correct outline but distorted proportions | No unified coordinate system constraint | Declare canvas and units explicitly |
| Occluded parts drawn in front | No intermediate representation of layer order | Output the z-order list first |
| Code fails to compile | Syntax drift in long sequences | Generate by layer plus syntax self-check |
| Light and shadow rendered as dense lines | No primitive selection strategy | Constrain fill and stroke to be separate |
| Details get blurrier as drawing proceeds | Attention decay from overly long context | Local redraw and iterative correction |
It is worth stressing that these symptoms are independent of the specific model version; they are common difficulties of this class of task. The evaluation methodology itself therefore has more long-term value than any single point-in-time hands-on impression.
5. Recommended Automated Evaluation Pipeline
Manual visual inspection does not scale, so a four-stage automated pipeline is recommended:
- Compilation check: run syntax and semantic checks first, and fail the sample outright if it does not pass, so that downstream metrics are not distorted.
- Render comparison: compute multi-scale similarity between the rendered result and the reference image, and separately track error in edge regions.
- Structural metrics: perform a structured comparison of layer count, occlusion relationships, and the distribution of primitive types.
- Regression set accumulation: turn failed samples into regression cases, run them on every model or prompt change, and build a comparable historical curve.
For batch job scheduling, a container platform can host rendering workers, a message queue can handle task distribution, object storage can hold intermediate artifacts, and a logging service with monitoring and alerting can track failure rates and latency distribution. These general-purpose cloud capabilities can be combined as needed without binding to a specific implementation.
6. Practical Conclusions
Judging by the comparative results from recent internal test builds, this generation of multimodal models shows visible progress in 3D structure understanding and layer reconstruction, particularly in expressing occlusion and distinguishing solid from dashed lines. But the bottleneck for engineering deployment has shifted from “can it draw it” to “can it draw it stably, compilably, and with regression coverage.”
The recommendation for teams is threefold: make the evaluation dimensions explicit, write the coordinate system and layer order into the prompt, and accumulate failed samples into a regression set. With these three in place, the gains from model iteration can be captured reliably rather than remaining a one-off pleasant surprise.
