Skip to main content
Back

Alibaba's gte-reranker-modernbert-base Hits 1.7M Downloads Boosting RAG Accuracy

Alibaba's Tongyi Lab pairs ModernBERT with GTE training to deliver a 149M parameter cross-encoder that reranks long documents up to 8192 tokens.

Model, Full Access
  • Alibaba's gte-reranker-modernbert-base is a 149M parameter English reranker built on ModernBERT.
  • Supports 8192 token inputs, far beyond the 512 limit of most classic BERT rerankers.
  • Scores 90.68 average on LoCo long document retrieval, up from 87.57 for the embedding-only baseline.
  • Apache 2.0 license with 1.7M+ downloads, ships in safetensors, ONNX, and transformers.js formats.
  • Runs through Text Embeddings Inference for a production /rerank endpoint on CPU or GPU.
  • Works out of the box with sentence-transformers CrossEncoder and picks up Flash Attention 2 automatically.

Alibaba's Tongyi Lab has quietly become one of the most downloaded sources of retrieval components on Hugging Face, and its gte-reranker-modernbert-base shows why. The model is a compact cross-encoder that takes a query and a candidate passage, then returns a single relevance score you can use to sort search results before passing them to an LLM. It has crossed 1.7 million downloads and sits under an Apache 2.0 license, so it is free to run locally or in production.

What is under the hood explains the traction. The gte-modernbert series is built on top of Answer.AI's ModernBERT encoder, and the training recipe is inherited from the earlier GTE work, with only the base encoder swapped out. That combination yields a small model with a long context window and modern attention optimizations, tuned specifically for ranking.

What a reranker actually does

In a typical retrieval-augmented generation pipeline, a bi-encoder embeds your query and documents into vectors and pulls back the top few hundred candidates using cosine similarity. That step is fast but lossy because the query and document never see each other during scoring. A cross-encoder reranker fixes that by concatenating the query and each candidate and running them through the transformer together, so attention can compare tokens across both sides. The tradeoff is compute cost, which is why you only rerank the shortlist, not the whole corpus.