🧠 Balash Faty β€” RAG Hallucination Judge (EN/AR)

This model is a fine-tuned Qwen2.5-3B-Instruct model specialized in detecting hallucinations in Retrieval-Augmented Generation (RAG) answers in both English and Arabic.

It acts as an LLM judge that determines whether an answer is fully supported by the retrieved context.


🎯 Task

Given:

  • Context (retrieved documents)
  • Question
  • Answer (generated by an LLM)

The model outputs:


PASS  β†’ Answer is grounded in the context
FAIL  β†’ Answer contains hallucinations or unsupported claims

πŸ— Base Model

  • Model: Qwen/Qwen2.5-3B-Instruct
  • Fine-tuning: LoRA β†’ merged into base weights
  • Languages: English + Arabic
  • Training Objective: Hallucination classification for RAG systems

βš™οΈ Inference Format

Prompt Template:


You are a system that detects hallucinations in RAG answers.

Decide whether the answer is fully supported by the context.
Reply with only one word: PASS or FAIL.

[CONTEXT]
{context}

[QUESTION]
{question}

[ANSWER]
{answer}

Judgment:

πŸ’» Example (Python)

import requests

API_URL = "YOUR_HF_ENDPOINT_URL"
HF_TOKEN = "hf_xxx"

headers = {
    "Authorization": f"Bearer {HF_TOKEN}",
    "Content-Type": "application/json"
}

def judge(context, question, answer):
    prompt = f"""You are a system that detects hallucinations in RAG answers.

Decide whether the answer is fully supported by the context.
Reply with only one word: PASS or FAIL.

[CONTEXT]
{context}

[QUESTION]
{question}

[ANSWER]
{answer}

Judgment:"""

    payload = {
        "inputs": prompt,
        "parameters": {
            "max_new_tokens": 5,
            "do_sample": False,
            "temperature": 0.0
        }
    }

    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()[0]["generated_text"]

πŸ“Š Training Data

The model was trained on a labeled dataset of RAG examples from HaluBench:

Field Description
Context Retrieved passages
Question User query
Answer LLM-generated answer
Label PASS / FAIL

The dataset is balanced between grounded and hallucinated answers.


πŸš€ Intended Use

βœ… Evaluating RAG pipelines βœ… LLM-as-a-judge research βœ… Automatic hallucination detection βœ… Benchmarking grounding quality

❌ Not for open-ended chat ❌ Not a knowledge source


🧩 Deployment

Optimized for low-latency inference using Hugging Face Text Generation Inference (TGI) endpoints.


πŸ‘€ Author

Ahmed Abolfadl B.Sc. Computer Science & Engineering β€” German University in Cairo Research focus: ML, AI, Data Science


πŸ“… Model Version

Uploaded on: 2026-01-26

Downloads last month
-
Safetensors
Model size
3B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for aabolfadl/balash-faty

Quantizations
1 model