SwiftKey Next-Word Predictor

Abanti Mukherjee
October 2026

Executive Pitch: Fast, Lightweight Predictive Text Engine

1. The Problem & Product Solution

Users typing on mobile and web interfaces need instant, accurate next-word suggestions that run within tight memory limits.

  • Real-Time Inference: Predicts the next word in < 15 milliseconds.
  • 100% Phrase Coverage: Handles Twitter slang, news phrases, and unseen contexts without errors.
  • Ultra-Lightweight: Operates under 5 MB of RAM for seamless cloud and mobile deployment.

2. Predictive Algorithm: Stupid Backoff

Our model implements the Stupid Backoff N-gram algorithm (Brants et al., 2007) trained on the HC Corpora (Blogs, News, Twitter):

  • Tier 1 (4-Gram): Matches the last 3 words entered by the user.
  • Tier 2 (3-Gram Backoff): Backs off to the last 2 words with penalty weight (lambda = 0.4).
  • Tier 3 (2-Gram Backoff): Backs off to the last 1 word (lambda = 0.16).
  • Tier 4 (Unigram MLE): Guarantees a high-frequency fallback prediction for unseen words.

3. Benchmark Performance & Validation

Tested across 5 standard Twitter and News benchmark phrases with the final word removed:

Input Phrase Predicted Word Model Tier Triggered
Thanks for the follow 4-Gram Match
At the end of the 4-Gram Match
Looking forward to seeing 3-Gram Backoff
In New York city 3-Gram Backoff
Unseen news phrase the Unigram Fallback

4. How the App Works & Live Demo

User Instructions: 1. Open the Shiny app link and type any English phrase into the text box. 2. Click Predict Next Word (or view the instant reactive update). 3. Review the predicted word, normalized text, and candidate score table.

Try the Live Application: