Definition

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

Taxonomy

  • Task types: LLM.
  • Availability: and .

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:
[
  {
    "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"
  }
]