Skip to content

Spike: vocabulary boosting via a new stdio command (#322) - #419

Open
Nabzx wants to merge 2 commits into
mainfrom
vocab-boosting-spike-322
Open

Nabzx wants to merge 2 commits into
mainfrom
vocab-boosting-spike-322

Conversation

@Nabzx

@Nabzx Nabzx commented Sep 21, 2026

Copy link
Copy Markdown
Owner

A compile-verified spike for #322 (keyword boosting), not a shipped feature - opened as its own PR so it's reviewable and mergeable independently, but this is research/spike work, not something to hold up other work on.

Why this exists

Posted findings on #322 after reading the vendored FluidAudio source: the issue's own cost estimate was too high on both counts (the second model is a documented ~97.5 MB, not 100-400 MB; boosting composes as a side-channel pass over the existing AsrManager.transcribe() call, not an engine swap). The one thing that research couldn't answer - the ANE latency cost of the extra CTC pass on the actual M3 target - needed real code and real hardware, hence this spike.

What's built

transcribeWithVocabulary, a new command on transcription-helper's stdio protocol - not called from any Electron code path. Same request shape as "transcribe", runs the exact same asr.transcribe() call unmodified, then layers FluidAudio's CTC keyword-spotting rescore pass on top against a hardcoded vocabulary (a few proper nouns, two spoken-command phrases - not a real vocabulary source, that's separate unresolved product work). Every FluidAudio API call was verified against source first, then confirmed by compiling.

Verification

Compile-verified only. swift build --package-path native/transcription-helper -c release succeeds. This session's sandbox cannot execute transcription-helper at all (confirmed separately, same constraint as #253's Swift piece), so nothing here has actually run. docs/testing/vocabulary-boosting-spike-322.md has manual steps: build, feed it a WAV via raw stdio JSON, compare its ms against a plain "transcribe" request for the same clip to isolate what the boosting pass adds, and check whether it fits the sub-1s dictation budget (ADR-0002/ADR-0003).

Please run it before drawing any conclusions from it - I'd genuinely like to know the latency number before this goes any further (into a real feature, or shelved).

🤖 Generated with Claude Code

#322)

New "transcribeWithVocabulary" command, unreachable from any Electron
code path. Runs the exact same asr.transcribe() call "transcribe"
already makes, then layers FluidAudio's CTC keyword-spotting rescore
pass on top as a side-channel - not a different transcription class.
Every API call here was verified against the vendored FluidAudio
source first (CustomVocabularyContext, CtcKeywordSpotter,
VocabularyRescorer, AudioConverter - see the #322 issue comment for
the full research), then confirmed by actually compiling it.

Vocabulary is hardcoded (a few proper nouns, two spoken-command
phrases) - this spike answers one question, the ANE latency cost of
the extra pass, and nothing about where a real vocabulary would come
from.

Never executed - this session's sandbox cannot run
transcription-helper at all, same constraint as #253's Swift piece.
docs/testing/vocabulary-boosting-spike-322.md has the manual steps
and what to look for.

Claude-Session: https://claude.ai/code/session_0144sxo5CJiyk99vaR7sgjuj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant