Downloads · 30 days
5
9% of all-time downloads
dhruvv45/lightretriever-llama3.2-3b
lightretriever-llama3.2-3b is a machine learning model from dhruvv45. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
A LoRA-fine-tuned dense retriever built on Llama-3.2-3B, reproducing LightRetriever — an LLM adapted into a bi-encoder for query/passage embedding via contrastive learning.
Downloads · 30 days
5
9% of all-time downloads
All-time downloads
53
Public
Repo size
1.7 GB
Likes
1
Public
Click a slice to open those files.
.pt1.6 GB · 93%
From the Hugging Face model README
A LoRA-fine-tuned dense retriever built on Llama-3.2-3B, reproducing LightRetriever — an LLM adapted into a bi-encoder for query/passage embedding via contrastive learning.
Encode queries/passages into embeddings for retrieval or RAG pipelines. Not a generation/chat model.
msmarco, nq, hotpotqa, fever, trivia, and others. 1 query + 1 positive + 7 hard negatives per example.MS MARCO dev set (8.84M passages, 6,980 queries) via MTEB retrieval benchmark (mteb v1.39.7).
| Metric | @1 | @3 | @5 | @10 | @100 |
|---|---|---|---|---|---|
| nDCG | 0.196 | 0.292 | 0.330 | 0.368 | 0.429 |
| Recall | 0.191 | 0.361 | 0.454 | 0.567 | 0.853 |
| MRR | 0.196 | 0.271 | 0.293 | 0.308 | 0.320 |
Evaluation time: ~14.1 hours (single GPU, corpus chunk size 2M).
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B")
model = PeftModel.from_pretrained(base_model, "dhruvv45/lightretriever-llama3.2-3b-full")
tokenizer = AutoTokenizer.from_pretrained("dhruvv45/lightretriever-llama3.2-3b-full")
Note: adapter only — full inference needs the lightretriever source for pooling/prompt logic.
Dhruv Agarwal