> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exact match

> Learn how to use the exact match test

## Definition

The exact match test assesses if two strings are identical in every aspect, including capitalization, punctuation, and spacing.

## Taxonomy

* **Task types**: LLM.
* **Availability**: <Tooltip tip="Continuously evaluate your models and datasets as you iterate on their versions.">development</Tooltip>
  and <Tooltip tip="Monitor a model in production, measure its health, check for drifts and set up alerts.">monitoring</Tooltip>.

## Why it matters

* Exact match provides the strictest measure of text generation accuracy, requiring perfect correspondence between generated and reference text.
* This metric is particularly useful for tasks where precision is critical, such as code generation, structured data extraction, or specific formatting requirements.
* It helps identify when your model produces outputs that are close but not exactly correct, which might be important for certain applications.

## Required columns

To compute this metric, your dataset must contain the following columns:

* **Outputs**: The generated text from your LLM
* **Ground truths**: The reference/expected text to compare against

## Test configuration examples

If you are writing a `tests.json`, here are a few valid configurations for the exact match test:

<CodeGroup>
  ```json Development theme={null}
  [
    {
      "name": "Mean exact match above 0.8",
      "description": "Ensure that the mean exact match score is above 0.8",
      "type": "performance",
      "subtype": "metricThreshold",
      "thresholds": [
        {
          "insightName": "metrics",
          "insightParameters": null,
          "measurement": "meanExactMatch",
          "operator": ">",
          "value": 0.8
        }
      ],
      "subpopulationFilters": null,
      "mode": "development",
      "usesValidationDataset": true,
      "usesTrainingDataset": false,
      "usesMlModel": false,
      "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
    }
  ]
  ```

  ```json Monitoring theme={null}
  [
    {
      "name": "Mean exact match above 0.8",
      "description": "Ensure that the mean exact match score is above 0.8",
      "type": "performance",
      "subtype": "metricThreshold",
      "thresholds": [
        {
          "insightName": "metrics",
          "insightParameters": null,
          "measurement": "meanExactMatch",
          "operator": ">",
          "value": 0.8
        }
      ],
      "subpopulationFilters": null,
      "mode": "monitoring",
      "usesProductionData": true,
      "evaluationWindow": 3600,
      "delayWindow": 0,
      "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
    }
  ]
  ```
</CodeGroup>

## Related

* [Quasi-exact match test](/tests/catalog/quasi-exact-match) - Allow partial matches and variations.
* [Edit distance test](/tests/catalog/edit-distance) - Measure character-level similarity.
* [BLEU score test](/tests/catalog/bleu-score) - Measure n-gram based text similarity.
* [Aggregate metrics](/tests/performance/aggregate-metrics) - Overview of all available metrics.
