WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Development

summary

Video file (mp4)

The gist

The gist: WAFFLE introduces a fine-tuning pipeline for UI-to-HTML code generation that utilizes structure-aware attention and contrastive learning to improve multi-modal models' understanding of HTML

In short

WAFFLE is a new fine-tuning strategy for multi-modal models to generate functional HTML code from UI designs. It uses structure-aware attention to help models understand HTML hierarchy and contrastive learning to align visual images with text codes. This approach significantly improves model performance on benchmarks like WebSight-Test, leading to substantial gains in code accuracy and visual similarity.

Key concepts

Structure-Aware Attention
This mechanism teaches the model the rules of HTML structure by allowing tokens to focus on three specific types of previous code segments: parent elements, preceding sibling elements, and self-attention. This helps the model understand how different parts of the HTML code relate to each other structurally.
Contrastive Learning
This technique is used to teach models to focus on subtle visual differences between UI images and corresponding HTML text. It forces the model to learn which visual details are important for generating correct, distinct code, preventing it from generating identical code for visually different inputs.
HTML Match
This metric measures how closely the generated HTML matches a ground truth design. WAFFLE improved this score by up to 9.00 percentage points on new benchmarks, indicating that the model is much better at producing structurally correct code compared to standard methods.

Terminology used across episodes

This episode discusses

The paper

WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Development · Read on arXiv

Shanchao Liang, Nan Jiang, Shangshu Qian, Lin Tan

Purdue University

Web development involves turning UI designs into functional webpages, which can be difficult for both beginners and experienced developers due to the complexity of HTML's hierarchical structures and styles. While Large Language Models (LLMs) have shown promise in generating source code, two major challenges persist in UI-to-HTML code generation: (1) effectively representing HTML's hierarchical structure for LLMs, and (2) bridging the gap between the visual nature of UI designs and the text-based format of HTML code. To tackle these challenges, we introduce Waffle, a new fine-tuning strategy that uses a structure-aware attention mechanism to improve LLMs' understanding of HTML's structure and a contrastive fine-tuning approach to align LLMs' understanding of UI images and HTML code. Models fine-tuned with Waffle show up to 9.00 pp (percentage point) higher HTML match, 0.0982 higher CW-SSIM, 32.99 higher CLIP, and 27.12 pp higher LLEM on our new benchmark WebSight-Test and an existing benchmark Design2Code, outperforming current fine-tuning methods.

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: We're looking at the paper: "WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Development".

Jane: Here's the gist of the paper. The gist: WAFFLE introduces a fine-tuning pipeline for UI-to-HTML code generation that utilizes structure-aware attention and contrastive learning to improve multi-modal models' understanding of HTML structure and visual differences.

Tom: WAFFLE's Core Strategy WAFFLE is a new fine-tuning strategy that uses a structure-aware attention mechanism to improve LLMs’ understanding of HTML’s structure and a contrastive fine-tuning approach to align LLMs’ understanding of UI images and HTML code Abstract, WAFFLE, a new fine-tuning strategy that uses a structure-aware attention mechanism to improve LLMs’ understanding of HTML’s structure and a contrastive fine-tuning approach to align LLMs’ understanding of UI images and HTML code.

Jane: Key Components of WAFFLE The approach combines two main techniques to tackle the challenges in UI-to-HTML code generation WAFFLE, a new fine-tuning strategy that uses a structure-aware attention mechanism to improve LLMs’ understanding of HTML’s structure and a contrastive fine-tuning approach to align LLMs’ understanding of UI images and HTML code.

Paper summary: Jane: So wrapping up this discussion on WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Development, the authors are proposing that this combination of structure-aware attention and contrastive learning is a solid way to make AI better at turning UI designs into functional webpages.

Lu: The title points out that they are focusing on these multi-modal models specifically, meaning the research isn't just about making code generation better in isolation, but about integrating visual understanding with textual generation.

Meng: From a deployment view, it suggests that if we want robust front-end AI tools, we should probably look for fine-tuning methods that explicitly bake in structural knowledge like this instead of relying on pure prompt engineering or standard fine-tuning.

Lalam: The paper shows that WAFFLE outperforms standard fine-tuning on two backbone MLLMs, specifically showing improvements of up to nine point zero zero pp higher HTML match, zero point zero nine eight two higher CW-SSIM, thirty-two point nine nine higher CLIP, and twenty-seven point one two pp for LLEM on our new benchmark WebSight-Test and an existing benchmark Design2Code.

Tom: So the takeaway here is that this strategy provides measurable improvements across several metrics when you apply it to models that can handle both images and text inputs for front-end tasks.

Jane: It really highlights how much the way we fine-tune these models matters, and WAFFLE seems like a promising direction for researchers looking to build more capable tools that can handle complex visual interfaces reliably.

Conclusion: Tom: So we’re wrapping up on WAFFLE, this paper from VLMWebSight and Moondream2, which is about fine-tuning multi-modal models for front-end development.

Jane: It’s about taking those models that can see images and understand text, and making them way better at turning a design into actual working HTML code.

Tom: Exactly. The authors are showing how adding structure awareness and contrastive learning makes a big difference in how the model understands the layout of HTML versus what it sees visually.

Jane: And they report some solid numbers, showing improvements on benchmarks like WebSight-Test and Design2Code, with things like up to nine percent higher HTML match.

Lu: The core idea is using structure-aware attention to teach the AI the rules of how an HTML tree actually works—like parent styles flowing down to children.

Meng: But it’s not just about structure; they also use contrastive learning to make sure the model notices those tiny visual differences in UI images that might cause code errors.

Lalam: I’m seeing that contrastive learning is key for alignment, specifically helping the model focus on visual details when generating text.

Tom: So, what does this actually mean when we think about deploying these kinds of tools?

Jane: It means we can start trusting AI to handle more complex UI tasks because the models are learning the structure correctly and paying attention to those subtle visual cues.

Lu: The point is that this approach isn't just a trick; it’s a fine-tuning strategy that makes the models more robust when they have to generate code based on a visual prompt.

Meng: From an engineering standpoint, if this works across different models, it suggests we can use this framework to improve any existing multi-modal model for front-end generation without having to start from scratch.

Tom: It’s about making the AI more reliable in production environments where those small structural mistakes can cause big problems.

Jane: So, the paper shows how these two techniques—structure awareness and contrastive learning—work together to give the AI a much better grasp of both what it sees and what it needs to write.

Tom: It’s definitely a solid step forward in getting this kind of specific task done reliably by AI models.

Jane: Now, we’ve seen the results on those benchmarks, but we should probably look closer at how these kinds of fine-tuning methods hold up when you try to apply them to completely different types of visual inputs.

More episodes

← Home