Zhan-Lun commited on
Commit
6a680cb
·
verified ·
1 Parent(s): b4f97a7

Update model card: SDPA scores, quick start, eval environment

Browse files
Files changed (1) hide show
  1. README.md +133 -42
README.md CHANGED
@@ -60,7 +60,7 @@ as synthetically generated data.
60
  | **Method** | ColBERT-style late interaction with MaxSim scoring |
61
  | **Output** | L2-normalized multi-vector embeddings `(sequence_length, 640)` |
62
  | **Modalities** | Text queries and document images |
63
- | **Attention** | Bidirectional full-attention layers; selectable FlashAttention 2, FlashAttention 3, or SDPA kernel |
64
  | **Visual-token budget** | 1,792 tokens per image in the released processor |
65
  | **Training** | LoRA adapters and a fully trained projection layer, merged for release |
66
  | **Weights** | `bfloat16`; language-model head removed |
@@ -72,8 +72,9 @@ as synthetically generated data.
72
  layout and content signals that single-vector pooling can discard.
73
  - **Compact projection:** Hidden states are projected to 640 dimensions
74
  without an activation function.
75
- - **Bidirectional retrieval attention:** Selecting FlashAttention 2 or 3
76
- changes the execution kernel, not the model's bidirectional attention mode.
 
77
 
78
  ## 📊 Evaluation results
79
 
@@ -82,23 +83,31 @@ percentages rather than values between 0 and 1 (for example, 0.80 is shown as
82
  80.00). Each task value is the mean of its six language subsets; the public
83
  average is the unweighted mean of the eight public task values.
84
 
85
- The result artifacts record MTEB 2.18.5, Transformers 5.14.1, PyTorch 2.9.0
86
- with CUDA 12.8, `bfloat16`, FlashAttention 2.8.3, and batch size 32. The release
87
- processor is configured with a 1,792 visual-token budget. Comparator values
88
- were read from the live
 
 
 
 
 
 
 
 
 
 
 
 
89
  [ViDoRe V3 MTEB leaderboard](https://mteb-leaderboard.hf.space/benchmark/ViDoRe%28v3%29)
90
  on July 22, 2026.
91
 
92
- Model encoding runs in `bfloat16`. Before MaxSim scoring, query and document
93
- embeddings are moved to CPU and converted to `float32`. All reported ViDoRe
94
- results use this FP32 scoring path.
95
-
96
  | Model | Computer Science | Energy | FinanceEn | FinanceFr | HR | Industrial | Pharmaceuticals | Physics | **Avg. public** |
97
  | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
98
- | **[webAI-ColVec1.1-8b](https://huggingface.co/webAI-Official/webAI-ColVec1.1-8b)** | 80.14 | 70.09 | **71.89** | **55.10** | 68.49 | **57.41** | 67.88 | 51.29 | **65.29** |
99
- | [VultronRetriever Prime](https://huggingface.co/vultr/VultronRetrieverPrime-Qwen3.5-8B) | 79.81 | **70.26** | 69.01 | 54.51 | 66.82 | **57.41** | **68.19** | **51.73** | 64.72 |
100
  | [webAI-ColVec1-9b](https://huggingface.co/webAI-Official/webAI-ColVec1-9b) | **80.92** | 69.77 | 68.28 | 53.72 | **70.04** | 57.18 | 67.32 | 48.38 | 64.45 |
101
- | **webAI-ColVec1.1-4b (this model)** | 80.35 | 69.26 | 69.12 | 53.21 | 67.02 | 56.30 | 67.07 | 51.36 | 64.21 |
102
  | [VultronRetriever Core](https://huggingface.co/vultr/VultronRetrieverCore-Qwen3.5-4.5B) | 79.77 | 69.19 | 68.93 | 52.02 | 66.10 | 56.11 | 67.45 | 50.18 | 63.72 |
103
  | [Nemotron ColEmbed VL 8B V2](https://huggingface.co/nvidia/nemotron-colembed-vl-8b-v2) | 79.29 | 69.82 | 67.29 | 51.54 | 66.32 | 56.03 | 67.19 | 50.84 | 63.54 |
104
  | [webAI-ColVec1-4b](https://huggingface.co/webAI-Official/webAI-ColVec1-4b) | 79.84 | 68.70 | 68.49 | 51.11 | 67.40 | 55.73 | 65.68 | 50.15 | 63.39 |
@@ -117,31 +126,29 @@ The processor provides the current retrieval API:
117
  - `score_retrieval(query_embeddings, document_embeddings)` computes a MaxSim
118
  score matrix with shape `(number_of_queries, number_of_documents)`.
119
 
120
- ### Prerequisites and attention backends
121
 
122
- The public ViDoRe V3 numbers are reproducible with this pinned FlashAttention 2
123
- environment:
 
 
124
 
125
- ```text
126
- Python 3.12
127
- PyTorch 2.9.0 + CUDA 12.8
128
- Transformers 5.14.1
129
- MTEB 2.18.5
130
- Sentence Transformers 5.6.0
131
- FlashAttention 2.8.3
132
- ```
133
 
134
- The model also supports FlashAttention 3 on Hopper GPUs (H100/H200). See the
135
- [Dao-AILab FlashAttention repository](https://github.com/dao-ailab/flash-attention)
136
- for FlashAttention 3 installation instructions, then select
137
- `flash_attention_3` when loading in a compatible Hopper environment.
138
 
139
- FlashAttention 2 and FlashAttention 3 both preserve bidirectional attention.
140
- FlashAttention 3 can improve throughput on Hopper GPUs, but the published
141
- scores use FlashAttention 2; changing kernels can produce small floating-point
142
- differences. Use FlashAttention 2 when reproducing the table.
143
 
144
- ### Inference code
 
 
145
 
146
  ```python
147
  from io import BytesIO
@@ -153,11 +160,9 @@ from transformers import AutoModel, AutoProcessor
153
 
154
  MODEL_ID = "webAI-Official/webAI-ColVec1.1-4b"
155
  DEVICE = "cuda:0" if torch.cuda.is_available() else "cpu"
156
- ATTN_IMPLEMENTATION = (
157
- "flash_attention_2" if torch.cuda.is_available() else "sdpa"
158
- )
159
- # On an H100/H200 with FlashAttention 3 installed, use:
160
- # ATTN_IMPLEMENTATION = "flash_attention_3"
161
 
162
  processor = AutoProcessor.from_pretrained(
163
  MODEL_ID,
@@ -222,11 +227,97 @@ print(scores)
222
  print("Best document per query:", scores.argmax(dim=1))
223
  ```
224
 
225
- The processor loads the release's 1,792 visual-token budget by default. To
226
- reduce memory use, pass a lower `max_num_visual_tokens` value to
227
  `AutoProcessor.from_pretrained`; this changes document granularity and may
228
  change retrieval scores.
229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  ## ⚖️ Strengths and limitations
231
 
232
  ### Strengths
@@ -242,7 +333,7 @@ change retrieval scores.
242
 
243
  ### Limitations
244
 
245
- - **Storage Cost:** Still larger than single-vector baselines despite the
246
  smaller token dimension.
247
 
248
  ## License
 
60
  | **Method** | ColBERT-style late interaction with MaxSim scoring |
61
  | **Output** | L2-normalized multi-vector embeddings `(sequence_length, 640)` |
62
  | **Modalities** | Text queries and document images |
63
+ | **Attention** | Bidirectional full-attention layers; selectable SDPA, FlashAttention 2, or FlashAttention 3 kernel |
64
  | **Visual-token budget** | 1,792 tokens per image in the released processor |
65
  | **Training** | LoRA adapters and a fully trained projection layer, merged for release |
66
  | **Weights** | `bfloat16`; language-model head removed |
 
72
  layout and content signals that single-vector pooling can discard.
73
  - **Compact projection:** Hidden states are projected to 640 dimensions
74
  without an activation function.
75
+ - **Bidirectional retrieval attention:** Selecting SDPA, FlashAttention 2, or
76
+ FlashAttention 3 changes the execution kernel, not the model's bidirectional
77
+ attention mode.
78
 
79
  ## 📊 Evaluation results
80
 
 
83
  80.00). Each task value is the mean of its six language subsets; the public
84
  average is the unweighted mean of the eight public task values.
85
 
86
+ The evaluation software versions and setup are documented under
87
+ [Reproducing the evaluation environment](#reproducing-the-evaluation-environment).
88
+ For the reported evaluation, SDPA was selected as the attention
89
+ implementation, the released processor used a 1,792 visual-token budget, and
90
+ the batch size was 32.
91
+
92
+ Model encoding used `bfloat16`. Before MaxSim scoring, query and document
93
+ embeddings were moved to CPU and converted to `float32`; all reported ViDoRe
94
+ results use this FP32 scoring path. Because floating-point calculations and
95
+ kernel execution can vary across accelerator hardware, independent
96
+ evaluations may produce slightly different results. The submitted MTEB
97
+ artifacts are the canonical source for the reported scores.
98
+
99
+ All table values are shown to two decimal places. ColVec1.1 values are rounded
100
+ from the submitted artifacts using round-half-up. Comparator values were read
101
+ from the live
102
  [ViDoRe V3 MTEB leaderboard](https://mteb-leaderboard.hf.space/benchmark/ViDoRe%28v3%29)
103
  on July 22, 2026.
104
 
 
 
 
 
105
  | Model | Computer Science | Energy | FinanceEn | FinanceFr | HR | Industrial | Pharmaceuticals | Physics | **Avg. public** |
106
  | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
107
+ | **[webAI-ColVec1.1-8b](https://huggingface.co/webAI-Official/webAI-ColVec1.1-8b)** | 80.08 | 70.12 | **71.90** | **54.87** | 68.55 | **57.65** | 67.88 | 51.50 | **65.32** |
108
+ | [VultronRetriever Prime](https://huggingface.co/vultr/VultronRetrieverPrime-Qwen3.5-8B) | 79.81 | **70.26** | 69.01 | 54.51 | 66.82 | 57.41 | **68.19** | **51.73** | 64.72 |
109
  | [webAI-ColVec1-9b](https://huggingface.co/webAI-Official/webAI-ColVec1-9b) | **80.92** | 69.77 | 68.28 | 53.72 | **70.04** | 57.18 | 67.32 | 48.38 | 64.45 |
110
+ | **webAI-ColVec1.1-4b (this model)** | 80.34 | 69.50 | 69.18 | 53.13 | 66.90 | 56.36 | 67.25 | 51.24 | 64.24 |
111
  | [VultronRetriever Core](https://huggingface.co/vultr/VultronRetrieverCore-Qwen3.5-4.5B) | 79.77 | 69.19 | 68.93 | 52.02 | 66.10 | 56.11 | 67.45 | 50.18 | 63.72 |
112
  | [Nemotron ColEmbed VL 8B V2](https://huggingface.co/nvidia/nemotron-colembed-vl-8b-v2) | 79.29 | 69.82 | 67.29 | 51.54 | 66.32 | 56.03 | 67.19 | 50.84 | 63.54 |
113
  | [webAI-ColVec1-4b](https://huggingface.co/webAI-Official/webAI-ColVec1-4b) | 79.84 | 68.70 | 68.49 | 51.11 | 67.40 | 55.73 | 65.68 | 50.15 | 63.39 |
 
126
  - `score_retrieval(query_embeddings, document_embeddings)` computes a MaxSim
127
  score matrix with shape `(number_of_queries, number_of_documents)`.
128
 
129
+ ### Quick start
130
 
131
+ Create and activate a Python 3.12 virtual environment, then install the
132
+ validated PyTorch CUDA 12.8 build and the minimal packages required for SDPA
133
+ inference. If you are already using an isolated Python environment, skip the
134
+ first two commands.
135
 
136
+ ```bash
137
+ python3.12 -m venv .venv
138
+ source .venv/bin/activate
 
 
 
 
 
139
 
140
+ python -m pip install \
141
+ torch==2.9.0 torchvision==0.24.0 \
142
+ --index-url https://download.pytorch.org/whl/cu128
 
143
 
144
+ python -m pip install \
145
+ "transformers>=5.14.1,<6.0.0" \
146
+ accelerate pillow requests safetensors
147
+ ```
148
 
149
+ The following example uses SDPA, the portable default and the attention
150
+ implementation used for the reported evaluation. It does not require
151
+ FlashAttention.
152
 
153
  ```python
154
  from io import BytesIO
 
160
 
161
  MODEL_ID = "webAI-Official/webAI-ColVec1.1-4b"
162
  DEVICE = "cuda:0" if torch.cuda.is_available() else "cpu"
163
+
164
+ # Portable default and the backend used by the published evaluation:
165
+ ATTN_IMPLEMENTATION = "sdpa"
 
 
166
 
167
  processor = AutoProcessor.from_pretrained(
168
  MODEL_ID,
 
227
  print("Best document per query:", scores.argmax(dim=1))
228
  ```
229
 
230
+ The released processor uses a 1,792 visual-token budget by default. To reduce
231
+ memory use, pass a lower `max_num_visual_tokens` value to
232
  `AutoProcessor.from_pretrained`; this changes document granularity and may
233
  change retrieval scores.
234
 
235
+ ### Optional acceleration
236
+
237
+ The model can run with compatible PyTorch and CUDA builds using SDPA,
238
+ FlashAttention 2, or FlashAttention 3. CPU execution is supported through
239
+ PyTorch's SDPA math fallback, but is generally impractical for a model of this
240
+ size.
241
+
242
+ Qwen3.5 uses a hybrid stack of full-attention and GatedDeltaNet
243
+ linear-attention layers. These kernels serve different parts of the model:
244
+
245
+ - `flash-attn` can accelerate the full-attention layers when selected.
246
+ - `causal-conv1d` and `flash-linear-attention` (`fla`) accelerate the
247
+ GatedDeltaNet layers. Transformers can fall back to PyTorch implementations
248
+ without them.
249
+ - `tilelang` provides optimized GPU kernels for some FLA operations. FLA uses
250
+ these kernels when the operation and hardware are supported and uses another
251
+ implementation otherwise. Pin `apache-tvm-ffi<0.1.10` alongside it to keep
252
+ TileLang's TVM dependency compatible.
253
+
254
+ [flash-attn](https://github.com/Dao-AILab/flash-attention) and
255
+ [causal-conv1d](https://github.com/Dao-AILab/causal-conv1d) ship as prebuilt
256
+ wheels tied to a specific Python, PyTorch, CUDA, and C++ ABI combination, so
257
+ install the build that matches your environment;
258
+ [flash-linear-attention](https://github.com/fla-org/flash-linear-attention) and
259
+ [TileLang](https://github.com/tile-ai/tilelang) install from PyPI. The exact
260
+ versions used for the reported scores are pinned in
261
+ [Reproducing the evaluation environment](#reproducing-the-evaluation-environment).
262
+
263
+ `causal-conv1d`, `flash-linear-attention`, and `tilelang` are detected
264
+ automatically once installed, so the GatedDeltaNet layers need no configuration
265
+ change. Only the full-attention backend is selected explicitly, as a one-line
266
+ change to the model loading code in [Quick start](#quick-start):
267
+
268
+ ```python
269
+ ATTN_IMPLEMENTATION = "flash_attention_2" # or "flash_attention_3"
270
+ ```
271
+
272
+ FlashAttention 2 and FlashAttention 3 both preserve the model's bidirectional
273
+ attention, and FlashAttention 3 can improve throughput on Hopper GPUs
274
+ (H100/H200). PyTorch's built-in SDPA remains the more portable choice because
275
+ it does not require a separate FlashAttention package or ABI-compatible wheel.
276
+ Changing the full-attention implementation may introduce small floating-point
277
+ differences and affect only those layers, not the GatedDeltaNet layers.
278
+
279
+ ### Reproducing the evaluation environment
280
+
281
+ The complete pinned Python environment is provided in
282
+ [`evaluation-requirements-cu128.txt`](./evaluation-requirements-cu128.txt),
283
+ which reproduces the recorded Linux x86-64, CPython 3.12, CUDA 12.8, and
284
+ PyTorch 2.9 environment used for evaluation. Its pinned wheel URLs are specific
285
+ to that platform, so a different environment needs matching wheels or a source
286
+ build.
287
+
288
+ Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/), ensure
289
+ Git is available, and then run:
290
+
291
+ ```bash
292
+ uv venv --python 3.12 .venv
293
+ source .venv/bin/activate
294
+
295
+ uv pip install \
296
+ torch==2.9.0 torchvision==0.24.0 \
297
+ --index-url https://download.pytorch.org/whl/cu128
298
+
299
+ uv pip install -r evaluation-requirements-cu128.txt
300
+ uv pip check
301
+ ```
302
+
303
+ The requirements include FlashAttention 2 as an optional supported backend;
304
+ its presence does not change the SDPA configuration used for the reported
305
+ scores.
306
+
307
+ The public ViDoRe V3 scores used the following core software versions:
308
+
309
+ ```text
310
+ Python 3.12
311
+ PyTorch 2.9.0 + CUDA 12.8
312
+ Transformers 5.14.1
313
+ MTEB 2.18.6 (commit d56a414b45ebad0d03495de000b4880d8b028d4a)
314
+ Sentence Transformers 5.6.0
315
+ causal-conv1d 1.6.2.post1
316
+ flash-linear-attention 0.5.1
317
+ TileLang 0.1.9
318
+ Attention implementation: SDPA
319
+ ```
320
+
321
  ## ⚖️ Strengths and limitations
322
 
323
  ### Strengths
 
333
 
334
  ### Limitations
335
 
336
+ - **Storage cost:** Still larger than single-vector baselines despite the
337
  smaller token dimension.
338
 
339
  ## License