/ Модель

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

Контекст
40 960 токенов
Параметры
3,7 млрд
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3-Reranker-4B
Библиотека
transformers
Опубликована
30 ноя 2026

llav-4b

Генерация текстаТекст → текст
4скачиваний за 30 дней0лайковвеса обновлены30 ноя 2026

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

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

Дообученный реранкер на основе Qwen3, который оценивает, является ли текстовый фрагмент нужным доказательством для вопроса в поисковом или RAG-конвейере.

llav 4B — модель LLav Lab на основе Qwen3, использующая причинную языковую модель с 36 блоками и размером 3,7 млрд параметров как cross-encoder для оценки релевантности доказательных фрагментов вопросу. Она предназначена прежде всего для роли судьи в llavRAG: оценивает, содержит ли отрывок нужные свидетельства, в том числе с учётом уже найденных материалов, и выдаёт вероятность «да» вместо связного текста. Модель можно применять для ранжирования или фильтрации кандидатов в поисковом и RAG-конвейере. Контекст модели — 40 960 токенов, но README указывает, что входные данные для решения обрезаются до 2 048 токенов; обучение и оценка проводились только на английском языке.

Модель дообучена на Qwen/Qwen3-Reranker-4B и распространяется в формате safetensors по лицензии Apache-2.0. Для оценок вероятности предусмотрено Platt-калибрование, однако оно основано на состояниях retrieval-цикла всего 30 обучающих вопросов и на других данных должно трактоваться преимущественно как сигнал ранжирования. Проверки проводились на небольших корпусах англоязычной Википедии и открытых многошаговых вопросно-ответных наборах; пригодность для бизнес-документов, больших корпусов, модерации, общих классификационных решений и неанглийского текста не подтверждена. Модель не предназначена для генерации ответов, командной безопасности или проверки патчей.

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

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

Ограничения

Обучение и оценка охватывают только английский текст, небольшие корпуса Википедии и публичные многошаговые бенчмарки; обобщение на большие и бизнес-корпуса не проверено. Калиброванные вероятности могут не соответствовать частотам на новых данных, а модель не предназначена для генерации ответов, модерации, решений о людях или командной безопасности.

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

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

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

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

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

Бенчмарки пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

Открыть на Hugging Face

llav 4B

A decision model: a question in, a probability out. llav 4B answers one question about a passage: is this passage evidence that the question needs? It returns a probability instead of generated text. The model can also take the evidence already found and decide in that context.

llav 4B is the judge of llavRAG, an open retrieval engine that builds each search round from the evidence the judge has confirmed. Our larger decision model, llav 27B, is not released (llav Pro: a managed API, waitlist). llav 4B is the first llav model with released weights; the v0.4 research checkpoints were never published on Hugging Face.

Scope. llav 4B is the evidence judge for llavRAG. It is not trained or recommended for command-safety or patch-review decisions.

Developed byLLav Lab
Contactllachat.co@gmail.com
Model typeQwen3 causal LM (36 blocks, hidden size 2,560) used as a yes/no cross-encoder
Base modelQwen/Qwen3-Reranker-4B, Apache-2.0, Qwen team (Alibaba Cloud)
Modificationsthree LoRA fine-tuning stages and one checkpoint average, all merged into the base weights (no adapter needed at inference)
Weightsmodel.safetensors, bf16, about 8 GB
Extra filecalib.json: Platt parameters round0 (no evidence) and rounds (with evidence)
LanguageEnglish
LicenceApache-2.0
PaperllavRAG: Evidence-Conditioned Multi-Hop Retrieval with an Open 4B Decision Model (Mengyi Sing, LLav Lab, preprint v0.3.1), DOI 10.5281/zenodo.24687037, llav.app/llavrag#paper

Input and output

Each decision uses one prompt in the Qwen3-Reranker format:

<|im_start|>system
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".<|im_end|>
<|im_start|>user
<Instruct>: Given a multi-hop question, judge whether the passage states a fact that is necessary to answer it (including a fact that identifies an intermediate entity in the answer chain).
<Query>: {question}
Already retrieved evidence (context only): {title 1}: {text 1, first 300 characters} || {title 2}: {text 2, first 300 characters} || ...
<Document>: {candidate title}
{candidate text}<|im_end|>
<|im_start|>assistant
<think>

</think>

  • The Already retrieved evidence line is left out when no evidence has been found yet (the first round). At most ten evidence passages are included. llavRAG sends five.
  • Inputs longer than 2,048 tokens are truncated: the first 2,008 tokens and the last 39 are kept.
  • Raw output: P(yes) is the softmax over the logits of the tokens no and yes at the last position.
  • Platt mapping: p = sigmoid(a * logit(P(yes)) + b), with P(yes) clipped to [1e-6, 1 - 1e-6]. (a, b) comes from calib.json: round0 for requests without evidence, rounds for requests with evidence. Both pairs were fitted on loop states of 30 MuSiQue training questions that the last training stage did not train on. No benchmark question was used. llavRAG applies this mapping and so does the example below. Read the result as a ranking signal, and only roughly as a frequency on your own documents.
  • A second instruction for free-form yes/no questions exists (<Instruct>: Given a yes/no question about the Document, judge whether the correct answer is yes., with the question as <Query> and the text as <Document>). This mode was part of training but is not evaluated here and has no Platt mapping ("general": null).

How to use

With llavRAG (recommended). llavRAG downloads this model, indexes your documents and runs the multi-round search (pip install llavrag, then llavrag download). It runs on Apple silicon (MLX) or an NVIDIA GPU; the verified machines are an Apple M5 Max 128 GB (about 13 s per question, median, measured with the reference implementation of the same core, not the package) and an NVIDIA RTX 3060 12 GB (about 65 s per question, with the embedder and this model taking turns on the GPU). See the llavRAG repository.

With transformers. This example scores one candidate. It follows the prompt and readout above (requires transformers>=4.51).

import json, math
import torch
from huggingface_hub import snapshot_download
from transformers import AutoModelForCausalLM, AutoTokenizer

path = snapshot_download("llavapp/llav-4b")
device = "cuda" if torch.cuda.is_available() else "cpu"
tok = AutoTokenizer.from_pretrained(path)
model = AutoModelForCausalLM.from_pretrained(
    path, torch_dtype=torch.float16 if device == "cuda" else torch.float32).to(device).eval()
calib = json.load(open(f"{path}/calib.json"))
YES = tok.encode("yes", add_special_tokens=False)[0]
NO = tok.encode("no", add_special_tokens=False)[0]

SYSTEM = ('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".')
INSTRUCT = ("Given a multi-hop question, judge whether the passage states a fact that is necessary to answer it "
            "(including a fact that identifies an intermediate entity in the answer chain).")

def build_prompt(question, title, text, evidence=()):
    query = question
    if evidence:  # (title, text) pairs already confirmed: at most 10, each cut to 300 characters
        query += "\nAlready retrieved evidence (context only): " + " || ".join(
            f"{t}: {x[:300]}" for t, x in evidence[:10])
    return ("<|im_start|>system\n" + SYSTEM + "<|im_end|>\n<|im_start|>user\n"
            f"<Instruct>: {INSTRUCT}\n<Query>: {query}\n<Document>: {title}\n{text}"
            "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n")

def platt(p, ab):
    p = min(max(p, 1e-6), 1 - 1e-6)
    return 1 / (1 + math.exp(-(ab[0] * math.log(p / (1 - p)) + ab[1])))

@torch.inference_mode()
def p_evidence(question, title, text, evidence=()):
    ids = tok.encode(build_prompt(question, title, text, evidence), add_special_tokens=False)
    if len(ids) >= 2048:
        ids = ids[:2008] + ids[-39:]
    logits = model(input_ids=torch.tensor([ids], device=device), logits_to_keep=1).logits[0, -1]
    p_yes = torch.softmax(logits[[NO, YES]].float(), dim=-1)[1].item()
    return platt(p_yes, calib["rounds" if evidence else "round0"])

q = "Who directed the film that won Best Picture at the 1995 Academy Awards?"
title, text = "Forrest Gump", "Forrest Gump is a 1994 American film directed by Robert Zemeckis."
print(p_evidence(q, title, text))  # about 0.05: on its own, the passage does not show which film won
print(p_evidence(q, title, text, evidence=[("67th Academy Awards",
      "The 67th Academy Awards honored films of 1994. Forrest Gump won Best Picture.")]))  # about 0.92

The two calls show the evidence conditioning: the same passage becomes needed once the evidence names the film.

To rank candidates, score each one and sort by the probability. For many candidates that share one question, batch them. llavRAG also reuses the shared prompt prefix. Small fp16 differences between backends can reorder near-ties.

Intended use

  • Deciding whether a passage is evidence needed for a question, with or without evidence already found, as the judge inside llavRAG or inside your own retrieval or RAG pipeline.
  • Ranking or filtering candidate passages before they go to a reader, an LLM or a person.
  • Research on retrieval built from decisions.

Out-of-scope use

  • Generating text or answers. The model outputs a yes/no probability only.
  • Command-safety or patch-review decisions. The model is not trained or recommended for them.
  • General-purpose yes/no or classification decisions. The free-form mode is not evaluated.
  • Decisions about people (for example credit, employment, housing, medical or legal matters) without qualified human review.
  • Content moderation or safety filtering. Toxicity datasets are part of the training mix, but the model is not evaluated for moderation.
  • Non-English text. The model was trained and evaluated on English only.
  • Reading the probability as a guaranteed frequency on your own data.

Evaluation

All numbers come from the paper. They are retrieval results of the frozen llavRAG v0.3 system with llav 4B as its only judge (the standard tier), so they measure the whole system with this model inside, not the model alone. llav 4B ran in fp16 with MLX on one Apple M5 Max laptop.

Test set: fresh-2. 1,200 multi-hop test questions that none of our runs or training files had used: 600 MuSiQue questions from the MuSiQue training split, plus 300 2WikiMultiHopQA and 300 HotpotQA questions from the development splits. Any question whose identifier, normalised text or any word 13-gram occurs in any of our training or evaluation files was excluded. Each dataset has its own closed corpus of English Wikipedia paragraphs (13,977, 6,186 and 9,841 passages). The set was built before any result of llavRAG v0.3 existed, and the frozen system was run on it once.

settingR@10AE@10
llavRAG v0.3 with llav 4B only, all 1,200 questions95.087.6
llavRAG v0.3 with llav 4B only, MuSiQue (600 questions)91.077.2
one pass (round 0 only): hybrid BM25 + dense pool ranked by llav 4B, all 1,200 questions83.963.5
  • R@10: share of a question's gold supporting passages among the first 10 distinct documents, averaged over questions.
  • AE@10: share of questions with all gold supporting passages in the top 10.
  • The one-pass row comes from the same run's logged decisions (no new model calls). It is the question-weighted mean over the three datasets. It costs 100 judgments per question; llavRAG costs about 318 (243-390), about 3× as many. A one-pass baseline with the same budget, an off-the-shelf reranker and the base Qwen3-Reranker-4B in the same loop were not measured.
  • llav 4B is fine-tuned on the training splits of these three datasets. The test questions were excluded from all training data, but passages overlap; see Limitations.
  • On 2WikiMultiHopQA and HotpotQA the system is close to 100%, so MuSiQue carries most of the information.

Training

Labels come only from the datasets' gold annotations (supporting-paragraph flags or class labels), converted to yes/no by our own scripts. No label was produced by an external or hosted model. No question from the evaluation sets above is in any training file: exact question matches 0, word 13-gram question matches 0.

stagewhatdata
1. listwise retrievalLoRA (rank 8) on the last 16 of 36 blocks, pointwise yes/no cross-entropy plus listwise cross-entropy over each question's candidate group, 1,750 stepsMuSiQue training split (BM25 hard negatives and gold paragraphs); 1,000 HotpotQA (distractor, train) and 1,000 2WikiMultiHopQA (train) questions
2. averageuniform average of the stage-1 checkpoints at steps 250, 1,250 and 1,750, mergednone
3. general decisionsLoRA (rank 16) on all blocks, binary cross-entropy, 1,000 steps, merged127,683 rows: MNLI 23,850; MuSiQue retrieval rows 19,850; FEVER 19,847; CLINC150 15,850; Banking77 13,850; Civil Comments 11,850; SNLI 7,850; toxic_conversations 7,780; BoolQ 6,956
4. on-policy statesthe stage-3 model runs an earlier prototype of the retrieval loop, and every round's state and candidate pool is logged2,099 (question, round) groups from MuSiQue training questions
5. own loop statesLoRA (rank 8) on the last 16 blocks, groups of 16 candidates, pointwise plus listwise loss, 1,200 steps, mergedthe stage-4 groups, labelled with MuSiQue supporting-paragraph flags
6. selection and Platt mappingcheckpoint 1,200 chosen over 600 by end-to-end retrieval; Platt parameters fitted on round states50 MuSiQue training questions that stage 5 did not train on (Platt: 30 of them)

Datasets and licences

datasetlicencestage
MuSiQue (Trivedi et al., 2022), official release (StonyBrookNLP)CC BY 4.01, 3, 4-6
HotpotQA (Yang et al., 2018), distractor setting, via the Hub copy hotpotqa/hotpot_qaCC BY-SA 4.01
2WikiMultiHopQA (Ho et al., 2020), via the Hub mirror xanhho/2WikiMultihopQAApache-2.01
MultiNLI (Williams et al., 2018)OANC; fiction genre partly CC BY-SA 3.0 / CC BY 3.03
SNLI (Bowman et al., 2015)CC BY-SA 4.03
BoolQ (Clark et al., 2019)CC BY-SA 3.03
FEVER (Thorne et al., 2018), copenlu/fever_gold_evidenceCC BY-SA 3.0 (FEVER / Wikipedia terms)3
Civil Comments; SetFit/toxic_conversations_50k (Jigsaw Unintended Bias text)CC0-1.03
CLINC150 (Larson et al., 2019)CC BY 3.03
Banking77 (Casanueva et al., 2020)CC BY 4.03

Several sources are ShareAlike, and MuSiQue, HotpotQA, 2WikiMultiHopQA, BoolQ and FEVER reuse Wikipedia text (CC BY-SA). The licence audit, with per-source notes, is published with llavRAG (LICENSE-AUDIT.md). fresh-2 data record released with the paper (identifiers and scores, no text): CC BY 4.0 (DOI 10.5281/zenodo.24687039); full per-question decision traces are not yet released (CC BY-SA 4.0 if released).

Limitations

  • Scale and domain. Every evaluation corpus has 6,000 to 14,000 passages of English Wikipedia text, and the questions are public multi-hop benchmark questions. We have not measured the model on large or non-Wikipedia collections or on business documents.
  • In-domain fine-tuning and passage overlap. The model is fine-tuned on the training splits of MuSiQue, HotpotQA and 2WikiMultiHopQA. The MuSiQue part of fresh-2 comes from MuSiQue's training split: 597 of its 600 questions have a gold passage in the fine-tuning data, even though the questions themselves are not in it. The paper's overlap analyses are inconclusive, and MuSiQue-f2 is not independent of the judge's training data.
  • Public benchmarks and pretraining. The pretraining data of the base model is not public and was not audited. Public benchmark data may be part of it.
  • Training states. Stage 5 used states from an earlier prototype of the retrieval loop, not from llavRAG v0.3.
  • Platt mapping. Both Platt pairs rest on the round states of 30 training questions from one dataset. On other data, read the probabilities as a ranking signal.
  • Numerics. Rankings can change slightly across backends and batch sizes (fp16 rounding). In a multi-round loop, a changed near-tie can move a passage into or out of the top 10.
  • Cost. In llavRAG the model makes about 300 decisions per question, so latency depends heavily on the hardware: about 13 s per question (median) on an Apple M5 Max, measured with the reference implementation of the same core, not the package, and about 65 s on an NVIDIA RTX 3060 12 GB. Other hardware has not been verified.
  • Bias. The model inherits biases of its base model and training datasets. It was not evaluated for fairness.

Citation

@misc{sing2026llavrag,
  title  = {llavRAG: Evidence-Conditioned Multi-Hop Retrieval with an Open 4B Decision Model},
  author = {Sing, Mengyi},
  year   = {2026},
  note   = {LLav Lab. Preprint v0.3.1},
  doi    = {10.5281/zenodo.24687037},
  url    = {https://doi.org/10.5281/zenodo.24687037}
}

Base model:

@article{zhang2025qwen3embedding,
  title   = {Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models},
  author  = {Zhang, Yanzhao and Li, Mingxin and Long, Dingkun and Zhang, Xin and Lin, Huan and Yang, Baosong and Xie, Pengjun and Yang, An and Liu, Dayiheng and Lin, Junyang and Huang, Fei and Zhou, Jingren},
  journal = {arXiv preprint arXiv:2506.05176},
  year    = {2025}
}

Licence

Apache-2.0. llav 4B is a modified version of Qwen3-Reranker-4B (Apache-2.0, Qwen team, Alibaba Cloud). If you redistribute it, keep the licence and the attribution notice. The training datasets keep their own licences (see above).

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей