/ Модель

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

Контекст
512 токенов
Параметры
25,9 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
ms-marco-MiniLM-L6-v2
Библиотека
transformers
Опубликована
21 ноя 2026

nq-open-minilm-reranker

Классификация текстаТекст → label4 профессии
80скачиваний за 30 дней0лайковвеса обновлены21 ноя 2026

Описание модели

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

Англоязычный cross-encoder для переранжирования отрывков Википедии по открытым вопросам в поисковом конвейере Natural Questions.

NezarIn/NQ-open MiniLM reranker — англоязычный cross-encoder на архитектуре BERT, дообученный разработчиком на базе cross-encoder/ms-marco-MiniLM-L6-v2 на вопросах Natural Questions. Модель предназначена для второго этапа поиска: она оценивает релевантность пар «вопрос — отрывок» и переранжирует найденные отрывки из Википедии для ответов на открытые вопросы.

В описанном эксперименте модель ранжировала 50 кандидатов, полученных гибридным поиском по корпусу NQ-open. На отложенной выборке из 5 712 вопросов ответ встречался среди десяти лучших отрывков в 91,0% случаев; это метрика поиска, а не точности генерации ответа. Модель содержит около 25,9 млн параметров, использует формат safetensors и принимает последовательности длиной до 512 токенов. Для обучения применялись группы из одного положительного и семи отрицательных примеров.

Модель рассчитана на английские вопросы и отрывки из англоязычной Википедии. Результаты ограничены составом корпуса и настройкой эксперимента; при разметке положительных примеров использовалось совпадение строк ответа, которое иногда может быть случайным. Распространяется по лицензии Apache-2.0.

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

  • Переранжирование найденных отрывков Википедии по вопросу на английском языке
  • Повышение доли ответосодержащих документов в первой десятке результатов поиска
  • Второй этап retrieve-then-rerank поиска по открытым вопросам
  • Оценка релевантности пар «поисковый запрос — текст» для RAG

Ограничения

Предназначена для английских вопросов и англоязычных документов; опубликованные результаты относятся к ограниченному корпусу NQ-open и не гарантируют такую же эффективность на полной Википедии. Метки релевантности частично основаны на совпадениях строк ответа, поэтому возможны случайные совпадения.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

NQ-open MiniLM reranker

A 22.7M-parameter cross-encoder that reranks Wikipedia passages for open-domain questions. It is cross-encoder/ms-marco-MiniLM-L6-v2 fine-tuned on Natural Questions (NQ) training questions, as the second stage of a retrieve-then-rerank pipeline built over a 100k-question NQ Wikipedia corpus.

Result: on 5,712 held-out questions, an answer appears in the top 10 reranked passages for 91.0% (95% CI 90.2–91.7) of questions, up from 84.2% for the first-stage retriever alone.

Usage

from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

name = "NezarIn/nq-open-minilm-reranker"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name).eval()

query = "who wrote the declaration of independence"
passages = ["Declaration of Independence | The Declaration was drafted by Thomas Jefferson in 1776.",
            "France | Paris is the capital of France."]
enc = tok([query] * len(passages), passages, truncation="only_second", max_length=512,
          padding=True, return_tensors="pt")
with torch.no_grad():
    scores = model(**enc).logits[:, 0]      # higher = more relevant; sort passages by score

Passages were formatted as "<title> > <section path> | <passage text>" during training and evaluation; the model also works on plain text.

Results

The candidates are the top 50 passages from a hybrid first stage (contriever-msmarco dense + BM25, reciprocal-rank fusion), with exact-duplicate passages removed. Every reranker below scores the same candidate lists.

Metric: answer-hit@k. The share of questions where a gold short answer appears (normalised, word-bounded string match) in at least one of the top k passages. This is the standard DPR-style retrieval accuracy for NQ-open; it is a retrieval metric, not answer exact match.

Stage (top-50 candidates)test hit@1test hit@10 (95% CI)test hit@20val hit@10 (95% CI)
Hybrid retriever, duplicates removed47.384.2 (83.2–85.1)90.685.6 (84.5–86.7)
ColBERTv2, off the shelf57.988.4 (87.5–89.2)92.689.6 (88.6–90.6)
MiniLM base model, off the shelf57.788.4 (87.6–89.2)92.989.1 (88.0–90.1)
This model67.391.0 (90.2–91.7)94.191.7 (90.7–92.5)
  • test: 5,712 NQ-open questions from NQ train rows 80,000–99,999, never used for training or for any choice.
  • val: 3,608 NQ-open questions from the official NQ validation split.
  • Ceiling: the answer is in the 50 candidates for 95.5% (test) and 96.1% (val) of questions; no reranker can exceed that.
  • Exploratory, not the headline: with 100 candidates instead of 50, test hit@10 is 92.1. That depth was compared on the test set, so it is not a held-out result.
  • Latency: 13 ms median (20 ms p99) to rerank 50 passages for one question on an RTX PRO 6000 GPU.

Training

  • Data: NQ-open questions (short answer of 5 tokens or fewer) from the first 80,000 rows of NQ train: 21,963 questions after holding out 1,000 for epoch selection, of which 19,198 formed usable training groups. 2,399 were skipped because no answer-bearing passage from the gold page was in the top 50; 366 because fewer than 7 negatives were available.
  • Positive: the highest-ranked candidate that contains a gold answer and comes from the question's gold Wikipedia page (or is an identical copy of a gold-page passage).
  • Negatives: the 7 highest-ranked candidates with no answer string and not from the gold page.
  • Loss: softmax cross-entropy over each group of 1 positive + 7 negatives.
  • Setup: 3 epochs, learning rate 1e-5 with linear warmup and decay, 16 questions (128 pairs) per step, max 512 tokens, bf16. Epoch 3 was kept; held-out dev hit@10 went 88.4 (base model) → 90.9 → 91.8 → 92.0.
  • Compute: about 6 minutes of training on one RTX PRO 6000.

Data hygiene

  • The base model was fine-tuned on MS MARCO. Its training README uses NQ only as an evaluation set. Every retriever and reranker in this pipeline was chosen to have no documented NQ training data, so that the only NQ data the system has seen is the training split described above.
  • Test and validation questions were not used for training, epoch choice or depth choice.

Limitations

  • String-match labels. Positives come from answer-string matches, so a few are coincidental mentions. The answer-hit metric has the same bias.
  • Corpus scope. The passage corpus is the Wikipedia pages behind the first 100k NQ train questions plus the validation pages (3.2M passages, 2.0M distinct), not full Wikipedia. Results on full Wikipedia will be lower.
  • Page versions. NQ pages are keyed by URL, which includes a revision id; 2.8% of questions point to a stored revision other than their own. A direct check found the answer missing from the stored page for 8 of the 5,712 test questions, only 1 of them because of the revision mismatch.
  • English Wikipedia only, and questions in NQ's style (real Google search queries).

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

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

GPU в ailist

Универсальный рантайм · transformers · text-classification

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

Подбираем GPU…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
c115a7f

0 моделей