Skip to content

model: add ModernVBERT models#4337

Open
paultltc wants to merge 7 commits intoembeddings-benchmark:mainfrom
paultltc:add-modernvbert
Open

model: add ModernVBERT models#4337
paultltc wants to merge 7 commits intoembeddings-benchmark:mainfrom
paultltc:add-modernvbert

Conversation

@paultltc
Copy link
Copy Markdown
Contributor

@paultltc paultltc commented Mar 31, 2026

Close #3245

  • I have filled out the ModelMeta object to the extent possible
  • I have ensured that my model can be loaded using
    • mteb.get_model(model_name, revision) and
    • mteb.get_model_meta(model_name, revision)
  • I have tested the implementation works on a representative set of tasks.
  • The model is public, i.e., is available either as an API or the weights are publicly available to download

@QuentinJGMace @ManuelFay @mlconti1

In progress!

@QuentinJGMace
Copy link
Copy Markdown
Contributor

@paultltc , I can run inference on vidore v1-3 when the PR is merged

Comment thread tests/test_models/test_colmodernvbert.py Outdated
Comment thread mteb/models/model_implementations/colmodernvbert_models.py Outdated
torch_dtype=torch.float32,
trust_remote_code=True,
),
name="ModernVBERT/bimodernvbert",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it same/similar model as ModernVBERT/modernvbert-embed?

Copy link
Copy Markdown
Contributor Author

@paultltc paultltc Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BiModernVBERT is the doc specialization, *-embed is the generalist one. If it is too confusing regarding naming, we can only add ColModernVBERT in this PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep both?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean both ColModernVBERT and BiModernVBERT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModernVBERT/bimodernvbert and ModernVBERT/modernvbert-embed

Comment thread mteb/models/model_implementations/colmodernvbert_models.py Outdated
Comment thread mteb/models/model_implementations/colmodernvbert_models.py Outdated
Comment thread mteb/models/model_implementations/colmodernvbert_models.py Outdated
@Samoed Samoed added the new model Questions related to adding a new model to the benchmark label Apr 1, 2026
@KennethEnevoldsen KennethEnevoldsen marked this pull request as ready for review April 5, 2026 13:54
@KennethEnevoldsen KennethEnevoldsen changed the title feat: add ModernVBERT models model: add ModernVBERT models Apr 5, 2026
Comment on lines +41 to +42
if "torch_dtype" in kwargs:
self.mdl.to(kwargs["torch_dtype"])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this happen in super?

@KennethEnevoldsen
Copy link
Copy Markdown
Contributor

@paultltc can I ask you to finish the checklist and also run the models on a sample task?

@paultltc
Copy link
Copy Markdown
Contributor Author

paultltc commented Apr 7, 2026

@paultltc can I ask you to finish the checklist and also run the models on a sample task?

Sure, working on it this morning but should be done.
@QuentinJGMace will take care of running it on ViDoRe benchmarks as I don't have access to compute anymore!

# Generalist model, trained for single-vector embeddings.
# Should be specialized for specific tasks for best performance.
modernvbert_embed = ModelMeta(
loader=BiModernVBertWrapper,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this for single vector should it use BiModernVBertWrapper wrapper? Maybe change to sentence transformers?


# Document specific model, trained for single-vector retrieval
bimodernvbert = ModelMeta(
loader=BiModernVBertWrapper,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this loader changed to sentence transformers, because this model for dense retrieval?

Copy link
Copy Markdown
Contributor Author

@paultltc paultltc Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could yes but haven't tried. How would it work in mteb? Default loader would use ST right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default loader would use ST right?

Yes

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to inactivity.

@github-actions github-actions Bot added the stale label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new model Questions related to adding a new model to the benchmark stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add model: ModernVBERT

4 participants