feat(voice_worker): finals are also decoded with the recent conversation as Whisper's prompt

The words of the topic were the ones misheard live (화면공이 for 화면 공유, 계산지 for 계산기), and
five models made the same mistakes. Each final is decoded as before and again with the last 180 s
of the channel's conversation (everyone's finals and Jarvis's speech, at most context_chars=200
characters) as the previous-text prompt; the prompted text is used only when the plain one was kept,
stays within half its letters and keeps every hotword count, as for the hint.

Measured on the game PC (RTX 5070 Ti, 100 recordings of the user, 16 with their own text): CER
12.0% -> 7.5%, empty results unchanged, noise clips with text unchanged (16/108), final decode
p95 170 -> 253 ms. Finals with a context are decoded one clip at a time (ctranslate2 needs the
start token at one position in a batch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-19 19:38:10 +09:00
parent 478968949c
commit 628d89c4f1
10 changed files with 234 additions and 17 deletions

View File

@@ -80,6 +80,7 @@ STT settings (all optional in `hello` and `config`):
| `end_silence_ms` | 300 | Trailing VAD silence that ends an utterance. Range 100-2000. |
| `final_beam` | 2 | Beam size for finals (partials always use 1). Range 1-5. |
| `language` | `"ko"` | Whisper language code, or `null` to detect per utterance. |
| `context_chars` | 200 | Finals are also decoded with the recent conversation as Whisper's previous-text prompt, at most this many characters (Conversation context). `0` turns it off. Range 0-500. |
| `hotwords` | `[]` | Words (wake words, names) passed to Whisper as a hint. The hint alone made Whisper write the wake word on laughter, so with hotwords every clip is also decoded without them and that plain decode decides (see Hallucination gate). |
### Utterance rules
@@ -152,6 +153,35 @@ text is empty:
`no_speech_prob` is not used: large-v3-turbo reports 0.0 for silence and noise alike.
### Conversation context
People talk about one thing for a while, and the words of that topic ("디코", "화면 공유", "계산기")
were the ones misheard (live 2026-11-19): Whisper heard a casual, unclear "화면 공유" as "화면공이"
and "계산기" as "계산지", and five models (large-v3-turbo, large-v3 and three Korean fine-tunes) made
the same mistakes. Whisper was trained to continue from the text before a clip, so a final is also
decoded with the recent conversation as its previous-text prompt:
- The context is what was said (the session's non-empty finals, everyone's) and what Jarvis said
(the text of every `tts` request) in the voice channel Jarvis is in, over the last 180 s, joined
by spaces, at most `context_chars` characters from the end. Joining another channel or leaving
clears it. It lives in memory only, is never logged and goes nowhere but the model's prompt.
- Partials have none (they stay one cheap decode).
- The clip is decoded as before (with the hotword choice above) and again with the context (the
same choice, each decode prompted). The prompted text is used only when the one without context
was kept, it stays within half that text's letters of it, and it holds every hotword exactly as
often; otherwise the text without context is used. On noise or unsure audio the prompt makes
Whisper write words of the conversation; this rule keeps that out, as for the hint.
- Prompts of different lengths cannot share one decoder call, so finals with a context are decoded
one clip at a time (the encoder costs the same per clip).
Measured (2026-11-19, the game PC's RTX 5070 Ti with Strata loaded, large-v3-turbo int8_float16,
beam 2, the 100 recordings of the user's speech from 2026-11-16 to 19, 16 of them with the user's own
text): character error rate 12.0% without and 7.5% with the context (wrong sentences 10 to 8), no more
empty results (17 of 100 both ways), final decode 134 ms to 182 ms on average (p95 170 to 253 ms).
On the 108 noise clips decoded straight (no VAD), as many came out with text with the context as
without it (16 each); without the rule above it was 22 with turbo, and with large-v3 63, which wrote
whole sentences of the prompt. Evidence and the model comparison: `docs/v2/stt-accuracy-plan.md`.
Measured (2026-11-11, RTX 5050) with 54 real noise recordings from ESC-50 (typing, mouse, breathing,
coughing, laughing, crying, vacuum, ...), each at its own level and at -25 dBFS: of the 108 noise-only
clips streamed through the worker with the wake word hint on, 103 never reached the model (the VAD