tittle - a tiny 2M parameter model for punctuation and numbers after ASR
3 min readupdated
The compact AI model tittle by author n4ze3m formats raw text from automatic speech recognition (ASR) systems, which typically output continuous lowercase text without punctuation. Trained from scratch (without pre-trained weights), the model inserts commas, periods, and question marks, restores uppercase letters, acronyms, and special brand spellings like iPhone and YouTube, and converts number words into digits (for example, "nineteen eighty four" to "1984"). Featuring a 4-block architecture with self-attention and depthwise convolution, the model weighs just 8.3 MB in ONNX format and runs without a graphics card — making it useful for developers of voice assistants, subtitles, and English transcription pipelines.
Key features
- High CPU speed: processes about 14,400 words per second in a single PyTorch thread and up to 33,500 words per second via ONNX Runtime (on 8 AMD EPYC vCPUs).
- Casing and brand restoration: distinguishes between normal lowercase, initial uppercase, full UPPERCASE (such as NASA), and a dictionary of 2,411 words with special spellings (iPhone, YouTube).
- Number word to digit conversion: finds integer numbers in text and transforms them using deterministic rules with round-trip validation to avoid breaking ambiguous phrases like "five or six".
- Streaming mode and browser support: the repository includes a ready-to-use JavaScript implementation (
tittle.jsandnumbers.js) on top ofonnxruntime-webwith aLiveWriterclass for live subtitles with a latency of just 4 words.
What you can do
- Whisper or Vosk output post-processing: clean up long transcripts of interviews, podcasts, and calls on a server without a GPU or directly on a client device.
- Live subtitles in a web application: integrate the JavaScript version with
LiveWriterin a browser or Node.js to format a user's speech stream on the fly. - Lightweight pipeline without PyTorch: run the 8 MB
onnx/model.onnxfile via ONNX Runtime in microservices with strict memory limits.
Example
from tittle.infer import Punctuator
p = Punctuator.load("tittle", onnx=True)
res = p.text("okay so i was born in nineteen eighty four and i still use an iphone")
print(res)
# Okay, so I was born in 1984 and I still use an iPhone.Read more
DetailsParameters: 2,039,691 (4.1 MB in PyTorch fp16, 8.3 MB in ONNX fp32), Apache-2.0 license.
Training: 140.2 million words from English YODAS dataset subtitles on a single RTX 3090 in 1 hour and 45 minutes.
Quality (F1): period - 69.4, question mark - 64.4, comma - 54.2, uppercase - 80.8, UPPER - 82.8, numbers - 89.8% recall at 85.4% precision.
Limitations: English language only; supported punctuation is limited to commas, periods, and question marks; only whole numbers are converted to digits (no fractions, currencies, or percentages).










Comments