Downloads · 30 days
20
20% of all-time downloads
Mehd1SLH/LF_BERT_v1
LF_BERT_v1 is a text classification model from Mehd1SLH. 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.
LFBERTv1 is a lightweight TinyBERT-based cross-encoder fine-tuned for semantic evidence filtering in Retrieval-Augmented Generation (RAG) pipelines.
Downloads · 30 days
20
20% of all-time downloads
All-time downloads
101
Public
Parameters
14.4M
57.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors57.4 MB · 98%
From the Hugging Face model README
LF_BERT_v1 is a lightweight TinyBERT-based cross-encoder fine-tuned for semantic evidence filtering in Retrieval-Augmented Generation (RAG) pipelines.
The model acts as a semantic gatekeeper, scoring (query, candidate_sentence) pairs to determine whether the sentence is factually useful evidence or a semantic distractor.
It is designed for CPU-only, edge, and offline deployments, with millisecond-level inference latency.
This model is the core filtering component of Project Sentinel.
huawei-noah/TinyBERT_General_4L_312D[CLS] query [SEP] candidate_sentence [SEP]
✔ Semantic filtering for RAG pipelines
✔ Hallucination reduction
✔ Early-exit decision systems
✔ Edge / offline LLM deployments
This model is especially suited for:
Performance may degrade on highly domain-specific or non-factual corpora.
The model was trained on a binary dataset derived from HotpotQA (Distractor setting).
| Split | Samples |
|---|---|
| Train | 69,101 |
| Validation | 7,006 |
The dataset is intentionally imbalanced, reflecting real retrieval scenarios.
1e-516242| Epoch | Validation Loss | F1 | Accuracy | Precision | Recall | ROC-AUC |
|---|---|---|---|---|---|---|
| 1 | 0.4003 | 0.7119 | 0.8290 | 0.6146 | 0.8457 | 0.9038 |
| 2 | 0.4042 | 0.7028 | 0.8167 | 0.5907 | 0.8674 | 0.9064 |
This configuration prioritizes trustworthiness over recall.
If you use this model, please cite:
@article{salih2026sentinel,
title={Project Sentinel: Lightweight Semantic Filtering for Edge RAG},
author={Salih, El Mehdi and Ait El Mouden, Khaoula and Akchouch, Abdelhakim},
year={2026}
}
El Mehdi Salih
Mohammed V University – Rabat
Email: [email protected]