Omnilingual SONAR: Cross-Lingual and Cross-Modal Sentence Embeddings Bridging Massively Multilingual Text and Speech
Organizations: FAIR at Meta
Abstract
Cross-lingual sentence encoders typically cover only a few hundred languages and often trade downstream quality for stronger alignment, limiting their adoption. We introduce OmniSONAR, a new family of omnilingual, cross-lingual and cross-modal sentence embedding models that natively embed text, speech, code, and mathematical expressions in a single semantic space, while delivering state-of-the-art downstream performance at the scale of thousands of languages, from high-resource to extremely low-resource varieties. To reach this scale without representation collapse, we use progressive training. We first learn a strong foundational space for 200 languages with an LLM-initialized encoder-decoder, combining token-level decoding with a novel split-softmax contrastive loss and synthetic hard negatives. Building on this foundation, we expand to several thousands language varieties via a two-stage teacher-student encoder distillation framework. Finally, we demonstrate the cross-modal extensibility of this space by seamlessly mapping 177 spoken languages into it. OmniSONAR halves cross-lingual similarity search error on the 200-language FLORES dataset and reduces error by a factor of 15 on the 1,560-language BIBLE benchmark. It also enables strong translation, outperforming NLLB-3B on multilingual benchmarks and exceeding prior models (including much larger LLMs) by 15 chrF++ points on 1,560 languages into English BIBLE translation. OmniSONAR also performs strongly on MTEB and XLCoST. For speech, OmniSONAR achieves a 43% lower similarity-search error and reaches 97% of SeamlessM4T speech-to-text quality, despite being zero-shot for translation (trained only on ASR data). Finally, by training an encoder-decoder LM, Spectrum, exclusively on English text processing OmniSONAR embedding sequences, we unlock high-performance transfer to thousands of languages and speech for complex downstream tasks.
Figures & tables
| Example 1: Python | |
| Source | if input_event["enable_points"] or event_info.get("bonus"): |
| Target | The script determines if the "enable_points" in the input_event dictionary is set to True, or if the event_info dictionary includes a key called "bonus" with any associated value. |
| Example 2: JavaScript | |
| Source | const DataHandler = require(’./lib/dataHandler.js’); let windowRef; const dataHandler = new DataHandler({}); |
| Target | A constant named DataHandler is initialized by importing a module from a file called dataHandler.js located in a folder named lib , then a variable windowRef is declared, and a constant dataHandler is created as a new instance of DataHandler , passing an empty object to its constructor. |
| Example 3: Math | |
| Original Sentence | Generated hard negatives |
| It was carrying a special mission unit | It was not carrying a special mission unit |
| It is carrying a normal mission unit | |
| She was carrying a special mission unit | |
| It will be carrying a special mission team | |
| It was carrying 12 special mission units |
| Parameter | Foundational | New |
| MSE weight ( ) | ||
| Student-Teacher Contrastive weight ( \lambda^{\text{s \rightarrow t}} ) | ||
| Teacher-Student Contrastive weight ( \lambda^{\text{t \rightarrow s}} ) | ||
| Logit scale ( ) | ||
| Teacher Embedding ( ) | Interpolated source-target † | Target |
| Language drop prob. ( ) |
| BIBLE | FLORES | |||||
| Model | xsim | chrF++ | xsim++ | chrF++ | ||
| (a) Omnilingual Vocabulary Adaptation warm-up | ||||||
| without | 4.8 | 37.1 | 5.9 | 55.4 | ||
| with | 4.8 | 37.7 | 5.6 | 56.0 | ||
| (b) Loss function for foundational Languages | ||||||
| MSE | Contr. s t | Contr. t s | ||||
| BIBLE | FLORES | FLORES+ | |||||||||||
| Vocabulary | Params | xsim | chrF++ | Fert. | Thr. | xsim++ | chrF++ | Fert. | Thr. | xsim++ | chrF++ | Fert. | Thr. |
| 200-lang Vocabularies | |||||||||||||
| 256K | 1.5 | 4.7 | 37.5 | 57.5 | 264 | 5.6 | 55.9 | 43.2 | 523 | 14.3 | 43.3 | 76.4 | 130 |
| Omnilingual Vocabularies | |||||||||||||
| 8K | 1.0 | 4.6 | 37.5 | 73.2 | 263 | 5.6 | 55.8 | 70.3 | 321 | 14.5 | 43.7 | 78.2 | 335 |
| 16K | 1.0 | 4.8 | 37.6 | 66.9 | 297 | 5.6 | 55.9 | 62.7 | 365 | 14.6 | 43.9 | 70.2 | 378 |
| chrF++ (Translation Quality) | xsim (Similarity Search Error) | |||||
| Feature | Importance | 95% CI | Rank | Importance | 95% CI | Rank |
| Tokenizer Fertility | 22.61 | [20.88, 24.75] | 1 | 5.12 | [4.43, 5.73] | 2 |
| Family Examples | 14.19 | [13.23, 15.13] | 2 | 4.47 | [3.99, 5.19] | 3 |
| Language Examples | 12.03 | [11.11, 12.99] | 3 | 6.86 | [6.07, 7.59] | 1 |
| Latitude | 6.89 | [6.50, 7.42] | 4 | 3.63 | [3.18, 4.23] | 4 |
| Longitude | 5.53 | [5.10, 6.09] | 5 | 3.46 | [3.06, 3.79] | 5 |
| AE BLEU1 | AE BLEU2 | AE BLEU3 | AE BLEU4 | AE BLEU | |
| Spectrum auto-encode | 99.9 | 99.8 | 99.7 | 99.6 | 99.71 |
| Model | XBelebele | SIB200 | Taxi1500 |
| Llama 3.2 3B Instruct | 53.03 | 65.69 | 19.67 |
| Llama 3.1 8B Instruct | 63.06 | 66.07 | 24.18 |
| Spectrum 6B-3B | 61.85 | 79.95 | 36.9 |
| T T | S T | |
| Speech-XBelebele | 63.64 | 62.74 |
| Speech-SIB100 | 85.11 | 82.59 |
| Dataset/task | #Test languages | Example |
| Word alignment | 14 | The necessary correction will be made . Eine entsprechende Anderung wird vorgenommen werden . |
| Massive | 52 | What is today ’s forecast for Berlin DATE PLACE |
| PAN-X | 40 | REDIRECCIÓN Algarrobo ( Chile ) B-LOC I-LOC |
| WiC | 6 | \left.\begin{array}[]{@{}l@{}}\text{Bolivia holds a key \lx@text@underline{play} in this process of peace.}\\ \text{A musical \lx@text@underline{play} on the same subject was also staged.}\end{array}\right\}\ \begin{array}[]{@{}l@{}}\text{Different}\\ \text{meaning}\end{array} |
Appendix figures & tables24 assets
Supplementary material from the paper’s appendix.
Appendix
| Pattern | Description |
| Inline math (e.g., ) | |
| Display math with double dollar signs | |
| $(.*?)$ | Display math with |
| \begin{equation}(.*?)\end{equation} | Equation environment |
| \begin{align}(.*?)\end{align} | Align environment |
| \begin{align*}(.?)\end{align} | Align* environment |
| Original sentence | Generated hard negatives |
| Tonight will be long. | Tonight will not be short |
| Yesterday may be long | |
| Tomorrow will be short | |
| Tonight may not be long | |
| Last night was short | |
| You got the archaeologist and the psychologist wrong. | You did not get the archaeologist and the psychologist right |
| Code | Language | Script | Family | Subgrouping | Res. | |
| ace_Arab | Acehnese | Arabic | Austronesian | Malayo-Polynesian | Low | |
| ace_Latn | Acehnese | Latin | Austronesian | Malayo-Polynesian | Low | |
| acm_Arab | Mesopotamian Arabic | Arabic | Afro-Asiatic | Semitic | Low | |
| acq_Arab | Ta’izzi-Adeni Arabic | Arabic | Afro-Asiatic | Semitic | Low | |
| aeb_Arab | Tunisian Arabic | Arabic | Afro-Asiatic | Semitic | Low | |
| afr_Latn | Afrikaans | Latin | Indo-European | Germanic | High |
| Code | Language | Script | Family | Subgrouping | Res. |
| ita_Latn | Italian | Latin | Indo-European | Italic | High |
| jav_Latn | Javanese | Latin | Austronesian | Malayo-Polynesian | Low |
| jpn_Jpan | Japanese | Japanese | Japonic | Japanesic | High |
| kab_Latn | Kabyle | Latin | Afro-Asiatic | Berber | Low |
| kac_Latn | Jingpho | Latin | Sino-Tibetan | Brahmaputran | Low |
| kam_Latn | Kamba | Latin | Atlantic-Congo | Benue-Congo | Low |
| Code | Language | Script | Family | Subgrouping | Res. |
| smo_Latn | Samoan | Latin | Austronesian | Malayo-Polynesian | Low |
| sna_Latn | Shona | Latin | Atlantic-Congo | Benue-Congo | Low |
| snd_Arab | Sindhi | Arabic | Indo-European | Indo-Aryan | Low |
| som_Latn | Somali | Latin | Afro-Asiatic | Cushitic | Low |
| sot_Latn | Southern Sotho | Latin | Atlantic-Congo | Benue-Congo | High |
| spa_Latn | Spanish | Latin | Indo-European | Italic | High |
| Languages | ||||||
| ace_Arab | ace_Latn | acm_Arab | acq_Arab | aeb_Arab | afr_Latn | ajp_Arab |
| aka_Latn | als_Latn | amh_Ethi | apc_Arab | arb_Arab | ars_Arab | ary_Arab |
| arz_Arab | asm_Beng | ast_Latn | awa_Deva | ayr_Latn | azb_Arab | azj_Latn |
| bak_Cyrl | bam_Latn | ban_Latn | bel_Cyrl | bem_Latn | ben_Beng | bho_Deva |
| bjn_Arab | bjn_Latn | bod_Tibt | bos_Latn | bug_Latn | bul_Cyrl | cat_Latn |
| ceb_Latn | ces_Latn | cjk_Latn | ckb_Arab | crh_Latn | cym_Latn | dan_Latn |
| Seq2Seq | Contrastive | |||||||
| Dataset | pairs | dirs | source | target | pairs | dirs | source | target |
| BT Math | 445M | 56 | 8 | 8 | – | – | – | – |
| Dictionary | 153M | 3.3K | 182 | 97 | – | – | – | – |
| Code/Math Eng | 1B | 9 | 9 | 1 | 9.0M | 9 | 9 | 1 |
| Eng Code | 941M | 8 | 1 | 8 | – | – | – | – |
| Eng Math | 80M | 1 | 1 | 1 | – | – | – | – |
| Langs | Examples | ||||
| Group | Train | Dev | Total (M) | Median (K) | Note |
| Resource-based grouping ( Figures 4(a) and 4(b) ) | |||||
| A | 211 | 140 | 2,764 | 541 | High-resource |
| B | 300 | 246 | 93 | 104 | |
| C | 300 | 269 | 17 | 55 | |
| D | 300 | 275 | 11 | 37 | |
| Parameter | Large | Medium | Small | Tiny | xTiny |
| vocab_size | 256,232 | 128,232 | 64,232 | 32,232 | 16,232 |
| hidden_size | 2,048 | 1,792 | 1,536 | 1,152 | 512 |
| intermediate_size | 8,192 | 7,168 | 6,144 | 4,608 | 2,048 |
| num_hidden_layers | 16 | 14 | 12 | 10 | 8 |
| num_attention_heads | 32 | 28 | 24 | 18 | 16 |
| num_key_value_heads | 8 | 7 | 6 | 6 | 4 |
| Model | xsim | xsim++ |
| Mean | 0.68 | 9.25 |
| CLS | 0.64 | 8.77 |
| model | std | mean |
| MEXMA | 0.0312 | -0.0011 |
| mE5 large | 0.0312 | -0.0008 |
| LaBSE | 0.0358 | 0.0049 |
| SONAR | 0.0074 | 0.0000 |
| OmniSONAR | 0.0356 | -0.0006 |
| System | Source Sentence | Desired Retrieved | Actual Retrieved |
| OmniSONAR | O Corpo de Engenheiros dos EUA estimou que 15 cm de chuva podem romper os diques anteriormente danificados. | The U.S. Corps of Engineers estimated that 6 inches of rainfall could breach the previously damaged levees. | The U.S. Corps of Engineers estimated that 15 inches of rainfall could breach the previously damaged levees. |
| OmniSONAR | Os limites de velocidade anunciados sao visivelmente mais baixos do que nas secoes anteriores e subsequentes - comumente 55-65 km/h - e a estrita obediencia a eles e ainda mais importante do que o contrario. | Posted speed limits are noticeably lower than in previous and subsequent sections commonly 35-40 mph (56-64 km/h) and strict obedience to them is even more important than otherwise. | Posted speed limits are noticeably lower than in previous and subsequent sections commonly 35-90 mph (56-64 km/h) and strict obedience to them is even more important than otherwise. |
| MEXMA | O Corpo de Engenheiros dos EUA estimou que 15 cm de chuva podem romper os diques anteriormente danificados. | The U.S. Corps of Engineers estimated that 6 inches of rainfall could breach the previously damaged levees. | The U.S. Corps of Engineers estimated that 15 inches of rainfall could breach the previously damaged levees. |
| MEXMA | Reportagens televisivas divulgam a fumaca esbranquicada saindo da planta. | Television reports show white smoke coming from the plant. | Television reports show black smoke coming from the plant. |
| SONAR | No periodo de um ano, uma pessoa infectada pode infectar entre 10 e 15 contatos proximos. | In one year’s time, an infected person may infect 10 to 15 close contacts. | In one year’s time, an infected person will infect 10 to 15 close contacts. |
| SONAR | Aconteceu novamente no mesmo mes em Mashhad, outro aviao comercial entrou em uma pista e atingiu uma parede, matando dezessete pessoas. | The same month saw another airliner overrun a runway at Mashhad and strike a wall, killing seventeen. | The same month did not saw another airliner overrun a runway at Mashhad and strike a wall, killing seventeen. |
| Source | Prompt Template |
| Encoder | |
| Source/Anchor | "<CLS><s> [LANGUAGE]:<SEP> [INPUT SENTENCE] </s>" |
| Decoder | |
| Primary data | "<s> This is a possible translation in [LANGUAGE]:<SEP> [INPUT SENTENCE] </s>" |
| Mined data | "<s> This is a possible mined translation in [LANGUAGE]:<SEP> [INPUT SENTENCE] </s>" |
| Back-translations | "<s> This is a possible back-translation in [LANGUAGE]:<SEP> [INPUT SENTENCE] </s>" |
| Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 |
| ace_Arab | 6.23 | 96.44 | 57.91 | 8.60 | 77.77 | ace_Latn | 0.30 | 32.61 | 8.60 | 0.10 | 8.70 | acm_Arab | 0.10 | 0.30 | 0.00 | 0.00 | 0.10 | acq_Arab | 0.00 | 0.10 | 0.00 | 0.00 | 0.10 |
| aeb_Arab | 0.40 | 4.94 | 0.20 | 0.20 | 0.99 | afr_Latn | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | ajp_Arab | 0.10 | 0.49 | 0.00 | 0.00 | 0.20 | aka_Latn | 0.30 | 53.46 | 44.86 | 0.10 | 7.21 |
| als_Latn | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | amh_Ethi | 0.00 | 0.00 | 0.00 | 0.00 | 0.40 | apc_Arab | 0.10 | 1.09 | 0.00 | 0.00 | 0.10 | arb_Arab | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| ars_Arab | 0.10 | 0.00 | 0.00 | 0.00 | 0.10 | ary_Arab | 0.99 | 13.14 | 0.99 | 0.89 | 2.77 | arz_Arab | 0.20 | 0.69 | 0.10 | 0.00 | 0.40 | asm_Beng | 0.10 | 1.78 | 0.00 | 0.00 | 0.69 |
| ast_Latn | 0.00 | 0.20 | 0.00 | 0.00 | 0.00 | awa_Deva | 0.99 | 1.09 | 0.89 | 0.89 | 0.99 | ayr_Latn | 3.85 | 72.13 | 54.25 | 1.68 | 43.97 | azb_Arab | 2.96 | 44.37 | 1.68 | 0.69 | 11.36 |
| azj_Latn | 0.30 | 0.30 | 0.20 | 0.20 | 0.20 | bak_Cyrl | 0.00 | 41.90 | 11.36 | 0.00 | 1.68 | bam_Latn | 4.05 | 65.61 | 52.37 | 2.17 | 14.62 | ban_Latn | 0.40 | 8.40 | 1.09 | 0.30 | 2.57 |
| Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 | Lang | SONAR | LaBSE | MEXMA | OmniSONAR | mE5 |
| ace_Arab | 55.34 | 100.00 | 92.09 | 36.76 | 98.91 | ace_Latn | 16.30 | 82.21 | 49.41 | 8.10 | 48.22 | acm_Arab | 11.17 | 52.67 | 9.39 | 5.83 | 27.37 | acq_Arab | 8.30 | 46.54 | 8.20 | 10.87 | 23.02 |
| aeb_Arab | 11.76 | 66.60 | 13.64 | 6.72 | 31.72 | afr_Latn | 5.14 | 9.49 | 4.64 | 1.19 | 13.34 | ajp_Arab | 7.61 | 54.15 | 9.19 | 5.24 | 23.81 | aka_Latn | 19.47 | 92.39 | 85.18 | 10.77 | 42.79 |
| als_Latn | 5.14 | 10.97 | 9.39 | 1.78 | 18.48 | amh_Ethi | 8.60 | 28.85 | 6.23 | 3.36 | 43.48 | apc_Arab | 9.58 | 58.00 | 12.65 | 5.14 | 28.46 | arb_Arab | 6.82 | 35.87 | 6.72 | 2.37 | 19.27 |
| ars_Arab | 13.93 | 39.72 | 12.65 | 8.50 | 23.52 | ary_Arab | 14.03 | 77.08 | 22.23 | 12.45 | 39.03 | arz_Arab | 10.87 | 58.99 | 11.46 | 4.84 | 24.51 | asm_Beng | 14.92 | 62.15 | 11.17 | 6.42 | 41.50 |
| ast_Latn | 9.68 | 38.04 | 14.13 | 6.82 | 19.86 | awa_Deva | 11.07 | 26.98 | 12.06 | 3.75 | 27.67 | ayr_Latn | 34.78 | 97.43 | 83.10 | 19.27 | 85.77 | azb_Arab | 42.59 | 94.76 | 32.61 | 21.25 | 65.32 |
| azj_Latn | 14.03 | 17.98 | 10.77 | 6.13 | 29.45 | bak_Cyrl | 11.46 | 91.90 | 51.09 | 3.56 | 40.71 | bam_Latn | 30.14 | 95.26 | 85.67 | 17.09 | 61.56 | ban_Latn | 13.04 | 60.38 | 29.15 | 6.13 | 36.26 |
| Family | Langs | Examples | xsim | chrF++ | Family | Langs | Examples | xsim | chrF++ | |
| Indo-European | 535 | 6,329,570 | 0.9 | 56.3 | Huitotoan | 3 | 107 | 6.1 | 32.3 | |
| Atlantic-Congo | 652 | 464,728 | 2.8 | 43.3 | Border | 2 | 105 | 6.1 | 31.4 | |
| Afroasiatic | 196 | 419,370 | 4.2 | 44.0 | Eastern Daly | 3 | 102 | 7.5 | 31.1 | |
| Turkic | 82 | 410,656 | 0.6 | 55.4 | Kunimaipan | 3 | 96 | 9.3 | 29.9 | |
| Dravidian | 39 | 369,957 | 1.9 | 49.7 | Araucanian | 3 | 90 | 4.5 | 38.9 | |
| Austronesian | 795 | 315,373 | 3.0 | 41.8 | Lengua-Mascoy | 6 | 84 | 12.2 | 31.4 |
Sentence Embeddings
Sentence embeddings map sentences to vectors for semantic similarity, retrieval, clustering, and downstream language tasks.
See all 35 papers