Oscillator streaming speech recogniser (10.4 M parameters, one C file)

A small English speech recogniser that transcribes while you speak, built for a handheld ARM computer (ClockworkPi uConsole). Text appears every 320 ms, not after you stop, from a single dependency-free C file.

  • Fastest of the six recognisers tested on one slow ARM core: RTF 0.45 on a Cortex-A53, against 0.53 to 11.5 for a streaming Zipformer, Moonshine and Whisper.
  • Lightest: 86 MB peak memory on short clips.
  • Constant cost on long audio. The state is a fixed size, so an 87-second recording runs faster (RTF 0.34) in 111 MB. On the same file Moonshine needs 1.75 to 2.2 GB and Whisper runs slower than real time.
  • Accuracy: 8.7 % WER on LibriSpeech test-clean and 25.3 % on test-other. That is usable for dictation on clean speech, but well behind Whisper and Moonshine (see the table below).

It is a research model. The point is the architecture and its cost, and every result here was predicted in writing before it was measured.

How it works

  • Front end: a bank of 64 damped complex oscillators running at the 16 kHz sample rate, z_t = c z_(t-1) + x_t with c = exp(-dt/tau + 2 pi i f dt). Frequencies and decay times are learned. There is no FFT and no convolution. Every 20 ms, the bank's state (real, imaginary, energy) is the feature vector.
  • Backbone: six recurrent blocks of complex poles at 50 Hz, with learned decay times from under one frame to about 8 s, each followed by a gated MLP. There is no attention: the state is a fixed size, so cost and memory per second of audio are constant, and output is available as the audio arrives.
  • CTC over characters, decoded greedily as you speak and re-decoded at each pause with a word 3-gram (prefix beam search, also in the C file).

Results

Against other small recognisers

LibriSpeech, word error rate (lower is better), on all 2,620 test-clean and 2,939 test-other utterances. Speed and memory were measured on the uConsole (Rockchip RK3399), plugged in, as the median of three passes, with model and LM loading included. Real-time factor (RTF) is compute seconds per second of audio. "Joined" means the 87-second file made by joining the 12 bench clips. EXP-0052.

system test-clean test-other RTF, 1 A53 core RTF, 4 cores RTF, joined 87 s, 1 core peak RSS, MB (clips / joined)
this model, int8 + 3-gram 9.1 % 26.1 % 0.45 (1 thread) 0.34 86 / 111
sherpa-onnx streaming Zipformer 20M, int8 11.1 % 19.0 % 0.53 (1 thread) 0.55 166 / 106
Moonshine tiny 4.6 % 11.8 % 0.63 0.39 2.58 256 / 1,752
Moonshine base 3.4 % 8.3 % 1.26 0.62 4.66 459 / 2,157
whisper tiny.en 5.1 % 12.4 % 5.18 1.33 2.66 182 / 258
whisper base.en 3.9 % 9.5 % 11.47 2.88 5.38 290 / 367

This model's row uses the original 23.9 MB 3-gram at alpha 0.7, beta 1.0. The default below is slightly more accurate. On short clips with four cores free, Moonshine tiny is the stronger choice. On one core and on long audio, this model is.

On the faster Cortex-A72 core, the same int8 + 3-gram build runs at RTF 0.16.

This model's decoders

Beam width 64, int8 C program. The language model is LibriSpeech's own 3-gram (OpenSLR 11), pruned. Its weights were chosen on dev sets, never on test. EXP-0049, EXP-0054.

decoder test-clean test-other peak RSS A53 RTF
greedy (PyTorch) 16.8 % 37.9 %
3-gram 3e-7 (23.9 MB), alpha 0.7, beta 1.0 (the first release) 9.05 % 26.1 % 86 MB
3-gram 3e-7 (23.9 MB), alpha 0.7, beta 2.0 9.08 % 25.7 % 86 MB 0.40
3-gram 1e-7 (56.4 MB), alpha 0.7, beta 2.0 (default) 8.65 % 25.3 % 117 MB 0.42

The RTF column in this table comes from a different session than the comparison table above. A53 timings vary by up to 40 % between sessions, so only compare numbers within one table.

What was tried and did not help

Each of these changes was pre-registered with a numeric prediction, then trained and scored on the same test sets. All are written up, including the failures:

change result record
Data augmentation 1-3.5 % relative gains, all under the minimum effect EXP-0053
Subword units (BPE 256) instead of characters greedy test-clean 3.5 % worse EXP-0055
200 ms lookahead gains under the minimum effect EXP-0063
Input-dependent (Mamba-style) decay worse, +2.7 points WER EXP-0064

The model scores about twice as well on training audio as on test audio. Model size is the largest lever not yet tested.

Use

cc -O3 -ffast-math -fno-finite-math-only -o zara_stt zara_stt.c -lm
./zara_stt model.bin speech.wav --int8 --lm librispeech-3gram-1e-7.zlm --alpha 0.7 --beta 2.0   # 16 kHz mono WAV
arecord -q -f S16_LE -r 16000 -c 1 -t raw | ./zara_stt model.bin --stream --int8 --lm librispeech-3gram-1e-7.zlm --alpha 0.7 --beta 2.0

For the smallest memory use (86 MB), use librispeech-3gram.zlm with the same weights. --stream prints letters live and a cleaned-up line after each pause. On the uConsole headset, use dictate.sh (the codec delivers the mic as left minus right).

Training

  • Data: LibriSpeech 960 h (train-clean-100, -360 and -other-500), 16 kHz mu-law.
  • Schedule: 150,000 updates of 240 s batches (about 11.3 passes) on one NVIDIA RTX 3090: about 28 hours and about $7.
  • Shape: osc front (64 poles), 6 blocks of width 448, gated MLP 672.
  • Optimiser: Muon on the blocks' matrices (Nesterov momentum, Newton-Schulz orthogonalised updates), AdamW for everything else. Peak learning rate 3e-3, 200 warmup updates, cosine decay to 10 %.

Limitations

  • English read speech only. Accents and microphones outside LibriSpeech are weaker.
  • No punctuation or capitals.
  • The language model is built from public-domain books, so modern and technical words are often misrecognised.
  • Accuracy is well below Whisper, Moonshine and production recognisers.

Files

  • zara_stt.c: inference (oscillator bank, blocks, int8 NEON kernels, beam search, streaming).
  • model.bin, params.pt: the model, for the C program and for PyTorch.
  • librispeech-3gram-1e-7.zlm (default) and librispeech-3gram.zlm: the 3-grams, in the C file's format.
  • zara_stt.py, zara_block.py: training (model, block, optimiser).
  • mulaw.py, pack_libri.py, export_c.py, export_lm.py, score_lines.py, dictate.sh, SHA256SUMS.

Credits

Roland Sharp, with Claude (Anthropic). Muon: Jordan et al. (2024); Liu et al. (2025), "Muon is Scalable for LLM Training". Data: LibriSpeech audio (Panayotov et al., 2015), CC BY 4.0 (OpenSLR 12). The 3-grams and vocabulary are from OpenSLR 11 (public domain).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train rolandnsharp/oscillator-asr