> ## 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**: development (Continuously evaluate your models and datasets as you iterate on their versions.)
  and monitoring (Monitor a model in production, measure its health, check for drifts and set up alerts.).

## 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:

```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",
        "measurement": "meanExactMatch",
        "operator": ">",
        "value": 0.8
      }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true,
    "usesTrainingDataset": false,
    "usesMlModel": true,
    "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",
        "measurement": "meanExactMatch",
        "operator": ">",
        "value": 0.8
      }
    ],
    "subpopulationFilters": null,
    "mode": "monitoring",
    "usesProductionData": true,
    "evaluationWindow": 3600,
    "delayWindow": 0,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]
```

## Related

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.