Model reference · open weights

E2Rank

Available as managed deployment Embeddings Alibaba-NLP Embeddings 3 variants 598 dl/mo

E2Rank is an open-weight embedding model from Alibaba-NLP. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

MakerAlibaba-NLP
TypeEmbedding models
TaskEmbeddings
Parameters (lead)596M
Context40k tokens
Runs withtransformers
Based onQwen/Qwen3-0.6B
Released2025-10-24
Popularity598 downloads / month
LicenceOpen weights

About

What E2Rank is

We introduce E2Rank, meaning Efficient Embedding-based Ranking (also meaning Embedding-to-Rank), which extends a single text embedding model to perform both high-quality retrieval and listwise reranking, thereby achieving strong effectiveness with remarkable efficiency.

By applying cosine similarity between the query and document embeddings as a unified ranking function, the listwise ranking prompt, which is constructed from the original query and its candidate documents, serves as an enhanced query enriched with signals from the top-K documents, akin to pseudo-relevance feedback (PRF) in traditional retrieval models. This design preserves the efficiency and representational quality of the base embedding model while significantly improving its reranking performance.

Empirically, E2Rank achieves state-of-the-art results on the BEIR reranking benchmark and demonstrates competitive performance on the reasoning-intensive BRIGHT benchmark, with very low reranking latency. We also show that the ranking training process improves embedding performance on the MTEB benchmark. Our findings indicate that a single embedding model can effectively unify retrieval and reranking, offering both computational efficiency and competitive ranking accuracy.

Our work highlights the potential of single embedding models to serve as unified retrieval-reranking engines, offering a practical, efficient, and accurate alternative to complex multi-stage ranking systems.

🚀 Quick Start

Model List

Supported TaskModel NameSizeLayersSequence LengthEmbedding DimensionInstruction Aware
Embedding + RerankingAlibaba-NLP/E2Rank-0.6B0.6B2832K1024Yes
Embedding + RerankingAlibaba-NLP/E2Rank-4B4B3632K2560Yes
Embedding + RerankingAlibaba-NLP/E2Rank-8B8B3632K4096Yes
Embedding OnlyAlibaba-NLP/E2Rank-0.6B-Embedding-Only0.6B2832K1024Yes
Embedding OnlyAlibaba-NLP/E2Rank-0.6B-Embedding-Only4B3632K2560Yes
Embedding OnlyAlibaba-NLP/E2Rank-0.6B-Embedding-Only8B3632K4096Yes

Note:

  • Embedding Only indicates that the model is trained only with the constrative learning and support embedding tasks, while Embedding + Reranking indicates the full E2Rank model trained with both embedding and reranking objectives (for more detals, please refer to the paper).
  • Instruction Aware notes whether the model supports customizing the input instruction according to different tasks.

Usage

Embedding Model

The usage of E2Rank as an embedding model is similar to Qwen3-Embedding. The only difference is that Qwen3-Embedding will automatically append an EOS token, while E2Rank requires users to manully append the special token `` at the end of each input text.

vLLM Usage (recommended)

# Requires vllm>=0.8.5
import torch
import vllm
from vllm import LLM
from vllm.config import PoolerConfig

def get_detailed_instruct(task_description: str, query: str) -> str:
    return f'Instruct: {task_description}\nQuery:{query}'

# Each query must come with a one-sentence instruction that describes the task
task = 'Given a web search query, retrieve relevant passages that answer the query'

queries = [
    get_detailed_instruct(task, 'What is the capital of China?'),
    get_detailed_instruct(task, 'Explain gravity')
]
# No need to add instruction for retrieval documents
documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun."
]
input_texts = queries + documents
input_texts = [t + "" for t in input_texts]

model = LLM(
    model="Alibaba-NLP/E2Rank-0.6B",
    task="embed",
    override_pooler_config=PoolerConfig(pooling_type="LAST", normalize=True)
)

outputs = model.embed(input_texts)
embeddings = torch.tensor([o.outputs.embedding for o in outputs])
scores = (embeddings[:2] @ embeddings[2:].T)
print(scores.tolist())
# [[0.5958386659622192, 0.030148349702358246], [0.060259245336055756, 0.5595865249633789]]
# Requires transformers>=4.51.0
import torch
import torch.nn.functional as F

from torch import Tensor
from transformers import AutoTokenizer, AutoModel

def last_token_pool(last_hidden_states: Tensor, attention_mask: Tensor) -> Tensor:
    left_padding = (attention_mask[:, -1].sum() == attention_mask.shape[0])
    if left_padding:
        return last_hidden_states[:, -1]
    else:
        sequence_lengths = attention_mask.sum(dim=1) - 1
        batch_size = last_hidden_states.shape[0]
        return last_hidden_states[torch.arange(batch_size, device=last_hidden_states.device), sequence_lengths]

def get_detailed_instruct(task_description: str, query: str) -> str:
    return f'Instruct: {task_description}\nQuery:{query}'

# Each query must come with a one-sentence instruction that describes the task
task = 'Given a web search query, retrieve relevant passages that answer the query'

queries = [
    get_detailed_instruct(task, 'What

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys e2rank for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (e2rank below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/embeddings \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"e2rank","input":"text to embed"}'

Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.

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