DeepGlint-AI / UniME-R1-2B

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: August 07 2026
image-text-to-text

Introduction of UniME-R1-2B

Model Details of UniME-R1-2B

UniME-R1-2B: Learning from Failures for Unified Multimodal Retrieval

Zelong Sun* , Jun Wang* , Kaicheng Yang , Tiancheng Gu , Ziyong Feng, Zhiwu Lu

Glint Lab

GitHub Paper Model

UniME-R1 is an Embedderโ€“Adviser framework that learns to reason over retrieved candidates (not the query alone) and generate Retrieval-Centric Chain-of-Thought (RC-CoT) to correct retrieval failures. This repository ships the 2B-scale pair: a Qwen3-VL-2B dual-mode Embedder and the Qwen3-VL-4B retrieval-aware Adviser.

๐Ÿ’ก Highlights
  • Retrieval-Centric CoT (RC-CoT) โ€” The Adviser analyzes the actual top-k retrieved candidates to diagnose model-specific confusion, then emits <cot_focus> (which discriminative cues are missing) and <cot_answer> (a concise corrected query) to redirect retrieval.
  • Dual-Mode Embedder โ€” A single VLM backbone produces two embeddings via special tokens: <dis_emb> for fast discriminative retrieval and <gen_emb> for RC-CoT-enhanced re-retrieval. Candidates are encoded once with <dis_emb> and reused across both paths โ€” no candidate-side CoT, no index rebuilding.
  • Adaptive Rerank-or-Retrieve โ€” The Adviser predicts whether a match exists in the top-k set. If yes, it reranks; if not, it appends RC-CoT to the query and re-retrieves over the full corpus.
  • Retrieval-Oriented GRPO โ€” The Adviser is optimized with a 4-component reward (format / NDCG rerank / CoT-embedding quality / judge decision) that calls a frozen Embedder API to score the Adviser's CoT against mined hard negatives, so the RL signal reflects real end-to-end retrieval quality.
๐Ÿงฑ Model Components

This release contains two sub-directories:

Component Backbone Format Notes
Embedder ( embedder/ ) Qwen3-VL-2B-Instruct LoRA (DoRA, r=16, ฮฑ=64) + new_token_embeddings.pt Adds <dis_emb> / <gen_emb> tokens; pooling at the special-token position
Adviser ( adviser/ ) Qwen3-VL-4B-Instruct Full merged weights (bf16) Outputs 5 structured XML fields; served with vLLM
โ”œโ”€โ”€ adviser/                       # Qwen3-VL-4B Adviser (full weights, vLLM-ready)
โ”‚   โ”œโ”€โ”€ model-0000{1,2}-of-00002.safetensors
โ”‚   โ”œโ”€โ”€ config.json / generation_config.json
โ”‚   โ”œโ”€โ”€ preprocessor_config.json / video_preprocessor_config.json
โ”‚   โ””โ”€โ”€ tokenizer.json / chat_template.jinja
โ””โ”€โ”€ embedder/                      # Qwen3-VL-2B Embedder (LoRA adapter)
    โ”œโ”€โ”€ adapter_config.json
    โ”œโ”€โ”€ adapter_model.safetensors
    โ”œโ”€โ”€ new_token_embeddings.pt    # trained <dis_emb>/<gen_emb> embeddings
    โ”œโ”€โ”€ config.json
    โ””โ”€โ”€ preprocessor_config.json / video_preprocessor_config.json

The Embedder is released as a PEFT/LoRA adapter โ€” load it on top of Qwen/Qwen3-VL-2B-Instruct . The two special tokens ( <dis_emb> =151670, <gen_emb> =151669) and their embeddings are provided via added_tokens.json + new_token_embeddings.pt .

The Adviser always emits five structured fields:

Field Role
<rerank_think> Candidate-by-candidate relevance analysis
<rerank_list> Predicted candidate ordering (JSON array, 0-based)
<rerank_judge> Path decision: best-match ID, or -1 if none matches
<cot_focus> Retrieval-failure diagnosis โ€” which discriminative cues are confused
<cot_answer> Concise refined query text for re-retrieval
๐Ÿš€ Quick Start
git clone https://github.com/deepglint/UniME-R1.git
cd UniME-R1
conda create -n vlm2vec python=3.10 -y
conda activate vlm2vec

# Install torch matching your CUDA first, e.g.:
# pip install torch==2.5.1 torchvision --index-url https://download.pytorch.org/whl/cu121
# pip install flash-attn==2.7.3 --no-build-isolation

pip install -r Embedder/requirements.txt
๐Ÿ” Embedder-only evaluation (direct <dis_emb> retrieval)
cd Embedder
bash shell/eval/eval.sh image "../models/UniME-R1-2B/embedder"
๐ŸŽฏ Full Adviser evaluation (rerank + RC-CoT iterative retrieval)

Serve the Adviser via vLLM, then run the unified evaluation:

vllm serve models/UniME-R1-2B/adviser --tensor-parallel-size 8 --port 9000

cd RL/eval
export EMBEDDER_CHECKPOINT="../../models/UniME-R1-2B/embedder"
export ADVISER_MODEL="Qwen3-VL-4B-Instruct"
export ADVISER_URL="http://127.0.0.1:9000/v1"
bash eval.sh image      # image | visdoc | video | uvrb | image_caption
๐Ÿ“Š Results
๐Ÿ† MMEB-V2

UniME-R1 achieves the best overall performance at both model scales. Notably, the 2B model already outperforms all medium-size (4Bโ€“7B) baselines, indicating the gains stem from the framework rather than model scale alone.

๐ŸŒˆ Zero-shot General Retrieval
๐Ÿ–Š๏ธ Citation

If you find this repository useful, please use the following BibTeX entry for citation.

@misc{unime-r1,
      title  = {Learning from Failures: Retrieval-Centric CoT via Hard Negatives for Unified Multimodal Retrieval},
      author = {Sun, Zelong and Wang, Jun and Yang, Kaicheng and Gu, Tiancheng and Feng, Ziyong and Lu, Zhiwu},
      year   = {2025},
      url    = {https://github.com/deepglint/UniME-R1}
}
โญ Don't forget to star this repository if you find it helpful!

Runs of DeepGlint-AI UniME-R1-2B on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About UniME-R1-2B huggingface.co Model

More UniME-R1-2B license Visit here:

https://choosealicense.com/licenses/mit

UniME-R1-2B huggingface.co

UniME-R1-2B huggingface.co is an AI model on huggingface.co that provides UniME-R1-2B's model effect (), which can be used instantly with this DeepGlint-AI UniME-R1-2B model. huggingface.co supports a free trial of the UniME-R1-2B model, and also provides paid use of the UniME-R1-2B. Support call UniME-R1-2B model through api, including Node.js, Python, http.

DeepGlint-AI UniME-R1-2B online free

UniME-R1-2B huggingface.co is an online trial and call api platform, which integrates UniME-R1-2B's modeling effects, including api services, and provides a free online trial of UniME-R1-2B, you can try UniME-R1-2B online for free by clicking the link below.

DeepGlint-AI UniME-R1-2B online free url in huggingface.co:

https://huggingface.co/DeepGlint-AI/UniME-R1-2B

UniME-R1-2B install

UniME-R1-2B is an open source model from GitHub that offers a free installation service, and any user can find UniME-R1-2B on GitHub to install. At the same time, huggingface.co provides the effect of UniME-R1-2B install, users can directly use UniME-R1-2B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

UniME-R1-2B install url in huggingface.co:

https://huggingface.co/DeepGlint-AI/UniME-R1-2B

Url of UniME-R1-2B

Provider of UniME-R1-2B huggingface.co

DeepGlint-AI
ORGANIZATIONS

Other API from DeepGlint-AI