File size: 1,964 Bytes
994b0f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
license: apache-2.0
base_model: Qwen/Qwen3-8B-Base
library_name: transformers
pipeline_tag: text-ranking
tags:
- reranker
- tevatron
- information-retrieval
- passage-ranking
---

# tevatron3-reranker-8b-contrastive-lora-hf

A pointwise passage **reranker** built on Qwen3-8B (dense), trained with the
[Tevatron](https://github.com/texttron/tevatron) 3.0 toolkit.

- **Backbone:** Qwen3-8B (dense)
- **Training backend:** HF DDP
- **Objective:** contrastive
- **Parameter efficiency:** LoRA (merged)
- **Training data:** [RLHN-680K](https://huggingface.co/datasets/rlhn/rlhn-680K)

## Scoring contract (important)

This checkpoint is a **sequence-classification scorer**, saved as
`Qwen3ForSequenceClassification` with `num_labels=1`. The relevance score of a
(query, passage) pair is the single regression logit read at the **last (EOS)
token**. Training builds the pair as `"query: {{query}} passage: {{title}} {{text}}"`
(no yes/no suffix) and **appends EOS**; score = `logits[:, 0]`.

> This differs from the Megatron causal-LM rerankers in this release, which
> score `logit(" yes") − logit(" no")` at a prompt suffix. Load this one with
> `AutoModelForSequenceClassification`, not `AutoModelForCausalLM`.

## Usage

Score with Tevatron's reranker eval backend (see the
[Tevatron repo](https://github.com/texttron/tevatron)), or directly:

```python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

name = "brutusxu/tevatron3-reranker-8b-contrastive-lora-hf"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(
    name, num_labels=1, dtype=torch.bfloat16).cuda().eval()
pair = "query: what is the capital of france passage: Paris is the capital of France."
ids = tok(pair + tok.eos_token, return_tensors="pt").to("cuda")
with torch.no_grad():
    print(model(**ids).logits[0, 0].item())
```

## Citation

If you use this model, please cite the Tevatron toolkit.