Grafy News
Try Grafy free

New Benchmark Tests AI Ability to Edit Code via Visual Sketches

Researchers have introduced UI-Redline-bench to evaluate how well Vision-Language Models interpret handwritten sketches and arrows to modify web code.

Illustration for the news story: New Benchmark Tests AI Ability to Edit Code via Visual SketchesSource: Grafy Research Lab

Researchers have developed a new way to measure how effectively artificial intelligence can translate visual design feedback into functional code. This new benchmark, named UI-Redline-bench, focuses on the "redline" process—a common practice in web development where designers draw directly on screenshots to indicate desired changes.

What is UI-Redline-bench?

Most existing benchmarks for Vision-Language Models (VLMs) rely on natural language instructions, such as a text prompt asking to "change the button color." However, in real-world collaborative design, humans often use non-linguistic marks like freehand arrows, enclosures, or rough sketches to convey intent that is difficult to describe in words.

According to the researchers Satoshi Hiai, Ryo Fujii, Yosuke Kishinami, and Makoto Morishita, UI-Redline-bench is designed to bridge this gap. Figure 1 shows the task overview: a VLM is provided with an image containing visual revision instructions alongside the original HTML and CSS code. The model's goal is to output the updated code that reflects the visual marks. The dataset includes a mix of websites generated by large language models and a subset of real-world, permissively licensed websites.

Figure 1: Task overview. The VLM takes an image with visual revision instructions and the corresponding HTML/CSS code as input, and outputs the revised code.
Figure 1. Task overview. The VLM takes an image with visual revision instructions and the corresponding HTML/CSS code as input, and outputs the revised code. Figure 1 of “UI-Redline-bench: A Benchmark for Web UI Code Modification based on Redline Instructions” by Satoshi Hiai, Ryo Fujii, Yosuke Kishinami et al. (arXiv.org), CC BY 4.0.

How do the visual instructions work?

Unlike previous studies that used simple, machine-generated geometric shapes, this benchmark utilizes human-crafted annotations. These include handwritten text, arrows, and rough sketches that mimic the unstructured nature of human communication.

Figure 2 illustrates different scenarios encountered during testing. It highlights both successful and failed attempts by models. For instance, a model might succeed if a revision area is explicitly designated by an enclosure or if a sketch is placed directly adjacent to the target element with accompanying text. Conversely, a failure occurs when a model cannot resolve the relationship between a sketch and its target, such as when a rough shape is drawn far from the intended position and only connected by a thin arrow.

Figure 2: Case analysis: (a) A failure case where a rough shape of additional UI is drawn away from the revision position and connected by an arrow. (b) A success case wh…
Figure 2. Case analysis: (a) A failure case where a rough shape of additional UI is drawn away from the revision position and connected by an arrow. (b) A success case where the rough shape is drawn directly adjacent to the revision position indicated by text. (c) A success case where the revision area is explicitly designated by an enclosure. Figure 2 of “UI-Redline-bench: A Benchmark for Web UI Code Modification based on Redline Instructions” by Satoshi Hiai, Ryo Fujii, Yosuke Kishinami et al. (arXiv.org), CC BY 4.0.

What are the limitations of current AI models?

Testing major VLMs against this benchmark revealed that current models face significant hurdles when interpreting visual marks. The researchers noted that a primary difficulty lies in spatial reasoning—specifically, the ability to integrate spatially distant information.

For example, if a designer draws a new UI element in one corner of a screenshot and connects it to a specific button with a long, curved arrow, the model must understand that the arrow links the two distant points. The study suggests that while models are improving at general image understanding, the specific leap from interpreting a hand-drawn spatial prompt to performing precise code modification remains a major challenge.

Why does visual instruction following matter?

The ability to automate the translation of visual intent into digital implementation could significantly enhance development efficiency. If a VLM can accurately interpret a "redline" on a screenshot, it enables a rapid trial-and-error workflow between designers and developers.

Currently, much of the research in this field focuses on either generating code from scratch or using text to edit existing code. By focusing on the intersection of visual prompting and code editing, UI-Redline-bench provides a more realistic evaluation of how AI might function as a collaborative partner in professional web development environments.

How to apply these concepts in Grafy

While UI-Redline-bench is a research tool for evaluating model capabilities, the practical application of AI-driven code modification is a core part of modern development workflows. Developers looking to experiment with iterative code refinement and AI-assisted programming can utilize Grafy Code. While the current focus in production tools remains heavily on text-based prompting, the advancements in VLM spatial reasoning highlighted by this research will likely influence how future coding assistants interpret visual layouts and design mockups.

Frequently asked questions

What is the main goal of UI-Redline-bench?

The main goal of UI-Redline-bench is to evaluate how well Vision-Language Models can interpret human-crafted visual instructions, such as sketches and arrows on a screenshot, and use that information to modify the underlying HTML and CSS code of a website.

How does this benchmark differ from previous UI benchmarks?

Previous benchmarks primarily rely on natural language instructions or structured metadata like bounding box coordinates. UI-Redline-bench is unique because it uses intuitive, non-linguistic visual marks created by humans, which more closely mirrors real-world design review processes.

What is the biggest challenge for models in this task?

The biggest challenge identified is the integration of spatially distant information. Models often struggle with spatial reasoning tasks, such as following an annotated arrow that connects a handwritten sketch in one part of an image to a specific UI element in another part.


Source: Grafy Research Lab — UI-Redline-bench: A Benchmark for Web UI Code Modification based on Redline Instructions