In this article
MAD-X separates language adaptation from task adaptation; successful swapping depends on a compatible stack and measured target-language behavior.
MAD-X is a modular framework for cross-lingual transfer that separates language adapters from task adapters. A language module learns from language-modeling data, while a task module learns a supervised problem. At transfer time, the language adapter can be replaced while retaining the task adapter, aiming to reuse task knowledge across languages.
Follow the training sequence
Language adaptation and task adaptation have different supervision. Preserve which language corpus trains the language module and which labeled dataset trains the task module. The source-language task stage uses a particular stack, so changing that stack is part of the experiment rather than an incidental inference setting. Record the exact module order.
Understand the invertible component
The framework includes language-specific invertible transformations near the embedding interface, alongside bottleneck language adapters. AdapterHub describes using the transformation in the forward direction before transformer layers and its inverse at the corresponding output side. This architectural relationship differs from attaching an unrelated multilingual text prompt or changing the tokenizer vocabulary.
Keep tokenization compatibility explicit
Swapping language modules does not automatically give the frozen base adequate vocabulary coverage or fix every segmentation problem. Inspect representative target-language inputs and their tokenization. For an illustrative entity-recognition transfer, keep label definitions and span reconstruction consistent; a boundary mismatch can damage evaluation independently of the adapter’s ability to represent the language.
Evaluate the zero-shot claim precisely
Zero-shot cross-lingual transfer concerns the absence of labeled target-task training in the stated setting. It does not mean that the target language was absent from all pretraining or language-adapter training. Report these exposures separately. Compare a source-language stack, the target-language stack and an appropriate multilingual baseline on genuinely held-out target-language examples.
Save the stack as a deployable object
Retain language and task adapter weights, invertible component, active order, prediction head, tokenizer and base revision. A collection of files without the composition rule is incomplete. Test a fresh load for each intended language and measure the added modules in the actual runtime. MAD-X is useful when this separation supports reproducible language transfer, rather than when modular names merely suggest that components should combine.
Primary references
AdapterHub method architectures.
Related explanations: task identity and adapter stacks; tokenization and vocabulary.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.