ameliechatelain commited on
Commit
21ac79c
·
verified ·
1 Parent(s): 291a14b

Model card edits: hero image, nDCG@10 table headers, BEIR results section, decontaminated wording

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +26 -19
  3. rerank.png +3 -0
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  tokenizer.json filter=lfs diff=lfs merge=lfs -text
 
 
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ rerank.png filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -40,6 +40,10 @@ tags:
40
  <a href="https://huggingface.co/lightonai/LightOn-rerank-LW-4B">LW-4B</a>
41
  </p>
42
 
 
 
 
 
43
  ---
44
 
45
  ## About the LightOn-rerank family
@@ -50,16 +54,16 @@ The models are built on Qwen3.5 vision-language backbones (hybrid linear + full
50
 
51
  The family comes in two scoring flavours × three sizes (0.8B / 2B / 4B):
52
 
53
- - **PW (pointwise)** each candidate is scored independently: the model judges whether the document answers the query, and the score is `logit("Yes") − logit("No")`. One forward pass per candidate, no generation simple to serve (vLLM-compatible) and embarrassingly parallel.
54
- - **LW (listwise)** generative listwise ranking: 4 candidates are placed in a single prompt and the model generates a permutation (`[2] > [4] > [1] > [3]`). Larger candidate pools are ranked with a sliding window (window 4, stride 2, bottom-to-top). Cross-document attention makes LW markedly stronger on hard visual reranking, and unlike pointwise scoring it keeps improving with backbone size.
55
 
56
- **LightOn-rerank-PW-4B** is the 4B pointwise member of the family. It ties the 2B pointwise model on ViDoRe V3 (0.5980 vs 0.5987) direct evidence that independent Yes/No scoring is a capacity bottleneck that extra parameters cannot fix. It is released as a scaling reference point; for 4B-budget deployments, [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) is +0.05 NDCG@10 at the same size.
57
 
58
  ## Results
59
 
60
- **ViDoRe V3** (visual document reranking, 8 domains × EN/FR queries), NDCG@10, ColQwen2.5-v0.2 first stage, retrieve 100 / rerank 100. All models including baselines were re-evaluated under this same two-stage protocol, so numbers are mutually comparable but not comparable to vendor-reported end-to-end results.
61
 
62
- | Model | Params | Scoring | ViDoRe V3 overall @10 |
63
  |---|---|---|---|
64
  | [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) | 4.5B | listwise | 0.6469 |
65
  | *Qwen3-VL-Reranker-8B* | *8B* | *pointwise (pooling)* | *0.6423* |
@@ -71,7 +75,7 @@ The family comes in two scoring flavours × three sizes (0.8B / 2B / 4B):
71
  | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | 0.85B | listwise | 0.5825 |
72
  | [LightOn-rerank-PW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-PW-0.8B) | 0.85B | pointwise | 0.4820 |
73
 
74
- ### ViDoRe V3 detail (NDCG, ColQwen2.5 first stage, rerank-100)
75
 
76
  | Domain | EN @5 | EN @10 | FR @5 | FR @10 |
77
  |---|---|---|---|---|
@@ -85,23 +89,27 @@ The family comes in two scoring flavours × three sizes (0.8B / 2B / 4B):
85
  | physics | 0.4249 | 0.4446 | 0.3525 | 0.3577 |
86
  | **mean** | **0.6090** | **0.6237** | **0.5613** | **0.5723** |
87
 
88
- Overall @10: **0.5980** (EN 0.6237 / FR 0.5723).
 
 
 
 
89
 
90
  ## Model Details
91
 
92
- - **Model type:** multimodal cross-encoder reranker **pointwise**: each candidate is scored independently as `logit("Yes") − logit("No")`
93
  - **Base model:** [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) (Qwen3.5 hybrid linear + full attention VLM)
94
  - **Parameters:** ≈4.5B (bfloat16, 9.1 GB)
95
- - **Inputs:** query (text) + candidate document(s) text passage **or** page image
96
- - **Fine-tuning:** joint text+vision LoRA (r=32, α=32, rsLoRA merged into the released weights), mixed-modality batches (2 text + 2 vision groups per micro-batch), vision loss weight 1.3, lr 1e-4, 1 epoch (465 steps)
97
  - **Data:** ~120k EN text queries (NQ, TriviaQA, MSMARCO) with mined hard negatives + ~118k visual query–page pairs with ColPali-family hard negatives (`dedup_120k_en_v3` + `ColPali_hard_neg_v2`)
98
  - **Languages:** English (training), French (zero-shot transfer)
99
  - **Requirements:** `transformers >= 5.4.0` (`qwen3_5` architecture)
100
  - **Internal experiment ID:** `exp40`
101
 
102
- ## Usage pointwise reranking
103
 
104
- Each candidate is scored independently as `logit("Yes") − logit("No")` at the first generated position; sort candidates by descending score. The model was trained with a fixed system prompt and user template use them verbatim for best results.
105
 
106
  ```python
107
  import torch
@@ -111,7 +119,7 @@ model_id = "lightonai/LightOn-rerank-PW-4B"
111
  model = AutoModelForImageTextToText.from_pretrained(
112
  model_id,
113
  dtype=torch.bfloat16,
114
- attn_implementation="flash_attention_2", # optional remove if flash-attn is not installed
115
  device_map="cuda",
116
  ).eval()
117
  processor = AutoProcessor.from_pretrained(model_id)
@@ -190,19 +198,18 @@ lp = {t.token: t.logprob for t in top}
190
  score = lp.get("Yes", -100.0) - lp.get("No", -100.0)
191
  ```
192
 
193
- Full-page document images can exceed 8k tokens keep `--max-model-len` at 16384 or higher when reranking page images.
194
 
195
  ## Notes & limitations
196
 
197
- - **Thinking must be disabled for scoring.** Qwen3.5-4B's chat template enables `<think>` by default; with it on, the first generated token is a thinking token and the Yes/No logprobs are distorted. Pass `enable_thinking=False` to `apply_chat_template` (or `chat_template_kwargs={"enable_thinking": False}` via the vLLM OpenAI client) as shown below.
198
- - Pointwise scoring does not benefit from the 2B→4B scale-up (ties the 2B pointwise model), while generative listwise gains +0.02 prefer [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) at this size.
199
  - Training data is English-only. French works zero-shot (the backbone is multilingual) but is slightly behind English on average.
200
- - Vision hard negatives were mined with ColPali-family retrievers; the model pairs best with a ColPali-family first stage (e.g. ColQwen2.5) for visual reranking.
201
- - BEIR contamination flag: NQ and MSMARCO are part of the text training data; headline text figures use clean means that exclude them.
202
 
203
  ## The LightOn-rerank family
204
 
205
- | Model | Backbone | Scoring | ViDoRe V3 @10 |
206
  |---|---|---|---|
207
  | [LightOn-rerank-PW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-PW-0.8B) | Qwen3.5-0.8B | pointwise | 0.4820 |
208
  | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | Qwen3.5-0.8B | listwise | 0.5825 |
 
40
  <a href="https://huggingface.co/lightonai/LightOn-rerank-LW-4B">LW-4B</a>
41
  </p>
42
 
43
+ <div align="center">
44
+ <img src="rerank.png" alt="Reranking: the second stage that puts the best text and image candidates on top" width="560">
45
+ </div>
46
+
47
  ---
48
 
49
  ## About the LightOn-rerank family
 
54
 
55
  The family comes in two scoring flavours × three sizes (0.8B / 2B / 4B):
56
 
57
+ - **PW (pointwise)**: each candidate is scored independently. The model judges whether the document answers the query, and the score is `logit("Yes") − logit("No")`. One forward pass per candidate and no generation, so it is simple to serve (vLLM-compatible) and embarrassingly parallel.
58
+ - **LW (listwise)**: generative listwise ranking, where 4 candidates are placed in a single prompt and the model generates a permutation (`[2] > [4] > [1] > [3]`). Larger candidate pools are ranked with a sliding window (window 4, stride 2, bottom-to-top). Cross-document attention makes LW markedly stronger on hard visual reranking, and unlike pointwise scoring it keeps improving with backbone size.
59
 
60
+ **LightOn-rerank-PW-4B** is the 4B pointwise member of the family. It ties the 2B pointwise model on ViDoRe V3 (0.5980 vs 0.5987): direct evidence that independent Yes/No scoring is a capacity bottleneck that extra parameters cannot fix. It is released as a scaling reference point; for 4B-budget deployments, [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) is +0.05 nDCG@10 at the same size.
61
 
62
  ## Results
63
 
64
+ **ViDoRe V3** (visual document reranking, 8 domains × EN/FR queries), overall nDCG@10, ColQwen2.5-v0.2 first stage, retrieve 100 / rerank 100. All models, including baselines, were re-evaluated under this same two-stage protocol, so numbers are mutually comparable but not comparable to vendor-reported end-to-end results.
65
 
66
+ | Model | Params | Scoring | ViDoRe V3 overall nDCG@10 |
67
  |---|---|---|---|
68
  | [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) | 4.5B | listwise | 0.6469 |
69
  | *Qwen3-VL-Reranker-8B* | *8B* | *pointwise (pooling)* | *0.6423* |
 
75
  | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | 0.85B | listwise | 0.5825 |
76
  | [LightOn-rerank-PW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-PW-0.8B) | 0.85B | pointwise | 0.4820 |
77
 
78
+ ### ViDoRe V3 detail (nDCG, ColQwen2.5 first stage, rerank-100)
79
 
80
  | Domain | EN @5 | EN @10 | FR @5 | FR @10 |
81
  |---|---|---|---|---|
 
89
  | physics | 0.4249 | 0.4446 | 0.3525 | 0.3577 |
90
  | **mean** | **0.6090** | **0.6237** | **0.5613** | **0.5723** |
91
 
92
+ Overall nDCG@10: **0.5980** (EN 0.6237 / FR 0.5723).
93
+
94
+ ### BEIR results (text reranking)
95
+
96
+ *Not yet evaluated for this model; results will be added.*
97
 
98
  ## Model Details
99
 
100
+ - **Model type:** multimodal cross-encoder reranker (**pointwise**: each candidate is scored independently as `logit("Yes") − logit("No")`)
101
  - **Base model:** [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) (Qwen3.5 hybrid linear + full attention VLM)
102
  - **Parameters:** ≈4.5B (bfloat16, 9.1 GB)
103
+ - **Inputs:** query (text) + candidate document(s): text passage **or** page image
104
+ - **Fine-tuning:** joint text+vision LoRA (r=32, α=32, rsLoRA, merged into the released weights), mixed-modality batches (2 text + 2 vision groups per micro-batch), vision loss weight 1.3, lr 1e-4, 1 epoch (465 steps)
105
  - **Data:** ~120k EN text queries (NQ, TriviaQA, MSMARCO) with mined hard negatives + ~118k visual query–page pairs with ColPali-family hard negatives (`dedup_120k_en_v3` + `ColPali_hard_neg_v2`)
106
  - **Languages:** English (training), French (zero-shot transfer)
107
  - **Requirements:** `transformers >= 5.4.0` (`qwen3_5` architecture)
108
  - **Internal experiment ID:** `exp40`
109
 
110
+ ## Usage: pointwise reranking
111
 
112
+ Each candidate is scored independently as `logit("Yes") − logit("No")` at the first generated position; sort candidates by descending score. The model was trained with a fixed system prompt and user template: use them verbatim for best results.
113
 
114
  ```python
115
  import torch
 
119
  model = AutoModelForImageTextToText.from_pretrained(
120
  model_id,
121
  dtype=torch.bfloat16,
122
+ attn_implementation="flash_attention_2", # optional, remove if flash-attn is not installed
123
  device_map="cuda",
124
  ).eval()
125
  processor = AutoProcessor.from_pretrained(model_id)
 
198
  score = lp.get("Yes", -100.0) - lp.get("No", -100.0)
199
  ```
200
 
201
+ Full-page document images can exceed 8k tokens, so keep `--max-model-len` at 16384 or higher when reranking page images.
202
 
203
  ## Notes & limitations
204
 
205
+ - **Thinking must be disabled for scoring.** Qwen3.5-4B's chat template enables `<think>` by default; with it on, the first generated token is a thinking token and the Yes/No logprobs are distorted. Pass `enable_thinking=False` to `apply_chat_template` (or `chat_template_kwargs={"enable_thinking": False}` via the vLLM OpenAI client) as shown above.
206
+ - Pointwise scoring does not benefit from the 2B→4B scale-up (ties the 2B pointwise model), while generative listwise gains +0.02, so prefer [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) at this size.
207
  - Training data is English-only. French works zero-shot (the backbone is multilingual) but is slightly behind English on average.
208
+ - BEIR contamination flag: NQ and MSMARCO are part of the text training data; headline text figures use decontaminated means that exclude them.
 
209
 
210
  ## The LightOn-rerank family
211
 
212
+ | Model | Backbone | Scoring | ViDoRe V3 overall nDCG@10 |
213
  |---|---|---|---|
214
  | [LightOn-rerank-PW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-PW-0.8B) | Qwen3.5-0.8B | pointwise | 0.4820 |
215
  | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | Qwen3.5-0.8B | listwise | 0.5825 |
rerank.png ADDED

Git LFS Details

  • SHA256: 12e66648b46320be5d648e3750e30f3e4c92b125a1d01ad54a213169012a7e31
  • Pointer size: 132 Bytes
  • Size of remote file: 1.84 MB