/ Модель

Характеристики

Контекст
40 960 токенов
Параметры
508 млн
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-0.6B-Base
Опубликована
6 июн 2025

Qwen3-Reranker-0.6B-seq-cls

Ранжирование текстаТекст → score10 профессий

Многоязычный реранкер на базе Qwen3, который оценивает релевантность текстовых кандидатов запросу для улучшения поиска и RAG.

201 тыс.скачиваний за 30 дней39лайковвеса обновлены10 июл 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Ранжирование» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Qwen3-Reranker-0.6B-seq-cls — вариант Qwen3-Reranker-0.6B, преобразованный в модель классификации последовательностей. Это плотная модель архитектуры Qwen3 с 507,6 млн параметров, дообученная на базе Qwen/Qwen3-0.6B-Base и предназначенная прежде всего для ранжирования текстовых пар. Она оценивает релевантность документа запросу, чтобы переупорядочить кандидатов в поиске или RAG-системе; также в метаданных указана поддержка классификации текста.

Модель рассчитана на многоязычные сценарии: карточка заявляет поддержку более 100 языков, включая языки программирования. Она подходит для поиска по тексту и коду, межъязыкового поиска и отбора документов по запросу. Входные инструкции можно настраивать под задачу; README сообщает, что инструкции часто улучшают результаты ранжирования. Метаданные указывают контекст до 40 960 токенов, а README — 32K. Для работы с Transformers требуется версия 4.51.0 или новее. Модель опубликована в формате safetensors по лицензии Apache-2.0.

Сценарии применения

  • переупорядочивание документов по релевантности запросу
  • повышение качества поиска по внутренней базе знаний
  • отбор контекстных фрагментов для RAG-системы
  • ранжирование результатов поиска по коду
  • межъязыковой поиск и сопоставление текстовых запросов с документами

Ограничения

Для загрузки архитектуры Qwen3 в Transformers нужна версия 4.51.0 или новее. README приводит разные оценки контекста: 32K токенов в описании модели и 40 960 токенов в метаданных.

Для каких профессий подходит10

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3-Reranker-0.6B

[!NOTE] This is a copy of the Qwen3-Reranker-0.6B model, part of the Qwen3 Reranker series, modified as a sequence classification model instead. See Updated Usage for details on how to use it, or Original Usage for the original usage.

See this discussion for details on the conversion approach.

Highlights

The Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. Building upon the dense foundational models of the Qwen3 series, it provides a comprehensive range of text embeddings and reranking models in various sizes (0.6B, 4B, and 8B). This series inherits the exceptional multilingual capabilities, long-text understanding, and reasoning skills of its foundational model. The Qwen3 Embedding series represents significant advancements in multiple text embedding and ranking tasks, including text retrieval, code retrieval, text classification, text clustering, and bitext mining.

Exceptional Versatility: The embedding model has achieved state-of-the-art performance across a wide range of downstream application evaluations. The 8B size embedding model ranks No.1 in the MTEB multilingual leaderboard (as of June 5, 2025, score 70.58), while the reranking model excels in various text retrieval scenarios.

Comprehensive Flexibility: The Qwen3 Embedding series offers a full spectrum of sizes (from 0.6B to 8B) for both embedding and reranking models, catering to diverse use cases that prioritize efficiency and effectiveness. Developers can seamlessly combine these two modules. Additionally, the embedding model allows for flexible vector definitions across all dimensions, and both embedding and reranking models support user-defined instructions to enhance performance for specific tasks, languages, or scenarios.

Multilingual Capability: The Qwen3 Embedding series offer support for over 100 languages, thanks to the multilingual capabilites of Qwen3 models. This includes various programming languages, and provides robust multilingual, cross-lingual, and code retrieval capabilities.

Model Overview

Qwen3-Reranker-0.6B has the following features:

  • Model Type: Text Reranking
  • Supported Languages: 100+ Languages
  • Number of Paramaters: 0.6B
  • Context Length: 32k

For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our blog, GitHub.

Qwen3 Embedding Series Model list

Model TypeModelsSizeLayersSequence LengthEmbedding DimensionMRL SupportInstruction Aware
Text EmbeddingQwen3-Embedding-0.6B0.6B2832K1024YesYes
Text EmbeddingQwen3-Embedding-4B4B3632K2560YesYes
Text EmbeddingQwen3-Embedding-8B8B3632K4096YesYes
Text RerankingQwen3-Reranker-0.6B0.6B2832K--Yes
Text RerankingQwen3-Reranker-4B4B3632K--Yes
Text RerankingQwen3-Reranker-8B8B3632K--Yes

Note:

  • MRL Support indicates whether the embedding model supports custom dimensions for the final embedding.
  • Instruction Aware notes whether the embedding or reranking model supports customizing the input instruction according to different tasks.
  • Our evaluation indicates that, for most downstream tasks, using instructions (instruct) typically yields an improvement of 1% to 5% compared to not using them. Therefore, we recommend that developers create tailored instructions specific to their tasks and scenarios. In multilingual contexts, we also advise users to write their instructions in English, as most instructions utilized during the model training process were originally written in English.

Usage

With Transformers versions earlier than 4.51.0, you may encounter the following error:

KeyError: 'qwen3'

Updated Usage

Updated Sentence Transformers Usage

# Requires transformers>=4.51.0
from sentence_transformers import CrossEncoder


def format_queries(query, instruction=None):
    prefix = '<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be "yes" or "no".<|im_end|>\n<|im_start|>user\n'
    if instruction is None:
        instruction = (
            "Given a web search query, retrieve relevant passages that answer the query"
        )
    return f"{prefix}<Instruct>: {instruction}\n<Query>: {query}\n"


def format_document(document):
    suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
    return f"<Document>: {document}{suffix}"


model = CrossEncoder("tomaarsen/Qwen3-Reranker-0.6B-seq-cls")

task = "Given a web search query, retrieve relevant passages that answer the query"

queries = [
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
]

documents = [
    "Venus is often called Earth's twin because of its similar size and proximity.",
    "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    "Jupiter, the largest planet in our solar system, has a prominent red spot.",
    "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
]

pairs = [
    [format_queries(query, task), format_document(doc)]
    for query, doc in zip(queries, documents)
]
scores = model.predict(pairs)
print(scores.tolist())
# [0.04272603616118431, 0.9991921782493591, 0.40642625093460083, 0.9718492031097412]

Updated Transformers Usage

# Requires transformers>=4.51.0
from transformers import AutoModelForSequenceClassification, AutoTokenizer


def format_instruction(instruction, query, doc):
    prefix = '<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be "yes" or "no".<|im_end|>\n<|im_start|>user\n'
    suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
    if instruction is None:
        instruction = (
            "Given a web search query, retrieve relevant passages that answer the query"
        )
    output = f"{prefix}<Instruct>: {instruction}\n<Query>: {query}\n<Document>: {doc}{suffix}"
    return output


tokenizer = AutoTokenizer.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls", padding_side="left")
model = AutoModelForSequenceClassification.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls").eval()
# We recommend enabling flash_attention_2 for better acceleration and memory saving.
# model = AutoModelForSequenceClassification.from_pretrained("tomaarsen/Qwen3-Reranker-0.6B-seq-cls", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
max_length = 8192

task = "Given a web search query, retrieve relevant passages that answer the query"

queries = [
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
]

documents = [
    "Venus is often called Earth's twin because of its similar size and proximity.",
    "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    "Jupiter, the largest planet in our solar system, has a prominent red spot.",
    "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
]

pairs = [format_instruction(task, query, doc) for query, doc in zip(queries, documents)]
inputs = tokenizer(
    pairs,
    padding=True,
    truncation=True,
    max_length=max_length,
    return_tensors="pt",
)
logits = model(**inputs).logits.squeeze()
print(logits.tolist())
# [-3.109282970428467, 7.120373725891113, -0.37874650955200195, 3.5416228771209717]

scores = logits.sigmoid()
print(scores.tolist())
# [0.04272596165537834, 0.9991921782493591, 0.406429260969162, 0.9718491435050964]

Original Usage

Original Transformers Usage

# Requires transformers>=4.51.0
import torch
from transformers import AutoModel, AutoTokenizer, AutoModelForCausalLM

def format_instruction(instruction, query, doc):
    if instruction is None:
        instruction = 'Given a web search query, retrieve relevant passages that answer the query'
    output = "<Instruct>: {instruction}\n<Query>: {query}\n<Document>: {doc}".format(instruction=instruction,query=query, doc=doc)
    return output

def process_inputs(pairs):
    inputs = tokenizer(
        pairs, padding=False, truncation='longest_first',
        return_attention_mask=False, max_length=max_length - len(prefix_tokens) - len(suffix_tokens)
    )
    for i, ele in enumerate(inputs['input_ids']):
        inputs['input_ids'][i] = prefix_tokens + ele + suffix_tokens
    inputs = tokenizer.pad(inputs, padding=True, return_tensors="pt", max_length=max_length)
    for key in inputs:
        inputs[key] = inputs[key].to(model.device)
    return inputs

@torch.no_grad()
def compute_logits(inputs, **kwargs):
    batch_scores = model(**inputs).logits[:, -1, :]
    true_vector = batch_scores[:, token_true_id]
    false_vector = batch_scores[:, token_false_id]
    batch_scores = torch.stack([false_vector, true_vector], dim=1)
    batch_scores = torch.nn.functional.log_softmax(batch_scores, dim=1)
    scores = batch_scores[:, 1].exp().tolist()
    return scores

tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-Reranker-0.6B", padding_side='left')
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-0.6B").eval()
# We recommend enabling flash_attention_2 for better acceleration and memory saving.
# model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-Reranker-0.6B", torch_dtype=torch.float16, attn_implementation="flash_attention_2").cuda().eval()
token_false_id = tokenizer.convert_tokens_to_ids("no")
token_true_id = tokenizer.convert_tokens_to_ids("yes")
max_length = 8192

prefix = "<|im_start|>system\nJudge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be \"yes\" or \"no\".<|im_end|>\n<|im_start|>user\n"
suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
prefix_tokens = tokenizer.encode(prefix, add_special_tokens=False)
suffix_tokens = tokenizer.encode(suffix, add_special_tokens=False)
        
task = 'Given a web search query, retrieve relevant passages that answer the query'

queries = [
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
    "Which planet is known as the Red Planet?",
]

documents = [
    "Venus is often called Earth's twin because of its similar size and proximity.",
    "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    "Jupiter, the largest planet in our solar system, has a prominent red spot.",
    "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
]

pairs = [format_instruction(task, query, doc) for query, doc in zip(queries, documents)]

# Tokenize the input texts
inputs = process_inputs(pairs)
scores = compute_logits(inputs)

print("scores: ", scores)
# scores:  [0.04272589832544327, 0.9991921782493591, 0.40642935037612915, 0.9718492031097412]

Original vLLM Usage

# Requires vllm>=0.8.5
import logging
from typing import Dict, Optional, List

import json
import logging

import torch

from transformers import AutoTokenizer, is_torch_npu_available
from vllm import LLM, SamplingParams
from vllm.distributed.parallel_state import destroy_model_parallel
import gc
import math
from vllm.inputs.data import TokensPrompt


        
def format_instruction(instruction, query, doc):
    text = [
        {"role": "system", "content": "Judge whether the Document meets the requirements based on the Query and the Instruct provided. Note that the answer can only be \"yes\" or \"no\"."},
        {"role": "user", "content": f"<Instruct>: {instruction}\n\n<Query>: {query}\n\n<Document>: {doc}"}
    ]
    return text

def process_inputs(pairs, instruction, max_length, suffix_tokens):
    messages = [format_instruction(instruction, query, doc) for query, doc in pairs]
    messages =  tokenizer.apply_chat_template(
        messages, tokenize=True, add_generation_prompt=False, enable_thinking=False
    )
    messages = [ele[:max_length] + suffix_tokens for ele in messages]
    messages = [TokensPrompt(prompt_token_ids=ele) for ele in messages]
    return messages

def compute_logits(model, messages, sampling_params, true_token, false_token):
    outputs = model.generate(messages, sampling_params, use_tqdm=False)
    scores = []
    for i in range(len(outputs)):
        final_logits = outputs[i].outputs[0].logprobs[-1]
        token_count = len(outputs[i].outputs[0].token_ids)
        if true_token not in final_logits:
            true_logit = -10
        else:
            true_logit = final_logits[true_token].logprob
        if false_token not in final_logits:
            false_logit = -10
        else:
            false_logit = final_logits[false_token].logprob
        true_score = math.exp(true_logit)
        false_score = math.exp(false_logit)
        score = true_score / (true_score + false_score)
        scores.append(score)
    return scores

number_of_gpu = torch.cuda.device_count()
tokenizer = AutoTokenizer.from_pretrained('Qwen/Qwen3-Reranker-0.6B')
model = LLM(model='Qwen/Qwen3-Reranker-0.6B', tensor_parallel_size=number_of_gpu, max_model_len=10000, enable_prefix_caching=True, gpu_memory_utilization=0.8)
tokenizer.padding_side = "left"
tokenizer.pad_token = tokenizer.eos_token
suffix = "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n"
max_length=8192
suffix_tokens = tokenizer.encode(suffix, add_special_tokens=False)
true_token = tokenizer("yes", add_special_tokens=False).input_ids[0]
false_token = tokenizer("no", add_special_tokens=False).input_ids[0]
sampling_params = SamplingParams(temperature=0, 
    max_tokens=1,
    logprobs=20, 
    allowed_token_ids=[true_token, false_token],
)

        
task = 'Given a web search query, retrieve relevant passages that answer the query'
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.",
]

pairs = list(zip(queries, documents))
inputs = process_inputs(pairs, task, max_length-len(suffix_tokens), suffix_tokens)
scores = compute_logits(model, inputs, sampling_params, true_token, false_token)
print('scores', scores)

destroy_model_parallel()

📌 Tip: We recommend that developers customize the instruct according to their specific scenarios, tasks, and languages. Our tests have shown that in most retrieval scenarios, not using an instruct on the query side can lead to a drop in retrieval performance by approximately 1% to 5%.

Evaluation

ModelParamMTEB-RCMTEB-RMMTEB-RMLDRMTEB-CodeFollowIR
Qwen3-Embedding-0.6B0.6B61.8271.0264.6450.2675.415.09
Jina-multilingual-reranker-v2-base0.3B58.2263.3763.7339.6658.98-0.68
gte-multilingual-reranker-base0.3B59.5174.0859.4466.3354.18-1.64
BGE-reranker-v2-m30.6B57.0372.1658.3659.5141.38-0.01
Qwen3-Reranker-0.6B0.6B65.8071.3166.3667.2873.425.41
Qwen3-Reranker-4B1.7B69.7675.9472.7469.9781.2014.84
Qwen3-Reranker-8B8B69.0277.4572.9470.1981.228.05

Note:

  • Evaluation results for reranking models. We use the retrieval subsets of MTEB(eng, v2), MTEB(cmn, v1), MMTEB and MTEB (Code), which are MTEB-R, CMTEB-R, MMTEB-R and MTEB-Code.
  • All scores are our runs based on the top-100 candidates retrieved by dense embedding model Qwen3-Embedding-0.6B.

Citation

If you find our work helpful, feel free to give us a cite.

@misc{qwen3-embedding,
    title  = {Qwen3-Embedding},
    url    = {https://qwenlm.github.io/blog/qwen3/},
    author = {Qwen Team},
    month  = {May},
    year   = {2025}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3ForSequenceClassification
Ревизия весов
6a5829f

0 моделей