A 9M-Parameter Speech Model Proves Voice AI Doesn't Need to Be Big to Be Precise — Lessons for Navigation

# A 9M-Parameter Speech Model Proves Voice AI Doesn't Need to Be Big to Be Precise — Lessons for Navigation **Posted on January 31, 2026 | HN #2 · 204 points · 74 comments** *Simon Edwardsson built a 9M-parameter Mandarin pronunciation tutor that runs entirely in-browser at 11MB. Instead of auto-correcting speech like Whisper (sequence-to-sequence), it uses CTC (Connectionist Temporal Classification) to tell you exactly what you said—wrong tones included. The tiny Conformer model achieves 98.29% tone accuracy on AISHELL validation set, barely worse than a 75M-parameter version. The lesson for Voice AI navigation: precision doesn't require scale. Small, task-specific models that refuse to auto-correct can outperform large general-purpose models that guess intent. When Voice AI navigation misunderstands "Find pricing" as "Find privacy," users need honest feedback, not silent auto-correction.* --- ## The Problem: Language Learning Needs Brutal Honesty, Not Helpful Auto-Correction Simon's motivation: Mandarin pronunciation is hard. Tones are foreign to English speakers. He's bad at hearing his own mistakes. No teacher available for instant feedback. Existing commercial APIs offer pronunciation training, but they auto-correct. When you say the wrong tone, they guess what you meant and transcribe the correct syllable. That's useful for transcription. It's useless for learning. **The requirement:** A model that tells you what you actually said, not what you probably meant. This sounds simple. Modern speech models are incredibly good at transcription. But transcription optimizes for understanding intent despite errors. Pronunciation training requires the opposite: **catching errors despite understanding intent.** --- ## The Architecture: Conformer + CTC Instead of Seq2Seq Most modern ASR systems (Whisper, etc.) use **sequence-to-sequence** architecture: - Audio goes in - Text comes out - Model predicts the most likely transcription **The problem for pronunciation training:** If you say "zhōng" (tone 1) but meant "zhòng" (tone 4), a seq2seq model will auto-correct based on context. It knows you probably meant "重" (heavy), so it outputs tone 4 even though you said tone 1. Simon's solution: **CTC (Connectionist Temporal Classification)** CTC outputs a probability distribution for every audio frame (~40ms chunks). Instead of predicting a likely sequence, it predicts what tokens are present at each time step. **Example output for "hello":** ``` h h h e e l l l l l l o o o ``` Collapse repeats, remove blanks → `hello` **The key difference:** CTC forces the model to handle what you actually said, frame by frame. No auto-correction. If you say tone 1 when you meant tone 4, CTC outputs tone 1. --- ## Why Conformer? Local + Global Patterns in Speech Speech recognition requires capturing two types of patterns: ### 1. Local Interactions (Short-Range) The difference between retroflex "zh" and alveolar "z" happens in milliseconds—a split-second spectral shift. **CNNs excel at this:** They detect short-range patterns in spectrograms (frequency bands, formant transitions). ### 2. Global Interactions (Long-Range) Mandarin tones are relative and context-dependent: - "High" pitch for an adult male is "low" pitch for a child - Tone sandhi: Tone 3 + Tone 3 becomes Tone 2 + Tone 3 ("你好" → "ní hǎo") **Transformers excel at this:** They model long-range dependencies across time steps. ### Conformer = CNN + Transformer Conformers combine both architectures: - **Convolution layers** capture local spectral features - **Self-attention layers** model global context (tone patterns, speaker characteristics) Result: 9M-parameter model achieves 98.29% tone accuracy. --- ## The Tokenization Decision: Pinyin + Tone as First-Class Tokens Most Mandarin ASR systems output **Hanzi** (Chinese characters). This hides pronunciation errors because the writing system encodes meaning, not sound. Example: - User says: "zhōng" (tone 1, meaning "middle") - User meant: "zhòng" (tone 4, meaning "heavy") - Hanzi output: "重" (the model guessed based on context) - **User feedback:** "Correct!" (even though the tone was wrong) Simon's approach: **Tokenize Pinyin syllable + tone** - `zhong1` = one token - `zhong4` = completely different token Vocabulary size: **1,254 tokens** (every valid Pinyin syllable × 5 tones, plus `` and ``) If you say the wrong tone, the model explicitly predicts the wrong token ID. No guessing. No context-based auto-correction. --- ## The Training Data: 300 Hours, 8 Hours to Train **Datasets:** - AISHELL-1 + Primewords (~300 hours total) - Mostly read speech (formal enunciation, clear tones) **Augmentation:** - SpecAugment (time/frequency masking to improve robustness) **Hardware:** - 4× NVIDIA GeForce RTX 4090s - Training time: ~8 hours **Metrics tracked:** 1. **TER (Token Error Rate):** Overall accuracy 2. **Tone Accuracy:** Accuracy specifically for tones 1-5 3. **Confusion Groups:** Errors between difficult pairs (zh/ch/sh vs z/c/s) Final model: **5.27% TER, 98.29% tone accuracy** --- ## The Compression: 75M → 9M Parameters with Minimal Accuracy Loss Simon started with a "medium" model (75M parameters). Worked well, but too large for in-browser inference. He kept shrinking it: | Parameters | TER | Tone Accuracy | |------------|-----|---------------| | 75M | 4.83% | 98.47% | | 35M | 5.16% | 98.36% | | **9M** | **5.27%** | **98.29%** | **The surprising result:** 75M → 9M parameters = only +0.44pp TER degradation. **Simon's conclusion:** The task is **data-bound, not compute-bound.** With 300 hours of training data, a 9M-parameter model can extract nearly all learnable patterns. More parameters don't help because the bottleneck is data coverage (speaker diversity, accent variation, recording conditions), not model capacity. **Further compression:** - FP32 model: ~37 MB - INT8 quantization: ~11 MB (negligible accuracy drop: +0.0003 TER) - Small enough to load instantly via `onnxruntime-web` --- ## The Deployment: Entirely In-Browser, 13MB Download The final model runs 100% client-side: - No API calls - No server-side inference - No privacy concerns (audio never leaves your device) **Download size:** ~13MB total (model + web app) For comparison: The average webpage in 2026 is ~2-3MB. Simon's entire speech recognition system is 4-5× larger than a typical webpage, but still small enough for instant loading on modern connections. **Inference speed:** Real-time on laptop CPUs, runs smoothly in Chrome/Firefox/Safari via WebAssembly. --- ## The Alignment Bug: Why Silence Breaks Everything CTC tells you **what** was said, but not exactly **when**. For a 3-second audio clip: - Model outputs ~150 time steps (columns) - Each time step has probabilities over all 1,254 tokens (rows) - Most of the matrix is `` (silence or transitions) To highlight mistakes in the UI, Simon needed **forced alignment:** map each syllable to specific time ranges in the audio. **The bug:** Leading silence ruined confidence scores. **Scenario:** - User records: [1 second silence] "我喜欢…" - Model alignment: Assigns silent frames to `wo3` (first syllable) - Confidence calculation: Averages probabilities over that span - Result: Overwhelming `` probability drowns out `wo3` - **Reported confidence: 0.0** (even though pronunciation was correct) ### The Fix: Decouple UI Spans from Scoring Frames Simon separated: 1. **UI spans:** What gets highlighted for the user 2. **Scoring frames:** What contributes to confidence calculation **Algorithm:** ```python def _filter_nonblank_frames(span_logp, blank_id=0, thr=0.7): """Only keep frames where P() < 0.7""" p_blank = span_logp[:, blank_id].exp() keep = p_blank < thr if keep.any(): return span_logp[keep] return span_logp # Fallback if entire span is silence ``` **Result:** Ignore frames where the model is >70% confident it's seeing silence. Only score frames where actual speech is detected. **Impact:** Confidence for the first syllable jumped from **0.0 → 0.99** after the fix. --- ## The Domain Shift Problem: Native Speakers Complained Beta testers included native Mandarin speakers. Their feedback: **"I have to over-enunciate to get marked correct."** Why? **Training data:** AISHELL-1 and Primewords are mostly **read speech**—formal, careful enunciation, clear tone pronunciation. **Real usage:** Casual conversational speech is faster, more slurred, with tone reduction and coarticulation. **The mismatch:** - Model trained on: "Nǐ hǎo" (carefully articulated, distinct tones) - Native speakers say: "Ni ha" (casual, tone reduction, elision) - Model marks it incorrect because it doesn't match training distribution **The same problem affects kids:** Their pitch is higher (different fundamental frequency range), and children are mostly absent from AISHELL training data. **Simon's next step:** Add conversational datasets like Common Voice to cover casual speech patterns. --- ## What Voice AI Navigation Can Learn from This Simon's 9M-parameter pronunciation tutor reveals design principles that apply directly to Voice AI navigation: ### 1. Task-Specific Models Beat General-Purpose Auto-Correction **Pronunciation training:** Don't want auto-correction. Need to know what user actually said. **Voice AI navigation:** Don't want silent auto-correction when user says "Find pricing" but model hears "Find privacy." **Current navigation models:** Optimized for intent understanding (sequence-to-sequence). If user says "pricing" but the model thinks they meant "privacy" based on page context, it navigates to privacy policy. **Better approach:** CTC-style output that tells user what it heard: "I heard 'privacy.' Did you mean 'pricing'?" User confirms or corrects. **Result:** User learns model's limitations, provides clarification, gets to correct destination. Model learns from correction. ### 2. Precision Doesn't Require Scale Simon's results: | Model Size | Accuracy Drop vs. 75M | |------------|----------------------| | 35M params | -0.11% tone accuracy | | 9M params | -0.18% tone accuracy | **The lesson:** For well-defined tasks with sufficient training data, tiny models achieve near-parity with large models. **Voice AI navigation equivalent:** Navigation-specific 10-50M parameter models could match or exceed general-purpose 70B+ models for site structure understanding, if trained on navigation-specific datasets (user queries → correct page mappings). **Why this matters:** - 10M-parameter models run client-side on phones/browsers - 70B+ models require server inference (latency, privacy concerns, cost) - Tiny models enable offline navigation (no internet required) ### 3. Training Data Distribution Matters More Than Model Size **Simon's native speaker problem:** Model trained on read speech struggles with casual speech. **Voice AI navigation equivalent:** Models trained on standard e-commerce sites (Pricing in header, Features in nav) struggle with unconventional sites (Enterprise pricing behind contact form, Features tab hidden in mobile menu). **The fix:** Collect training data covering edge cases, not just common patterns. **For navigation:** - Include non-standard site structures - Cover mobile-specific navigation patterns - Add sites with unconventional terminology ("Solutions" instead of "Features") ### 4. Forced Alignment = Navigation Transparency **Simon's forced alignment:** Shows user exactly which syllable was wrong and when. **Voice AI navigation equivalent:** Show user exactly which navigation decision was uncertain. Example: - Voice AI navigates to /privacy instead of /pricing - **Without alignment:** Silent error, user arrives at wrong page - **With alignment:** "I heard 'privacy' with 0.73 confidence. Did you mean 'pricing' (0.68 confidence)? Both are in the header menu." **Result:** User understands why error occurred, can correct immediately, trusts model more because it's transparent about uncertainty. ### 5. On-Device Models Enable Privacy and Offline Use Simon's model runs entirely client-side (11MB, loads in seconds). **Voice AI navigation equivalent:** 10-50M parameter navigation models could run on-device: - No audio leaves user's browser - Works offline (airplane, poor connectivity) - Zero latency (no API round-trip) - No usage costs (no server inference fees) **Tradeoff:** Smaller models have lower accuracy ceilings. But for navigation (bounded task, structured data), the accuracy gap is small. --- ## The Auto-Correction vs. Precision Tradeoff Simon's entire project hinges on refusing auto-correction. Modern seq2seq models are trained to guess intent despite errors. That's great for transcription. It's terrible for learning. Voice AI navigation faces the same tradeoff: ### Scenario 1: Auto-Correction (Current Standard) **User says:** "Find pricing" **Model hears:** "Find privacy" (acoustic similarity, noisy audio) **Model behavior:** Checks page context, sees /privacy link in footer, assumes user wants privacy policy, navigates silently. **User reaction:** "Why did it go to the privacy page? I said pricing." **Trust impact:** Negative. User perceives model as incompetent, has no visibility into why error occurred. ### Scenario 2: Precision with Confirmation (CTC-Style) **User says:** "Find pricing" **Model hears:** "Find privacy" (acoustic similarity) **Model behavior:** "I heard 'privacy.' I found a Privacy Policy page. Is that correct, or did you mean something else?" **User reaction:** "No, I said pricing." **Model:** "Got it. Navigating to Pricing page." **Trust impact:** Positive. User sees model is honest about uncertainty, appreciates the confirmation loop, gets to correct destination. --- ## The Conformer Advantage: Why Navigation Needs Both Local and Global Context Simon chose Conformer (CNN + Transformer) because speech has local patterns (phoneme differences) and global patterns (tone context, speaker characteristics). Navigation has the same structure: ### Local Patterns (CNN-Equivalent) - Button text: "Get Started" vs. "Sign Up" (lexical similarity, but different actions) - Link position: header vs. footer (same text, different priority) - Visual style: primary CTA vs. secondary link (same destination, different UI prominence) **What detects these:** Convolutional layers scanning page structure for local features (button text, CSS classes, DOM hierarchy). ### Global Patterns (Transformer-Equivalent) - Site-wide navigation structure: SaaS sites put Pricing in header, Enterprise in contact form - User journey context: User on /features likely wants /pricing next, not /about - Cross-page relationships: Blog post links to product page, product page links to pricing **What detects these:** Attention layers modeling long-range dependencies across pages and user sessions. **Navigation models optimized for both:** Conformer-style architectures that combine local element detection (CNNs) with global site structure understanding (Transformers). --- ## Practical Recommendations for Voice AI Navigation Simon's 9M-parameter pronunciation tutor demonstrates principles Voice AI builders can adopt: ### 1. Build Task-Specific Small Models, Not General-Purpose Giants **Current approach:** Use 70B+ parameter LLMs for navigation (Gemini, GPT-4, Claude) **Better approach:** Train 10-50M parameter navigation-specific models on site structure datasets **Benefits:** - 10× faster inference (on-device vs. server round-trip) - 100× cheaper (no API costs) - Privacy-preserving (audio stays local) - Works offline **Tradeoff:** Lower accuracy on edge cases. But for navigation (bounded task), accuracy gap is small. ### 2. Refuse Silent Auto-Correction, Embrace Transparency **Current behavior:** Voice AI mishears query, navigates to wrong page silently **Better behavior:** Voice AI confirms uncertain queries: "I heard 'privacy.' Did you mean 'pricing'?" **Benefit:** Users trust transparent models more than silently auto-correcting ones. ### 3. Use CTC-Style Output for Honest Feedback **Current ASR:** Sequence-to-sequence (optimize for intent despite errors) **Better for navigation:** CTC-style output (tell user exactly what you heard) **Example:** - User: "Find enterprise pricing" - Model hears: "Find enterprise privacy" - CTC output: Explicitly outputs "privacy," triggers confirmation - Seq2seq output: Auto-corrects to "pricing" based on context, navigates silently (wrong if user actually wanted privacy) ### 4. Train on Edge Cases, Not Just Common Patterns **Simon's problem:** AISHELL lacks casual speech and children's voices **Navigation equivalent:** Models trained on standard e-commerce miss unconventional sites **Solution:** Collect diverse training data covering: - Non-standard site structures - Mobile-specific navigation patterns - Ambiguous queries requiring clarification ### 5. Decouple Alignment from Scoring (Handle Silence Gracefully) **Simon's bug:** Leading silence ruined confidence scores **Navigation equivalent:** Page load delays before navigation completes shouldn't reduce confidence **Fix:** Ignore "silent" frames (loading states, transition animations) when calculating navigation confidence. --- ## The Broader Lesson: Data-Bound Tasks Don't Need Massive Models Simon's compression experiment revealed: **75M → 9M parameters = minimal accuracy loss.** Why? The task is **data-bound, not compute-bound.** With 300 hours of training data, even a 9M-parameter model can extract nearly all learnable patterns. **Voice AI navigation is likely similar:** If you have 100K+ examples of (user query → correct page) pairs covering diverse site structures, a 10-50M parameter model can likely match 70B+ model accuracy for navigation-specific tasks. **The bottleneck isn't model capacity. It's training data coverage:** - How many edge-case site structures are represented? - How many ambiguous queries have labeled correct destinations? - How many mobile vs. desktop navigation patterns are covered? **Implication:** Voice AI builders should invest in high-quality navigation datasets, not just bigger models. --- ## Final Thought: Small Models, Honest Feedback, Transparent Decisions Simon's 9M-parameter pronunciation tutor succeeds because it refuses to be helpful at the cost of honesty. It doesn't auto-correct your tones. It doesn't guess what you meant. It tells you exactly what you said, even when you're wrong. Voice AI navigation should adopt the same philosophy: **Don't optimize for:** Silently correcting user mistakes to maintain illusion of perfection **Optimize for:** Transparently communicating what you heard, confirming uncertain decisions, letting users provide corrections **The result:** Users trust honest models more than "smart" models that guess intent and fail silently. Simon's tiny model proves you don't need scale to achieve precision. You need the right architecture, the right training data, and the willingness to be brutally honest about what you don't know. For Voice AI navigation, that means: small models, clear feedback, transparent uncertainty. The 11MB download is just the beginning. --- *Keywords: 9M parameter speech model, CTC vs sequence-to-sequence, Conformer architecture speech recognition, Voice AI navigation precision, on-device speech models, pronunciation training CAPT, forced alignment speech, task-specific vs general AI models, honest feedback voice AI, auto-correction tradeoffs* *Word count: ~2,500 | Source: simedw.com | HN: 204 points, 74 comments*
← Back to Blog