Context Biasing: Improving Accuracy
On this page
Course updated November 3, 2026 for Voxtral 3, based on Mistral’s Migrate from Voxtral 2 guide: Voxtral 2 models (
voxtral-mini-2602,voxtral-mini-transcribe-realtime-2602,voxtral-mini-tts-2603), deprecated October 31, 2026 and retired April 30, 2027, are replaced in examples byvoxtral-mini-transcribe-3,voxtral-mini-transcribe-realtime-3, andvoxtral-mini-tts-3-0. Key changes: timestamps are segment-only (wordreturns a 400 error), diarization is possible in real time, real-time session settings are locked after the first audio chunk, andcontext_biasentries are free-form (phrases with spaces allowed). Sources: Migrate from Voxtral 2 · Speech to Text.
The Problem with Specialized Terms
Transcription models train on common language. When your audio contains proper nouns, acronyms, technical jargon, or rare industry terms, the model often mis-transcribes them: “Voxtral” becomes “vox trail,” and “RGPD” (the French acronym for the EU’s General Data Protection Regulation) comes out as “RG PD.” In a one-hour meeting, these errors add up to dozens, and they are precisely the words you wanted to extract.
Context biasing solves this by providing the model with a list of expected terms. The model then adjusts its probabilities to favor these terms when it detects them in the audio. This isn’t an automatic post-processing replacement; it steers the decoding during transcription. That nuance is why the result remains natural.
Using Context Biasing
The context_bias parameter accepts a list of terms: in Python, a list of strings. With Voxtral 3, an entry can contain spaces—a full product name like “Alder Creek Design”—and there is no longer a hard limit on the number of entries. However, entries share the context window with the audio: a request that exceeds it is rejected (400 error), which is why a short list is best.
import os
from mistralai.client import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
with open("reunion_tech.mp3", "rb") as f:
response = client.audio.transcriptions.complete(
model="voxtral-mini-transcribe-3",
file={"content": f, "file_name": "reunion_tech.mp3"},
context_bias=["Voxtral", "Mistral AI", "RGPD", "Kubernetes", "PostgreSQL", "FastAPI"]
)
print(response.text)
The effect is immediate. Without context biasing, an engineering meeting might produce this:
On a déployé le nouveau service sur cubernétisse avec fast API
et la base post grès cul.
With the list ["Kubernetes", "FastAPI", "PostgreSQL"], the same sentence becomes usable:
On a déployé le nouveau service sur Kubernetes avec FastAPI
et la base PostgreSQL.
Outside real-time mode, an entry can even be a free-form context phrase describing the conversation: “Call to Northwind support regarding an order of Quillara headsets shipped from the Rotterdam warehouse.” The model uses this to steer recognition of the names it contains.
Building an Effective List
Four families of terms deserve a spot. First, proper nouns: people, companies, products—anything the model has no reason to know. Second, technical terms: acronyms, technology names, protocols. Third, industry jargon specific to your field that doesn’t appear in general dictionaries. Finally, place names: cities, buildings, meeting rooms, often cited and rarely transcribed well.
The list content depends entirely on context. A tech startup meeting calls for different vocabulary than a medical consultation or a law firm interview. Here are three real lists to use as templates.
Tech startup meeting:
context_bias = [
"Mistral AI", "Voxtral", "Claude", "GPT-5.6",
"Kubernetes", "PostgreSQL", "FastAPI", "Redis",
"RGPD", "HIPAA", "SOC 2",
"sprint", "backlog", "user story",
"CI/CD", "Docker", "Terraform"
]
Medical practice:
context_bias = [
"paracétamol", "ibuprofène", "amoxicilline",
"IRM", "scanner", "échographie",
"glycémie", "hémoglobine", "créatinine",
"Dr Martin", "Dr Dubois",
"CHU Pitié-Salpêtrière"
]
Law firm:
context_bias = [
"SARL", "SAS", "SASU",
"article L.225-1", "Code de commerce",
"assignation", "mise en demeure",
"TGI", "Cour d'appel",
"Maître Dupont", "Maître Leroy"
]
Managing Vocabulary by Project
Hard-coding the list doesn’t scale once multiple clients or services enter the picture. The following script loads vocabulary from a JSON file, allows adding ad-hoc terms, and deduplicates the set. It imposes no hard limit since Voxtral 3 has none, but it warns if the list is too long: that’s what risks exceeding the context window.
import os
import json
from pathlib import Path
from mistralai.client import Mistral
ALERT_THRESHOLD = 50 # Internal marker: beyond this, check request size
def load_vocabulary(config_path: str) -> list[str]:
"""Loads context biasing vocabulary from a JSON file."""
config = json.loads(Path(config_path).read_text(encoding="utf-8"))
terms = list(dict.fromkeys(config.get("terms", [])))
if len(terms) > ALERT_THRESHOLD:
print(f"Warning: {len(terms)} terms; a long list reduces "
f"the space left for audio in the context window.")
return terms
def transcribe_with_vocabulary(
audio_path: str,
config_path: str = None,
additional_terms: list = None
) -> str:
"""Transcribes with optional context biasing."""
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
# Build the term list
all_terms = []
if config_path and Path(config_path).exists():
config = json.loads(
Path(config_path).read_text(encoding="utf-8")
)
all_terms.extend(config.get("terms", []))
if additional_terms:
all_terms.extend(additional_terms)
# Deduplicate while preserving order
all_terms = list(dict.fromkeys(all_terms))
bias = all_terms or None
# Transcribe
with open(audio_path, "rb") as f:
kwargs = {
"model": "voxtral-mini-transcribe-3",
"file": {"content": f, "file_name": Path(audio_path).name}
}
if bias:
kwargs["context_bias"] = bias
print(f"Context biasing active: {len(all_terms)} terms")
response = client.audio.transcriptions.complete(**kwargs)
return response.text
# Vocabulary configuration file vocabulaire.json
# {
# "terms": [
# "Mistral AI", "Voxtral", "Kubernetes",
# "PostgreSQL", "RGPD", "Dr Martin"
# ]
# }
# Usage
texte = transcribe_with_vocabulary(
"reunion.mp3",
config_path="vocabulaire.json",
additional_terms=["nouveau_terme", "autre_terme"]
)
print(texte)
What Works and What Doesn’t
Context biasing yields the best results on precise, distinct terms: proper nouns, acronyms, rare technical vocabulary. It also assumes the provided terms are actually present in the audio—adding words that will never be spoken dilutes the signal without adding value. A list of twenty to fifty well-chosen terms suffices in most situations.
Conversely, listing common words is useless: the model already recognizes them well, and you consume useful space. Long sentences work poorly; stick to words or short phrases. Finally, beware the reflex to dump the entire company glossary into the parameter: a vocabulary that is too broad drowns out the few terms that really mattered.
One point of vigilance for your French-language projects: context biasing is optimized for English, and Mistral AI qualifies support for other languages, including French, as experimental. In practice, it works correctly for proper nouns and acronyms in all languages but may be less effective for common terms in non-English languages. Test on a representative excerpt before generalizing to an entire corpus.
Key Takeaways
- Context biasing improves recognition of specialized terms via
context_bias - A list of terms (phrases with spaces allowed), no fixed limit but constrained by the context window
- Effective for: proper nouns, acronyms, technical jargon, place names
- Optimized for English, experimental support for other languages
- Prefer precise terms that are actually present in the audio
- Use a configuration file to manage vocabulary by project