Views
No views yet

| Method | Tokens | R@10 | nDCG@10 |
|---|---|---|---|
| SeqResize (this model) | 64 | 41.1 | 38.5 |
| MemTok | 64 | 48.7 | 44.8 |
| H-Pool | 64 | 49.2 | 46.5 |
| AGC | 64 | 49.6 | 46.3 |
| Initial weights | Qwen2.5-Omni-3B-Instruct (thinker) |
| Architecture | Qwen2.5-Omni (thinker) with bidirectional attention |
| Hidden dimension | 2048 |
| Compression method | SeqResize (learned sequence projection) |
| Resizer input size | 1536 (fixed sequence length before projection) |
| Resizer output size | 64 (Budget) |
| Resizer hidden size | 384 (MLP bottleneck) |
| Default budget | 64 vectors per document |
| Scoring | ColBERT-style MaxSim (late interaction) |
| Normalization | L2-normalized embeddings |
| Query prefix | "Query: " |
| Passage prefix | "Passage: " |
| Precision | bfloat16 |
| Training video frames | 24 |
| Audio sampling rate | 4KHz |
resizer_input_size, resizer_output_size, and resizer_hidden_size to match the trained checkpoint (1280, 64, 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_omni_utils import process_mm_info
4
5from src.arguments import ModelArguments
6from src.encoder.resize_encoder import SequenceResizerEncoder
7from src.models.qwen2_5_omni_embed.qwen2_5_omni_embed import Qwen2_5OmniForEmbedding
8
9MODEL_ID = "PLACEHOLDER"
10VIDEO_PATH = "PLACEHOLDER"
11AUDIO_PATH = "PLACEHOLDER"
12RESIZER_INPUT_SIZE = 1536
13RESIZER_OUTPUT_SIZE = 64
14RESIZER_HIDDEN_SIZE = 384
15
16# --- Setup ---
17model_args = ModelArguments(
18 model_name_or_path=MODEL_ID,
19 pooling="resize",
20 normalize=True,
21 resizer_input_size=RESIZER_INPUT_SIZE,
22 resizer_output_size=RESIZER_OUTPUT_SIZE,
23 resizer_hidden_size=RESIZER_HIDDEN_SIZE,
24 attn_implementation="flash_attention_2",
25)
26
27processor = AutoProcessor.from_pretrained(MODEL_ID)
28model = SequenceResizerEncoder.load(
29 Qwen2_5OmniForEmbedding,
30 model_args,
31 attn_implementation=model_args.attn_implementation,
32 dtype=torch.bfloat16,
33)
34model = model.to("cuda").eval()
35
36# --- Encode a video+audio document ---
37passage_messages = [
38 {
39 "role": "user",
40 "content": [
41 {"type": "text", "text": "Passage: "},
42 {"type": "video", "video": VIDEO_PATH, "nframes": 24, "max_pixels": 75264, "min_pixels": 65856},
43 {"type": "audio", "audio": AUDIO_PATH},
44 ],
45 }
46]
47text = processor.apply_chat_template(passage_messages, tokenize=False, add_generation_prompt=False)
48audio_inputs, image_inputs, video_inputs = process_mm_info([passage_messages], use_audio_in_video=False)
49passage_inputs = processor(
50 text=[text], images=image_inputs, videos=video_inputs, audio=audio_inputs, padding=True, return_tensors="pt",
51).to("cuda")
52
53with torch.amp.autocast(device_type="cuda", dtype=torch.bfloat16):
54 with torch.inference_mode():
55 doc_embeddings, doc_mask = model.encode(passage_inputs, is_query=False)
56 print(doc_embeddings.shape)
57 # doc_embeddings: (1, 64, 2048) — 64 compressed vectors
58
59# --- Encode a text query ---
60query_messages = [{"role": "user", "content": [{"type": "text", "text": "Query: a person is cooking"}]}]
61query_text = processor.apply_chat_template(query_messages, tokenize=False, add_generation_prompt=False)
62query_inputs = processor(text=[query_text], padding=True, return_tensors="pt").to("cuda")
63
64with torch.amp.autocast(device_type="cuda", dtype=torch.bfloat16):
65 with torch.inference_mode():
66 query_embeddings, query_mask = model.encode(query_inputs, is_query=True)
67 print(query_embeddings.shape)
68
69# --- ColBERT MaxSim scoring ---
70score = model.compute_similarity(query_embeddings, doc_embeddings, query_mask, doc_mask)
71print(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}