alt.freeweights.embed / BGE-VL-MLLM-S2
From: BAAI <huggingface.co/BAAI>Newsgroups: alt.freeweights.embedSubject:

BGE-VL-MLLM-S2

Date: 2026-11-15Commit: 20137e2Signed: 2DC28CC7B26A283B ✓

Sentence similarity model with 7.6B parameters. Safetensors weights, 15.1 GB in all. Published by BAAI under MIT.

7.6B params15.1GBBGE-VL-MLLM-S2safetensorspermissive
FactsParams7.6BSize15.1 GBFormatssafetensorsTasksentence similarityLicenseMITFrom sourcepermissive
$ fw get BAAI/BGE-VL-MLLM-S2
# manifest sha256 70e55f7c2272… · 15.1 GB · 29 files
$ fw verify ./BGE-VL-MLLM-S2 BAAI/BGE-VL-MLLM-S2
From sourceHosted (signed)BAAI/BGE-VL-MLLM-S2Last check: 2026-11-15 03:53 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of llava-v1.6-mistral-7b-hf.

Works with

Evaluate with

Overview

Size
15.1 GB
Weights
15.1 GB (safetensors)
Parameters
7.6B
Formats
safetensors
Task
sentence similarity
License
MIT (permissive)
Files
29, each with a sha256
Publisher
BAAI
Added
2026-11-15
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Base model: llava-hf/llava-v1.6-mistral-7b-hf

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:53 UTCpassed

Model card

From the publisher at commit 20137e2. Shown as plain text with links; images open at the publisher.

MegaPairs: Massive Data Synthesis For Universal Multimodal Retrieval#

Build Build Build Build Build Build Build

News#


## Release Plan
- [x] Paper
- [x] BGE-VL-base and BGE-VL-large models
- [x] BGE-VL-MLLM model
- [ ] MegaPairs Dataset
- [ ] Evaluation code
- [ ] Fine-tuning code


## Introduction
In this work, we introduce **MegaPairs**, a novel data synthesis method that leverages open-domain images to create *heterogeneous KNN triplets* for universal multimodal retrieval. Our MegaPairs dataset contains over 26 million triplets, and we have trained a series of multimodal retrieval models, **BGE-VL**, including BGE-VL-CLIP (base and large) and BGE-VL-MLLM.

BGE-VL achieve state-of-the-art performance on four popular zero-shot composed image retrieval benchmarks and the massive multimodal embedding benchmark (MMEB). Extensive experiments demonstrate the ***efficiency, scalability, and generalization*** features of MegaPairs. Please refer to our [paper](https://arxiv.org/abs/2412.14475) for more details.

## Model Usage

### Using Sentence Transformers

Install Sentence Transformers:

pip install sentence_transformers[image]


This model supports text, image, and combined text+image inputs. Images must be resized to 512x512, as the model was trained with that resolution. Pass a `prompt` with a task instruction to format inputs as queries, or omit it to format as candidates.

import torch from sentence_transformers import SentenceTransformer from PIL import Image

model = SentenceTransformer("BAAI/BGE-VL-MLLM-S2", model_kwargs={"torch_dtype": torch.float16})

Composed image retrieval: text + image query#

query_img = Image.open("./assets/cir_query.png").resize((512, 512)) query_emb = model.encode( {"text": "Make the background dark, as if the camera has taken the photo at night", "image": query_img}, prompt="Retrieve the target image that best meets the combined criteria by using both the provided image and the image retrieval instructions: ", )

Image-only candidates (no prompt = candidate format)#

candidate_imgs = [ Image.open("./assets/cir_candi_1.png").resize((512, 512)), Image.open("./assets/cir_candi_2.png").resize((512, 512)), ] candidate_embs = model.encode(candidate_imgs, batch_size=1) print(candidate_embs.shape)

(2, 4096)#

similarities = model.similarity(query_emb, candidate_embs) print(similarities)

tensor([[0.4158, 0.2188]], dtype=torch.float16)#


### 1. BGE-VL-CLIP Models
You can easily use BGE-VL-CLIP models based on ```transformers```

import torch from transformers import AutoModel

MODEL_NAME = "BAAI/BGE-VL-base" # or "BAAI/BGE-VL-large"

model = AutoModel.from_pretrained(MODEL_NAME, trust_remote_code=True) # You must set trust_remote_code=True model.set_processor(MODEL_NAME) model.eval()

with torch.no_grad(): query = model.encode( images = "./assets/cir_query.png", text = "Make the background dark, as if the camera has taken the photo at night" )

candidates = model.encode( images = ["./assets/cir_candi_1.png", "./assets/cir_candi_2.png"] )

scores = query @ candidates.T print(scores)


See the [demo](./retrieval_demo.ipynb) for a complete example of using BGE-VL for multimodel retrieval.


### 2. BGE-VL-MLLM Models

import torch from transformers import AutoModel from PIL import Image

MODEL_NAME= "BAAI/BGE-VL-MLLM-S1"

model = AutoModel.from_pretrained(MODEL_NAME, trust_remote_code=True) model.eval() model.cuda()

with torch.no_grad(): model.set_processor(MODEL_NAME)

query_inputs = model.data_process( text="Make the background dark, as if the camera has taken the photo at night", images="./assets/cir_query.png", q_or_c="q", task_instruction="Retrieve the target image that best meets the combined criteria by using both the provided image and the image retrieval instructions: " )

candidate_inputs = model.data_process( images=["./assets/cir_candi_1.png", "./assets/cir_candi_2.png"], q_or_c="c", )

query_embs = model(query_inputs, output_hidden_states=True)[:, -1, :] candi_embs = model(candidate_inputs, output_hidden_states=True)[:, -1, :]

query_embs = torch.nn.functional.normalize(query_embs, dim=-1) candi_embs = torch.nn.functional.normalize(candi_embs, dim=-1)

scores = torch.matmul(query_embs, candi_embs.T) print(scores)



## Model Performance
### Zero-Shot Composed Image Retrieval

BGE-VL sets a new performance benchmark in zero-shot composed image retrieval tasks. On the CIRCO benchmark, our BGE-VL-base model, with only 149 million parameters, surpasses all previous models, including those with 50 times more parameters. Additionally, BGE-VL-MLLM achieves an 8.1% improvement over the previous state-of-the-art model.

![](./assets/res-zs-cir.png)

### Zero-Shot Performance on MMEB

BGE-VL-MLLM achieves state-of-the-art zero-shot performance on the Massive Multimodal Embedding Benchmark (MMEB), despite being trained only on the ImageText-to-Image paradigm. This demonstrates the excellent generalization capability of MegaPairs for multimodal embedding.

![](./assets/res-zs-mmeb.png)

### Fine-Tuning Performance on MMEB

After fine-tuning on downstream tasks, BGE-VL-MLLM maintains its leading performance. Notably, it surpasses the previous state-of-the-art by 7.1% on the MMEB out-of-distribution (OOD) set. These results demonstrate the robust generalization capability of BGE-VL-MLLM and highlight the potential of MegaPairs as foundational training data for universal multimodal embedding.

![](./assets/res-ft-mmeb.png)

### Performance Scaling
MegaPairs showcases **scalability**: BGE-VL-base improves as training data increases. It also demonstrates **efficiency**: with just 0.5M training samples, BGE-VL-base significantly outperforms MagicLens, which uses the same CLIP-base backbone and was trained on 36.7M samples.

![](./assets/res-scaling.png)


## License
The annotations for MegaPairs and the BGE-VL models are released under the [MIT License](LICENSE). The images in MegaPairs originate from the [Recap-Datacomp](https://huggingface.co/datasets/UCSC-VLAA/Recap-DataComp-1B), which is released under the CC BY 4.0 license.



## Citation
If you find this repository useful, please consider giving a star ⭐ and citation

@article{zhou2024megapairs, title={MegaPairs: Massive Data Synthesis For Universal Multimodal Retrieval}, author={Zhou, Junjie and Liu, Zheng and Liu, Ze and Xiao, Shitao and Wang, Yueze and Zhao, Bo and Zhang, Chen Jason and Lian, Defu and Xiong, Yongping}, journal={arXiv preprint arXiv:2412.14475}, year={2024} }

Files

29 files · 15.1 GBWeights 15.1 GB (safetensors). Sizes and sha256 from the signed manifest.
Show all 29 files with their sha256
FileSizesha256
.gitattributes1.87 KBe0e7d7dfcafc776817cbdd7570ff7795161184435b2155a4280476832ba5d70f
1_Pooling/config.json96 Bb43aa95e25a5e3297c16ae4a5ba6918c7ea458e7018d3c66b0000a7583d4d3d0
README.md9.11 KBdae2cc18fed63337e47ce83574a1e1e9c4bfd91c35ea08817de953858fc0d010
added_tokens.json117 B282dc2ec475680a724cb7594780c76399add50e49d43b109ec1a524c3d2a0132
assets/cir_candi_1.png51.7 KB86e2ac6106533ef21d84007864af2f502b2a846edda38b3946e8832680967faa
assets/cir_candi_2.png901 KBe3c4b3debd66d4789545d52bdd4c18bdbabaa072b69110ad08ff54b7b4503557
assets/cir_query.png153 KB42ad0e1200ba5c8767ea752f6358f6b51719674b064666b415b6ab0ea90ae62b
assets/res-ft-mmeb.png116 KB07530b73c14564bc8f60bb825e868cd0ce4ed07913ab53e65ec6354912aa0249
assets/res-scaling.png137 KBb99d878d102a40bbcb30dce5b6bd54891ecda8f23e2e0d78aab8291183834f86
assets/res-zs-cir.png261 KB500c0a49e189f4ddca74023fdfa1e88439db6bd4b3b0f7ca8dd92ac3d8b018f8
assets/res-zs-mmeb.png136 KB7e3014812e4cd56b2147388a6a0b0a771007d41592e9accdf1d9b93e944c1925
chat_template.jinja1.28 KBb09681b3b29afee4b8899856776e0dcf3831160adca0431b23e05dbaa0aabac0
config.json1.38 KBf85bb1334cda6946c6657a8671a796ea2c25a851a8bef29bee1a7e69229921d9
config_sentence_transformers.json254 Ba9e8ed3dd9e9598e6bb811829f668ceb36858c7582b1b54c3bd528308a985cf3
generation_config.json111 Bf769ce0b018b0d689d27146688e2cfd6008040cc15bd51acb5b6bdf755a123e7
model-00001-of-00004.safetensors4.92 GB68eed18350b8f6a43feea2688939d707d8f445f6bdefe20755404761e89241a6
model-00002-of-00004.safetensors4.92 GBc5953a869223cfab1c632a2871a312f50d41ddcf4f7d2c90aacbf208eec05b06
model-00003-of-00004.safetensors4.92 GB3737d87633df5f4f7329a6572f45ce4c45828bc97f5f35363f685b90540ee56e
model-00004-of-00004.safetensors380 MB31c3b4302136277bf69a50d1db418f991cc8cc6c77f72f3433cf70f55a072743
model.safetensors.index.json70.2 KB4e378725ff60e04fc90244e360592f1dafe27c1cb80428e38a237790ec8827fc
modeling_llavanext_for_embedding.py16.0 KBd3da6242e857ae05a93b0adb3b5f1407045a8e8f4b679fa2249b8e7a71e4b07e
modules.json429 Bfa7d796a215e1b2416773062891923b191fc5a4849bc44e322997433c90f459c
preprocessor_config.json772 Becef425c1d3ee91f5e05144c4d107389f9fefd04a424d5cbfc3fb6e0525b8c55
processor_config.json177 B5c902a6a19f6970177327a38b5f0be73b7c1b7594e87f6a91a2e09cbd549d9b7
sentence_bert_config.json783 B41b85b6c39a4aad510d2647740596ac0e37b0e7365d5bb809d35ac99ef0d7987
special_tokens_map.json1.03 KBa122b9daa87d8875f880acce2879090ae36bd80df6c5aa08dd7def4e618cfa6a
tokenizer.json3.51 MBb34b0f034284a86ea3417130f0158f85823bb58aadcf4ab9f07afb9a4206d036
tokenizer.model493 KBdadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
tokenizer_config.json2.09 KB4bea598e6a948c6f62ec099944f4111973c2ea6e258663b32256760614b1403c
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
20137e245f pinned now2026-11-15 03:53 UTC29 files · 15.1 GB

Use it

$ fw get BAAI/BGE-VL-MLLM-S2
# manifest sha256 70e55f7c2272… · 15.1 GB · 29 files
$ fw verify ./BGE-VL-MLLM-S2 BAAI/BGE-VL-MLLM-S2
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/BAAI/BGE-VL-MLLM-S2.json --dir ./BGE-VL-MLLM-S2 $ python3 fw.py verify ./BGE-VL-MLLM-S2 ./BAAI__BGE-VL-MLLM-S2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download BAAI/BGE-VL-MLLM-S2 --revision 20137e245f277e7eca277bbb436ce7d632a16406 --local-dir ./BGE-VL-MLLM-S2
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("BAAI/BGE-VL-MLLM-S2", revision="20137e245f277e7eca277bbb436ce7d632a16406") model = AutoModel.from_pretrained("BAAI/BGE-VL-MLLM-S2", revision="20137e245f277e7eca277bbb436ce7d632a16406", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("BAAI/BGE-VL-MLLM-S2", revision="20137e245f277e7eca277bbb436ce7d632a16406") vectors = model.encode(["Hello"])

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
dae2cc18fed63337e47ce83574a1e1e9c4bfd91c35ea08817de953858fc0d010
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: BAAI <huggingface.co/BAAI>Newsgroups: alt.freeweights.embedSubject: BGE-VL-MLLM-S2Date: 2026-11-15Commit: 20137e2Signed: 2DC28CC7B26A283B ✓
Upstream
BAAI/BGE-VL-MLLM-S2
Pinned commit
20137e245f277e7eca277bbb436ce7d632a16406
Manifest
BGE-VL-MLLM-S2.json · .minisig
Manifest sha256
70e55f7c2272a6ad74c44dfcde1ad34150fe25086fb7da6882e2246ae984026c
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:53 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/BAAI/BGE-VL-MLLM-S2.json $ curl -O https://freeweights.allternit.com/manifests/BAAI/BGE-VL-MLLM-S2.json.minisig $ minisign -Vm BGE-VL-MLLM-S2.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

llava-hf/llava-v1.6-mistral-7b-hf · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download BAAI/BGE-VL-MLLM-S2
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. BGE-VL-MLLM-S2.json. Provenance. Takedown history: none.
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens