Technology

Dictionary (custom vocabulary)

Karsten B. Kreh Karsten B. Kreh Updated on

Also known as: custom vocabulary, user dictionary

A dictionary (custom vocabulary) is a user-defined list that steers a speech recognition system towards specific terms. An entry is either a vocabulary entry, which makes a term known to the model, or a correction pair, which replaces a fixed misspelling with the desired spelling. It improves the hit rate for technical terms, but it does not replace model fine-tuning or listening back to the audio.

How it works

Vocabulary entries work through the prompt with which a speech recognition system such as Whisper is started. Radford et al. (2022) train the model to use the history of the text recognised so far as context to resolve ambiguous audio. A dictionary uses the same mechanism in reverse: it puts an invented “already recognised” text that contains the desired terms in front of the model, which makes the model more prone to actually recognise these terms. The implementation SYSTRAN/faster-whisper documents the corresponding parameter initial_prompt as an optional text or token string that is prepended to every recognition window. It also documents the parameter hotwords for single hint words without this context character.

The prompt has a fixed upper limit. In the discussion on the prompting behaviour of Whisper, radurevutchi names a limit of about 223 tokens for smaller models (n_text_ctx // 2 for the Tiny model), after which the already recognised text displaces the prompt. A dictionary with many entries therefore cannot fit into the prompt completely, and the order of the list decides which vocabulary entries take priority. In the same discussion, Jongwook Kim points out that the model can ignore the prompt. Inclusion in the prompt is no guarantee of recognition in the text.

Correction pairs act as a second mechanism. They also carry the desired spelling into the prompt, and after recognition memozero replaces every word that exactly matches the stored misspelling with the stored correction. This second step takes effect whether or not the prompt worked, and it therefore gives a more reliable spelling than a vocabulary entry alone.

Relevance in a forensic context

In forensic practice, a dictionary mainly affects abbreviations, procedural terms and names that recur in a recording. The memozero measurement series (Kreh, 2026) shows the problem that a dictionary addresses: in a test with the abbreviations StPO, BKA, DNA and MRT, the word error rate was 0.39, while the character error rate in the same test was only 0.086. The model had heard the terms correctly and had only written them differently, for example with or without full stops. A correction pair catches exactly these cases, because it enforces the one desired spelling instead of relying on the hit rate of the prompt.

An editor therefore sets up the term list of a case before the first job: the names of the people involved, recurring technical terms and the spelling of abbreviations that is customary in the case. A single case reference number does not belong in the dictionary. It applies to one case only and displaces, in the limited space of the keyword list, terms that are needed permanently.

A dictionary changes only the prompt and the output of a single transcription, and never the model itself. A model fine-tuning such as the German adaptation by primeline retrains the weights of the model and acts permanently across every recording, beyond the terms named in the prompt. Radford et al. (2022), by contrast, describe Whisper as a zero-shot model without fine-tuning on the target language.

A dictionary also gives no protection against hallucination in speech recognition, which is text that the model invents without evidence in the recording. It cannot rescue a badly levelled or very noisy recording, because the cause lies in the audio signal and a missing vocabulary would not remove it. Whether a dictionary helps in a given case shows in the word error rate (WER) before and after the list is created. The number of entries gives no answer.

Frequently asked questions

Should I use a vocabulary entry or a correction pair?

A vocabulary entry is enough for a rare term that can be spelled correctly, such as a proper name. A correction pair belongs where a fixed misspelling keeps recurring, for example an abbreviation that the model regularly splits or writes differently.

Can a dictionary rescue a badly recorded file?

No. The prompt gives the model only a hint about possible terms, and it does not replace an audio signal. With heavy noise, overload or several people speaking at the same time, listening back to the audio remains the only reliable way.

How many entries can a dictionary hold?

Technically, the prompt limits the number of terms that actually take effect to a few hundred characters. An editor therefore keeps a short list for the case instead of a general reference work.

Sources

  1. Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C., Sutskever, I. (2022): Robust Speech Recognition via Large-Scale Weak Supervision. arXiv:2212.04356. https://arxiv.org/abs/2212.04356
  2. SYSTRAN (2025): faster-whisper, source code transcribe.py, parameters initial_prompt and hotwords. https://github.com/SYSTRAN/faster-whisper
  3. Kim, J. (2022): Prompting Whisper. Discussion openai/whisper #117. https://github.com/openai/whisper/discussions/117
  4. memozero article: Transcribing dialects, section “Individual dictionary”. https://memozero.io/en/blog/transcribing-dialects/
  5. Kreh, K. B. (2026): Speech recognition in 2026: what actually works on your own computer. memozero blog, 10 August 2026. https://memozero.io/en/blog/speech-recognition-2026-on-device/