Get the newsletter
Apple · AI / ML · Filed Nov 19, 2025 · USPTO published Nov 19, 2026 · This week's release

Apple Files Patent for Making On-Device AI Answer in Formats Apps Can Read

AI chatbots love to ramble, but apps need exact answers. Apple's patent application describes a way to force an on-device AI to write only answers that fit an app's strict format, and even skip ahead when only one word is possible.

Code instructions teach an on-device AI how to format its answers so an app can directly use the information. Drawing from patent filing US 2026/0367889 A1.
Code instructions teach an on-device AI how to format its answers so an app can directly use the information.All 17 drawings ↓
Publication number
US 2026/0367889 A1(US20260367889A1)
Applicant
Apple Inc.
Filed · Published
Nov 19, 2025 · Nov 19, 2026
Inventors
Erik D. Hornberger, Louis D'hauwe, Alexander D. Palmer, Yifei He, Bowen Huang, Xinran "Richard" Wei, John Dennison, Zhen Li
Status when we published
Waiting for an examiner
Document
20 claims
US classification
717/106
Parent application
Claims priority from a provisional application 63805668 (filed May 14, 2025)

What Apple's format-locked on-device AI does

Today, AI chatbots are good at understanding messy human language but bad at answering in a rigid format. Ask one for a person's name and age, and it may reply with a friendly sentence when the app wanted a neat, exact bundle of data. If the format is slightly off, the app can crash or throw the answer away.

Apple's patent application describes a fix for AI that runs on your own device. A developer just tells the AI what shape the answer should take, such as a person with a name and an age. The system then asks the programming language's own rule checker (called a compiler) what counts as valid, and builds a guardrail that only lets the AI write answers that fit.

The goal is for apps from outside developers to plug into the on-device AI and get answers they can use right away, without a lot of extra setup work.

From the filing · CLAIM 1
… retrieving, by the language model, rules defining the first syntax for the type in the first programming language from a compiler of the first programming language; creating, by the language model, from the rules from the compiler, a first grammar that defines tokens that may be output by the language model; …

Translation: The AI learns the exact grammar rules from a software compiler so it can format its answers correctly.

How the AI is blocked from breaking format

The claims center on one trick. An app sends the language model an instruction saying its answer must follow the format of a particular data type in a programming language, such as a Swift record with a name and an age. The model then retrieves that language's compiler rules (the compiler is the tool that checks code for errors) and builds a grammar, which is a list of rules about which pieces of text may come next.

While writing, the model is limited to pieces of text (called tokens) that fit the grammar. The filing describes a prefix tree, a branching map of valid next steps, that rules out invalid tokens as the answer grows. When only one token is possible, the system inserts it directly and skips the model's own calculation. The filing says this check runs on the CPU, which saves power compared with the power-hungry graphics chip.

The developer does not have to name the output language. The model can write JSON (a common data format) internally, which it may handle better, and a translation step turns the result back into the Swift type. The filing names an iOS tool called Generable for that translation.

  • Grammars can be nested, such as a hashtag pattern inside a JSON field.
  • The model can be configured ahead of time to call outside tools, like a contacts lookup, with correctly formatted requests.
From the filing · THE ABSTRACT
The present technology pertains to executing language models on personal computing devices, offering enhanced privacy and security over cloud-based solutions.

Translation: Running AI locally on your personal device keeps your private data secure instead of sending it to the cloud.

What this means for third-party Apple apps

For you, the payoff would show up as apps that act on what you say without breaking. Ask an app 'What's mom's number?' and the AI has to hand a correctly formatted request to a contacts tool. One malformed request and the feature fails. Locking the format in place makes that handoff dependable, and because the model runs on your device, the filing says you get better privacy and security than with cloud AI.

For Apple, the bigger story is opening its on-device model to outside developers. The filing also covers custom fine-tuned add-ons (called adapters) and smaller, faster distilled models that developers can ship through the App Store, and this format feature sits inside that larger package. Nothing in the filing says when or whether any of it ships.

This is the 22nd Apple filing we've tracked since July in our on-device AI privacy push, following work on rebuilding voices from text and swapping AI training data with towers.

Source: US 2026/0367889 A1 at the USPTO (PDF). Full patent text and figures are in the official publication.

Get our take in your Top Stories

Liked this breakdown? Add Patentlyze as a preferred source on Google, and our plain-English take shows up more often in your Top Stories the next time Apple patent news breaks.

There are more where this came from

We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.

The drawings · 17 sheets

17 drawing sheets from US 2026/0367889 A1 · click any drawing to enlarge

Connecting on-device AI tools directly to phone apps, drawing sheet 1 from US 2026/0367889 A1
Sheet 1 Connecting on-device AI tools directly to phone apps
How the phone forces AI answers into app code rules, drawing sheet 2 from US 2026/0367889 A1
Sheet 2 How the phone forces AI answers into app code rules
Narrowing down allowed characters so the AI never errors, drawing sheet 3 from US 2026/0367889 A1
Sheet 3 Narrowing down allowed characters so the AI never errors
Pruning vocabulary choices step by step as words form, drawing sheet 4 from US 2026/0367889 A1
Sheet 4 Pruning vocabulary choices step by step as words form
Timing processor chores so the AI responds without delay, drawing sheet 5 from US 2026/0367889 A1
Sheet 5 Timing processor chores so the AI responds without delay
Auto-filling obvious text to speed up structured answers, drawing sheet 6 from US 2026/0367889 A1
Sheet 6 Auto-filling obvious text to speed up structured answers
Switching between strict code rules and freeform AI text, drawing sheet 7 from US 2026/0367889 A1
Sheet 7 Switching between strict code rules and freeform AI text
An app asking the AI model for machine-readable output, drawing sheet 8 from US 2026/0367889 A1
Sheet 8 An app asking the AI model for machine-readable output
Show the other 9 sheets
Letting an AI model query tools with structured requests, drawing sheet 9 from US 2026/0367889 A1
Sheet 9 Letting an AI model query tools with structured requests
How the AI decides to gather extra information first, drawing sheet 10 from US 2026/0367889 A1
Sheet 10 How the AI decides to gather extra information first
Distributing specialized add-on models through an app store, drawing sheet 11 from US 2026/0367889 A1
Sheet 11 Distributing specialized add-on models through an app store
Loading AI files into secure memory at app launch, drawing sheet 12 from US 2026/0367889 A1
Sheet 12 Loading AI files into secure memory at app launch
Generating quick draft answers with smaller models to verify quality, drawing sheet 13 from US 2026/0367889 A1
Sheet 13 Generating quick draft answers with smaller models to verify quality
The AI setup that turns prompts into text replies, drawing sheet 14 from US 2026/0367889 A1
Sheet 14 The AI setup that turns prompts into text replies
Step-by-step calculations the AI uses to produce text, drawing sheet 15 from US 2026/0367889 A1
Sheet 15 Step-by-step calculations the AI uses to produce text
Chips that read sensors and run the on-device AI, drawing sheet 16 from US 2026/0367889 A1
Sheet 16 Chips that read sensors and run the on-device AI
Hardware components inside the device running the AI model, drawing sheet 17 from US 2026/0367889 A1
Sheet 17 Hardware components inside the device running the AI model
Patent filing page

More in AI assistant & agent

All 436 AI assistant & agent patents →

Watchlists this filing belongs to

All watchlists →
Reader comments

No comments yet

Start the discussion

Real name or a handle, either is fine. Comments are read by a person before they appear, so allow a little time. Keep it about the filing.