Skip to TinyFix contextual autocorrect console

text2text-generation · Bidirectional GRU + 80k Lexicon · WASM · quint8 · 3.55 MB · MIT

TinyFix — Bidirectional Contextual Autocorrect

A 1.9M-parameter bidirectional GRU (paperweight/tinyfix, 2.09 MB quint8 ONNX + 80,000-word lexicon = 3.55 MB total) that reads 16 words left and 4 words right to catch real-word mix-ups (form/from, their/there/they're, to/too, your/you're) and QWERTY typos completely locally in CPU WebAssembly.

Live Contextual Proofreader

Two-stage local correction: Misspellings (recieve → receive) are searched in an 80,000-word flat Trie with QWERTY edit costs and re-ranked by the left GRU. Real words in the wrong place (letter form the harbor → from) are scored against up to 8 confusion & 1-edit neighbors using both left (16 words) and right (4 words) context — while valid uses (fill out the form) stay quiet.

Ready to download or initialise paperweight/tinyfix (3.55 MB quint8 WASM).

Inline diff (<del> / <ins>)

Initialise TinyFix and click Proof text to highlight contextual edits inline.

Cleaned output

Accepted edits above the confidence threshold appear here as clean copy.
Backend–
Latency–
Words checked–
Protected skipped–
Applied fixes–
Held back–
NaN check–

See inside — Top-k GRU lexicon candidates

Select any flagged edit below to inspect the exact candidate set scored by wrong-word.onnx, its raw bidirectional GRU logits, margin over the typed word, and QWERTY keyboard typo cost. Dragging the confidence slider above immediately updates which edits apply without re-running inference.

Candidate probabilities & margins

Run Proof text to inspect top-k bidirectional GRU candidates.

Bidirectional GRU logit profile

Green = top-1 accepted replacement; amber = originally typed word (*); indigo = competing lexicon neighbors.

At a glance

Model paperweight/tinyfix (revision 5b1491e3e3a59ca75a51a952912ca1200b172d87, created for offlinepage.app)
Task text2text-generation — contextual real-word autocorrect & spelling correction
Architecture Two single-layer GRUs (left-to-right 16 words + right-to-left 4 words) joined and scored against up to 9 candidate embeddings (1.9M params, 64-dim embeddings, 256 hidden size, plain matrix multiplies for 8-bit ONNX quantization)
Vocabulary & lexicon 20,000 lowercase GRU words + 5 special tokens (<pad>=0, <unk>=1, <num>=2, <start>=3, <name>=4), ~160 confusion groups (wrong-word-confusions.txt), and an 80,000-word frequency Trie (words.txt)
Tensor I/O shape Inputs: left [B, 16], right [B, 4] (reversed), candidates [B, 9] (int64) → Output: scores [B, 9] (float32 logits)
Quantisation & download quint8 (8-bit quantized ONNX graph) · 3.55 MB decimal (3,549,457 bytes · 3.39 MiB total: wrong-word.onnx 2.09 MB + words.txt 1.28 MB + wrong-word-vocab.txt 0.17 MB + wrong-word-confusions.txt 2.9 KB)
Backend & runtime CPU WebAssembly (wasm) via onnxruntime-web 1.21.0 in a dedicated module Web Worker — no WebGPU required (~3 ms per word check in Chrome)
Training data ~120M words of self-supervised English text (70M FineWeb-Edu + 50M SmolTalk + OpenAssistant), with 25% of examples centered on 160 human confusion groups (half unswapped to teach restraint)
License MIT License (verified from paperweight/tinyfix LICENSE & model card)
Honest limitations English-only. Model-card benchmarks report 69% fix rate (99% precision) on classic mix-ups, 29% on real-word finger slips, and 18% on GitHub commit typos (~1 wrong edit per 2,000 clean words in Careful mode). Stays quiet when both words fit context, cannot judge words outside its 20,000-word GRU vocabulary, and needs right-hand words before firing a real-word swap.

See inside the code

Show the code — worker.js: checkManuscript() (off-main-thread 2-pass TinyFix proof loop)
Show the code — tinyfix-core.mjs: rankWrongWordCandidates() (GRU margin & QWERTY cost ranking)