By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Apple trained an LLM to teach itself good UI code in SwiftUI – 9to5Mac
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > Apple trained an LLM to teach itself good UI code in SwiftUI – 9to5Mac
News

Apple trained an LLM to teach itself good UI code in SwiftUI – 9to5Mac

News Room
Last updated: 2025/08/15 at 1:53 AM
News Room Published 15 August 2025
Share
SHARE

In a new study, a group of Apple researchers describe a very interesting approach they took to, basically, get an open-source model to teach itself how to build good user interface code in SwiftUI. Here’s how they did it.

In the paper UICoder: Finetuning Large Language Models to Generate User Interface Code through Automated Feedback, the researchers explain that while LLMs have gotten better at multiple writing tasks, including creative writing and coding, they still struggle to “reliably generate syntactically-correct, well-designed code for UIs.” They also have a good idea why:

Even in curated or manually authored finetuning datasets, examples of UI code are extremely rare, in some cases making up less than one percent of the overall examples in code datasets.

To tackle this, they started with StarChat-Beta, an open-source LLM specialized in coding. They gave it a list of UI descriptions, and instructed it to generate a massive synthetic dataset of SwiftUI programs from those descriptions.

Then, they ran every piece of code through a Swift compiler to make sure it actually ran, followed by an analysis by GPT-4V, a vision-language model that compared the compiled interface with the original description.

Any outputs that failed to compile, looked irrelevant, or were duplicates, were tossed. The remaining outputs formed a high-quality training set, which then was used to fine-tune the model.

They repeated this process multiple times and noted that with each iteration, the improved model generated better SwiftUI code than before. That, in turn, fed into an even cleaner dataset.

After five rounds, they had nearly one million SwiftUI programs (996,000 to be precise) and a model they call UICoder, which consistently compiled and produced interfaces much closer to the prompts than the starting model.

In fact, according to their tests, UICoder significantly outperformed the base StarChat-Beta model on both automated metrics, and human evaluations.

UICoder also came close to matching GPT-4 in overall quality, and actually surpassed it in compilation success rate.

Here’s the kicker: the original dataset accidentally excluded SwiftUI code

One of the more interesting facts from the study came from a slight screw-up. The original StarChat-Beta model was trained primarily on three corpora of data:

  1. TheStack, a large dataset (250B tokens) of permissively licensed code repositories;
  2. Crawled web pages;
  3. OpenAssistant-Guanaco, a small instruction-tuning dataset.

The problem, as Apple’s researchers explained:

Notably, StarChat-Beta’s training data contains little to no SwiftUI data. Swift code repositories were excluded by accident when creating TheStack dataset, and upon manual inspection, we found that the OpenAssistant-Guanaco dataset only contains one example (out of ten thousand) with any Swift code in the response field. We hypothesize that any Swift examples seen by StarChat-Beta during training were most likely from crawled web pages, which are possibly lower quality and less structured than repository code.

This means that UICoder’s gains didn’t come from simply rehashing SwiftUI examples it had already seen (because there were almost none in its original training data), but from the self-generated, curated datasets Apple built through its automated feedback loop.

From the study: “Screenshots rendered from SwiftUI code generated by our models. For illustration purposes we manually
included stock photos and icons. The model-generated code was not modified in any way except to update image
asset names.”

This actually led the researchers to hypothesize that even though their method proved effective to implement UIs using SwiftUI, it “would likely generalize to other languages and UI toolkits,” which is also pretty cool.

The study, UICoder: Finetuning Large Language Models to Generate User Interface Code through Automated Feedback, is available on arXiv.

Limited time Apple Watch deals on Amazon

FTC: We use income earning auto affiliate links. More.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Google Home finally adds full temperature scheduling for older Nest thermostats
Next Article BingX PCI DSS Certification Sets New Benchmark For Data Security In Web3 | HackerNoon
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

How to Use the Text-to-speech Feature on Instagram Reels
Computing
5 of the strangest places you’ll find USB ports hanging around in
News
The Best AI Web Scraper Tools in 2025: Top Picks, Features & Pricing | HackerNoon
Computing
ASUS Zenfone 12 Ultra is getting Android 16 beta
News

You Might also Like

News

5 of the strangest places you’ll find USB ports hanging around in

5 Min Read
News

ASUS Zenfone 12 Ultra is getting Android 16 beta

3 Min Read
News

Workday acquires Flowise to boost AI-powered workflows – News

4 Min Read
News

How fanatical Japanese soldier kept fighting for 30 YEARS after VJ Day

5 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?