songtingyu commited on
Commit
123aef9
·
verified ·
1 Parent(s): f0dcd42

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +121 -0
README.md CHANGED
@@ -1,3 +1,124 @@
1
  ---
2
  license: cc-by-4.0
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-4.0
3
+ pipeline_tag: feature-extraction
4
+ library_name: transformers
5
+ tags:
6
+ - embeddings
7
+ - multimodal
8
+ - retrieval
9
+ - compositional-reasoning
10
+ - vision
11
+ - reranker-distillation
12
  ---
13
+
14
+ <h1 align="center">Core-Embed: Improving Compositional Reasoning in MLLM Embedding via Reranker Distillation</h1>
15
+
16
+ <p align="center">
17
+ <a href="https://arxiv.org/abs/2609.04083"><img src="https://img.shields.io/badge/arXiv-CORE-b31b1b.svg" alt="arXiv"></a>
18
+ <a href="https://github.com/"><img src="https://img.shields.io/badge/GitHub-CODE-black.svg" alt="GitHub"></a>
19
+ <img src="https://img.shields.io/badge/License-CC--BY--4.0-blue.svg" alt="License: CC-BY-4.0">
20
+ </p>
21
+
22
+ Core-Embed is an MLLM-based multimodal embedding model that resolves fine-grained attribute-object bindings by distilling a reranker's compositional judgments into the embedding space.
23
+
24
+ ## Model Family
25
+
26
+ | Model | Backbone | Parameters | Outputs | Modalities |
27
+ |---|---|---:|---|---|
28
+ | core-emb-2b | VL-Emb (Qwen3-VL) | 2B | Dense embedding | Text, image |
29
+ | core-emb-8b | VL-Emb (Qwen3-VL) | 8B | Dense embedding | Text, image |
30
+ | core-reranker-2b | Qwen3-VL-Reranker | 2B | Relevance score | Text, image |
31
+ | core-reranker-8b | Qwen3-VL-Reranker | 8B | Relevance score | Text, image |
32
+
33
+ ## Highlights
34
+
35
+ - **Compositional retrieval**: distinguishes scenes with the same concepts but different attribute-object bindings (e.g., "a white plate and a black chair" vs. "a black plate and a white chair").
36
+ - **Rank-KL distillation**: trained to reproduce the reranker teacher's fine-grained ranking over a five-level compositional matching spectrum (full match, partial presence, attribute error, object error, full mismatch), instead of collapsing all negatives into one class as InfoNCE does.
37
+ - **General retrieval preserved**: continual training from a strong MLLM embedding backbone, so COCO and Flickr30k retrieval quality is retained while compositional accuracy improves.
38
+
39
+ ## Training
40
+
41
+ Candidate lists are synthesized from LAION-400M seed images: Qwen3-VL-32B extracts structured scene representations and generates queries plus five captions spanning the matching levels, Z-Image-Turbo generates the candidate images, and MLLM-based verification filters low-quality tuples. The student (VL-Emb) is then trained with the Rank-KL objective — a KL divergence between temperature-softened teacher reranker scores and student cosine similarities over each candidate list. Core-Reranker models are fine-tuned from Qwen3-VL-Reranker on the same synthesized data.
42
+
43
+ ## Results
44
+
45
+ On compositional reasoning benchmarks (COLA, SugarCrepe++, NegBench):
46
+
47
+ - **Core-Reranker-8B**: 82.7% total average, +10.7 points over Jina-Reranker, while recovering negation sensitivity that standard reranker fine-tuning erodes.
48
+ - **Core-Embed-8B**: best total average (0.666) among all evaluated embedding models, +5.7 points over its VL-Emb-8B backbone.
49
+ - Gains transfer to the MCMR multi-condition retrieval benchmark (R@1 0.375 → 0.412) with COCO/Flickr30k performance fully preserved.
50
+
51
+ See the paper for the full evaluation across 12 embedding baselines and 5 reranker baselines.
52
+
53
+ ## Usage
54
+
55
+ Requires a recent `transformers` build with Qwen3-VL support:
56
+
57
+ ```bash
58
+ pip install "transformers>=4.57.0" torch qwen-vl-utils pillow
59
+ ```
60
+
61
+ The model is loaded through the wrapper classes provided in the [GitHub repository](https://github.com/):
62
+
63
+ ```python
64
+ import torch
65
+ from models.qwen3_vl.qwen3_vl_wrapper import Qwen3VLForEmbedding, Qwen3VLForEmbeddingProcessor
66
+
67
+ model_path = "core-emb-8b"
68
+ model = Qwen3VLForEmbedding.from_pretrained(
69
+ model_path, device_map="cuda", torch_dtype=torch.bfloat16
70
+ )
71
+ processor = Qwen3VLForEmbeddingProcessor.from_pretrained(
72
+ model_path,
73
+ instruction_standalone=True,
74
+ max_length=3024,
75
+ min_pixels=32*32*4,
76
+ max_pixels=32*32*1280,
77
+ total_pixels=32*32*4500,
78
+ num_frames=48,
79
+ )
80
+
81
+ query_inst = "Find me an everyday image that matches the given caption: "
82
+ psg_inst = "Represent the given image."
83
+
84
+ queries = ["a white plate and a black chair"]
85
+ inputs = processor(
86
+ texts=queries, images=[None], videos=[None],
87
+ instruction=[query_inst], is_query=True,
88
+ )
89
+ with torch.inference_mode():
90
+ query_emb = model(**inputs.to(model.device)).last_hidden_state[:, -1]
91
+
92
+ images = ["path/to/image.jpg"]
93
+ inputs = processor(
94
+ texts=[None], images=images, videos=[None],
95
+ instruction=[psg_inst], is_query=False,
96
+ )
97
+ with torch.inference_mode():
98
+ img_emb = model(**inputs.to(model.device)).last_hidden_state[:, -1]
99
+
100
+ print(query_emb @ img_emb.T)
101
+ ```
102
+
103
+ For FlashAttention acceleration, pass `attn_implementation="flash_attention_2"` when loading the model.
104
+
105
+ For evaluation on COLA, SugarCrepe++, NegBench, COCO, Flickr30k, and MCMR, use the evaluation code in the [GitHub repository](https://github.com/).
106
+
107
+ ## Citation
108
+
109
+ If you use Core-Embed, please cite the paper:
110
+
111
+ ```bibtex
112
+ @misc{song2026core,
113
+ title={CORE: Improving Compositional Reasoning in MLLM Embedding via Reranker Distillation},
114
+ author={Tingyu Song and Mingxin Li and Yanzhao Zhang and Dingkun Long and Chu Liu and Pengjun Xie and Yilun Zhao and Shu Wu},
115
+ year={2026},
116
+ eprint={2609.04083},
117
+ archivePrefix={arXiv},
118
+ primaryClass={cs.CV},
119
+ url={https://arxiv.org/abs/2609.04083},
120
+ }
121
+ ```
122
+
123
+ ## Acknowledgements
124
+ We thank the authors of [COLA](https://arxiv.org/abs/2305.03689), [SugarCrepe++](https://arxiv.org/abs/2406.11171), and [NegBench](https://github.com/m1k2zoo/negbench) for their benchmarks, and the [Qwen3-VL-Embedding](https://github.com/QwenLM/Qwen3-VL-Embedding) project for the evaluation framework.