From: facebook <huggingface.co/facebook>Newsgroups: alt.freeweights.embedSubject:

MEXMA

Date: 2026-11-15Commit: c23e4c6Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 559M parameters. Safetensors weights, 2.26 GB in all. Published by facebook under MIT.

559M params2.26GBMEXMAsafetensorspermissive
FactsParams559MSize2.26 GBFormatssafetensorsTasksentence similarityLicenseMITFrom sourcepermissive
$ fw get facebook/MEXMA
# manifest sha256 6dd0abd36416… · 2.26 GB · 12 files
$ fw verify ./MEXMA facebook/MEXMA
From sourceHosted (signed)facebook/MEXMALast check: 2026-11-15 03:48 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of xlm-roberta-large.

Works with

Evaluate with

Overview

Size
2.26 GB
Weights
2.24 GB (safetensors)
Parameters
559M
Formats
safetensors
Task
sentence similarity
License
MIT (permissive)
Files
12, each with a sha256
Publisher
facebook
Added
2026-11-15
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Base model: FacebookAI/xlm-roberta-large

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:48 UTCpassed

Model card

From the publisher at commit c23e4c6. Shown as plain text with links; images open at the publisher.

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."
}

Files

12 files · 2.26 GBWeights 2.24 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 12 files with their sha256
FileSizesha256
.gitattributes1.57 KB34448b82c17d60fec9b65b1f093c115ddbaadc04beb1b0140b6bfed2e012a930
1_Pooling/config.json286 B54747e41599650199f469acd305a93300e02e5a42ac589b5c10b1b991aacc699
README.md4.14 KB061d90651fa8cf22bd4b63715c4584a315bc0034cb529cdb0d9b783596f2fdbb
config.json663 B0641e714116bcf6064a006ee3ff53c3e763b9a2f4ccc6a0e26383116e6be4e16
config_sentence_transformers.json197 B58c70afd0e6bb271c6fbaa3bbb270239bdde9f5362efa202e548df402a795391
model.safetensors2.24 GBe7012b7b66cef0088c558efc4382e11fc2a36f910e2f27777b905207f8696068
modules.json229 B8f4b264b80206c830bebbdcae377e137925650a433b689343a63bdc9b3145460
sentence_bert_config.json57 B948201d8329907aae938fa62f9ceeed53f5694dacc2b87b9f3b78b37ee986529
sentencepiece.bpe.model5.07 MBcfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
special_tokens_map.json280 B06e405a36dfe4b9604f484f6a1e619af1a7f7d09e34a8555eb0b77b66318067f
tokenizer.json17.1 MB3a56def25aa40facc030ea8b0b87f3688e4b3c39eb8b45d5702b3a1300fe2a20
tokenizer_config.json1.18 KBccf223ba3d5b3cc7fa6c3bf451f3bb40557a5c92b0aa33f63d17802ff1a96fd9
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
c23e4c68ec pinned now2026-11-15 03:48 UTC12 files · 2.26 GB

Use it

$ fw get facebook/MEXMA
# manifest sha256 6dd0abd36416… · 2.26 GB · 12 files
$ fw verify ./MEXMA facebook/MEXMA
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/facebook/MEXMA.json --dir ./MEXMA $ python3 fw.py verify ./MEXMA ./facebook__MEXMA.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download facebook/MEXMA --revision c23e4c68ecc94a32c483fed8e947ccd0caaa3e58 --local-dir ./MEXMA
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("facebook/MEXMA", revision="c23e4c68ecc94a32c483fed8e947ccd0caaa3e58") model = AutoModel.from_pretrained("facebook/MEXMA", revision="c23e4c68ecc94a32c483fed8e947ccd0caaa3e58", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("facebook/MEXMA", revision="c23e4c68ecc94a32c483fed8e947ccd0caaa3e58") vectors = model.encode(["Hello"])

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
061d90651fa8cf22bd4b63715c4584a315bc0034cb529cdb0d9b783596f2fdbb
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: facebook <huggingface.co/facebook>Newsgroups: alt.freeweights.embedSubject: MEXMADate: 2026-11-15Commit: c23e4c6Signed: 2DC28CC7B26A283B ✓
Upstream
facebook/MEXMA
Pinned commit
c23e4c68ecc94a32c483fed8e947ccd0caaa3e58
Manifest
MEXMA.json · .minisig
Manifest sha256
6dd0abd364163714b26f4493d8ab9ab0896ddbd0dfa7b5c2cb197984e13d2c47
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:48 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/facebook/MEXMA.json $ curl -O https://freeweights.allternit.com/manifests/facebook/MEXMA.json.minisig $ minisign -Vm MEXMA.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

FacebookAI/xlm-roberta-large · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download facebook/MEXMA
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. MEXMA.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens