Skip to main content
Back

UAE-Large-V1 Beats Bigger Embedding Models With a Math Trick

Universal AnglE Embedding delivers state-of-the-art semantic search from a 335M-parameter BERT backbone, crossing 1.4 million downloads on Hugging Face.

Pro

  • UAE-Large-V1 is a 335M-parameter English sentence embedding model on Hugging Face, MIT-licensed.
  • Trained with AnglE, which optimizes angles in complex space to avoid cosine gradient saturation.
  • Hit SOTA on MTEB with a 64.64 average score at release time.
  • Crossed 1.4M downloads and 3,900+ likes, ships in Safetensors, ONNX, and OpenVINO.
  • Works with sentence-transformers, Transformers, Transformers.js, and Infinity server out of the box.
  • Retrieval requires Prompts.C for queries; documents are encoded without any prompt.

A 335M-parameter English sentence embedding model called UAE-Large-V1 has quietly become one of the most-downloaded encoders on Hugging Face, clocking over 1.4 million downloads and nearly 4,000 likes. Built on top of the AnglE training technique, it packs a specific mathematical trick that dodges a long-standing problem with cosine-based training objectives.

The cosine trap it sidesteps

Most sentence encoders are trained with a cosine similarity loss, which suffers from vanishing gradients in the saturation zones of the cosine function. When two vectors are already very close or very far apart, the curve flattens and the gradient collapses toward zero, so the model stops learning from those examples. Hard negatives, the pairs you most want the encoder to distinguish, are exactly where this hurts.

AnglE addresses the issue by introducing angle optimization in a complex space, keeping the training signal flowing even for hard-to-rank pairs. The resulting embeddings tend to score well on nuanced similarity tasks where competitors plateau.

Benchmark position

At release, UAE-Large-V1 achieved SOTA on the MTEB Leaderboard with an average score of 64.64. The training approach was later formalized as AoE: Angle-optimized Embeddings for Semantic Textual Similarity, accepted to ACL 2024. Self-reported MTEB numbers on the model card include:

  • 75.55 accuracy on AmazonCounterfactualClassification (en)
  • 92.84 accuracy and 89.58 AP on AmazonPolarityClassification
  • 48.29 accuracy on AmazonReviewsClassification (en)
  • 982 total evaluations logged across MTEB tasks

Newer proprietary and 7B-parameter embedding models have since edged past it on the leaderboard, though UAE-Large-V1 remains competitive at a fraction of the size and cost, and it runs on a single consumer GPU.

How to actually use it

The model is MIT-licensed and free, with citation requested for academic use. It ships in Safetensors, ONNX, and OpenVINO formats, and works out of the box with sentence-transformers, Transformers, and Transformers.js.

One gotcha for retrieval workloads: queries need a specific prompt template, while documents do not. Here is the minimal pattern:

from angle_emb import AnglE, Prompts
from angle_emb.utils import cosine_similarity
angle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1',
                              pooling_strategy='cls').cuda()
qv = angle.encode(Prompts.C.format(text='what is the weather?'))
docs = angle.encode(['The weather is great!',
                     'it is rainy today.',
                     'i am going to bed'])

For classification, clustering, or symmetric similarity you skip Prompts.C entirely and just call encode. Deployment is equally straightforward: the model card ships a one-line Docker command for Infinity, an OpenAI-API-compatible embedding server, which is useful if you want to drop this into an existing RAG stack that already talks to the OpenAI embeddings endpoint.

Where it fits, where it does not

Good fits:

  • English semantic search and RAG retrieval on modest hardware
  • Duplicate detection, deduplication, and clustering pipelines
  • Classification heads built on frozen embeddings
  • Any workload where a private, self-hosted encoder is preferred over calling a hosted API

Where you should look elsewhere:

  • Multilingual corpora, since the model is English-only
  • Very long documents, because the BERT backbone caps at 512 tokens
  • Code search, where the sibling UAE-Code-Large-V1 is the intended model
  • Frontier leaderboard scores, where 7B-parameter LLM-based encoders now lead

Why it still matters

The AnglE recipe is the durable contribution here. Rather than another distillation of a bigger teacher, it is a training-objective change that other teams have picked up and applied to their own encoders. The base model reports 0.3B parameters at F32 precision, delivering near-frontier semantic similarity quality without paying the memory and latency cost of a decoder-scale embedding model. For anyone building retrieval systems on a budget, that trade-off explains why UAE-Large-V1 keeps trending long after its initial release.