BrazEmbed-PT-BR

BrazEmbed-PT-BR is a sentence-embedding model based on BERTimbau, the Brazilian BERT (110M parameters) pretrained by NeuralMind on the brWaC web corpus. BERTimbau is a masked language model, not an embedding model. BrazEmbed adds the embedding training on top of it: a contrastive stage that builds the sentence-embedding space, four task-specialised fine-tunes, and a merge of those four into this single model.

  • Size: 110M parameters, 768-dimensional embeddings, mean pooling, max 128 tokens, no instruction prefix.
  • MTEB-BR (por, v1): 57.5 mean over the 7 task types (21 native Brazilian-Portuguese tasks). That is the best score among models up to ~110M parameters, +13.4 points over its own base (BERTimbau, 44.1), and a point on the benchmark's Pareto frontier: no model on the leaderboard is both smaller and better.
  • Base: neuralmind/bert-base-portuguese-cased. License: MIT.

Usage

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("tardellirs/brazembed-pt-br")
sentences = [
    "O Brasil Γ© um paΓ­s tropical da AmΓ©rica do Sul.",
    "A RepΓΊblica Federativa do Brasil fica na AmΓ©rica Latina.",
    "OperaΓ§Γ΅es matemΓ‘ticas envolvem soma e multiplicaΓ§Γ£o.",
]
emb = model.encode(sentences, normalize_embeddings=True)   # 768-d, L2-normalised
print(emb @ emb.T)                                          # cosine similarities

No query/passage prefix is needed; the same encoder is used for queries and documents.

Results on MTEB-BR

MTEB-BR (por, v1) is a benchmark of 21 tasks built only from data created or found in Brazilian Portuguese (no machine translation), across 7 task types (arXiv 2607.04581). The score is the mean of the 7 task-type averages.

MTEB-BR quality vs. size: BrazEmbed-PT-BR on the Pareto frontier

Models of the same size (~100–120M parameters), plus the base model:

Model Params MTEB-BR Classif. Multilabel Pair clf. STS Clustering Retrieval Reranking
BrazEmbed-PT-BR 109M 57.5 69.8 25.7 81.3 78.2 49.2 50.8 47.6
serafim-100m-portuguese-pt-sentence-encoder-ir 109M 55.9 69.6 24.3 79.4 77.1 40.2 51.8 48.7
multilingual-e5-small 118M 55.0 69.3 24.6 76.1 74.0 42.5 50.7 48.0
granite-embedding-107m-multilingual 107M 53.9 68.3 23.6 71.6 70.5 42.7 51.0 50.0
BERTimbau-base (no embedding training) 109M 44.1 73.3 23.3 60.2 62.9 31.8 26.9 30.1

Strengths are pair classification, STS and clustering. Retrieval and reranking are on par with the other ~100M models rather than ahead of them; for retrieval-heavy use, see the routed retrieval expert below or a larger model. Live leaderboard with all 122 models: https://huggingface.co/spaces/MTEB-BR/leaderboard

How it was trained

neuralmind/bert-base-portuguese-cased (MLM, 110M)
   β”‚  Stage 1 β€” contrastive, full fine-tune (symmetric in-batch InfoNCE, mean pooling)
   β–Ό
Stage-1 encoder ──► four task experts (LoRA r=16, merged into full weights, then weight-souped)
   β”‚                  β”œβ”€ classification + clustering   β†’ brazembed-pt-br-clfclu
   β”‚                  β”œβ”€ pair classification (NLI)     β†’ brazembed-pt-br-pairclf
   β”‚                  β”œβ”€ semantic similarity (STS)     β†’ brazembed-pt-br-sts
   β”‚                  └─ retrieval + reranking         β†’ brazembed-pt-br-retrieval
   β–Ό
TIES merge of the four experts (density 0.6, Ξ» = 1.0)  β†’ brazembed-pt-br  (this model)
  1. Stage 1 (embedding space). Full fine-tune of BERTimbau with symmetric in-batch InfoNCE on 3,633 Portuguese query–passage pairs generated with Gemini across medical, legal, encyclopedic and web domains (batch 64, lr 2e-5, 300 steps). This alone lifts the MLM from a weak to a usable embedder; larger synthetic sets (6k–9.5k pairs) did not help.
  2. Task experts. On the frozen Stage-1 encoder, one LoRA adapter (r=16) per task group, merged into the weights. Each deployed expert is a uniform weight-soup (plain average, no weighting or greedy selection) of 2–4 checkpoints from the same start:
    • Classification + clustering: 50/50 soup of Stage 1 and an InfoNCE adapter trained on PLUE NLI (252k triples), with EmbeddingGemma-300m used to mask false in-batch negatives.
    • Pair classification: soup of two NLI adapters: PLUE NLI with an embedding-matching term towards EmbeddingGemma-300m similarities, and PLUE plus 33.7k MoritzLaurer multilingual NLI rows.
    • STS: 4-seed soup trained with CoSENT on 14,739 pairs (STSb machine-translated, ASSIN2 train, ASSIN train).
    • Retrieval: soup of three adapters trained with InfoNCE plus mined hard negatives on mMARCO-pt (400k), SQuAD-pt_BR (78k), Ulysses-RFCorpus (4.2k) and 5,851 synthetic legal QA pairs (federal-law passages, Gemini queries).
  3. Single model. TIES merge (trim by magnitude, sign election, disjoint mean) of the four experts as task vectors relative to Stage 1, with standard parameters (density 0.6, Ξ» = 1.0), not tuned on the test sets.

Training ran on single A10G GPUs (Modal) in June 2026.

Routed system (four experts)

The four experts are released separately and can be routed by task type with route.py. On the 16-task development version of the benchmark the routed system scored 0.6567 against 0.6372 for this single model: one set of weights cannot be optimal for both topic geometry (clustering) and retrieval geometry at once.

Expert Use for
brazembed-pt-br-clfclu classification, clustering
brazembed-pt-br-pairclf pair classification / NLI
brazembed-pt-br-sts semantic similarity
brazembed-pt-br-retrieval retrieval, reranking

Data and contamination

  • Checked against the benchmark test sets (exact match on normalised text): mMARCO-pt against the Quati judged pool (0 of 8.8M passages and 0 of 400k training pairs overlap), and SQuAD-pt_BR and Ulysses-RFCorpus against FaQuAD, JurisTCU, BRTaxQA and Quati (0 overlap).
  • ASSIN leak found and removed. A self-audit found 10 ASSIN2-STS test pairs in the STS training set (via machine-translation collisions in STSb-MT); they were removed and the STS expert was retrained. eduagarcia/sick-br was dropped entirely (363 exact pairs overlap with the ASSIN2 test set).
  • Uses benchmark-family training splits: the STS expert is trained on the ASSIN and ASSIN2 train splits, and the benchmark scores the test splits. STS scores should be read with that in mind.
  • Not hash-checked: the Gemini-generated Stage-1 pairs and the synthetic legal QA pairs (checked only against the Quati pool), and PLUE NLI (translated GLUE, not Brazilian-native text).
  • Teacher model: EmbeddingGemma-300m was used as a guide and similarity teacher for the classification/clustering and pair-classification experts.

Limitations

  • Max 128 tokens: long documents are truncated, which limits long-passage retrieval.
  • Development was iterative against the 16-task version of the benchmark (no held-out split), so the choice of soups carries some selection optimism; the soups are uniform and the merge parameters untuned to limit it.
  • Trained and evaluated for Brazilian Portuguese; quality on European Portuguese or other languages is not measured.

Citation

If you use BrazEmbed-PT-BR or the MTEB-BR results, please cite the benchmark:

@article{stekel2026mtebbr,
  title   = {MTEB-BR: A Text Embedding Benchmark for Brazilian Portuguese},
  author  = {Stekel, Tardelli Ronan Coelho},
  journal = {arXiv preprint arXiv:2607.04581},
  year    = {2026}
}

and BERTimbau (Souza, Nogueira and Lotufo, BRACIS 2020).

Downloads last month
238
Safetensors
Model size
0.1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for tardellirs/brazembed-pt-br

Finetuned
(260)
this model

Space using tardellirs/brazembed-pt-br 1

Collection including tardellirs/brazembed-pt-br

Paper for tardellirs/brazembed-pt-br