Grammar Correction Model for iPhone Runs Fully Offline

Grammar correction model for iPhone running inside the Mochi keyboard

A developer building an iPhone keyboard called Mochi has trained a grammar correction model for iPhone that runs entirely on the device. On an iPhone 14 it handles a sentence in roughly 0.2 seconds, and it scores 57.0 on the BEA-2019 dev benchmark, up from 42.5 for months.

That puts it in the same range as GECToR-2024, a model 2.6 times larger. Nothing is sent to a server.

Why run it on the phone

The developer argues that cloud dependence is often a habit rather than a need, and that it also keeps users tied to an account. A keyboard sees everything you type, so they’d rather it live on the phone than be rented from a company that can change terms or shut it down. Mochi needs no account and works in airplane mode.

The developer’s other apps follow the same idea of small local models: Spellforge for spelling in Fonts Pro, Luni for on-device text-to-speech and Lunara for voice-guided meditation.

Grammar correction score against model size on BEA-2019 dev
Image: Pixdeo

The memory budget is tight

Any grammar correction model for iPhone keyboards has to fit a strict limit. A keyboard extension is allowed only about 77 MB on an iPhone 14 and around 177 MB on an iPhone 16. Grammar is harder than spelling because the fix depends on the whole sentence. Take “She go to school yesterday”: the error sits in “go”, but the clue that it should be “went” is “yesterday”, three words later. Hand-written rules can’t keep up, since every rule has exceptions.

How the score went from 42.5 to 57.0

Early models started in the 20s. The first useful one was TITO, a small BERT-style model that learned by copying a larger one. Kiki 1 added a decoder and reached 42.5, then stalled for months while experiments with diffusion models and a tiny recursive model failed. The recursive one never passed 23.

In mid-November the developer restarted training with Claude Opus 5.5 and changed three things:

  • The model edits a sentence instead of rewriting it, marking words to change and proposing replacements.
  • A small judge model decides which proposed edits to apply.
  • Depth grew from 9 to 14 to 22 layers, adding 1 to 2 points each time.

The result, Kiki 2, scored 56.9 F0.5 on the dev set, and 57.0 running in Swift on the phone. Training ran on one rented RTX 5090. The 14-layer version needed 15 hours (about $10) and Kiki 2 needed 21 hours (about $15).

An ensemble of Kiki 2 with four other models reached 59.2, above T5-11B at 58.6, but five models per sentence is too heavy for a keyboard. Alone, Kiki 2 trails T5-11B by 1.6 points, while that model is 80 times larger.

What the benchmark misses

The benchmark has one reference correction per sentence, so a different but valid fix counts as an error. It rates Kiki 2’s precision at 62.5%. The developer reviewed 80 edits it marked wrong and found about 65% were fine. A separate model reader accepted 92% of 300 such edits. That puts true precision between 87% and 97%. On 600 real messages, it was 94%.

Ideas that failed

Most November experiments did nothing. Repeating layers for free depth made each sentence 7% to 14% slower with no gain. A second round of corrections was right only 18% of the time. Six copies voting added 0.4. Six-bit weights lost 7 points, while going to 8-bit lost nothing, which is what the phone uses. Going past 22 layers stopped making sense because the model gets much heavier.

Languages and release plans

Mochi shows a row of suggested changes above the keyboard after a sentence or a pause, with a Fix button and a few seconds to undo. English checks take about 200 ms and Spanish about 100 ms. Spanish, Portuguese and German checkers are planned for the first beta, and mixed-language text keeps words from your other language, so “muy” no longer becomes “my.” Spellforge 2 covers 10 languages. The developer says the App Store submission is happening now, and whether more languages follow depends on demand. A grammar correction model for iPhone at this size suggests that private, offline writing tools are practical on current hardware.

Source: Pixdeo

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.