/

Can a model learn developer taste in UI?

Trained on what developers choose on 21st, Qwen started filling the screen, adding colour and building a whole page around one component.

Alex Smirnov
Alex Smirnov
@asmirnovxyz
Time picker generated by Qwen, before and after we trained it with our reward model
Before trainingaverage reward 0.38
reward 0.43
reward 0.42
reward 0.40
reward 0.27
After trainingaverage reward 1.28
reward 1.76
reward 1.52
reward 1.19
reward 0.65

After training, the picker is drawn larger, mostly as a wide two-panel card with a clock and appointment details.

We trained a reward model on the components developers choose on 21st and used it to train Qwen3.8-27B to generate UI aligned with developers' preferences.

What we found

  • We trained a reward model: a model that scores a screenshot of a UI component by what developers choose on 21st. In 65% of pairs it had not seen, it gives the higher score to the component developers preferred. A coin gives 50%.
  • Qwen, trained to get a higher score from that reward model, builds a product around the component. Asked for one hero or one button, the trained Qwen adds a site navigation bar, a logo with the brand name or stat cards. After training 16% of its components have such additions, up from 1%.
  • The trained Qwen fills the screen and adds colour. Its components cover 37% of the screenshot, up from 23%, and 65% of them have a coloured glow in the background, up from 20%.

1 The reward model

We want a model that looks at a component and says how likely developers are to choose it over another component made for the same need.

The reward model is Qwen3.8-27B with a small trained adapter (LoRA) and one output number. It gets the search text and one screenshot, and returns a score.

1.1 Data

On 21st a developer searches or opens a category page, sees a grid of component previews and copies the one they want into their project. Many developers pay to copy, so a copy is a deliberate choice. We turned these copies into two datasets.

Clean pairs

A pair is clean when both components were shown for the same search many times and one of them, the winner, has a clearly higher ratio of copies to expected copies than the other, the loser. Expected copies are what an average component gets at the same places in the results. The winner's ratio is at least twice the loser's, and the difference is too large to be chance. A pair stays only if the two components are interchangeable: a developer who needs a pricing table with three plans could use either one. A model removed the pairs that are not interchangeable, for example a login form vs a full login page with a photo. Then we looked at every remaining pair ourselves and removed the ones the model had missed.

Developers opened the pricing category page and saw both components
Winner
59 copies, 20 expected = 2.9x expected
Loser
27 copies, 65 expected = 0.4x expected
The winner is the component with the higher ratio of copies to expected copies.
1,386 pairs·808 unique components·161 searches and category pages

Noisy comparisons

1,386 clean pairs are too few to train a 27B model on, so we also built a much larger and rougher set. When a developer opens several components from one search and copies one, the copied one wins a comparison against each of the others. In the example below, 5 opened and 1 copied give 4 comparisons.

Search "pricing": one developer opened five components and copied one. That gives four comparisons; two are shown.
Copied
wins over each of
Opened, not copied
Opened, not copied
19,355 comparisons·4,000 unique components·4,315 different search texts

One developer's choice can be chance, so these comparisons are noisy. They cover five times as many components as the clean pairs, so the model learns from them first.

1.2 Training

Final reward model
1,297
training steps
8 × H100
GPUs
50 minutes
training time
$25
GPU time
Training settings
AdapterLoRA, rank 16
Noisy comparisons1,210 steps, learning rate 1e-4, about 46 minutes
Clean pairs87 steps, learning rate 2e-5, about 4 minutes

The model learns one rule: in every pair, the winner must get a higher score than the loser. It is trained first on the 19,355 noisy comparisons and then on the 1,386 clean pairs. The diagram shows one training example from start to finish.

How the reward model scores one pair
A pair from the FAQ category page.
Prompt (same for both)
A developer is looking for a UI component: "faq" (on a category page). Here is a screenshot of one candidate React component. How likely is a developer to copy it into their project?
FAQ roller
Winner
higher ratio of copies to expected copies
FAQs Component
Loser
lower ratio of copies to expected copies
Same model, run once per screenshot
Qwen with the trained adapter, one number out
3.27
2.56
Loss
For this pair

turns the score difference into a number between 0 and 1. The loss is small when the winner scores higher (0.40 here) and large when it scores lower (1.11 if these two scores were swapped).

The loss is the standard pairwise (Bradley–Terry) loss for reward models. We trained with ms-swift, one pass over each dataset.

Test runs. Before training the final model, we checked that the method works. We trained five test models. Each one never saw a different fifth of the clean pairs: their components were removed from both the clean pairs and the noisy comparisons. Then each test model picked the winner in the pairs it had never seen. Guessing gives 50%. These five models are used only for this measurement and are then thrown away.

Accuracy of the test models on components they never saw
Share of unseen clean pairs where the test model gives the winner the higher score. Mean of the five test models. Step 0 is the model before any training. The clean-pairs part is stretched.
Noisy comparisons
Then clean pairs

Final model. The final reward model is trained the same way on all the data, so there are no unseen pairs left to test it on; this is its training loss.

Loss of the final reward model during training
Lower is better. Smoothed over about 20 steps on the noisy comparisons and 5 on the clean pairs. The clean-pairs part is stretched.
19,355 noisy comparisons
Then 1,386 clean pairs

2 The generator

Qwen already generates React components that build and render. Nothing in its training told it which components developers choose. The goal is a model that generates components developers would choose more often. Developers cannot rate every component during training, so the reward model stands in for them.

2.1 Training setup

We train the generator with GRPO: at each step it generates several components for the same brief, each gets a reward, and the model is pushed towards the ones that scored above the group's average. The model we train to generate UI is Qwen3.8-27B, the same model the reward model is built on, with a separate adapter. Qwen gets a brief and generates one React component. It trained on 480 briefs. We compare it before and after training on 30 other briefs it never saw.

System prompt for the generator (Qwen)
You are an expert frontend engineer. Write ONE self-contained React component (TSX).
Rules:
- Style with Tailwind CSS utility classes.
- Allowed imports only: 'react', 'framer-motion', 'lucide-react'. No other packages.
- No external images, fonts or network requests; draw visuals with CSS, SVG or gradients.
- Use realistic placeholder text, not lorem ipsum.
- export default the component; it takes no props.
- It is rendered alone on a page 1080px wide, so it must look complete in that viewport.
- Use exactly the theme (light or dark) the request asks for.
Output only the code, in a single ```tsx block.
Example brief for the generator (Qwen)
Build a single content card whose main feature is a glowing light effect, such as a glowing border or a glow following the cursor, not a grid of cards and not a landing page. It is for "Quantum Notes", a note-taking app. Required: exactly one card with an image area, a title, a short description and a button, with the glow clearly visible and animating. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a light theme.

At each step it generates 8 components for a brief. Every component is built, opened in Chromium and screenshotted, and gets a reward:

What happenedReward
The code did not build, crashed or showed a blank page−3
Claude Haiku 5.5 says the screenshot breaks the brief−2
OtherwiseThe reward model's score
Brief check prompt for Claude Haiku 5.5
You check whether a screenshot of a rendered UI component fulfills a design brief. You do NOT judge visual quality or style at all.
Answer with JSON only: {"component_ok": bool, "theme_ok": bool, "elements_ok": bool, "scope_ok": bool, "reason": "<max 15 words>"}
- component_ok: the screenshot shows the kind of component the brief asks for (same job, subtype and rough item count; small deviations in counts are fine).
- theme_ok: the overall page is predominantly light when the brief says light theme, predominantly dark when it says dark theme.
- elements_ok: false only if MOST of the required elements are missing or the screen is an error/blank/placeholder.
- scope_ok: if the brief says "Show only this component", false when the screenshot adds a substantial invented page around it (a hero headline section, a navbar, an extra editor or window, a full landing page). Small captions are fine. If the brief does not say this, true.
Be lenient on details and strict only on clear violations.

Brief:
{brief}
[screenshot]
One training step for one brief: 8 components, sorted by the reward each one got.
1.10
0.81
0.71
0.62
−0.20
−0.59
−2.00 · breaks the brief
no code in the answer
−3.00 · no code in the answer
Group average −0.32. Training makes the components above it more likely and the ones below it less likely.

2.2 Training

40
training steps
8 × H200
GPUs
4.6 hours
training time
$320
GPU time
Training settings
AdapterLoRA, rank 32
Learning rate1e-4
Temperature1.1
Components per brief8

Two charts show how training went: how many generated components failed at each step, and how the reward model scored the components for 30 unseen briefs.

How many generated components failed, and why, at each training step
Share of the components generated at each step.
Answer cut off at the length limit (−3)Other failures: answer ended without code, did not build, crashed or blank page (−3)Broke the brief (−2)Scored by the reward model

Qwen reasons before it generates code, and the reasoning and the code share one limit of 12,000 tokens. From step 4 the reasoning grew from about 2,100 characters to 14,900, and the code no longer fit. A cut-off answer gets −3, so training pushed the reasoning back down. The second dip is a different failure: the answers end without a finished code block and without reaching the limit.

Reward model score on the 30 unseen briefs, before training and after every 10 steps
Average score of the components that rendered.

On the 30 unseen briefs the reward model's score went from 0.32 before training to 0.66 after it. At steps 10 and 20 many components failed, so those two points average only the ones that rendered.

2.3 Results

For each of the 30 test briefs, we compare 4 components generated before training with 4 generated after.

Reward model score before and after training, brief by brief
Each row is one of the 30 unseen briefs; dots are the mean reward model score of its 4 components before and after training.
Before trainingAfter training, score went upAfter training, score went down
Score went up (24 briefs)
Time picker
+0.90
Social buttons
+0.86
Looping shapes
+0.77
Loading indicator
+0.74
Wave effect
+0.62
Open popover
+0.61
Starry sky
+0.61
Contribution heatmap
+0.59
Gallery hero
+0.58
Blog section
+0.57
Particle background
+0.57
404 page
+0.56
Music player
+0.51
Aurora hero
+0.50
Wallpaper background
+0.49
Folder card
+0.38
3D Earth globe
+0.36
Top navigation bar
+0.33
File tree
+0.28
Statistics section
+0.25
Account settings
+0.17
Glassmorphism card
+0.13
Gaming venue hero
+0.11
Log out button
+0.01
Score went down (6 briefs)
Background pattern
−0.46
Date range picker
−0.40
AI coding chat
−0.26
Mesh gradient
−0.24
Virtual keyboard
−0.10
Gradient CTA button
−0.04
−0.500.511.52
change
Mean reward model score, higher is better

The gain does not come from fewer broken components. Everything we measured on the same components:

Before trainingAfter training
Components that rendered93%94%
Added extra sections the brief did not ask for1 of 11218 of 113
Required elements missing6 of 1120 of 113
Share of the screenshot covered23%37%
Length of the answer3,818 tokens3,791 tokens

Below are the 30 briefs in three groups, by how the reward model score changed.

Reward model score went up (21 briefs)

Wave effect

Build a single animated wave effect that fills the viewport, not a static divider and not a chart. It is for "Tidal", a surf forecast app. Required: exactly one continuous wave animation made of layered flowing lines, shapes or a shader, looping smoothly. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a light theme.

Before trainingaverage score 0.91
score 1.31
score 1.08
score 1.01
score 0.23
After trainingaverage score 1.53
score 1.88
score 1.65
score 1.35
score 1.25

After training, 3 of the 4 components add extra sections the brief did not ask for: the Tidal logo in a corner and a card or bar with the day's wave height, wind and water temperature on top of the waves. None of the 4 components generated before training have them.

3 more briefs where the score went up

Time picker, 0.38 → 1.28, is the figure at the top of the post.

Looping shapes

Build a single looping decorative animation built from shapes, not a page with animated sections and not a collection of different effects. It is for "Nimbus Weather", a hyperlocal forecast app. Required: one self-contained animated composition of at least 5 moving elements, a seamless infinite loop, and smooth easing. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a light theme.

Before trainingaverage score −0.19
score 0.11
score −0.17
score −0.28
score −0.42
After trainingaverage score 0.58
score 0.93
score 0.89
score 0.79
score −0.28
Gallery hero

Build a single hero section whose main feature is an image gallery, not a full landing page and not a standalone lightbox. It is for "Casa Alba", a boutique hotel in Lisbon. Required: a headline, a short subtext, 1 call-to-action button, and exactly 5 gallery images (use placeholder image URLs). Visual style is up to you. Use a light theme.

Before trainingaverage score 0.65
score 0.99
score 0.66
score 0.30
broke the brief · no score
After trainingaverage score 1.23
score 1.63
score 1.17
score 1.16
score 0.96
Aurora hero

Build a single hero section with an animated aurora-borealis style background, not a full landing page and not a bare background without content. It is for "Northlight Analytics", a product analytics platform. Required: the aurora-style animated background, exactly 1 headline, 1 supporting paragraph and 2 call-to-action buttons. Visual style is up to you. Use a dark theme.

Before trainingaverage score −0.37
score 0.53
score −0.35
score −0.79
score −0.87
After trainingaverage score 0.13
score 0.48
score 0.36
score 0.03
score −0.35

Reward model score barely changed (5 briefs)

Glassmorphism card

Build a single glassmorphism card with a frosted translucent surface and background blur, not a grid of cards and not a full page. It is for "Lumen Bank", a mobile banking app. Required: one card containing a small icon, a title, a short description line, a balance figure and one action button, placed over a visible backdrop so the frosted blur reads clearly. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a dark theme.

Before trainingaverage score 0.93
score 1.09
score 1.04
score 0.95
score 0.64
After trainingaverage score 1.06
score 1.37
score 1.03
score 0.92
score 0.91
2 more briefs where the score barely changed
Gaming venue hero

Build a single hero section for a gaming venue, not a full multi-page website and not a game library grid. It is for "Pixel Pit", an arcade bar with retro cabinets. Required: 1 headline, 1 supporting paragraph, exactly 2 call-to-action buttons, exactly 3 small stat items (such as machines, tournaments, opening hours), and one gaming-themed visual element. Visual style is up to you. Use a light theme.

Before trainingaverage score 0.41
score 0.76
score 0.68
score 0.52
score −0.34
After trainingaverage score 0.52
score 0.84
score 0.54
score 0.38
score 0.31
Gradient CTA button

Build a single gradient call-to-action button, not a button group and not a form. It is for "Orbit Pay", a payments app for freelancers. Required: exactly one button with a text label and a small arrow icon, and a vivid multi-stop gradient fill that is clearly visible in its resting state. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a dark theme.

Before trainingaverage score 0.87
score 1.34
score 1.24
score 1.14
score −0.23
After trainingaverage score 0.83
score 1.33
score 0.84
score 0.61
score 0.53

Reward model score went down (4 briefs)

AI coding chat

Build a single chat interface where a user talks to an AI coding assistant and replies include code, not a landing page and not a plain messaging app. It is for "Syntaxly", an AI pair-programming tool. Required: exactly 4 messages alternating user and assistant, at least 1 syntax-highlighted code block with a copy button, and a message input bar with a send button. Visual style is up to you. Use a light theme.

Before trainingaverage score 0.52
score 0.60
score 0.49
score 0.48
did not render
did not render · no score
After trainingaverage score 0.26
score 1.02
score 0.44
score 0.00
score −0.44

All 4 components generated after training put the chat inside an app with a sidebar of past chats and a user profile, and one adds a file tree. None of the 3 components that rendered before training have a sidebar.

2 more briefs where the score went down
Date range picker

Build a single date range picker with an open calendar popover, not a single-date picker and not a full booking page. It is for "Stayloop", a vacation rental booking site. Required: a trigger field showing the selected range, a calendar showing exactly 2 months side by side with a highlighted start, end and in-between days, 4 preset shortcuts, and Cancel and Apply buttons. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a dark theme.

Before trainingaverage score 0.08
score 1.36
score 0.23
score 0.18
score −1.45
After trainingaverage score −0.32
score 0.51
score −0.20
score −1.27
counted as blank · no score

After training, one component shows a blank screen and in another the calendar dates overlap. Before training, one component shows a large yellow block instead of the calendar.

Background pattern

Build a single full-viewport decorative background pattern, not a gallery of pattern samples and not a page with content. It is for "Tessellate", a graphic design studio. Required: exactly 1 seamless repeating pattern built from one repeating motif that fills the whole viewport. Visual style is up to you. Show only this component on the page: no headline, hero, navigation or other sections around it. Use a dark theme.

Before trainingaverage score 0.16
score 0.89
score 0.22
score 0.02
score −0.49
After trainingaverage score −0.30
score 0.05
score 0.01
score −0.29
score −0.99

3 Next steps

  • Show Qwen's components to developers on 21st. We put components generated before and after training next to the ones made by people and count which ones developers choose. That is the test of whether training made the components better.
  • Feed those choices back into the reward model. So far the reward model has learned only from components made by people. Choices between generated components are the kind of data it is later asked to score.
  • More data for the reward model. It gives the higher score to the component developers preferred in 65% of pairs. We collect comparisons over a longer period and reduce them to one answer per pair.
  • Show the reward model more than a screenshot. It sees one static image. A developer also sees the animation, the hover states and the code.

Published

Nov 15, 2026

Read time

9 min

Tags

ResearchAIDesignTraining

Share