How does autocorrect guess the word you meant?
Your finger lands between two keys. How does the keyboard choose?
Two clues, one guess.
The first two taps are C, then A. Move the last tap between R and T.
Longer bars mean a better fit. The guess combines both clues.
car
catbest guess
A tiny example with two words. Real keyboards consider many more. These scores are made up to show how the clues work.
The guess right now
Why cat?
The last tap is closer to R, so the nearest keys spell “car”. But “Feed the cat” fits the sentence better. Together, the two clues favor “cat”.
It learns which words go together.
A tap gives the keyboard a place on the screen. Near a key’s edge, that place might fit more than one letter. The nearest key is one clue, but the words around it give another.
A language model learns patterns from examples of text. “Feed the cat” is a better fit than “Feed the car”. Change the sentence to “Park the…” and car makes more sense. The taps can stay exactly the same.
In the drawing, the tap fit and sentence fit are multiplied for each word. The word with the higher combined score wins. Real keyboards search many possible words, and their models can be much more complicated.
The sentence changes the guess. The taps don’t move.
A real word can still be the wrong word.
Car and cat are both spelled correctly. Autocorrect still has to guess which one you meant. A sentence can tip it toward the wrong one, especially when you use an unusual phrase or a name it rarely sees.
A guess isn’t a promise.
The best guess is the word that fits the available clues, even if you meant something else. A keyboard also has to decide whether the evidence is strong enough to replace your word automatically or just offer a suggestion. That choice varies between keyboards. This drawing shows the guess, not that extra decision.
Put a name to the word patterns
Language model
A model that learns patterns from text to estimate which words fit together. It can help a keyboard guess what you meant, but it can’t know for sure.
“The language model favors ‘cat’ after ‘Feed the’.”