Skip to content
项目

关于

OpenEmbed: frontier multimodal embedding models (0.8B to 9B) with open data, code, and weights

人工智能与机器学习

这些数字如何统计

53 星标4 复刻 +10 24小时

可以做什么

  • Fully open post-training. 51M curated query-target pairs from 109 public datasets, each record with its provenance; cached teacher embeddings; the training code and the exact recipe of each released model; weights at four sizes.
  • Frontier-competitive. OpenEmbed-9B scores 81.1 on the 36 image tasks of MMEB-V2, including a state-of-the-art 97.6 on grounding, and 82.4 on its 24 visual-document tasks.
  • Beyond MMEB. OpenEmbed-9B surpasses the published results of the Google, Amazon, and Voyage embedding APIs on DOCCI and ViDoRe V3.
  • Repository layout

实测星标增长

24小时
+10
7天
正在收集历史
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文
OpenEmbed: frontier multimodal embedding models with open data, code, and weights

Yanqing Liu1, Letian Zhang1, Huaxiu Yao2, Zeyu Zheng3, Yuyin Zhou1, Cihang Xie1
1University of California, Santa Cruz    2University of North Carolina at Chapel Hill    3University of California, Berkeley

🌐 Project page  ·  📄 Paper  ·  🤗 Models  ·  🗂️ Data  ·  ▶️ Colab demo

arXiv Open the demo in Colab Models Data Code license: Apache 2.0 Weights license: CC BY-NC 4.0

OpenEmbed: what each kind of model releases, MMEB-V2 image score by model size, and image and document retrieval

(a) What leading embedding models release. (b) MMEB-V2 image score by model size; * reproduced by us. (c) DOCCI text-to-image R@1 and ViDoRe V3 nDCG@10 (8 public sets, English queries); r: reported results, p: recomputed from public per-query results, others measured by us.

OpenEmbed embeds text, images, document pages, and image-text combinations into one space. The models, at 0.8B, 2B, 4B, and 9B, are fine-tuned from the Qwen3.5 base models in two stages: contrastive learning on 51M curated query-target pairs from 109 public datasets, then decoupled distillation from two open-weight teachers. Everything the post-training needs is released: the processed training records with per-record provenance, the cached teacher embeddings, this training code with the recipe of every released model, and the weights.

📰 News

  • 2026-12-01: the paper is on arXiv, and the code, data, and weights are public.

✨ Highlights

  • Fully open post-training. 51M curated query-target pairs from 109 public datasets, each record with its provenance; cached teacher embeddings; the training code and the exact recipe of each released model; weights at four sizes.
  • Strongest among fully open models. As of December 2026, OpenEmbed-9B scores higher on both the image and the visual-document tracks than any model on the MMEB-V2 leaderboard that releases its training data and training code, and the 0.8B, 2B, and 4B models do the same among models of their size or smaller. OpenEmbed-2B exceeds the strongest prior fully open 2B model (VLM2Vec-V2) by 14 points on images and 11 on visual documents.
  • Frontier-competitive. OpenEmbed-9B scores 81.1 on the 36 image tasks of MMEB-V2, including a state-of-the-art 97.6 on grounding, and 82.4 on its 24 visual-document tasks.
  • Beyond MMEB. OpenEmbed-9B surpasses the published results of the Google, Amazon, and Voyage embedding APIs on DOCCI and ViDoRe V3.
Contents

🤗 Models

All four models, with the training data and the web pool, are in the OpenEmbed collection on Hugging Face.

Model Dim CLS VQA RET GRD Image VisDoc Weights Recipe
OpenEmbed-0.8B 1,024 67.9 74.2 74.2 96.5 74.9 78.5 🤗 Hub stage 1
stage 2
OpenEmbed-2B 2,048 74.1 77.8 78.1 97.5 79.1 80.5 🤗 Hub stage 1
stage 2
OpenEmbed-4B 2,560 74.5 80.5 79.8 97.3 80.5 81.6 🤗 Hub stage 1
stage 2
OpenEmbed-9B 4,096 75.7 81.0 80.1 97.6 81.1 82.4 🤗 Hub stage 1
stage 2

MMEB-V2: Hit@1 on 36 image tasks (CLS classification, VQA visual question answering, RET retrieval, GRD grounding; Image is the mean over all 36 tasks) and nDCG@5 on 24 visual-document retrieval tasks (VisDoc), with the official Qwen3-VL-Embedding evaluation code and the input format in src/openembed/eval/. Each model is fine-tuned from the Qwen3.5 base model of its size (0.8B, 2B, 4B, 9B); Dim is the embedding size; a recipe is the launcher settings of one stage, checked against the command lines of our runs.

🚀 Quick start

pip install torch torchvision "transformers>=5.15.0" "sentence-transformers>=5.7.0"
import torch
from PIL import Image
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("UCSC-VLAA/OpenEmbed-2B", model_kwargs={"dtype": torch.bfloat16})

queries = model.encode([
    "Find me an everyday image that matches the given caption: A brown dog running on a beach.",
    "Find a document image that matches the given query. What was the revenue in 2023?",
])
candidates = model.encode([
    {"image": Image.open("dog.jpg"), "text": "Represent the given image."},
    {"image": Image.open("annual_report_page.png")},
])
print(model.similarity(queries, candidates))

Use transformers 5.15 or later with Sentence Transformers: older versions keep the position offsets of the last batch with images and can fail on a later batch without images.

Plain Transformers (no remote code)
import torch
import torch.nn.functional as F
from PIL import Image
from transformers import AutoModel, AutoProcessor

model_id = "UCSC-VLAA/OpenEmbed-2B"
processor = AutoProcessor.from_pretrained(model_id, use_fast=False)
model = AutoModel.from_pretrained(model_id, dtype=torch.bfloat16).cuda().eval()


def embed(inputs):
    """inputs: dicts with an optional "image" (a PIL.Image) and an optional "text"."""
    texts, images = [], []
    for x in inputs:
        content = [{"type": "image"}] if x.get("image") is not None else []
        if x.get("text") or not content:
            content.append({"type": "text", "text": x.get("text", "")})
        texts.append(processor.apply_chat_template([{"role": "user", "content": content}], tokenize=False))
        if x.get("image") is not None:
            images.append(x["image"])
    batch = processor(text=texts, images=images or None, padding=True, return_tensors="pt").to(model.device)
    model.rope_deltas = None  # transformers < 5.15 would reuse the last image batch's value
    with torch.inference_mode():
        hidden = model(**batch).last_hidden_state
    last = batch["attention_mask"].sum(dim=1) - 1  # the <embedding> token
    rows = torch.arange(hidden.size(0), device=hidden.device)
    return F.normalize(hidden[rows, last].float(), dim=-1)  # shape (len(inputs), 2048)
vLLM serving
hf download UCSC-VLAA/OpenEmbed-2B --local-dir OpenEmbed-2B
vllm serve OpenEmbed-2B --runner pooling --chat-template OpenEmbed-2B/embedding_chat_template.jinja \
  --limit-mm-per-prompt.video=0

Then post messages to http://localhost:8000/v1/embeddings; the model cards show a full request.

No remote code is needed. Each model card lists the instruction of every task and how close each path is to our evaluation. examples/retrieval_demo.ipynb runs three small searches (captions to photos, photos to labels, questions to document pages) plus one of your own, and opens in Colab.

🧩 How it works

Heterogeneous annotations become query-target pairs; stage 1 is contrastive, stage 2 adds distillation

  • One format for many tasks. Classification labels, VQA answers, captions, document questions, and image edits become query-target pairs with task instructions and explicit negatives.
  • Stage 1 trains LoRA adapters on the language model and the vision tower with a contrastive loss over the 109 curated datasets. The 9B model also samples 13 web-pool datasets of DataComp-1B images with generated captions and questions.
  • Stage 2 widens the language-model adapters and adds decoupled distillation from cached embeddings of Qwen3-VL-Embedding-8B and WeMM-Embedding-9B.

📊 Training data

Sampling weights of the final 2B stage-1 mixture by dataset family

Sampling weights, not dataset sizes, set the mixture. The data is on the Hugging Face Hub:

Repository Contents
OpenEmbed-Data the 109 curated datasets in one record format, with per-record provenance and the loaders that rebuild the training shards from their sources (tools/openembed_data/build.py); the cached teacher embeddings (teacher/, 11.9M vectors for the 75 distilled datasets); the training metadata (training/: per dataset the card, the manifest, the contamination blocklist, and the duplicate skip list the loader reads)
OpenEmbed-WebPool the web pool of the 9B model's stage 1: alt-texts, recaptions, and about 1.06B generated captions and questions for about 200M DataComp-1B images, keyed by image id

🏋️ Training

Requirements. TPU v5p: the released runs used v5p-64 (8 hosts) and v5p-128 (16 hosts) slices, and each recipe names its layout. Python 3.11 with pip install -r requirements.txt on the TPU hosts; requirements-extra.txt adds what the weight conversion, the evaluation patch, and the data builders need. The base models come from Hugging Face (Qwen/Qwen3.5-0.8B-Base, -2B-Base, -4B-Base, -9B-Base), converted to Flax with conversion/convert_qwen35_hf_to_flax.py.

1. Install the data. In the data repository, tools/openembed_data/build.py rebuilds the training shards, and tools/openembed_data/install_training.py checks them and installs them, the training metadata, and the teacher vectors into a gs:// folder of yours. It prints the two lines to export: OPENEMBED_DATA (where the data is) and OPENEMBED_SKIP (what your install leaves out). See training/README.md there.

2. Run a recipe. recipes/ holds the launcher settings of the final recipe, stage 1 and stage 2 of each model, checked against the command lines of our runs. On every host of the slice, with the same run id:

export OPENEMBED_DATA=gs://YOUR-BUCKET/openembed-data OPENEMBED_SKIP=...   # as the data installer printed
set -a; . recipes/openembed-2b/stage1.env; set +a
bash scripts/train_multihost.sh my_2b_stage1

Stage 2 starts from your stage-1 checkpoint (export STAGE1_RUN=my_2b_stage1, then the same with recipes/openembed-2b/stage2.env). recipes/README.md has the details.

More on the launcher and the data root
  • scripts/train_multihost.sh RUN_ID runs on every worker of a pod with the same run id; scripts/sync_to_pod.sh copies the repository to the workers. The settings are environment variables, documented at the top of the launcher (registry, pair budget, steps, LoRA ranks, geometry micro-batches, distillation, checkpoints).
  • Every file of the training metadata names its objects under one logical root, gs://openembed-release/v1. That is the default of OPENEMBED_ROOT; keep it. The launcher maps the logical root to OPENEMBED_DATA (src/openembed/gcs_map.py). Outputs (checkpoints, logs, program caches) go to $OPENEMBED_DATA/v2data unless GCSROOT is set.
  • OPENEMBED_SKIP names the datasets your install leaves out; the launcher disables them and leaves them out of distillation. A recipe that cannot do without some of them names them in OPENEMBED_NEEDS, and the launcher stops: the 9B stage-1 recipe needs the web pool, which the release carries as text and image URLs only (OPENEMBED_ALLOW_MISSING=1 trains the variant without it; see recipes/README.md). The final recipe reads the exact-item contamination lists (CONTAMINATION_OVERLAY).
  • Stage 2 reads the installed teacher store through TEACHER_ROOT; the loss is src/openembed/losses.py:kd_loss (decoupled, symmetric KL at temperature 0.02, weight 0.5).

📏 Evaluation

One command reproduces the MMEB-V2 numbers with the official evaluation code. It clones that code at a pinned commit, applies src/openembed/eval/mmeb_v2_harness.patch (the input format of training, read byte for byte from src/openembed/eval/), runs the 36 image and 24 visual-document tasks with the paper's settings, and summarizes them:

DOWNLOAD=1 bash scripts/eval_mmeb_v2.sh UCSC-VLAA/OpenEmbed-2B outputs/openembed-2b

DOWNLOAD=1 fetches the three MMEB-V2 archives it needs (about 42 GB). The run writes every task's scores and summary.md with the Image and VisDoc means, and with MODEL_NAME set also the file the MMEB leaderboard takes. The top of the script lists the environment (transformers 5.2.0, as in our runs), the batch sizes and TASKS for a quick check of a few tasks. A trained checkpoint goes to the Hugging Face format first with conversion/convert_qwen35_flax_to_hf.py.

Our scores for every task are in results/: the category means, and each task's metrics in the format the MMEB leaderboard takes.

MTEB. src/openembed/eval/mteb_models.py holds the four models' MTEB entries, with the input format of training, for the image and visual-document tasks of MTEB (MIEB, ViDoRe, and others). With mteb 2.x installed:

PYTHONPATH=src python -m openembed.eval.mteb_models --model OpenEmbed-2B --tasks Winoground,CVBenchCount --output outputs/mteb

🗂️ Repository layout

Path What it is
src/openembed/ the training stack: data streams, loader, packer, train step, losses, distillation, checkpoints, exported programs (trainer.py is the per-host driver)
src/openembed/builders/, datasets_tree/, stage0/ the data builders and the in-repo pipelines the released datasets came from
src/openembed/contamination/ the scan of training data against the evaluation sets, and the block lists
src/openembed/mining/ the teacher pass that computes the cached teacher embeddings
src/openembed/eval/ the evaluation setup: prompt layouts, the patch for the MMEB-V2 evaluation code, the score summary
src/openembed/tools/ checks and measurement tools (label vocabularies, length statistics, loader and multi-host checks, memory probe)
src/models/ the models in JAX (Qwen3.5 with its gated delta rule layers, the Qwen3-VL reference), LoRA, the Pallas kernels
configs/openembed/ the dataset registry, batch geometries, instructions, label vocabularies
conversion/ weight conversion between Hugging Face and Flax, and the teacher parity checks
scripts/ the launcher (train_multihost.sh), a single-host smoke run, the pod sync, the MMEB-V2 evaluation (eval_mmeb_v2.sh)
recipes/ the launcher settings of the final recipe: both stages of the four models
local_qwen35_config/ the Qwen3.5 tokenizer and model configurations
examples/ the demo notebook
results/ the MMEB-V2 scores of the four models, every task
docs/ the project page
tests/ unit tests; most run on CPU

🧪 Tests

Running the tests on CPU

pip install jax==0.5.3 jaxlib==0.5.3 together with the rest of requirements.txt (without libtpu), plus pytest and transformers (tested with 4.57.1), then python -m pytest tests/. Training itself does not import transformers; the tests do, because they build small random models through the reference vision tower (src/models/modeling_qwen3_vl.py). Tests that need a TPU or PyTorch skip themselves.

Known differences on CPU: the tests were developed with jax 0.4.35 on an Apple CPU. With the pinned jax 0.5.3 on an x86 CPU (AMD EPYC 7702P), 13 of them fail: ten compare two code paths bit for bit or to a tight tolerance (relative differences up to about 3e-4), two check that every matmul carries the float32 precision (jax 0.5.3 marks four bf16 matmuls with the BF16_BF16_F32 algorithm), and in one the round trip of FSDP programs through the program store crashes its subprocess. With jax 0.4.35, eight of the 13 pass on the same x86 machine and the other five on the Apple CPU.

📄 License

  • Code: Apache 2.0, see LICENSE and NOTICE.
  • Weights: CC BY-NC 4.0, see each model card.
  • Data: each dataset under its own terms, listed in the data repository.

📚 Citation

@article{liu2026openembed,
  title   = {{OpenEmbed}: A Family of Frontier Multimodal Embedding Models with Open Data, Code, and Weights},
  author  = {Liu, Yanqing and Zhang, Letian and Yao, Huaxiu and Zheng, Zeyu and Zhou, Yuyin and Xie, Cihang},
  journal = {arXiv preprint arXiv:2612.02432},
  year    = {2026}
}

🙏 Acknowledgements

OpenEmbed builds on the Qwen3.5 base models and distills from Qwen3-VL-Embedding-8B and WeMM-Embedding-9B. We follow WeMM-Embedding's input format, evaluate with the MMEB-V2 code released with Qwen3-VL-Embedding, and thank the authors of the public datasets this work is built on.

探索相关项目

加载中…