Inferensys

Glossary

Cohen's Kappa

Cohen's Kappa is a statistical measure of the level of agreement between two raters for categorical items, correcting for the agreement expected by chance.
Developer reviewing semantic search engine results on laptop, relevance scores visible, technical search demo.
EVALUATION METRIC

What is Cohen's Kappa?

Cohen's Kappa is a statistical measure used to assess the level of agreement between two human or automated raters on categorical items, correcting for the agreement expected by chance alone.

Cohen's Kappa (κ) quantifies inter-annotator agreement beyond what would occur randomly. It is calculated as (observed agreement - expected agreement) / (1 - expected agreement), producing a value between -1 and 1. A κ of 1 indicates perfect agreement, 0 indicates agreement equal to chance, and negative values suggest systematic disagreement. This chance correction is critical for evaluating the reliability of human-labeled ground truth data used to train and benchmark machine learning models, especially in subjective domains.

In Retrieval-Augmented Generation (RAG) and information retrieval evaluation, Cohen's Kappa validates the consistency of human judges scoring retrieved documents for relevance or grading answer quality. High κ scores increase confidence in evaluation benchmarks like RAGAS or TREC assessments. It is preferred over simple percent agreement for its robustness against chance concurrence, making it a foundational metric for establishing trustworthy algorithmic performance baselines in enterprise AI systems.

INTER-RATER RELIABILITY

Key Characteristics of Cohen's Kappa

Cohen's Kappa (κ) quantifies the agreement between two raters on a categorical scale, adjusting for the level of agreement expected purely by chance. It is a foundational metric for establishing the reliability of human-generated ground truth in machine learning evaluation.

01

Chance-Corrected Agreement

Cohen's Kappa's core innovation is correcting for agreement by chance. Simple percent agreement can be misleadingly high if categories are imbalanced. Kappa calculates the observed agreement (Po) and subtracts the probability of expected agreement (Pe) due to random chance, then normalizes the result: κ = (Po - Pe) / (1 - Pe). A κ of 0 indicates agreement no better than chance, while 1 indicates perfect agreement.

02

Interpretation Scale (Landis & Koch)

The value of Kappa is interpreted using established benchmarks. The widely cited scale by Landis and Koch (1977) provides qualitative labels:

  • < 0.00: Poor agreement
  • 0.00 – 0.20: Slight agreement
  • 0.21 – 0.40: Fair agreement
  • 0.41 – 0.60: Moderate agreement
  • 0.61 – 0.80: Substantial agreement
  • 0.81 – 1.00: Almost perfect agreement This scale helps contextualize Kappa's numerical output for practical decision-making in data annotation quality control.
03

Categorical Data Requirement

Cohen's Kappa is designed for nominal or ordinal categorical data where raters assign items to mutually exclusive categories. Common use cases in ML evaluation include:

  • Sentiment labeling (Positive/Neutral/Negative)
  • Topic classification for retrieved documents
  • Relevance judgment (Relevant/Irrelevant) for IR benchmarks
  • Intent classification in dialogue systems It is not suitable for continuous or interval-scaled measurements, where metrics like the Intraclass Correlation Coefficient (ICC) are more appropriate.
04

The Confusion Matrix & Calculation

Kappa is calculated from a confusion matrix (contingency table) summarizing the cross-tabulation of two raters' judgments. For a binary case (Yes/No), the matrix has four cells: agreements (Yes/Yes, No/No) and disagreements (Yes/No, No/Yes). Observed Agreement (Po): Sum of the diagonal cells divided by total items. Expected Agreement (Pe): For each category, multiply the raters' marginal proportions and sum these products. This represents the probability of random agreement given each rater's category distribution.

05

Limitations and Considerations

While powerful, Kappa has known limitations that engineers must account for:

  • Prevalence Paradox: Kappa values can be artificially low when one category is very prevalent (e.g., 95% 'Not Relevant' documents), even if raters agree highly. Metrics like Prevalence-Adjusted Bias-Adjusted Kappa (PABAK) can address this.
  • Bias Paradox: Disagreements are treated symmetrically, but systematic bias between raters affects interpretation.
  • Number of Categories: Kappa tends to be lower with more categories, as chance agreement decreases. Weighted Kappa is used for ordinal data where some disagreements (e.g., 'Positive' vs. 'Neutral') are less severe than others ('Positive' vs. 'Negative').
06

Related Agreement Metrics

Cohen's Kappa is part of a family of inter-rater reliability statistics:

  • Fleiss' Kappa: Generalizes Cohen's Kappa to more than two raters.
  • Krippendorff's Alpha: A more robust metric that handles missing data, any number of raters, and different measurement levels (nominal, ordinal, interval, ratio). It is often preferred for complex annotation tasks.
  • Intraclass Correlation Coefficient (ICC): Used for continuous data, measuring agreement based on variance components from ANOVA. Choosing the correct metric depends on the data type, number of raters, and the need for tolerance to missing values.
INTER-RATER RELIABILITY

Cohen's Kappa vs. Other Agreement Metrics

A comparison of statistical measures used to quantify the level of agreement between two or more raters, judges, or systems, highlighting their core mechanisms, use cases, and limitations for evaluation tasks.

Metric / FeatureCohen's KappaFleiss' KappaKrippendorff's AlphaPercent Agreement

Primary Use Case

Two raters, categorical data

Three or more raters, categorical data

Two or more raters, any data type (nominal, ordinal, interval, ratio)

Two or more raters, simple calculation

Chance Correction

Handles Missing Data

Data Type Flexibility

Nominal / Ordinal

Nominal

Nominal, Ordinal, Interval, Ratio

Any

Interpretation Scale

Poor (<0), Slight (0-0.20), Fair (0.21-0.40), Moderate (0.41-0.60), Substantial (0.61-0.80), Almost Perfect (0.81-1)

Same as Cohen's Kappa

Reliability: α >= 0.80 (High), α >= 0.667 (Tentative conclusions), α < 0.667 (Low)

0% to 100%

Common Application in AI/ML

Evaluating human annotation for classification tasks, benchmarking against a gold standard

Evaluating consensus in crowd-sourced labeling

Content analysis, evaluating coding reliability for complex schemas

Quick sanity check, preliminary agreement assessment

Key Limitation

Assumes same two raters for all items; sensitive to prevalence and bias of categories

Requires same number of raters for all items; assumes fixed set of raters

Computationally intensive; interpretation less standardized than Kappa

Overestimates agreement by ignoring chance; not suitable for rigorous benchmarking

Formula Basis

Observed vs. Expected agreement for two raters

Extension of Scott's Pi for multiple raters

Disagreement observed vs. disagreement expected, based on variance

(Number of agreeing items) / (Total items)

COHEN'S KAPPA

Frequently Asked Questions

Cohen's Kappa is a foundational statistic for measuring agreement between raters, essential for establishing reliable ground-truth data in machine learning evaluation. This FAQ addresses its calculation, interpretation, and critical role in Retrieval-Augmented Generation (RAG) and broader AI system assessment.

Cohen's Kappa (κ) is a statistical measure that quantifies the level of agreement between two raters for categorical items, correcting for the agreement expected purely by chance. The formula is κ = (p₀ - pₑ) / (1 - pₑ), where p₀ is the observed proportion of agreement and pₑ is the expected probability of chance agreement, calculated from the raters' marginal distributions.

Calculation Example: Imagine two data annotators labeling 100 text snippets as 'Relevant' or 'Not Relevant' for a RAG system. They agree on 85 items. Their marginal totals show Rater A labeled 70 as 'Relevant', and Rater B labeled 60 as 'Relevant'. The chance-expected agreement pₑ is calculated from these marginals. If p₀ = 0.85 and pₑ = 0.55, then κ = (0.85 - 0.55) / (1 - 0.55) = 0.30 / 0.45 = 0.667. This indicates a level of agreement substantially better than chance.

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.