NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Pay Once for Robustness: Label-Free Robustness Tokens for Low-Resource Languages

Adversarial training makes a model resistant to small, deliberately chosen input changes. It does this by repeatedly attacking the model during training and learning from the attacks. That inner attack loop multiplies training cost. In text it also needs language-specific tools: synonym dictionaries, sentence-similarity models, and fluent masked language models. For most African and Indonesian languages these tools barely exist. The practical result is that low-resource languages get no adversarial training at all, because the cost there is effectively unbounded rather than merely high. We propose to sidestep both problems with a small set of learnable vectors prepended to the input of a frozen multilingual encoder. These "robustness tokens" are trained once, without labels, to keep the encoder's internal features unchanged when its input embeddings are attacked. They are then plugged into any language and any task.

The core bet is that the encoder's internal features are largely shared across languages, so a defense that operates on those features should travel with the representations. If it does, the inner-loop cost is paid once per backbone instead of once per task and language. No target-language attack tooling is needed, because the attack used during training runs in continuous embedding space and needs only the model itself. We test this on African part-of-speech tagging and Indonesian-language sentiment, where no robustness results exist today.

Core Claim

A task-agnostic, label-free robustness module, trained with embedding-space attacks on unlabeled text from a few high-resource languages, gives worthwhile robustness on low-resource target languages it never saw. The attacks used for evaluation are discrete and realistic: character edits, diacritic stripping, and substitutions proposed by the model's own masked-language head. We expect this module to reach a large fraction of the robustness of task-specific adversarial training run directly on the target language, at a small fraction of the compute. Optionally adding unlabeled target-language text, which is often available from Bible translations even where labels are not, should close most of the remaining gap.

What is new is the combination of three properties. The defense is label-free, so it is reusable across tasks. It works on a frozen backbone, so it is cheap and composes with language adapters. It is evaluated by zero-shot transfer to typologically distant languages.

Relation to Prior Work

The mechanism comes from Robustness Tokens: Towards Adversarial Robustness of Transformers. That paper appends about ten learnable tokens to a frozen vision transformer and trains them with two losses: one keeps clean features unchanged, the other corrects attacked features. Training converges in about 200 steps. On DINOv2-G, attacked accuracy recovers from 0.3% to 63.1% while clean accuracy moves only from 85.6% to 85.2%. That work is vision-only and single-domain. We move the method to multilingual text encoders and ask whether it survives crossing languages, which it never had to do.

The idea of amortized robustness is motivated by Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners. That paper shows adversarial pretraining can carry robustness to unseen tasks. Robust accuracy on CIFAR-10 pairs rose from 21% to 34%, but only for linear attention and homogeneous feature spaces. Languages are the clearest real case of heterogeneous input spaces sharing one encoder.

Cheaper text adversarial training, Towards Improving Adversarial Training of NLP Models (A2T), constrains our design. A2T gains its speed, about 3x faster than TextFooler with about 10x less memory, from gradient word ranking plus English-specific synonym embeddings and DistilBERT similarity checks. Those components are unavailable for most of our target languages. Likewise, Adversarial Robustness for Large Language NER models using Disentanglement and Word Attributions gets cheaper attacks but depends on Wikidata, GPT-J, and the Universal Sentence Encoder. Both papers show that discrete-attack training does not port, which is why we train in embedding space.

The cross-lingual "adversarial" papers solve a different problem. Cross-lingual Multi-Level Adversarial Transfer to Enhance Low-Resource Name Tagging and AdvPicker use a discriminator to remove language identity from representations. That is domain invariance, not worst-case robustness, and neither paper measures attacks. We use their observation that language-agnostic features are learnable as the reason to expect transfer.

The low-resource side supplies the deployment setting. MasakhaPOS shows that MAD-X-style language adapters beat full fine-tuning by over 10% in zero-shot transfer. This is why our module must compose with swapped language adapters rather than assume a fixed backbone. Language Fusion for Parameter-Efficient Cross-lingual Transfer reports that multilingual encoders hold weaker representations for low-resource languages. That observation is the main reason transfer might fail, and we treat it as a falsification risk.

Research Program

The backbone is AfroXLMR-large for African languages and XLM-R for NusaX. Both stay frozen, with task adapters, and language adapters for the zero-shot condition.

The robustness module is $k$ learnable vectors $r$ prepended to the input sequence. For an unlabeled sentence with input embeddings $e$, an attacker runs a few steps of projected gradient ascent to find a perturbation $\delta$ with $\|\delta\| \le \epsilon$ per token. The perturbation is chosen to push apart the encoder's final-layer features $h(\cdot)$. We then minimize

$$\mathcal{L}(r) = \big(1-\cos(h(e+\delta; r),\, h(e))\big) + \lambda \big(1-\cos(h(e; r),\, h(e))\big),$$

where $h(e)$ is the frozen encoder's clean feature without tokens and $\lambda$ weights preservation of clean behavior. No labels appear anywhere in this loss. Downstream task adapters are then trained normally on clean data with the tokens in place.

We will train three versions. The source-only version uses English, French, and Swahili raw text. The source-plus-target version adds a few thousand unlabeled target sentences, for example Bible verses. The per-language version trains on target raw text only. Comparing the source-only and source-plus-target versions tells a practitioner whether a few thousand raw sentences are worth collecting.

Every run logs total GPU-hours, including all attack forward and backward passes. We report robustness per GPU-hour as well as absolute robustness, because cost is half the claim.

Baselines

The do-nothing reference is the clean pipeline: the frozen encoder with clean-trained task and language adapters, attacked at test time. MasakhaPOS reports 89.4% average clean accuracy across 20 languages for AfroXLMR-large. That is the clean ceiling our module must not erode by more than about one point. We found no reported result on Lacuna for robust accuracy on MasakhaPOS or NusaX under any attack, so we establish these numbers ourselves.

The strongest competitor is task-specific adversarial training on the target language. We run embedding-space adversarial training on the task adapter, using the same attack steps and $\epsilon$, on labeled target data. It is the strongest because it optimizes robustness for exactly the evaluated task and language. To keep the comparison fair, both methods get the same backbone, the same adversarial step count per example, and the same hyperparameter-search budget of 20 trials. We beat it if the source-only module reaches at least 70% of its robust-accuracy gain over the do-nothing reference. The source-plus-target module should reach at least 90%. Both must use under a quarter of its total compute summed across all tasks and languages.

The second competitor is source-language task adversarial training: adversarially train the task adapter on English labeled data, then swap in the target language adapter. This tests whether a separate, label-free module is needed at all.

We also include Dynamic Attention from Improving the Robustness of Transformer-based Large Language Models with Dynamic Attention, which masks hijacked attention at inference with no training. It reports up to 33% better robustness than prior defenses against TextFooler and PWWS on English. We also include the Information Bottleneck layer of Improving the Adversarial Robustness of NLP Models by Information Bottleneck, which kept 52.2% accuracy under TextFooler on IMDB where plain BERT fell to 0.8%. Its $\beta$ gets the same tuning budget.

The key ablation removes the attack: identical tokens trained only with the clean-preservation term and with random noise in place of $\delta$. This isolates whether the worst-case inner loop, rather than extra parameters, produces the robustness.

Why not just…?

Why not just adversarially train the task adapter on English and transfer it? This is the most serious threat. If it matches our module, the label-free design adds nothing except reuse across tasks. Our experiments run it under identical compute and report it per task. Our module's advantage is then only that one module serves both POS and sentiment. If the two match on robustness, we will report the finding as "source-language adversarial training transfers" and frame the cost saving purely as amortization across tasks, rather than claim a better defense.

Why not just augment training with random typos and diacritic stripping? This costs almost nothing and needs no tools. It may cover much of the realistic threat for Yoruba-style diacritic noise. It is in effect a second do-nothing-plus baseline that we run on every task. We expect it to help against random noise but not against gradient-guided edits. That is the pattern seen when static defenses like defensive dropout lose to adaptive attacks in Dynamic Attention. If it matches us under guided attacks, the inner loop is unnecessary, and the noise-only ablation will show that directly.

Why not just use an inference-time defense with zero training cost? Dynamic Attention costs nothing to train, so on cost it wins by definition. Its reported gains are English-only, and nothing in the file shows that its masking heuristic suits subword fragments of high-OOV languages. We run it on every target language. If it matches our robust accuracy, our proposal reduces to a negative result for training-based defenses here.

Proposed Experiments

Tasks are MasakhaPOS, all 20 languages and zero-shot from English, and NusaX sentiment, 11 languages. Evaluation uses three attacks, none of which needs language-specific tools. The first is embedding-space projected gradient attack, which matches the training attack and serves as a sanity check. The second is gradient-guided character edits and diacritic removal with at most two edits per word and 15% of words. The third is substitution from AfroXLMR's own masked-language head with the same word budget. For POS, the attacker edits context words, and we score accuracy only on unedited tokens so labels stay valid.

All attacks are also run fully white-box with the tokens known. Robustness Tokens admits that its defense partly relies on keeping the tokens secret. A defense that only works when the tokens are hidden would not count.

There are three decisive checks. First, source-only transfer must hold on languages typologically far from the training languages, especially chiShona. If the gain correlates strongly with each language's clean zero-shot accuracy, the module is merely riding on the backbone's representation quality. Second, the compute-normalized comparison against target-language task adversarial training must favor the module once costs are summed over both tasks and all languages. Third, the noise-only ablation must fall clearly below the full module under guided attacks. If any of these fails, the experiments still deliver the first robustness measurements for these benchmarks and a clear account of which cheap defense actually holds up for low-resource languages.