Skip to content

Idea: on-device cleanup model, with no LLM #475

Backlog

Description

@DailyXplorer

Summary

Clean a dictation on the device, with no account and no network: remove fillers, stutters, false starts and spoken self-corrections, and restore punctuation, casing, numbers, e-mails and URLs. Today AI cleanup needs the Codex session.

Behaviour

  • A small encoder model (about 30 MB, int8) tags each token (keep, filler, restart, reparandum, correction cue) and predicts punctuation and casing. It never generates text, so it cannot invent words or answer a question in the dictation.
  • Deterministic formatting (numbers, times, e-mails, URLs, versions, file names) runs on the spans the model marks.
  • Hard vetoes: never delete negations, digits, URLs, paths, code or custom words. A line the model would delete entirely keeps its raw text.
  • Runs after the text passes and before (or instead of) Codex cleanup: when signed out, offline, or as a user choice.
  • Target latency: under 50 ms for a typical dictation on Apple silicon (Core ML), under 100 ms on Windows CPU (ONNX).

Notes

French and English both need training data; the model must be trained or fine-tuned for French. Ship it as an optional local_models source, pinned by SHA-256 like the others. Start with a prototype that measures quality against the current Codex cleanup on a fixed corpus before any UI.

Out of scope

Style rewrites (Formal, Casual) stay with Codex.

Done when

  • A corpus of real-style French and English dictations runs through the model, with the diff against Codex cleanup reported.
  • With the network off, a dictation full of fillers is pasted cleaned.
  • A test proves negations, digits and custom words are never deleted.

Activity

  1. added
    enhancement
    on Dec 4, 2026
  2. DailyXplorer commented on Dec 5, 2026

    @DailyXplorer
    OwnerAuthor

    Prototype results (Apple silicon M4 Pro, ONNX Runtime, CPU), on a 36-dictation synthetic corpus (18 English, 18 French: fillers, stutters, self-corrections, unpunctuated text, spoken emails and versions, must-keep text such as code, URLs, numbers and custom words). Lower WER is better.

    Candidate Size p50 latency, 50 words EN WER FR WER Must-keep intact
    Raw text 0 0 0.516 0.534 8/8
    English disfluency tagger, 29M int8 29 MB 1.7 ms 0.430 0.523 5/8
    English disfluency tagger, 66M int8 66 MB 4.0 ms 0.406 0.503 5/8
    Multilingual punctuation + casing, int8 303 MB 7.7 ms 0.519 0.552 3/8
    Deterministic rules with hard vetoes 0 0.01 ms 0.299 0.313 8/8

    Findings:

    • Speed is not the problem: a 29M int8 encoder runs in under 4 ms on the CPU for 150 words.
    • No usable pretrained model exists: no French or multilingual disfluency tagger was found, the English ones remove nothing in French, miss every spoken self-correction (0/8), delete real words ("J'ai enfin fini le rapport" → "J'ai le rapport") and are trained on non-commercial data. Multilingual punctuation models are 5-10× the size budget and break code and custom-word casing, while the local speech model already punctuates.
    • Deterministic rules are safe and instant but cannot handle false starts or self-corrections.

    Next step, if pursued: train a bilingual French + English token tagger (~30 MB, small vocabulary) on commercially usable data, measure it against the current cleanup on held-out dictations, and only then integrate it. Leaving this open as that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions