﻿# MMS language switching: adapter weights and decoding vocabulary must move together

Keep MMS ASR language adapters, output heads, and tokenizer language state aligned, including request isolation when a shared worker serves different languages.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-mms-language-adapter-tokenizer-atomic-switch/
Language: en

## Identify the ASR release

The [MMS paper](https://arxiv.org/abs/2305.13516) studies broad multilingual speech coverage across several tasks. Coverage at the project level does not make all task artifacts interchangeable. This guide concerns the multilingual recognition route with language adapters, rather than the project's separate speech-synthesis or language-identification artifacts. Start with the exact ASR checkpoint and supported language code before reasoning about how a shared inference worker can switch languages.

## Change both sides of the mapping

The [official ASR card](https://huggingface.co/facebook/mms-1b-all) demonstrates switching the model adapter with `load_adapter` and the tokenizer language with `set_target_lang`. The pair matters: output identifiers must be interpreted using the corresponding vocabulary. Updating only the visible language field while retaining an old adapter or decoder can produce plausible-looking but incorrectly mapped text. A request should identify the effective model and tokenizer state, not merely its intended language.

## Account for head shape changes

The [MMS integration documentation](https://huggingface.co/docs/transformers/model_doc/mms) explains that selecting another language can require resizing the language-model head for its vocabulary. Its documented loading recipe accommodates those changes. Do not generalize that recipe into permission to ignore arbitrary mismatched parameters in unrelated checkpoints. The supported adapter-loading procedure and resulting trained head are the evidence; a generic mismatch-suppression switch alone does not prove that the requested language was installed correctly.

## Isolate concurrent language requests

Suppose a shared worker alternates English and French requests. If adapter and tokenizer changes mutate shared state, the complete switch and inference need a deliberate isolation strategy. Separate workers, serialized transitions, or a verified immutable selection mechanism are possible designs. Test interleaved requests against isolated references. This is a concurrency implication of the mutable example, not a claim that the library supplies a universal atomic language-switch operation.

## Record the effective language state

Store checkpoint revision, language code, loaded adapter, vocabulary identity, and decoding settings. Validate a short labeled sample after a switch, and retain an unsupported-language error path rather than silently falling back. Background on [language adapter stacks](/journal/guide-madx-language-task-adapter-stack/) and [artifact validation](/journal/safetensors-artifact-validation/) helps separate model roles. MMS adds a concrete ASR requirement: model-side adaptation and token-side interpretation must remain aligned for the entire request, including under batch scheduling and concurrent workloads.
