Inferensys

Glossary

Knowledge F1

A composite metric that calculates the harmonic mean between the precision and recall of factual knowledge units extracted by a model, balancing exactness and completeness.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
HALLUCINATION RISK ASSESSMENT

What is Knowledge F1?

A composite metric for evaluating the factual accuracy of generated text by balancing the precision and recall of extracted knowledge units.

Knowledge F1 is a composite evaluation metric that calculates the harmonic mean between the factual precision and factual recall of atomic knowledge units extracted by a language model. It provides a single, balanced score that penalizes systems for both generating incorrect facts (low precision) and omitting correct facts from the source (low recall), making it a critical tool for hallucination risk assessment.

Unlike surface-level lexical overlap metrics like ROUGE, Knowledge F1 operates on decomposed, verifiable atomic facts. This requires first segmenting both the source text and the model's output into discrete knowledge units, then classifying each generated unit as correct or incorrect against the ground-truth source. The resulting score is essential for LLMOps engineers quantifying the trade-off between exactness and completeness in Retrieval-Augmented Generation (RAG) pipelines.

METRIC DECOMPOSITION

Key Characteristics of Knowledge F1

Knowledge F1 provides a unified view of a model's factual extraction quality by balancing precision and recall. The following characteristics define its calculation, interpretation, and operational significance.

01

Harmonic Mean Formulation

Knowledge F1 is calculated as the harmonic mean of Factual Precision and Factual Recall, not a simple arithmetic average. This mathematical choice penalizes extreme imbalances between the two metrics.

  • Formula: 2 * (Precision * Recall) / (Precision + Recall)
  • Penalty Effect: A model with 100% precision but only 10% recall will score a low F1 (~18%), reflecting incomplete extraction
  • Why Harmonic: Prevents models from gaming the system by being overly conservative (high precision, low recall) or overly verbose (high recall, low precision)
  • Range: Always between 0.0 and 1.0, where 1.0 represents perfect extraction
02

Atomic Fact Decomposition

Before Knowledge F1 can be computed, both the generated text and the ground-truth source must be decomposed into atomic factual units—individual, verifiable statements.

  • Atomic Fact: A single, self-contained claim that can be independently verified (e.g., 'The Eiffel Tower is 330 meters tall')
  • Decomposition Methods: Can use rule-based NLP parsers, fine-tuned extractive models, or LLM-based factoid extraction
  • Granularity Control: The definition of an 'atomic fact' must be consistent across both prediction and reference to ensure valid comparison
  • Example: The sentence 'Paris, founded in the 3rd century BC, is the capital of France' decomposes into three atomic facts
03

Precision-Recall Trade-off

Knowledge F1 explicitly surfaces the inherent tension between exactness and completeness in factual extraction, forcing evaluation beyond single-dimensional accuracy.

  • High Precision, Low Recall: The model extracts few facts but all are correct—indicative of a conservative, risk-averse generation strategy
  • Low Precision, High Recall: The model extracts many facts but includes errors—indicative of hallucination-prone behavior
  • Operational Interpretation: A system used for medical summarization may prioritize precision over recall, while a legal discovery tool may require high recall
  • Threshold Setting: Organizations can set minimum acceptable F1 thresholds based on their domain's risk tolerance
04

Entity-Level vs. Relation-Level Scoring

Knowledge F1 can be computed at different semantic depths, distinguishing between simple entity extraction and complex relational fact verification.

  • Entity-Level F1: Measures whether the correct named entities (people, dates, locations) were extracted, ignoring relationships between them
  • Relation-Level F1: Measures whether the correct subject-predicate-object triples were extracted, requiring both entity correctness and relational accuracy
  • Example: Extracting 'Tim Cook' and 'Apple' is entity-level; extracting 'Tim Cook is the CEO of Apple' is relation-level
  • Hierarchical Reporting: Mature evaluation pipelines report both levels to provide granular diagnostic insight into failure modes
05

Alignment with Human Judgment

Knowledge F1 is designed to correlate with human evaluator assessments of factual quality, making it a reliable proxy for manual review in automated evaluation pipelines.

  • Benchmark Correlation: Studies using datasets like FActScore and HaluEval show strong Pearson correlation (>0.7) between Knowledge F1 and human factuality ratings
  • Inter-Annotator Agreement: The atomic decomposition step reduces subjectivity, improving consistency across human evaluators
  • Limitation: F1 does not capture the severity of errors—a critical medical misstatement and a minor date error are weighted equally
  • Complementary Metrics: Should be used alongside Critical Error Rate and Semantic Entropy for a complete risk picture
06

Domain-Specific Thresholding

Acceptable Knowledge F1 scores vary dramatically by application domain, and no universal threshold exists for 'good enough' factual accuracy.

  • Medical Summarization: Typically requires F1 > 0.95 due to patient safety implications
  • News Article Generation: Often targets F1 > 0.85, balancing completeness with acceptable minor errors
  • Creative Writing Assistance: May accept F1 as low as 0.60, where factual precision is secondary to stylistic quality
  • Continuous Monitoring: F1 thresholds should be monitored in production as model drift or data distribution shifts can degrade performance over time
KNOWLEDGE F1 EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about the Knowledge F1 metric, its calculation, and its role in evaluating factual accuracy in language model outputs.

Knowledge F1 is a composite evaluation metric that calculates the harmonic mean between Factual Precision and Factual Recall of knowledge units extracted by a language model. It works by first decomposing a model's generated text into a set of atomic factual claims, then comparing those claims against a ground-truth knowledge source. Precision measures the proportion of generated facts that are correct, while Recall measures the proportion of ground-truth facts successfully captured. The F1 score balances these two competing objectives into a single value between 0 and 1, where 1.0 represents perfect factual exactness and completeness. This metric is particularly critical in Retrieval-Augmented Generation (RAG) systems, where both omission of key details and injection of spurious information constitute distinct failure modes that must be jointly optimized.

COMPARATIVE ANALYSIS

Knowledge F1 vs. Related Factuality Metrics

A feature-level comparison of Knowledge F1 against other core metrics used to evaluate the factual accuracy and completeness of language model outputs.

FeatureKnowledge F1Factual PrecisionFactual RecallFActScore

Primary Measurement

Harmonic mean of precision and recall of factual units

Ratio of correct facts to total facts generated

Ratio of correct facts to total facts in source

Percentage of atomic facts verified against a knowledge base

Balances Completeness & Exactness

Requires Ground-Truth Source

Uses External Knowledge Base

Granularity of Evaluation

Fact unit

Fact unit

Fact unit

Atomic fact

Penalizes Extraneous Information

Human Correlation

High

Moderate

Moderate

Very High

Primary Use Case

Overall factual fidelity scoring

Measuring output exactness

Measuring source coverage

Long-form generation evaluation

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.