---
type: concept
x-llmwiki:
  schemaVersion: "0.1"
  contentHash: bcd3b16a2351b5331fe3f5537e1609a9e847c8d96e7b8dc3ecc692ee58c9b67d
  pageDirectory: concepts
  sources:
    - arize-phoenix-scorers-databricks-on-aws.md
  confidence: 1
  provenanceState: extracted
  freshnessStatus: unverified
  aliases:
    - hallucination-scorer
    - Evaluation Scorers
    - Hallucination Detection
    - LLM Hallucination
  citations:
    - file: arize-phoenix-scorers-databricks-on-aws.md
title: Hallucination Scorer
description: An Arize Phoenix scorer that detects hallucinations in LLM outputs by comparing them against a provided context
tags:
  - llm-evaluation
  - hallucination-detection
timestamp: "2026-06-19T22:08:15.295Z"
---

```yaml
---
title: Hallucination Scorer
summary: An Arize Phoenix scorer that detects whether LLM-generated text contains statements unsupported by the provided context, used with MLflow GenAI Evaluation.
sources:
  - arize-phoenix-scorers-databricks-on-aws.md
kind: concept
createdAt: "2026-06-19T14:43:57.264Z"
updatedAt: "2026-06-19T14:43:57.264Z"
tags:
  - llm-evaluation
  - hallucination-detection
  - arize-phoenix
  - mlflow
aliases:
  - hallucination-scorer
confidence: 0.95
provenanceState: extracted
inferredParagraphs: 1
---

# Hallucination Scorer

**Hallucination Scorer** is an Arize Phoenix evaluation metric available through MLflow’s GenAI evaluation framework as `mlflow.genai.scorers.phoenix.Hallucination`. It judges whether an LLM-generated output contains hallucinations — claims that are not supported by the expected reference context. ^[arize-phoenix-scorers-databricks-on-aws.md]

## Usage

The scorer is included in the `scorers` list when calling `mlflow.genai.evaluate()`. It requires a `model` argument that specifies the LLM endpoint used as the judge (e.g., `databricks:/databricks-gpt-5-mini`). The evaluation dataset must supply an `outputs` field (the model’s response) and a nested `expectations.context` field containing the reference context against which hallucinations are measured. ^[arize-phoenix-scorers-databricks-on-aws.md]

```python
import mlflow
from mlflow.genai.scorers.phoenix import Hallucination, Relevance

eval_dataset = [
    {
        "inputs": {"query": "What is MLflow?"},
        "outputs": "MLflow is an open-source AI engineering platform for agents and LLMs.",
        "expectations": {
            "context": "MLflow is an ML platform for experiment tracking and model deployment."
        },
    },
    {
        "inputs": {"query": "How do I track experiments?"},
        "outputs": "You can use mlflow.start_run() to begin tracking experiments.",
        "expectations": {
            "context": "MLflow provides APIs like mlflow.start_run() for experiment tracking."
        },
    },
]

results = mlflow.genai.evaluate(
    data=eval_dataset,
    scorers=[
        Hallucination(model="databricks:/databricks-gpt-5-mini"),
        Relevance(model="databricks:/databricks-gpt-5-mini"),
    ],
)
```

## Parameters

| Parameter | Description |
|-----------|-------------|
| `model`   | The LLM endpoint used to judge hallucinations. Supported formats include Databricks serving endpoints (e.g., `databricks:/databricks-gpt-5-mini`) or other model references recognized by MLflow. |

## Evaluation Dataset Format

Each record in the evaluation dataset must contain:

- `outputs` (required) – The response generated by the LLM under evaluation.
- `expectations.context` (required) – The factual context or ground-truth information to check against.

The `inputs` field is optional but typically includes the user query for reference.

## Relationship to Other Scorers

The Hallucination scorer is often paired with the [[Relevance Scorer]] (also from `mlflow.genai.scorers.phoenix`) to jointly assess response accuracy. Both use the same `model` parameter and share the same evaluation dataset structure. ^[arize-phoenix-scorers-databricks-on-aws.md]

## Related Concepts

- [[MLflow GenAI Evaluation]] — The framework that runs the Hallucination scorer
- Arize Phoenix — The third-party library that provides the scorer implementation
- [[Relevance Scorer]] — A companion metric for measuring response relevance
- [[MLflow]] — The open-source platform that hosts the evaluation API
- [[Databricks Foundation Model APIs]] — Endpoints such as `databricks-gpt-5-mini` used as judge models

## Sources

- arize-phoenix-scorers-databricks-on-aws.md
```

# Citations

1. [arize-phoenix-scorers-databricks-on-aws.md](/references/arize-phoenix-scorers-databricks-on-aws-53f4b817.md)
