Model reference · open weights

MEXMA

Embeddings facebook Embeddings 1 build Open weights 1k dl/mo

MEXMA is an open-weight embedding model from Meta. MEXMA (FP32) weighs 1.1 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • MEXMA is a cross-lingual sentence encoder developed by Meta that integrates sentence-level and token-level objectives to improve representation quality.
  • The model has 559M parameters, a context length of 514 tokens, and is released under the MIT license.
  • It is designed for sentence-similarity tasks and utilizes the CLS token directly as the sentence representation.

Summary of the facebook/MEXMA model card, 2026-10-01

What it is

Released byMeta
Released2024-10-04
Parameters559M
VRAM1.1 GB for the weights

What it runs on

Memory and cards for MEXMA (FP32)

1.1 GBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What Meta says about MEXMA

Read the model card

Current pre-trained cross-lingual sentence encoders approaches use sentence-level objectives only. This can lead to loss of information, especially for tokens, which then degrades the sentence representation. We propose MEXMA, a novel approach that integrates both sentence-level and token-level objectives. The sentence representation in one language is used to predict masked tokens in another language, with both the sentence representation and all tokens directly updating the encoder. We show that adding token-level objectives greatly improves the sentence representation quality across several tasks. Our approach outperforms current pre-trained cross-lingual sentence encoders on bi-text mining as well as several downstream tasks. We also analyse the information encoded in our tokens, and how the sentence representation is built from them.

Usage

You use this model as you would any other XLM-RoBERTa model, taking into account that the "pooler" has not been trained, so you should use the CLS the encoder outputs directly as your sentence representation:

from transformers import AutoTokenizer, XLMRobertaModel

tokenizer = AutoTokenizer.from_pretrained("facebook/MEXMA")
model = XLMRobertaModel.from_pretrained("facebook/MEXMA", add_pooling_layer=False)
example_sentences = ['Sentence1', 'Sentence2']
example_inputs = tokenizer(example_sentences, return_tensors='pt')

outputs = model(**example_inputs)
sentence_representation = outputs.last_hidden_state[:, 0]
print(sentence_representation.shape) # torch.Size([2, 1024])

You can also use this model with SentenceTransformers:

from sentence_transformers import SentenceTransformer
model = SentenceTransformer("facebook/MEXMA")
example_sentences = ['Sentence1', 'Sentence2']
sentence_representation = model.encode(example_sentences)
print(sentence_representation.shape) # torch.Size([2, 1024])

License

This model is released under the MIT license.

Training code

For the training code of this model, please check the official MEXMA repo.

Paper

MEXMA: Token-level objectives improve sentence representations

Citation

If you use this model in your work, please cite:

@inproceedings{janeiro-etal-2025-mexma,
    title = "{MEXMA}: Token-level objectives improve sentence representations",
    author = "Janeiro, Jo{\~a}o Maria  and
      Piwowarski, Benjamin  and
      Gallinari, Patrick  and
      Barrault, Loic",
    editor = "Che, Wanxiang  and
      Nabende, Joyce  and
      Shutova, Ekaterina  and
      Pilehvar, Mohammad Taher",
    booktitle = "Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2025",
    address = "Vienna, Austria",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.acl-long.1168/",
    doi = "10.18653/v1/2025.acl-long.1168",
    pages = "23960--23995",
    ISBN = "979-8-89176-251-0",
    abstract = "Cross-lingual sentence encoders (CLSE) create fixed-size sentence representations with aligned translations. Current pre-trained CLSE approaches use sentence-level objectives only. This can lead to loss of information, especially for tokens, which then degrades the sentence representation. We propose MEXMA, a novel approach that integrates both sentence-level and token-level objectives. The sentence representation in one language is used to predict masked tokens in another language, with both the sentence representation and *all tokens directly update the encoder*. We show that adding token-level objectives greatly improves the sentence representation quality across several tasks. Our approach outperforms current pre-trained cross-lingual sentence encoders on bitext mining as well as several downstream tasks. We also analyse the information encoded in our tokens, and how the sentence representation is built from them."
}

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms