MAMMa is a Large Vision-Language Model (LVLM) aligned over TIGER-Lab/VLM2Vec-LoRA.
This model has been trained for increased performance in multilingual retrieval tasks, specifically it was trained on a machine-translated parallel corpus.
It is capable of performing several multimodal retrieval tasks (e.g. Text-to-Image, Image-to-Text, VQA, Visual Grounding and Classification).
More details regarding the training procedure (e.g. hyperparameters, dataset construction, and so on) can be found in the [paper].
Developed by: Elio Musacchio, Lucia Siciliani, Pierpaolo Basile
Model type: Phi-3.5-vision-instruct
Language(s) (NLP): English, French, German, Italian and Spanish
Below you can find an example of model usage. To facilitate its usage, we recommend pulling from GitHub the version of the VLM2Vec source code we used for both training and inference:
git clone https://github.com/swapUniba/MAMMa
cd MAMMa
Now you should be able to run the following:
python
1from src.mmeb_src.model import MMEBModel
2from src.mmeb_src.arguments import ModelArguments
34from PIL import Image
5from transformers import AutoProcessor
67import torch
8import requests
910model_args = ModelArguments(11 model_name='microsoft/Phi-3.5-vision-instruct',12 checkpoint_path="swap-uniba/MAMMa",13 pooling='last',14 normalize=True,15 lora=False,16)1718processor = AutoProcessor.from_pretrained(19"microsoft/Phi-3.5-vision-instruct",20 trust_remote_code=True,21 num_crops=4,22)2324model = MMEBModel.load(model_args)25model.eval()26model = model.to('cuda', dtype=torch.bfloat16)2728with torch.no_grad():29 inputs = processor("<|image_1|>\nTrova una didascalia che descriva l'immagine di tutti i giorni",[Image.open(requests.get("http://images.cocodataset.org/train2017/000000514915.jpg", stream=True).raw)])30 inputs ={key: value.to('cuda')for key, value in inputs.items()}31 qry_output = model(qry=inputs)["qry_reps"]3233 strings =['Un cane steso sul pavimento','Un gatto steso sul pavimento']34 inputs = processor(strings)35 inputs ={key: value.to('cuda')for key, value in inputs.items()}36 tgt_output = model(tgt=inputs)["tgt_reps"]37 cos_sim = model.compute_similarity(qry_output, tgt_output).squeeze()3839for string_, sim_ inzip(strings, cos_sim):40print(string_,'=', sim_)
This is a use case where the model is being used to retrieve an image caption in Italian.
Citation
If you use this model in your research, please cite the following:
bibtex
1@article{Musacchio2026,
2 title = {MAMMa: adaptation of multimodal LLM embeddings to multilinguality},
3 volume = {38},
4 ISSN = {1433-3058},
5 url = {http://dx.doi.org/10.1007/s00521-026-12339-x},
6 DOI = {10.1007/s00521-026-12339-x},
7 number = {15},
8 journal = {Neural Computing and Applications},
9 publisher = {Springer Science and Business Media LLC},
10 author = {Musacchio, Elio and Siciliani, Lucia and Basile, Pierpaolo and Semeraro, Giovanni},
11 year = {2026},
12 month = Aug
13}