rerank-4b-erb
Qwen/Qwen3-Reranker-4B, self-tuned to rerank whole documents for questions about one company's work: the synthetic company corpus of EnterpriseRAG-Bench (MIT-licensed, per its publisher). It is the reranker of Louvain's open retrieval stack.
- Base model: Qwen/Qwen3-Reranker-4B (Apache-2.0)
- Licence: Apache-2.0, the same as the base. See
LICENSE. - Changes from the base: a LoRA adapter (rank 32, on every attention and MLP projection), trained as described below and merged into the base weights. No architecture change.
Training data
- Questions: synthetic questions over the corpus's own passages, and nothing else. Each was written from one
passage by
qwen/qwen3-235b-a22b-2507. - Groups: each question is paired with its own source document as the positive, and up to 7 negatives from a fused BM25 + dense nearest-neighbour search. Every text is a whole document, cut at 8,000 characters.
- False-negative filter: the untuned base model dropped any negative it scored at or above its positive.
- Excluded documents: every gold document of the benchmark's 100 dev questions, and every document in the 94 evaluation pools (10,221 documents), whether as a positive or as a negative.
- No benchmark data: none of the benchmark's questions, answers or gold labels is in the training data in any form. The model has seen the corpus's other documents, which is what self-tuning on a workspace means.
Training
- Objective: listwise softmax cross-entropy over logit("yes") − logit("no") at the answer position.
- Settings: 2,239 groups after filtering, one epoch, learning rate 5e-5, 4 groups accumulated, maximum length 8,192 tokens, seed 241.
- Compute: about 1.7 h on one H100 (training), plus the filter pass.
Use
Use the base model's prompt and read the score as logit("yes") − logit("no") at the last position, with inputs left-padded:
<|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 question about a company's work, judge whether the document answers it
<Query>: {question}
<Document>: {document}<|im_end|>
<|im_start|>assistant
<think>
</think>
On Louvain's open engine, the rerank sidecar serves it with LOUVAIN_RERANK_KIND=qwen3-reranker and
LOUVAIN_RERANK_MODEL=<this repo or its directory> (apps/nlp/rerank.py). vLLM serves it with the base model's
Qwen3ForSequenceClassification overrides.
Load it on transformers 5.22.2, the version that saved it (requirements-rerank.txt pins it). transformers 4.57.6
cannot read its tokenizer config. The config also states rope_theta (1,000,000) at the top level beside
rope_parameters.
Integrity: model.safetensors sha256 f21d63076f8b1551afd7c702bf456838b0fd70e816e5492f89f89e90aad36f71. Every
file's digest is in SHA256SUMS.
Measured
The benchmark is 94 EnterpriseRAG-Bench dev questions with gold documents. Each question's candidate pool is the union of two first-stage searches (median 108 documents), every document whole at 8,000 characters, with the question as the query. The table counts questions with a gold document at rank 1 / ≤3 / ≤10 / ≤24:
| Model | Count |
|---|---|
| Qwen3-Reranker-4B (base) | 80 / 86 / 88 / 89 |
| rerank-4b-erb | 84 / 87 / 89 / 89 |
| Cohere rerank-v4.0-pro, for reference | 86 / 89 / 89 / 89 |
On 300 held-out synthetic groups, the positive is ranked first in 214 (base: 183), MRR 0.814 (base: 0.744).
These are ranking numbers, not a benchmark score: Louvain's judged runs add retrieval, an agent and a reader around it.
Precision. The table above was scored in bfloat16 on an H100. In bfloat16 the order of two documents whose scores are within one bfloat16 step can change with the batch they share: measured on 20 of the pools, rank 1 was identical in all 20 and no top-3 pair differed by more than a step, but two golds deep in the ranking moved by one place (11→12, 25→26). Scoring in float32 removes that; a float32 table on the same code replaces this one.
Limitations
- Tuned to one synthetic company's documents. On other companies' documents, expect it to sit between the base model and a model tuned on that company's own documents.
- English only, as tuned.