A private, on-device predictive keyboard
On-Device
Predictive Keyboard
TypeAhead — thesis defense, Computer Science Department
Defense roadmap
The problem —
keystrokes leave the phone
Every major mobile keyboard (Gboard, SwiftKey) ships raw keystrokes to cloud servers for next-word prediction — a privacy liability class-action suits have already targeted.
Three design principles
TypeAhead: on-device,
federated, adaptive
On-device inference
A 2.1M-parameter transformer runs entirely on-device via Core ML / NNAPI. No keystroke ever leaves the phone — verified by packet-capture across 40 hours of typing.
Federated fine-tuning
Personalization trains locally overnight and syncs only encrypted gradient deltas — the same class of protocol behind Gboard's federated learning, rebuilt at capstone scale.
Adaptive vocabulary
A per-user trie re-ranks candidates against typing history, so names, slang, and jargon surface within roughly 200 keystrokes without retraining the base model.
The question isn't whether an on-device model can predict text — it's whether it can do it as well as the cloud, without the privacy trade-off.
— Prof. Elena Cho, thesis advisor
On-device accuracy
Evaluated on a held-out set of 50,000 keystrokes from 12 volunteer typists, TypeAhead matches Gboard's cloud model (95.1%) within 0.9 points — using a model 40× smaller.
Latency benchmark — Pixel 7, cold cache
18ms beats the 340ms cloud round trip
Existing keyboards — versus TypeAhead
Cloud keyboards (Gboard, SwiftKey)
- Keystrokes leave the device
- No offline personalization
- 120–340ms median latency over the network
- Opaque to independent audit
TypeAhead (this thesis)
- 100% on-device inference, no network calls
- Federated personalization, encrypted deltas only
- 18ms median latency, no radio required
- Open evaluation harness + full weights released
Four contributions of this thesis
2.1M-param transformer
A quantized 8-bit transformer that fits in 6.8MB and runs inference in under 20ms on a mid-range 2021-era phone.
Federated update protocol
A gradient-delta sync protocol that personalizes overnight on Wi-Fi and charge, verified to leak no raw text in transit.
Privacy-utility benchmark
A reproducible 12-participant, 50K-keystroke harness comparing on-device and cloud keyboards on accuracy, latency, and battery.
Open weights & code
Full model weights, training scripts, and the eval harness published for the department's future capstones to build on.
Yes, it scales —
within limits.
Committee question addressed: given six more months, TypeAhead's federated protocol generalizes to any keyboard vocabulary — the constraint is per-language training data, not architecture.