Harmonic mean
The harmonic mean of positive values is the reciprocal of the arithmetic mean of their reciprocals.
LLM Evaluation and Alignment, The Foundational Ideas
A harmonic mean is an average based on the reciprocal values of its inputs that is strongly influenced by the smallest input.
- How it is used
- Aggregates competing evaluation objectives when failure in one dimension must not be concealed by strength in another.
- How deep it goes
- Defines the reciprocal-based average, explains its strict penalty, and compares it with arithmetic and geometric means.
- Examples
- Uses precision-recall evaluation and helpfulness-safety scores of 0.90 and 0.10 to demonstrate strict aggregation.
- What you can do after
- Evaluate competing objectives with an aggregation rule that exposes weak dimensions instead of averaging them away.
Read how LLM Evaluation and Alignment, The Foundational Ideas explains harmonic mean →
Grokking Machine Learning, Second Edition
The harmonic mean of positive numbers is the reciprocal of the arithmetic mean of their reciprocals.
- How it is used
- Uses the harmonic mean to combine precision and recall when both should be high.
- How deep it goes
- Defines the two-number formula, compares it with the ordinary average, and applies it to F1-score without broader derivation.
- Examples
- Uses precision of 100% with recall of 50%, plus the numerical pair 1 and 9.
- What you can do after
- Evaluate/understand why F1-score penalizes an imbalance between precision and recall.
Read how Grokking Machine Learning, Second Edition explains harmonic mean →
Also covered in
What to know first
- precisionPrecision is the proportion of items predicted, selected, or retrieved as positive that are correct or relevant.
- recallRecall is the proportion of all relevant or actual positive items that a system successfully retrieves or correctly identifies.
Related concepts
- meancontrasts with · The mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
- f-scoreused by · An F-score is a classification metric that combines precision and recall through a weighted harmonic mean; F1 weights them equally.
- ROUGEuses · ROUGE is a family of automatic text-generation evaluation metrics that compare generated text with reference text using lexical overlap, often emphasizing recall.
Questions about harmonic mean
What is harmonic mean?
The harmonic mean of positive values is the reciprocal of the arithmetic mean of their reciprocals.
Which Manning books explain harmonic mean?
LLM Evaluation and Alignment, The Foundational Ideas and Grokking Machine Learning, Second Edition.
What should I know before learning harmonic mean?
Manning books that teach harmonic mean usually introduce precision and recall first.
What is the difference between harmonic mean and mean?
The harmonic mean of positive values is the reciprocal of the arithmetic mean of their reciprocals. The mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

