Inferensys

Glossary

Citation F1 Score

A precision and recall-based evaluation metric that measures a model's ability to generate correct legal citations, balancing the accuracy of provided citations against the completeness of all necessary references.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
EVALUATION METRIC

What is Citation F1 Score?

The Citation F1 Score is a harmonic mean of precision and recall that quantifies a legal AI model's ability to generate both accurate and complete legal citations.

The Citation F1 Score is an evaluation metric that combines citation precision and citation recall into a single balanced measure. Precision calculates the percentage of generated citations that are correct and valid, while recall calculates the percentage of all necessary ground-truth citations that the model successfully retrieved. The F1 score is the harmonic mean of these two values, penalizing systems that achieve high precision by citing very few sources or high recall by flooding the output with irrelevant references.

This metric is critical for evaluating retrieval-augmented generation (RAG) pipelines and legal language models where citation integrity is paramount. A model might achieve high precision by only citing a single, obvious case but fail on recall by missing a dozen other relevant precedents. The F1 score forces a balanced optimization, ensuring a system is both trustworthy in its assertions and thorough in its research, directly addressing the core challenge of legal hallucination.

METRICS

Core Characteristics

The Citation F1 Score is a rigorous evaluation metric that balances the precision and recall of generated legal citations, ensuring a model's outputs are both accurate and complete.

01

Precision in Citation

Measures the exactness of generated citations. It answers: 'Of all the citations the model provided, how many are correct?'

  • A high precision score means the model rarely hallucinates or misattributes a source.
  • Calculated as: True Positives / (True Positives + False Positives)
  • Example: If a model generates 10 citations but only 8 are valid, its precision is 0.8. This metric is critical for avoiding fabricated case law.
02

Recall in Citation

Measures the completeness of generated citations. It answers: 'Of all the necessary citations, how many did the model find?'

  • A high recall score means the model is thorough and doesn't miss key supporting authorities.
  • Calculated as: True Positives / (True Positives + False Negatives)
  • Example: If a legal argument requires 5 citations and the model only provides 3, its recall is 0.6, indicating a gap in research completeness.
03

The Harmonic Mean

The F1 Score is the harmonic mean of precision and recall, providing a single, balanced metric.

  • It penalizes extreme imbalances between precision and recall more heavily than a simple arithmetic mean.
  • Calculated as: 2 * (Precision * Recall) / (Precision + Recall)
  • Use Case: An F1 Score of 0.9 indicates a robust system that is both highly accurate and highly thorough, a non-negotiable standard for legal AI applications.
04

Ground-Truth Validation

Citation F1 relies on a gold-standard corpus of legally verified references.

  • Each generated citation string is normalized and matched against a database like a validated Shepard's Citations report or a curated court opinion graph.
  • Fuzzy Matching: Advanced systems use algorithms like Levenshtein distance to account for minor formatting variations (e.g., 'U.S.' vs 'US') without penalizing the score.
  • This prevents a model from being rewarded for generating a citation that looks correct but doesn't exist.
05

Pinpoint vs. Page-Level Accuracy

Advanced F1 scoring differentiates between general citation and pinpoint citation.

  • Page-Level: The model correctly identifies the case volume and reporter.
  • Pinpoint (Pincite): The model correctly identifies the specific page or paragraph that supports the proposition.
  • A model might have a high F1 for finding the right case but a much lower F1 for the exact pincite, revealing a surface-level understanding of the source material.
06

Micro vs. Macro Averaging

The method of averaging F1 scores across a dataset reveals different model behaviors.

  • Micro-Averaging: Aggregates the total true positives, false positives, and false negatives across all documents. This gives more weight to performance on longer documents with many citations.
  • Macro-Averaging: Calculates the F1 score independently for each document and then takes the average. This treats all documents equally, highlighting if the model fails catastrophically on specific, shorter legal texts.
CITATION F1 SCORE

Frequently Asked Questions

Explore the critical evaluation metric that measures a legal AI model's ability to generate correct and complete citations, balancing precision against recall to ensure high-integrity legal reasoning.

A Citation F1 Score is a harmonic mean of Citation Precision and Citation Recall, providing a single balanced metric for evaluating a legal AI model's citation generation quality. It is calculated as 2 * (Precision * Recall) / (Precision + Recall). Citation Precision measures the percentage of generated citations that are correct (i.e., they reference a real, relevant case or statute), penalizing the model for hallucinating or fabricating authorities. Citation Recall measures the percentage of all necessary citations that the model successfully included, penalizing it for omissions. The F1 score ranges from 0 to 1, where 1.0 represents a perfect balance of generating only correct citations and missing none of the required references. This metric is essential because it prevents a model from gaming a single metric—a model could achieve high precision by citing only one very safe case, but its recall would be terrible, resulting in a low F1 score.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.