brutusxu's picture
Add files using upload-large-folder tool
994b0f1 verified
|
Raw
History Blame Contribute Delete
1.96 kB
---
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.