NextWord

Compact phrase completion

2026-10-07

The opportunity

  • Mobile typing is slow.
  • A useful predictor must respond quickly.
  • The official English corpus contains:

4,269,678 lines

Evaluated in R: sum(c(899288,1010242,2360148))

The algorithm

  1. Normalize and filter text.
  2. Search the four-gram context.
  3. Back off through tri-, bi-, and unigram tables.
  4. Return one word plus alternatives.

Evidence and limits

  • 193,477 held-out tokens
  • Top-1 accuracy: 12.44%
  • Top-3 accuracy: 20.07%
  • Sampled and domain-sensitive

The product

Enter a phrase and press Predict next word.

The compact model gives an immediate result and explains its context order and limitations.