Views
No views yet

| Method | Tokens | R@1 | R@10 | nDCG@10 |
|---|---|---|---|---|
| OmniEmbed-7B | 1 | 51.5 | 83.2 | 67.1 |
| Video-ColBERT | 26 | 51.5 | 85.5 | 67.7 |
| Baseline (Ours, uncompressed) | 1318 | 55.7 | 88.3 | 71.9 |
| SeqResize (This model) | 32 | 53.3 | 86.9 | 69.9 |
| MemTok | 32 | 54.2 | 86.4 | 69.9 |
| H-Pool | 32 | 54.1 | 87.3 | 70.4 |
| AGC | 32* | 56.9 | 87.0 | 71.5 |
| Initial weights | Qwen2.5-VL-3B-Instruct |
| Architecture | Qwen2.5-VL with bidirectional attention |
| Hidden dimension | 2048 |
| Budget | 32 vectors per document |
| Compression method | SeqResize (learned sequence projection) |
| Resizer input size | 1024 (fixed sequence length before projection) |
| Resizer output size | 32 (Budget) |
| Resizer hidden size | 256 (MLP bottleneck) |
| Scoring | ColBERT-style MaxSim (late interaction) |
| Normalization | L2-normalized embeddings |
| Query prefix | "Query: " |
| Passage prefix | "Passage: " |
| Precision | bfloat16 |
| Training video frames | 24 |
resizer_input_size, resizer_output_size, and resizer_hidden_size to match the trained checkpoint (1024, 32, and 256 for this release). The extra_encoder_state.safetensors, should also be placed in the model directory so the sequence resizer weights are loaded.1import torch
2from transformers import AutoProcessor
3from qwen_vl_utils import process_vision_info
4
5from src.arguments import ModelArguments
6from src.encoder.resize_encoder import SequenceResizerEncoder
7from src.models.qwen2_5_vl_embed.qwen2_5_vl_embed import Qwen2_5ForEmbedding
8
9MODEL_ID = "hltcoe/SeqResize_qwen2.5-vl_msrvtt"
10VIDEO_PATH = "PLACEHOLDER"
11RESIZER_INPUT_SIZE = 1024
12RESIZER_OUTPUT_SIZE = 32
13RESIZER_HIDDEN_SIZE = 256
14
15# --- Setup ---
16model_args = ModelArguments(
17 model_name_or_path=MODEL_ID,
18 pooling="resize",
19 normalize=True,
20 resizer_input_size=RESIZER_INPUT_SIZE,
21 resizer_output_size=RESIZER_OUTPUT_SIZE,
22 resizer_hidden_size=RESIZER_HIDDEN_SIZE,
23 attn_implementation="flash_attention_2",
24)
25
26processor = AutoProcessor.from_pretrained(MODEL_ID)
27model = SequenceResizerEncoder.load(
28 Qwen2_5ForEmbedding,
29 model_args,
30 attn_implementation=model_args.attn_implementation,
31 dtype=torch.bfloat16,
32)
33model = model.to("cuda").eval()
34
35# --- Encode a video document ---
36passage_messages = [
37 {
38 "role": "user",
39 "content": [
40 {"type": "text", "text": "Passage: "},
41 {"type": "video", "video": VIDEO_PATH, "nframes": 24, "max_pixels": 84672, "min_pixels": 75264},
42 ],
43 }
44]
45text = processor.apply_chat_template(passage_messages, tokenize=False, add_generation_prompt=False)
46image_inputs, video_inputs = process_vision_info(passage_messages)
47passage_inputs = processor(
48 text=[text], images=image_inputs, videos=video_inputs, padding=True, return_tensors="pt",
49).to("cuda")
50
51with torch.amp.autocast(device_type="cuda", dtype=torch.bfloat16):
52 with torch.inference_mode():
53 doc_embeddings, doc_mask = model.encode(passage_inputs, is_query=False)
54 print(doc_embeddings.shape)
55 # doc_embeddings: (1, 32, 2048) — 32 compressed vectors
56
57# --- Encode a text query ---
58query_messages = [{"role": "user", "content": [{"type": "text", "text": "Query: a person is cooking"}]}]
59query_text = processor.apply_chat_template(query_messages, tokenize=False, add_generation_prompt=False)
60query_inputs = processor(text=[query_text], padding=True, return_tensors="pt").to("cuda")
61
62with torch.amp.autocast(device_type="cuda", dtype=torch.bfloat16):
63 with torch.inference_mode():
64 query_embeddings, query_mask = model.encode(query_inputs, is_query=True)
65 print(query_embeddings.shape)
66
67# --- ColBERT MaxSim scoring ---
68score = model.compute_similarity(query_embeddings, doc_embeddings, query_mask, doc_mask)
69print(f"Similarity score: {score.item():.4f}")1@misc{qin2026multivectorindexcompressionmodality,
2 title={Multi-Vector Index Compression in Any Modality},
3 author={Hanxiang Qin and Alexander Martin and Rohan Jha and Chunsheng Zuo and Reno Kriz and Benjamin Van Durme},
4 year={2026},
5 eprint={2602.21202},
6 archivePrefix={arXiv},
7 primaryClass={cs.IR},
8 url={https://arxiv.org/abs/2602.21202},
9}