Case study · Gmail Smart Compose · Google
Suggestions faster than a keystroke
Smart Compose finishes your sentence as you type, and to feel like part of typing it had to arrive in about a tenth of a second.
The problem
A writing suggestion helps only if it shows up before the person types the next word. If it arrives late, it lands on words already typed or breaks the thought. The team had to get a language model to answer in the gap between keystrokes, for a product with more than 1.4 billion users at the time.
- 1Types 'Thanks for the'
- 4Shows 'quick reply!' after the cursor
- 5Presses Tab to accept
The whole round trip has to fit in the gap between two keys.
The design decisions
- Set a speed budget first
The team aimed for suggestions to arrive within about 100 milliseconds, fast enough that people would not notice a delay. The first version, on ordinary processors, took hundreds of milliseconds. Moving the work to Google's TPU chips brought it down to tens of milliseconds, so the suggestion shows up before the next key is pressed.
- Put the words in the sentence
Suggestions appear right after the cursor as you type, and Tab accepts one. Taking the help costs a single key, so the writer's hands stay on the keyboard and the sentence keeps moving.
- Use what is already on the screen
The model reads the words typed so far, the subject line and, in a reply, the email being answered. Those clues let it suggest words that fit the thread, and the writer never has to explain what the email is about.
- Let people choose how personal it gets
Personalised suggestions follow the way a person normally writes, and only that person sees them. In Settings, switching off Smart Compose personalization gives generic suggestions, and another setting turns writing suggestions off. The models were also tested to make sure they only memorise common phrases used by multiple people, so one person's private wording doesn't turn up in someone else's draft.
What to take from it
- Set a time budget before designing an AI feature that runs while people type.
- Use context already on the screen so people do not have to explain themselves.
- Let people turn personalisation down or off with a clear setting.
Start a reply in Gmail on a computer and count how many words you type before a suggestion appears. Then open Settings, See all settings, and find Smart Compose and Smart Compose personalization under General. Smart Compose works in English, Spanish, French, Italian and Portuguese.