Model reference · open weights
drama is an open-weight embedding model from Meta. drama-1b (FP32) weighs 2.5 GB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the facebook/drama-1b model card, 2026-10-13
What it is
| Released by | Meta |
|---|---|
| Released | 2025-02-25 |
| Parameters | 1.2B |
| VRAM | 2.5 GB for the weights |
What it runs on
| Card | Runs | Memory |
|---|---|---|
| RTX 3060 12 GB | fits | 11.6 GB |
| RTX 4060 Ti 16 GB | fits | 15.4 GB |
| RTX 3090 24 GB | fits | 23.4 GB |
| RTX 4090 24 GB | fits | 23.4 GB |
| RTX 5090 32 GB | fits | 31.0 GB |
| L40S 48 GB | fits | 44.0 GB |
| A100 80 GB | fits | 78.2 GB |
| H100 80 GB | fits | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | fits | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | fits | 107 GB |
| H200 141 GB | fits | 138 GB |
| B200 180 GB | fits | 176 GB |
From the model card
DRAMA-1B 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-1B achieves strong performance across both English and multilingual retrieval tasks, despite its compact size.
The default embedding size of drama-1b is 2048, as we adopt Matryoshka Representation Learning, the dimionality can be flexiblely truncated to dimensionalities such as 768 or 256.
Please check our paper for the detials.
Below is an example using drama-base to encode query and document examples from the MIRACL dataset, using either Transformers or Sentence Transformers:
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-1b"
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.5062, 0.1475], [0.1837, 0.6331]]
The
trust_remote_codewill use our customizeddrama_modeling.pywith 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:
query_embs = model.encode_queries(tokenizer, queries, dim=256)
doc_embs = model.encode_documents(tokenizer, documents, dim=256)
scores = query_embs @ doc_embs.T
print(scores.tolist())
# Expected output: [[0.6579, 0.3296], [0.3388, 0.7547]]
from sentence_transformers import SentenceTransformer
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 = SentenceTransformer("facebook/drama-1b", trust_remote_code=True)
query_embs = model.encode(queries, prompt_name="query")
doc_embs = model.encode(documents)
scores = model.similarity(query_embs, doc_embs)
print(scores.tolist())
# Expected output: [[0.5062, 0.1475], [0.1837, 0.6331]]
- The
trust_remote_codewill use our customizeddrama_modeling.pywhich uses bi-directional attention instead of uni-directional attention.- For queries, you have to use
prompt_name="query"to select the prompt called "query", orprompt="Query: "to specify the prompt string manually.
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:
from sentence_transformers import SentenceTransformer
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 = SentenceTransformer("facebook/drama-1b", truncate_dim=256, trust_remote_code=True)
query_embs = model.encode(queries, prompt_name="query")
doc_embs = model.encode(documents)
scores = model.similarity(query_embs, doc_embs)
print(scores.tolist())
# Expected output: [[0.6579, 0.3296], [0.3388, 0.7547]]
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-1b released in this page is corresponidng to the line DRAMA-1B with 1B non-embedding parrameters.
DRAMA-1B was initialized from Llama3.2-1B (which was originally pruned from Llama3.1-8B). During retriever training, training data covered the following 20 languages (sorted alphabetically):
Arabic, Bengali, Chinese, English, Finnish, French, German, Hindi, Indonesian, Italian, Japanese, Korean, Persian, Portuguese, Russian, Spanish, Swahili, Telugu, Thai, Yoruba
Other languages may have downgraded peformance.
If you find our paper or models helpful, please consider cite as follows:
@article{drama,
title={{Drama}: Diverse Augmentation from Large Language Models To Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.