# F1 Score

> F1 Score is the harmonic mean of precision and recall, used to evaluate the accuracy of search results in AI systems. It provides a single score that penalizes extreme imbalances between false positives and false negatives.

GEO and AI search · Updated 2026-08-29 · [Marketing glossary](https://www.getlooploop.com/glossary)

**In short** F1 Score combines two measures — how many of the results are correct (precision) and how many of the correct results were found (recall) — into one number that tells you if your search is both accurate and complete.

## What it is and how it works

F1 Score is calculated as 2 × (precision × recall) / (precision + recall). In AI search, precision is the fraction of retrieved documents that are relevant, and recall is the fraction of all relevant documents that were retrieved. The harmonic mean ensures that a low value in either metric pulls the F1 Score down sharply. For example, if precision is 0.9 but recall is only 0.2, the F1 Score becomes 0.33 — far lower than the arithmetic mean of 0.55. This makes F1 a strict judge of balance. In retrieval-augmented generation (RAG) pipelines, F1 is often computed at the chunk or document level to decide whether the system is returning enough useful context without drowning the language model in noise.

## What to do about it

Start by collecting a labeled test set of at least 50 queries with known relevant documents. Run your AI search system on those queries and compute precision and recall for each. Then calculate the F1 Score. If F1 is below 0.7, examine which side is weaker. Low precision means too many irrelevant results — tighten the retrieval by reducing top‑k, increasing chunk size, or adding a re‑ranking step. Low recall means you are missing relevant content — expand the search by using hybrid retrieval (keyword + vector), increasing the number of chunks, or tuning the embedding model. This week, pick one query category, label 20 queries, run a baseline, and make one change. Re‑measure F1 to see if the balance improved.

## How it is measured or noticed

You need ground‑truth relevance labels for each query in your evaluation set. After running your AI search, count true positives (relevant documents returned), false positives (irrelevant documents returned), and false negatives (relevant documents not returned). Compute precision = TP / (TP + FP) and recall = TP / (TP + FN). Then apply the F1 formula. Many evaluation frameworks such as RAGAS, TruLens, and DeepEval automate this. You notice F1 by looking at the aggregate score across queries — a score below 0.5 signals serious imbalance, while 0.8 or higher indicates a well‑tuned retrieval. Always also inspect the individual precision and recall numbers; a high F1 can hide a situation where both are mediocre.

## Common mistakes

- Using F1 alone without examining precision and recall separately — you miss whether the system is too strict or too loose.
- Assuming F1 is symmetric when the cost of false positives and false negatives differs — in search, missing a key document (false negative) is often worse than returning a marginally relevant one.
- Ignoring the base rate of relevant documents — a query with only one relevant document can produce a misleadingly high F1 if that one document is returned.
- Comparing F1 scores across different query sets or different ground‑truth definitions — the metric is only meaningful within a consistent evaluation setup.
- Not using a held‑out test set — tuning on the same data that you measure leads to overfitting and inflated F1.
- Treating F1 as a ranking metric — it does not consider the order of results; a relevant document at position 10 counts the same as one at position 1.

## Limits

F1 Score does not account for ranking order — it treats all retrieved documents equally regardless of position. It requires binary relevance judgments (relevant / not relevant), so it cannot capture graded relevance (e.g., highly relevant vs. somewhat relevant). The score is sensitive to the number of relevant documents per query; queries with very few relevant items can dominate the average. F1 is often confused with accuracy (which includes true negatives) or with mean average precision (MAP), which does consider ranking. In AI search, F1 is most useful for evaluating retrieval before re‑ranking or for comparing chunking strategies. It is less informative for end‑to‑end system evaluation where the language model may hallucinate even with perfect retrieval.

## Worked example

> Query: 'best coffee maker 2025'. Ground truth: 10 relevant documents. AI search returns 8 results, of which 6 are relevant. Precision = 6/8 = 0.75, recall = 6/10 = 0.60. F1 = 2 × (0.75 × 0.60) / (0.75 + 0.60) = 0.90 / 1.35 = 0.667. The F1 Score of 0.667 tells you the system is moderately balanced but missing 40% of relevant content. To improve, you might increase the number of retrieved chunks or add a keyword fallback to catch the missing documents.

## Use F1 as a starting point

Always inspect precision and recall separately to understand where your system is failing. F1 alone can hide a trade‑off that you need to address.

## Frequently asked questions

### How is F1 Score different from accuracy?

F1 Score differs from accuracy because it accounts for both false positives and false negatives, whereas accuracy can be misleading when classes are imbalanced. In AI search, a system that returns no results might have high accuracy if most queries have no relevant documents, but F1 Score would correctly penalize that.

### Should I use F1 Score or just precision or recall?

It depends on your goal. If you need a single metric that balances both false positives and false negatives, use F1 Score. If you care more about avoiding false positives (precision) or false negatives (recall), use the individual metric.

### How do I calculate F1 Score for my search results?

First, collect a labeled test set of queries with known relevant documents. Then compute precision and recall for each query, and calculate F1 Score as 2 × (precision × recall) / (precision + recall). Average the F1 scores across queries for an overall measure.

### Does F1 Score work well for evaluating ranking quality?

No, F1 Score does not account for the order of retrieved documents. It treats all retrieved documents equally, so two systems with the same set of results but different rankings get the same F1 Score. For ranking evaluation, consider metrics like MAP or NDCG.

### What happens if I only optimize for F1 Score?

You might miss improvements in ranking order, since F1 Score ignores position. A system that returns relevant documents at the bottom could have a high F1 Score but poor user experience. You should also monitor ranking metrics.

### When should I start evaluating with F1 Score?

Start after you have a labeled test set of at least 50 queries with ground-truth relevance. Without labels, you cannot compute precision and recall. You can use other metrics like click-through rate in the meantime.

## Asked out loud

The same term in the words somebody uses speaking to an assistant rather than typing into a box — written from the situation, which is why each one carries the situation it came from.

### I'm looking at a report that shows precision and recall for my search results. How do I combine them into one number?

Use the F1 Score. It's the harmonic mean of precision and recall, giving you a single score that penalizes extreme imbalances.

### My boss wants a single metric to evaluate our AI search, but I'm worried about false positives and false negatives. What should I use?

Use the F1 Score. It balances both precision and recall, so you won't miss either type of error.

### I'm on my phone checking search results, and I need a quick way to see if the results are both relevant and complete. What metric should I look at?

Check the F1 Score. It gives you a single number that captures both precision and recall, perfect for a quick assessment.

## Sources

- [Google Search Central — Search Quality Evaluation](https://developers.google.com/search/docs/fundamentals/search-quality-evaluation)

Source: GetLoopLoop Glossary — https://www.getlooploop.com/glossary/f1-score. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/

---

Canonical page: https://www.getlooploop.com/glossary/f1-score
This is the Markdown copy of that page for AI agents, made from the same content.
