Workflow · Production

Grammarly builds an on-device personal language model for iOS keyboard personalization

The problem

Mobile phone keyboards fail to recognize personal vocabulary such as nicknames or project-specific terms, giving unhelpful auto-corrections that disrupt the user experience.

Workflow diagram · grounded in source
1
User types unfamiliar term
trigger
“typing a word that we use frequently—our pet's nickname or the name of a project at work—only to have our keyboard not recognize this term and give us an unhelpful correction instead”
2
Noise detection filtering
validation
“Noisy inputs are casual versions of actual words—they might include extra vowels or consonants to convey tone ("awwwww"), have missing apostrophes ("cant"), or use incorrect capitalization ("i agree"). We excluded these inputs from our l…”
3
Trust-but-verify word learning
ai_action
“we use edit-distance-based frequency thresholding to determine when the candidate has met the necessary criteria to go from learning to suggesting”
4
Time-based vocabulary decay
ai_action
“applying a time-based decay function that dynamically adjusted word probabilities based on how recently the word was used”
5
Personalized suggestion delivery
output
“tailoring suggestions to the words you use, even if they're not in the standard dictionary”
Reported outcome

The personalized language model was shipped to over 5 million mobile devices and produced a significant decrease in reverted suggestions and a slight increase in accepted suggestions, indicating better modeling of how users communicate.

Reported metrics
Devices deployedover 5 million
Rate of reverted suggestionssignificant decrease
Rate of accepted suggestionsslight increase
model RAM usageminimal RAM usage
Reported stack
Grammarly Keyboardregex filtersmemory-mapped key-value store
Source
https://www.grammarly.com/blog/engineering/personal-language-model/
Read source ↗

Frequently asked questions

What did this team achieve with this AI workflow?

The personalized language model was shipped to over 5 million mobile devices and produced a significant decrease in reverted suggestions and a slight increase in accepted suggestions, indicating better modeling of how…

What tools did this team use?

Grammarly Keyboard, regex filters, memory-mapped key-value store.

What results were reported?

Devices deployed: over 5 million; Rate of reverted suggestions: significant decrease; Rate of accepted suggestions: slight increase; model RAM usage: minimal RAM usage (source-reported, not independently verified).

How is this workflow AI workflow structured?

User types unfamiliar term → Noise detection filtering → Trust-but-verify word learning → Time-based vocabulary decay → Personalized suggestion delivery.