Sponsored by
Designkit Free Background Remover
-Designkit offers free AI background removal for up to 100 images daily, with batch processing, custom backgrounds, and resizing.
DRAMA-large (0.3B): Diverse Augmentation from Large Language Models to Smaller Dense Retrievers
DRAMA-large (0.3B) is a dense retrieval model built upon a pruned large language model backbone. It is derived by pruning a large language model and fine-tuned for efficient and generalizable multilingual text retrieval.
By leveraging large language models for high-quality data augmentation, DRAMA-large achieves strong performance across both English and multilingual retrieval tasks, despite its compact size of 0.3B non-embedding parameters.
The default embedding size of
drama-large
is 1024, as we adopt Matryoshka Representation Learning, the dimionality can be flexiblely truncated to dimensionalities such as 512 or 256.
Below is an example using
drama-large
to encode query and document examples from the MIRACL dataset:
import torch
from transformers import AutoTokenizer, AutoModel
queries = [
'What percentage of the Earth\'s atmosphere is oxygen?',
'意大利首都是哪里?',
]
documents = [
"The amount of oxygen in the atmosphere has fluctuated over the last 600 million years, reaching a peak of 35% during the Carboniferous period, significantly higher than today's 21%.",
"羅馬是欧洲国家意大利首都和罗马首都广域市的首府及意大利全国的政治、经济、文化和交通中心,位于意大利半島中部的台伯河下游平原地,建城初期在七座小山丘上,故又名“七丘之城”。按城市范围内的人口计算,罗马是意大利人口最多的城市,也是欧盟人口第三多的城市。",
]
model_name = "facebook/drama-large"
device = "cuda"if torch.cuda.is_available() else"cpu"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name, trust_remote_code=True).to(device)
query_embs = model.encode_queries(tokenizer, queries)
doc_embs = model.encode_documents(tokenizer, documents)
scores = query_embs @ doc_embs.T
print(scores.tolist())
# Expected output: [[0.5429, 0.1109], [0.1317, 0.6074]]
The
trust_remote_code
will use our customized
drama_modeling.py
with two details:
We use bi-directional attention instead of uni-directional attention
We add
"Query: "
as prefix for query text. (No prefix added to document)
DRAMA models are trained using Matryoshka Representation Learning (
MRL
) to support flexible dimensionality. Both queries and documents can be encoded into smaller dimensions, such as 256, using the following:
The model has been evaluated on multiple retrieval benchmarks, including
BEIR
,
MIRACL
,
MLDR
, and several multilingual retrieval tasks in
MTEB
.
It demonstrates strong performance in both English and multilingual retrieval tasks.
drama-large
released in this page is corresponidng to the line DRAMA-0.3B with 265M non-embedding parrameters.
Supported Languages
DRAMA-large was initialized from
Llama3.2-1B
(which was originally pruned from
Llama3.1-8B
). During pruning and retriever training, training data covered the following 20 languages (sorted alphabetically):
If you find our paper or models helpful, please consider cite as follows:
@article{drama,
title={{Drama}: Diverse Augmentation from Large Language Models To Smaller Dense Retrievers},
author={Ma, Xueguang and Lin, Victoria Xi and Oguz, Barlas and Lin, Jimmy and Yih, Wen-tau and Chen, Xilun},
journal={arXiv:2502.18460},
year={2025}
}
Runs of facebook drama-large on huggingface.co
672
Total runs
-21
24-hour runs
-80
3-day runs
-115
7-day runs
-4.6K
30-day runs
More Information About drama-large huggingface.co Model
drama-large huggingface.co is an AI model on huggingface.co that provides drama-large's model effect (), which can be used instantly with this facebook drama-large model. huggingface.co supports a free trial of the drama-large model, and also provides paid use of the drama-large. Support call drama-large model through api, including Node.js, Python, http.
drama-large huggingface.co is an online trial and call api platform, which integrates drama-large's modeling effects, including api services, and provides a free online trial of drama-large, you can try drama-large online for free by clicking the link below.
facebook drama-large online free url in huggingface.co:
drama-large is an open source model from GitHub that offers a free installation service, and any user can find drama-large on GitHub to install. At the same time, huggingface.co provides the effect of drama-large install, users can directly use drama-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.