LayaEval logoLayaEval/RAG Checks/Abstention Correctness
RAG-013RAG · Enough to answerlayaeval.AbstentionCorrectness

Abstention Correctness

When sources are empty, did it honestly say “I don't know”?

SOURCESnothing foundI don't know thatHonest — didn't guess
Simulation state:
When it passes

Honest “I don't know”.

Threshold satisfied: evaluation score >= 0.50.

When it fails

Made up an answer.

Violation detected: execution flagged for human review or fallback routing.

SDK Specification

ParameterValueDescription
ClassAbstentionCorrectnessPython evaluator class in layaeval
Required Fields"query", "retrieved_context", "response"Arguments expected in the call signature
Default Threshold>= 0.50Passes when quality score is at or above this value
CategoryRAG EvaluationEnough to answer (Is there enough in the pages to answer at all?)

Python Example

pip install layaeval
abstention-correctness.py
1from layaeval import AbstentionCorrectness
2
3metric = AbstentionCorrectness(threshold=0.50) # passes at or above 0.50
4
5res = metric(
6 query="What is the capital of France?",
7 retrieved_context="Paris is the capital of France, with 2.1M residents.",
8 response="Paris is the capital of France.",
9)
10
11print(res.passed, res.value, res.confidence)

Related RAG Checks

Other checks in Enough to answer

View all 42 checks →