NAACL 2025 · Main conference
Soft Language Prompts for Language Transfer
We trained soft prompts that carry a language rather than a task, and compared them with language adapters for transfer from six high-resource languages to ten mid- and low-resource ones, on four tasks.
- Ivan Vykopal1,2
- Simon Ostermann3,4
- Marián Šimko2
- 1Faculty of Information Technology, Brno University of Technology
- 2Kempelen Institute of Intelligent Technologies, Bratislava
- 3German Research Center for Artificial Intelligence (DFKI), Saarbrücken
- 4Centre for European Research in Trusted AI (CERTAIN), Saarbrücken
A soft language prompt combined with a task adapter gave the best average for four of the six source languages, and it beat the usual pairing of a language adapter with a task adapter (MAD-X) in 47 of 60 language pairs. No configuration wins everywhere, though: the best choice depends on the task and the target language, and Swahili, Telugu and Urdu often did as well without any language representation.
- high-resource source languages
- 6
- mid- and low-resource target languages
- 10
- tasks: QA, NER, NLI and check-worthy claims
- 4
- combinations of adapters and soft prompts
- 6
Average score of each configuration by source language
- Task adapter
- Task prompt
- Lang. adapter + task adapter (MAD-X)
- Lang. adapter + task prompt
- Lang. prompt + task adapter
- Lang. prompt + task prompt
Overview
Multilingual language models know much less about low-resource languages than about English or Spanish, and labelled data in those languages is scarce. A common workaround is cross-lingual transfer: train a model on a task in a high-resource language and use it in another language. One popular way to help the transfer is MAD-X, which trains a small language adapter on unlabelled text in each language, stacks a task adapter on top of it and swaps the language adapter at test time. Earlier work reported this pairing as the one to use.
We tested whether a soft prompt can do the language adapter's job. A soft prompt is a short sequence of trained vectors put in front of the input. Prompt tuning had been used for tasks, but not, to our knowledge, for languages. We call these soft language prompts. We trained language adapters and soft language prompts for 16 languages on Wikipedia, trained task adapters and soft task prompts in six high-resource languages, and evaluated all six combinations on ten mid- and low-resource languages. The base model, mT0-BASE, stayed frozen throughout.
mT0 is mT5 after instruction tuning. We started with mT5-BASE itself, but prompt tuning alone could not get it to produce meaningful outputs, while the instruction-tuned mT0 worked even on tasks it had not been tuned on, such as NER and check-worthy claim detection.
How the study was run
16
languages with a trained language adapter and prompt
For each language we trained a language adapter and a soft language prompt of 50 vectors on Wikipedia (November 2023 dump), with span corruption: 15% of the tokens are masked and the model learns to restore them. The prompt starts from the embedded instruction "Generate the output in {Language}:", repeated to fill 50 vectors.
- Wikipedia
- Span corruption
- 100,000 steps
- 50-vector prompts
Where each representation sits in the model
- Language representation, trained on Wikipedia
- Task representation, trained on the task
- mT0-BASE, frozen
Lang. prompt + task adapter
- TrainingLanguage promptSpanish+Task adaptertrained on Spanish data
- TestingLanguage promptBulgarian+Task adapterunchanged
- language pairs where it scores best over all tasks
- 22 of 60
- mean score over all pairs and tasks
- 56.67
Findings
Finding 1: A soft language prompt with a task adapter wins most often
Averaged over the four tasks, the soft language prompt with a task adapter scored best in 22 of the 60 source and target pairs, ahead of the task adapter alone (12) and MAD-X (9). It also gave the best average for Arabic, German, Spanish and Russian as source languages.
The highest average of all, 60.96, came from task representations trained in Spanish with this configuration. English did best with a task adapter alone (55.31), and Chinese with two soft prompts (52.17). Chinese gave the lowest average for five of the six configurations.
On NER the soft language prompt with a task adapter won 20 of 60 pairs. On NLI the task adapter alone won 33 of 60, and it also won most often on QA and check-worthy claims.
Best configuration for each source and target language
- Task adapter12
- Task prompt4
- Lang. adapter + task adapter (MAD-X)9
- Lang. adapter + task prompt5
- Lang. prompt + task adapter22
- Lang. prompt + task prompt8
SourcetargetBulgarianbgCzechcsGreekelMalayalammlRomanianroSlovenianslSlovakskSwahiliswTeluguteUrduurArabic71.2348.9867.2249.8265.6655.5348.2651.2153.8049.63German79.9853.8173.4851.7771.5557.7654.5756.7857.5052.34English68.9549.6470.3746.6074.5054.8050.8851.4352.4352.54Spanish75.3755.2373.5051.3973.8358.8854.8457.4757.1254.01Russian83.9652.5273.8650.6373.7552.6051.9955.2156.8953.62Chinese65.9748.7461.6243.0967.4856.0945.5252.1951.0944.69Computed from Tables 3 to 7 of the paper. Each cell is coloured by the configuration with the highest score for that pair and shows that score; the numbers beside the legend count the pairs each configuration wins. Hover a cell for all six scores, or a legend entry to keep only its cells. Bulgarian has no QA dataset. Finding 2: A soft language prompt beats MAD-X in 47 of 60 pairs
Swapping MAD-X's language adapter for a soft language prompt raised the four-task average in 47 of 60 language pairs, and in every one of the six source languages on average.
Task by task, the soft language prompt with a task adapter beat MAD-X in 36 of 54 QA pairs, 46 of 60 NER pairs, 41 of 60 NLI pairs and 36 of 60 check-worthy claim pairs. On check-worthy claims MAD-X still had the higher average when the source language was English, Russian or Chinese.
Both configurations train the same task adapter. They differ only in how the language is represented.
MAD-X against a soft language prompt with a task adapter
- Lang. adapter + task adapter (MAD-X)
- Lang. prompt + task adapter
- mean score, higher is better
- Arabic48.4355.47
- German57.4159.01
- English49.3154.26
- Spanish56.2560.96
- Russian55.2658.50
- Chinese46.8051.80
Average columns of Tables 3 to 7 of the paper: each dot is the mean over the target languages for task representations trained in that source language. The axis range changes with the task. Finding 3: QA transfer helps from English, German and Spanish and hurts from the other sources
Compared with mT0-BASE used as it is, the soft language prompt with a task adapter raised QA F1 in all nine targets when trained on English, but lowered it in every target when trained on Arabic, Russian or Chinese.
German (seven of nine targets) and Spanish (five of nine) also mostly helped. The gains were largest for targets written in Latin script, with English to Slovenian the largest at +5.78, and the losses were largest for Russian and Chinese to Czech, at −9.28 and −9.13. We think the script of the source language plays a part.
QA scores are low overall. mT0-BASE alone reaches 57.00 F1 in Greek and Romanian but under 4 in Malayalam and Swahili. For Telugu and Urdu, the task adapter alone was the best configuration for three and four of the six source languages.
Change in QA F1 over mT0-BASE alone
SourcetargetCzechcsGreekelMalayalammlRomanianroSlovenianslSlovakskSwahiliswTeluguteUrduurArabic−3.39−0.55−1.27−1.19−3.33−2.79−0.81−4.43−0.63German+0.47+2.67−0.57+2.85+4.24+1.03+0.21−1.51+0.04English+4.18+4.17+0.02+4.99+5.78+4.45+0.33+1.55+0.69Spanish+1.09+2.41−0.63+2.05+4.52+1.56−0.02−1.00−0.96Russian−9.28−1.76−0.46−2.62−6.89−3.64−0.61−3.10−1.15Chinese−9.13−4.99−0.84−5.55−7.65−7.57−1.13−4.73−3.78Figure 4 of the paper, from the F1 scores in Table 4. Red cells gained over mT0-BASE without any trained language or task representation, blue cells lost. Hover a cell for both scores. Finding 4: Soft language prompts help NER the most
The largest gap on NER was Russian to Telugu: the soft language prompt with a task adapter reached 55.41 F1, against 18.41 for MAD-X.
MAD-X stayed between 5.56 and 24.52 F1 on Telugu NER, whatever the source language, while the soft language prompt with a task adapter reached between 28.76 and 55.41. The best NER average in the study, 60.25, also came from this configuration, trained on Spanish; the next best was 56.57.
mT0-BASE was never trained on NER and scores 0 without a task representation, so the chart leaves it out.
NER F1 per target language
- Task adapter
- Lang. adapter + task adapter (MAD-X)
- Lang. prompt + task adapter
- Bulgarian
- Czech
- Greek
- Malayalam
- Romanian
- Slovenian
- Slovak
- Swahili
- Telugu
- Urdu
Table 5 of the paper, three of the six configurations. Pick the language the task representation was trained in; hover a row for the scores. Finding 5: A task adapter alone wins most NLI pairs
For NLI, a task adapter alone scored best in 33 of 60 language pairs. MAD-X broke down on Slovenian, where it scored between 0.20 and 16.13 against 68.74 for mT0-BASE alone, 63 points lower on average.
Only one of the 36 trained configurations beat mT0-BASE alone on Slovenian: a language adapter with a task prompt trained on Chinese, at 98.20. Czech and Slovak, where the data is adversarial NLI, stayed between 33.33 and 38.75 for every configuration, close to chance for three classes.
Romanian rose from 4.98 to as much as 90.09. We put this down to Romanian being in the pre-training data of mT5 but not in the instruction tuning of mT0.
NLI accuracy per target language
- mT0-BASE alone
- Task adapter
- Lang. adapter + task adapter (MAD-X)
- Lang. adapter + task prompt
- Bulgarian
- Czech
- Greek
- Malayalam
- Romanian
- Slovenian
- Slovak
- Swahili
- Telugu
- Urdu
Table 6 of the paper, the untrained baseline and three of the six configurations. Pick the language the task representation was trained in; hover a row for the scores. Finding 6: Swahili, Telugu and Urdu often do best without a language representation
For Swahili, Telugu and Urdu, the best configuration had no language representation in more than half of the task and source combinations. For Slovak, Slovenian and Bulgarian it had one in more than three quarters of them.
We think the language representations had too little text to learn from: Wikipedia has few articles in the smallest languages.
Share of wins by configurations without a language representation
- Half of the combinations or more
- Fewer than half
- Swahili (14 of 24)58%
- Urdu (14 of 24)58%
- Telugu (13 of 24)54%
- Greek (10 of 24)42%
- Malayalam (9 of 24)38%
- Romanian (9 of 24)38%
- Czech (6 of 24)25%
- Bulgarian (4 of 18)22%
- Slovenian (3 of 24)13%
- Slovak (2 of 24)8%
Computed from Tables 4 to 7 of the paper. For each target language, the share of the task and source language combinations (24, or 18 for Bulgarian without QA) in which a task adapter or a task prompt alone scored highest. Finding 7: Three seeds pick the same winner as one seed for 8 of 10 targets
We trained one seed for the main results. With three seeds on German NER, MAD-X was best for five targets and the soft language prompt with a task adapter for the other five.
Some configurations vary a lot between seeds: the language adapter with a task prompt has a standard deviation of 14.17 points on Czech, and MAD-X of 11.17 on Urdu. The full study took about 3,200 GPU hours on NVIDIA A10 and A40 cards, which is why the main results use a single seed.
German NER over three seeds
- Task adapter
- Task prompt
- Lang. adapter + task adapter (MAD-X)
- Lang. adapter + task prompt
- Lang. prompt + task adapter
- Lang. prompt + task prompt
- Bulgarian
- Czech
- Greek
- Malayalam
- Romanian
- Slovenian
- Slovak
- Swahili
- Telugu
- Urdu
Table 8 of the paper. Dots are the mean of three runs and the lines through them span one standard deviation on each side. Hover a row for the values, or a legend entry to isolate one configuration.
Results
Datasets
| Task | Dataset | Languages | Source |
|---|---|---|---|
| QA | SQuAD | en | Rajpurkar et al., 2016 |
| MLQA | ardehizhesvi | Lewis et al., 2019 | |
| XQuAD | elro | Artetxe et al., 2020 | |
| SK-QuAD | sk | Hládek et al., 2023 | |
| Czech SQuAD | cs | Macková and Straka, 2020 | |
| TeQuAD | te | Vemula et al., 2022 | |
| KenSwQuAD | sw | Wanjawa et al., 2023 | |
| UQA | ur | Arif et al., 2024 | |
| Slovene SQuAD | sl | Borovič et al., 2022 | |
| IndicQA | ml | Doddapaneni et al., 2023 | |
| NER | WikiANN | arbgcsdeelenesmlroruslskswteurzh | Rahimi et al., 2019 |
| NLI | XNLI | arbgdeelenesruswurzh | Conneau et al., 2018 |
| IndicXNLI | mlte | Aggarwal et al., 2022 | |
| CS ANLI | cssk* | CS-ANLI (Hugging Face) | |
| RoNLI | ro | Poesina et al., 2024 | |
| Sl-NLI | sl | Klemen et al., 2024 | |
| Check-worthy claims | MultiClaim | arbgcsde*el*enesml*ro*ru*sl*sksw*te*ur*zh* | Pikuliak et al., 2023; Hyben et al., 2023 |
Table 1 of the paper, grouped by task. Languages marked with * were machine-translated with Google Translate, from Czech (CS ANLI) or from English (MultiClaim). Bulgarian has no QA dataset.
Training settings
| Language representation | Task representation | |||
|---|---|---|---|---|
| Setting | Adapter | Soft prompt | Adapter | Soft prompt |
| Learning rate | 5e-5 | 5e-1 | 5e-5 | 5e-1 |
| Weight decay | 0 | 1e-5 | 0 | 1e-5 |
| Batch size | 32 | 32 | 32 | 32 |
| Training steps | 100,000 | 100,000 | 50,000 | 50,000 |
| Optimizer | AdamW | Adafactor | AdamW | Adafactor |
| Evaluation every | 500 steps | 500 steps | 1,000 steps | 1,000 steps |
| Max input length | 256 | 256 | 256 | 256 |
| Prompt length | – | 50 vectors | – | 50 vectors |
Table 2 of the paper. Language representations are trained on Wikipedia and task representations on the task data.
Cite
@inproceedings{vykopal-etal-2025-soft,
title = "Soft Language Prompts for Language Transfer",
author = "Vykopal, Ivan and Ostermann, Simon and Simko, Marian",
booktitle = "Proceedings of the 2025 Conference of the Nations of the {A}mericas Chapter of the {A}ssociation for {C}omputational {L}inguistics: Human Language Technologies (Volume 1: Long Papers)",
month = apr,
year = "2025",
address = "Albuquerque, New Mexico",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.naacl-long.517/",
doi = "10.18653/v1/2025.naacl-long.517",
pages = "10294--10313",
}