Downloads · 30 days
21
15% of all-time downloads
abdoelsayed/llama2-13b-rankllama-teacher
llama2-13b-rankllama-teacher is a text classification model from abdoelsayed. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
LLaMA2-13B-RankLLaMA-Teacher is a 13B parameter teacher model designed for neural reranking tasks. This model serves as the foundation for knowledge distillation in the DeAR framework, generating Chain-of-Thought (CoT…
Downloads · 30 days
21
15% of all-time downloads
All-time downloads
142
Public
Parameters
12.9B
51.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors51.4 GB · 100%
From the Hugging Face model README
LLaMA2-13B-RankLLaMA-Teacher is a 13B parameter teacher model designed for neural reranking tasks. This model serves as the foundation for knowledge distillation in the DeAR framework, generating Chain-of-Thought (CoT) reasoning to guide smaller student models.
This model is intended to:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load model
model_name = "abdoelsayed/llama2-13b-rankllama-teacher"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
model.eval()
# Score a query-document pair
query = "What is machine learning?"
document = "Machine learning is a subset of artificial intelligence that focuses on training algorithms to learn patterns from data."
inputs = tokenizer(
f"query: {query}",
f"document: {document}",
return_tensors="pt",
truncation=True,
max_length=512,
padding=True
)
inputs = {k: v.to(model.device) for k, v in inputs.items()}
with torch.no_grad():
score = model(**inputs).logits.squeeze().item()
print(f"Relevance score: {score}")
This teacher model is evaluated on standard IR benchmarks:
| Dataset | NDCG@10 |
|---|---|
| MS MARCO Dev | 72.5 |
| TREC DL19 | 73.8 |
| TREC DL20 | 71.2 |
LLaMA2-13B
↓
[Transformer Layers]
↓
[Classification Head]
↓
Relevance Score
This teacher model generates soft labels and CoT reasoning used to train:
The distillation process uses:
If you use this model, please cite:
@article{abdallah2025dear,
title={DeAR: Dual-Stage Document Reranking with Reasoning Agents via LLM Distillation},
author={Abdallah, Abdelrahman and Mozafari, Jamshid and Piryani, Bhawna and Jatowt, Adam},
journal={arXiv preprint arXiv:2508.16998},
year={2025}
}
MIT License
Student Models (Distilled from this teacher):
8B Models:
3B Models:
Dataset: