--- license: apache-2.0 language: - en - fr base_model: - Qwen/Qwen3.5-0.8B pipeline_tag: image-text-to-text library_name: transformers tags: - reranker - cross-encoder - multimodal - text-ranking - document-reranking - vidore - beir ---
LightOn [![Website](https://img.shields.io/badge/LightOn-Website-blue?logo=google-chrome)](https://lighton.ai) [![LinkedIn](https://img.shields.io/badge/LightOn-LinkedIn-0A66C2?logo=linkedin)](https://www.linkedin.com/company/lighton/) [![X](https://img.shields.io/badge/@LightOnIO-X-black?logo=x)](https://x.com/LightOnIO) πŸ“ Blog post: *coming soon*

LightOn-rerank-PW-0.8B

Unified Text + Visual Document Reranker by LightOn

PW-0.8B | LW-0.8B | PW-2B | LW-2B | PW-4B | LW-4B

--- ## About the LightOn-rerank family Production retrieval pipelines usually need two rerankers: one for text passages and one for visual documents (PDF pages, slides, scans). **LightOn-rerank** models are *unified* cross-encoder rerankers: a single model scores both text passages and document page images against a query, on top of any first-stage retriever (BM25, dense embeddings, or ColPali-family late-interaction models). The models are built on Qwen3.5 vision-language backbones (hybrid linear + full attention) and jointly fine-tuned on text and visual reranking data with mixed-modality batches (LoRA, merged into the released weights). Training data is English-only; French performance transfers zero-shot from the multilingual backbone. The family comes in two scoring flavours Γ— three sizes (0.8B / 2B / 4B): - **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. - **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. **LightOn-rerank-PW-0.8B** is the smallest pointwise member of the family, released primarily as a size/recipe reference point: it shows that independent Yes/No scoring degrades sharply below 2B parameters. If you want a 0.8B reranker, use [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) instead (+0.10 NDCG@10 on ViDoRe V3 with the same backbone). ## Results **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. | Model | Params | Scoring | ViDoRe V3 overall @10 | |---|---|---|---| | [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) | 4.5B | listwise | 0.6469 | | *Qwen3-VL-Reranker-8B* | *8B* | *pointwise (pooling)* | *0.6423* | | [LightOn-rerank-LW-2B](https://huggingface.co/lightonai/LightOn-rerank-LW-2B) | 2.2B | listwise | 0.6266 | | [LightOn-rerank-PW-2B](https://huggingface.co/lightonai/LightOn-rerank-PW-2B) | 2.2B | pointwise | 0.5987 | | [LightOn-rerank-PW-4B](https://huggingface.co/lightonai/LightOn-rerank-PW-4B) | 4.5B | pointwise | 0.5980 | | *jina-reranker-m0* | *2.4B* | *pointwise* | *0.5939* | | *Qwen3-VL-Reranker-2B* | *2B* | *pointwise (pooling)* | *0.5918* | | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | 0.85B | listwise | 0.5825 | | **LightOn-rerank-PW-0.8B (this model)** | 0.85B | pointwise | **0.4820** | ### ViDoRe V3 detail (NDCG, ColQwen2.5 first stage, rerank-100) | Domain | EN @5 | EN @10 | FR @5 | FR @10 | |---|---|---|---|---| | finance_en | 0.5648 | 0.5740 | 0.3023 | 0.3108 | | finance_fr | 0.3042 | 0.3228 | 0.2956 | 0.3027 | | computer_science | 0.7213 | 0.7396 | 0.5097 | 0.5086 | | hr | 0.5543 | 0.5641 | 0.2538 | 0.2612 | | energy | 0.6265 | 0.6490 | 0.6233 | 0.6397 | | industrial | 0.5427 | 0.5488 | 0.2512 | 0.2599 | | pharmaceuticals | 0.6340 | 0.6459 | 0.4627 | 0.4640 | | physics | 0.4548 | 0.4784 | 0.4232 | 0.4422 | | **mean** | **0.5503** | **0.5653** | **0.3902** | **0.3986** | Overall @10: **0.4820** (EN 0.5653 / FR 0.3986). ## Model Details - **Model type:** multimodal cross-encoder reranker β€” **pointwise**: each candidate is scored independently as `logit("Yes") βˆ’ logit("No")` - **Base model:** [Qwen/Qwen3.5-0.8B](https://huggingface.co/Qwen/Qwen3.5-0.8B) (Qwen3.5 hybrid linear + full attention VLM) - **Parameters:** β‰ˆ0.85B (bfloat16, 1.7 GB) - **Inputs:** query (text) + candidate document(s) β€” text passage **or** page image - **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) - **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`) - **Languages:** English (training), French (zero-shot transfer) - **Requirements:** `transformers >= 5.4.0` (`qwen3_5` architecture) - **Internal experiment ID:** `qwen08pointwise` ## Usage β€” pointwise reranking 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 (`RERANKER_SYSTEM_V2` / `RERANKER_TEXT_V2` / `RERANKER_VISION_V2`) β€” these will be published alongside the blog post and **must** be used verbatim for best results. ```python import torch from transformers import AutoModelForImageTextToText, AutoProcessor model_id = "lightonai/LightOn-rerank-PW-0.8B" model = AutoModelForImageTextToText.from_pretrained( model_id, dtype=torch.bfloat16, attn_implementation="flash_attention_2", device_map="cuda", ).eval() processor = AutoProcessor.from_pretrained(model_id) processor.tokenizer.padding_side = "left" # scores are read at the last position YES_TOKEN_ID = 9175 # "Yes" NO_TOKEN_ID = 2665 # "No" SYSTEM_PROMPT = ... # RERANKER_SYSTEM_V2 β€” released with the blog post USER_TEMPLATE = ... # RERANKER_TEXT_V2, with {query} and {doc} fields query = "What is late interaction in neural information retrieval?" documents = [ "ColBERT computes token-level query-document interactions at search time...", "The Eiffel Tower is located on the Champ de Mars in Paris.", ] texts = [ processor.apply_chat_template( [ {"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": USER_TEMPLATE.format(query=query, doc=doc)}, ], tokenize=False, add_generation_prompt=True, ) for doc in documents ] inputs = processor( text=texts, return_tensors="pt", padding=True, truncation=True, max_length=2048 ).to(model.device) with torch.inference_mode(): logits = model(**inputs).logits[:, -1] scores = (logits[:, YES_TOKEN_ID] - logits[:, NO_TOKEN_ID]).tolist() ranked = sorted(zip(scores, documents), reverse=True) ``` To score a **page image** instead of a text passage, replace the user message with: ```python {"role": "user", "content": [ {"type": "image", "image": page_image}, # PIL.Image {"type": "text", "text": VISION_TEMPLATE.format(query=query)}, # RERANKER_VISION_V2 ]} ``` and pass `images=[page_image, ...]` to the processor call. ### Serving with vLLM ```bash vllm serve lightonai/LightOn-rerank-PW-0.8B --trust-remote-code --max-model-len 16384 ``` ```python resp = client.chat.completions.create( model="lightonai/LightOn-rerank-PW-0.8B", messages=messages, # same system + user messages as above max_tokens=1, logprobs=True, top_logprobs=20, temperature=0.0, ) top = resp.choices[0].logprobs.content[0].top_logprobs lp = {t.token: t.logprob for t in top} score = lp.get("Yes", -100.0) - lp.get("No", -100.0) ``` Full-page document images can exceed 8k tokens β€” keep `--max-model-len` at 16384 or higher when reranking page images. ## Notes & limitations - At 0.8B, pointwise Yes/No scoring cannot discriminate hard candidates: βˆ’0.10 NDCG@10 vs the listwise sibling on the same backbone, with French hit hardest. Prefer [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) at this size. - Reranking a deeper candidate pool amplifies the weakness: overall @10 drops from 0.5030 (rerank-10) to 0.4820 (rerank-100). - Training data is English-only. French works zero-shot (the backbone is multilingual) but is slightly behind English on average. - 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. - BEIR contamination flag: NQ and MSMARCO are part of the text training data; headline text figures use clean means that exclude them. ## The LightOn-rerank family | Model | Backbone | Scoring | ViDoRe V3 @10 | |---|---|---|---| | [LightOn-rerank-PW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-PW-0.8B) | Qwen3.5-0.8B | pointwise | 0.4820 | | [LightOn-rerank-LW-0.8B](https://huggingface.co/lightonai/LightOn-rerank-LW-0.8B) | Qwen3.5-0.8B | listwise | 0.5825 | | [LightOn-rerank-PW-2B](https://huggingface.co/lightonai/LightOn-rerank-PW-2B) | Qwen3.5-2B | pointwise | 0.5987 | | [LightOn-rerank-LW-2B](https://huggingface.co/lightonai/LightOn-rerank-LW-2B) | Qwen3.5-2B | listwise | 0.6266 | | [LightOn-rerank-PW-4B](https://huggingface.co/lightonai/LightOn-rerank-PW-4B) | Qwen3.5-4B | pointwise | 0.5980 | | [LightOn-rerank-LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B) | Qwen3.5-4B | listwise | **0.6469** | Rule of thumb: **LW** models are stronger at every size (and the gap grows with size); **PW** models are cheaper to serve and score candidates independently. For the best quality pick [LW-4B](https://huggingface.co/lightonai/LightOn-rerank-LW-4B); for the best quality/cost trade-off pick [LW-2B](https://huggingface.co/lightonai/LightOn-rerank-LW-2B); for maximum throughput on text-heavy workloads pick a PW model.