Skip to content
Back to skills

Entity Hallucination Eval

ASecurity

Evaluates large language models' ability to generate factually correct answers to complex and factual questions while mitigating entity-level hallucinations. It also measures the effectiveness of a real-time hallucination detection mechanism in identifying fabricated or low-confidence entities during generation. Use when the user wants to benchmark on WikiBio GPT-3 dataset, 2WikiMultihopQA, StrategyQA, NQ, or asks about evaluating this task. Reports AUC.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 11, 2026
researchpythongo

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill entity-hallucination-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Entity Hallucination Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Entity Hallucination Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-entity-hallucination-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-entity-hallucination-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: entity-hallucination-eval
description: Evaluates large language models' ability to generate factually correct answers to complex and factual questions while mitigating entity-level hallucinations. It also measures the effectiveness of a real-time hallucination detection mechanism in identifying fabricated or low-confidence entities during generation. Use when the user wants to benchmark on WikiBio GPT-3 dataset, 2WikiMultihopQA, StrategyQA, NQ, or asks about evaluating this task. Reports AUC.
metadata:
  skill_kind: dataset_eval
  source_arxiv: 2407.09417
  bibtex_key: [REDACTED]
  confidence: high
---

# entity-hallucination-eval

> Mitigating Entity-Level Hallucination in Large Language Models — Su et al. (2024) (arXiv:2407.09417, 2024)

## What this evaluates

Evaluates large language models' ability to generate factually correct answers to complex and factual questions while mitigating entity-level hallucinations. It also measures the effectiveness of a real-time hallucination detection mechanism in identifying fabricated or low-confidence entities during generation.

## Datasets

- **WikiBio GPT-3 dataset** — total ?; splits: test (-1)
- **2WikiMultihopQA** — total ?; splits: test (-1)
- **StrategyQA** — total ?; splits: test (-1)
- **NQ** — total ?; splits: test (-1)

## Metrics

- `AUC` **(primary)** — range: [0, 1]
  - Area under the Receiver Operating Characteristic curve, measuring the trade-off between true positive and false positive rates for hallucination detection.
- `Exact Match (EM)` — range: [0, 1]
  - Binary score of 1 if the extracted final answer exactly matches the reference answer string, 0 otherwise.
- `F1` — range: [0, 1]
  - Token-level F1 score computed as the harmonic mean of precision and recall over word tokens in the predicted and reference answers.
- `Accuracy` — range: [0, 1]
  - Proportion of correctly answered yes/no questions in StrategyQA.

## Input / output format

**Input**: For generation: Question + top-3 BM25-retrieved Wikipedia passages + few-shot examples (8 for 2WikiMultihopQA/StrategyQA, none for NQ). For detection: GPT-3 generated text passages with factual claims.

**Output**: For generation: Chain-of-thought reasoning followed by a final extracted answer. For detection: A probability or entropy score indicating entity-level hallucination likelihood.

## Scoring recipe

```python
def score_generation(preds, golds):
    em_scores = []
    f1_scores = []
    for p, g in zip(preds, golds):
        em_scores.append(1.0 if p.strip() == g.strip() else 0.0)
        p_tok, g_tok = set(p.split()), set(g.split())
        if not p_tok or not g_tok: continue
        prec = len(p_tok & g_tok) / len(p_tok)
        rec = len(p_tok & g_tok) / len(g_tok)
        f1 = 2 * prec * rec / (prec + rec) if (prec + rec) > 0 else 0.0
        f1_scores.append(f1)
    return {"EM": sum(em_scores)/len(em_scores), "F1": sum(f1_scores)/len(f1_scores)}
```

## Common pitfalls

- Failing to use pattern-matching to extract the final answer from the LLM's chain-of-thought output before computing metrics.
- Applying the 8-shot few-shot prompt template to NQ, which the authors explicitly state should receive zero examples due to its simpler nature.
- Comparing multi-round retrieval baselines without enforcing the single-sentence revision constraint, which inflates retrieval overhead unfairly.

## Evidence (verbatim from paper)

> For the evaluation metrics, we use pattern-matching techniques to extract the final answer from the output of the LLM. This extracted answer is subsequently compared to the reference answer. We employ various methods for this comparison, including the exact match (EM) metric at the answer level and token-level assessments of F1 score, precision, and recall.

## Citation

```bibtex
@misc{su2024mitigating,
  title={Mitigating Entity-Level Hallucination in Large Language Models},
  author={Su et al. (2024)},
  year={2024},
  note={arXiv:2407.09417}
}
```

- arXiv: 2407.09417

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.