Qwen3-Embedding 8B
Alibaba (Qwen) · Qwen/Qwen3-Embedding-8B
Weights license: Apache 2.0 · code and components may use other terms
Quality
MTEB (Multilingual, v2)
Mean(task) · 0–100 · higher is better · this model outlined
- Color = publisher
Source: MTEB results dataset (independent runs, CC0) · publisher-reported where the model card is the only source · other benchmarks and versions are not mixed in
| MTEB (Multilingual, v2) | mean(task) · 4096d | 70.58 | independent run |
|---|---|---|---|
| MTEB (eng, v2) | mean(task) · 4096d | 75.22 | independent run |
Reported by the publisher
- Mean (Task)
- 70.58MTEB (Multilingual) · MTEB
- Mean (Type)
- 61.69MTEB (Multilingual) · MTEB
- Bitxt Mining
- 80.89MTEB (Multilingual) · MTEB
- Class.
- 74.00MTEB (Multilingual) · MTEB
- Clust.
- 57.65MTEB (Multilingual) · MTEB
- Inst. Retri.
- 10.06MTEB (Multilingual) · MTEB
- Multi. Class.
- 28.66MTEB (Multilingual) · MTEB
- Pair. Class.
- 86.40MTEB (Multilingual) · MTEB
Every reported result
- Rerank
- 65.63MTEB (Multilingual) · MTEB
- Retri.
- 70.88MTEB (Multilingual) · MTEB
- STS
- 81.08MTEB (Multilingual) · MTEB
- Mean (Task)
- 75.22MTEB (Eng v2) · MTEB
- Mean (Type)
- 68.71MTEB (Eng v2) · MTEB
- Class.
- 90.43MTEB (Eng v2) · MTEB
- Clust.
- 58.57MTEB (Eng v2) · MTEB
- Pair Class.
- 87.52MTEB (Eng v2) · MTEB
- Rerank.
- 51.56MTEB (Eng v2) · MTEB
- Retri.
- 69.44MTEB (Eng v2) · MTEB
- STS
- 88.58MTEB (Eng v2) · MTEB
- Summ.
- 34.83MTEB (Eng v2) · MTEB
- Mean (Task)
- 73.84C-MTEB (MTEB Chinese) · MTEB
- Mean (Type)
- 75.00C-MTEB (MTEB Chinese) · MTEB
- Class.
- 76.97C-MTEB (MTEB Chinese) · MTEB
- Clust.
- 80.08C-MTEB (MTEB Chinese) · MTEB
- Pair Class.
- 84.23C-MTEB (MTEB Chinese) · MTEB
- Rerank.
- 66.99C-MTEB (MTEB Chinese) · MTEB
- Retr.
- 78.21C-MTEB (MTEB Chinese) · MTEB
- STS
- 63.53C-MTEB (MTEB Chinese) · MTEB
Values as printed on the card, with the publisher's own settings (card section: Evaluation › MTEB (Multilingual); Evaluation › MTEB (Eng v2)); column “Qwen3-Embedding-8B”. Not comparable across publishers and not used in any ranking. Model card
Quality × memory
No comparable quality × memory pair
Embedding memory estimates cluster at a few GB, so a quality × memory chart would not separate these models; MTEB is ranked above instead.
Consider Qwen3-Embedding 8B for retrieval and semantic search: it turns text into 4,096-dimension vectors.
The publisher states no memory figure; the hardware list uses a ~12 GB planning estimate, a ceiling and not a measurement. See the prompt format under How to run. PT-BR is confirmed by a source.
Runs on
Fast memory holds it 90
The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.
Show all 90
One memory tier short 24
The same machines with the next memory size up would hold it in fast memory.
Show all 24
Hardware profiles grouped by the embedding planning estimate (8-bit weights, 20% allowance, 2 GB reserve). Not a measured fit.
Measured speed
No published measurement for this checkpoint
Throughput (texts per second) is shown only when a source publishes it with hardware, build and setup. It is never estimated.
How to run
The planning estimate uses 8-bit weights, 20% working allowance and a 2 GB reserve; it is a ceiling, not a measurement.
- Runs in
- Ollama, Sentence Transformers, Transformerssource
- Query/document prompts
- Queries: prepend a one-sentence task instruction in the form “Instruct: {task} Query: {query}”. Documents: no prefix.
- Languages · PT-BR
- 100+ languages, including programming languages (model card)PT-BR confirmed by a source
Documented ways to run it
Copied as printed in the linked source (read 2026-10-18); not run by this site.
# Requires transformers>=4.51.0
# Requires sentence-transformers>=2.7.0
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer("Qwen/Qwen3-Embedding-8B")
# We recommend enabling flash_attention_2 for better acceleration and memory saving,
# together with setting `padding_side` to "left":
# model = SentenceTransformer(
# "Qwen/Qwen3-Embedding-8B",
# model_kwargs={"attn_implementation": "flash_attention_2", "device_map": "auto"},
# tokenizer_kwargs={"padding_side": "left"},
# )
# The queries and documents to embed
queries = [
"What is the capital of China?",
"Explain gravity",
]
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.",
]
# Encode the queries and documents. Note that queries benefit from using a prompt
# Here we use the prompt called "query" stored under `model.prompts`, but you can
# also pass your own prompt via the `prompt` argument
query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)
# Compute the (cosine) similarity between the query and document embeddings
similarity = model.similarity(query_embeddings, document_embeddings)
print(similarity)
# tensor([[0.7493, 0.0751],
# [0.0880, 0.6318]])# 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 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
tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen3-Embedding-8B', padding_side='left')
model = AutoModel.from_pretrained('Qwen/Qwen3-Embedding-8B')
# We recommend enabling flash_attention_2 for better acceleration and memory saving.
# model = AutoModel.from_pretrained('Qwen/Qwen3-Embedding-8B', attn_implementation="flash_attention_2", torch_dtype=torch.float16).cuda()
max_length = 8192
# Tokenize the input texts
batch_dict = tokenizer(
input_texts,
padding=True,
truncation=True,
max_length=max_length,
return_tensors="pt",
)
batch_dict.to(model.device)
outputs = model(**batch_dict)
embeddings = last_token_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
# normalize embeddings
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:2] @ embeddings[2:].T)
print(scores.tolist())
# [[0.7493016123771667, 0.0750647559762001], [0.08795969933271408, 0.6318399906158447]]# Requires vllm>=0.8.5
import torch
import vllm
from vllm import LLM
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
model = LLM(model="Qwen/Qwen3-Embedding-8B", task="embed")
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.7482624650001526, 0.07556197047233582], [0.08875375241041183, 0.6300010681152344]]Technical details
What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.
- Checkpoint / source
- Qwen/Qwen3-Embedding-8B
- Task
- embeddings for search (feature extraction)
- Library in source
- Ollama, Sentence Transformers, Transformers
- Weight license
- Apache 2.0
- Commercial use
- Allowed Apache License 2.0 text (SPDX) · read 2026-10-18license text
- Parameter basis
- Hub safetensors total (7,567,295,488 parameters, read 2026-10-07 from the Hub API); publishers round it in their names.
- Announced
- 2025-06-05
The card states a 32K sequence length and output sizes from 32 to 4096 (“user-defined”), so there is no fixed list of Matryoshka sizes; the model card lists Portuguese nowhere by name, only “100+ languages”. Instructions are recommended in English.
Sources
Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.
- Publisher model card
- Hugging Face model page / card · 2026-10-07
- Hugging Face API (parameters, licence, library) · 2026-10-07
- Ollama library (availability only) · 2026-10-07
- MTEB results dataset (CC0), scores computed by scripts/ingest-mteb-results.mjs · 2026-10-25
- Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models | Qwen · 2026-10-09
Curated facts checked: 2026-10-07. Each value cites its source (the publisher's card or the MTEB results dataset); estimates are labelled as estimates, and a value no source states stays empty. A repository commit is not a model release date.



























































