This prompt is designed for evaluation infrastructure teams who need to move from 'the judges seem to agree' to a statistical understanding of inter-rater reliability. The core job-to-be-done is computing agreement metrics—Cohen's Kappa for two judges, Fleiss' Kappa for three or more, and raw percent agreement—from a complete score matrix. You should use this prompt when you have already collected scores from multiple LLM judges rating the same set of items and need to decide whether your automated evaluation pipeline is consistent enough to trust without human oversight on every sample. The ideal user is an AI engineer or evaluation lead who has a structured dataset of judge outputs and needs a rigorous, repeatable statistical check before shipping a judge-based evaluation system.
Prompt
Inter-Rater Agreement Score Calculation Prompt Template

When to Use This Prompt
Quantify how consistently your fleet of LLM judges scores the same outputs before trusting automated evaluation pipelines.
The prompt requires a complete score matrix as input, meaning every judge has rated every item on the same categorical or ordinal scale. It assumes scores are already collected, formatted, and ready for computation. The output includes the primary agreement statistics plus divergence diagnostics that flag which specific items or judge pairs are driving disagreement. This is a batch computation workflow, not a real-time streaming check. Do not use this prompt when judges use incompatible rating scales (e.g., one judge uses 1–5 Likert and another uses binary pass/fail), when your score matrix is sparse with missing ratings, or when you need continuous live monitoring rather than a point-in-time reliability assessment. For sparse matrices, you will need imputation or pairwise deletion logic that this prompt does not handle.
Before running this prompt, verify that your score matrix is complete and that all judges used the same rating scale. If you have more than two judges, Fleiss' Kappa will be computed; for exactly two, Cohen's Kappa applies. The divergence diagnostics are your most actionable output—they tell you not just that agreement is low, but which judge pairs or specific items are the source of the problem. After receiving results, if agreement is below your threshold (typically Kappa < 0.6 warrants investigation), proceed to the sibling playbooks for Outlier Judge Detection or Disagreement Root Cause Analysis rather than trusting the evaluation pipeline. If agreement is acceptable, document the Kappa score and sample size as part of your judge fleet qualification evidence before promoting the pipeline to production.
Use Case Fit
Where the Inter-Rater Agreement Score Calculation Prompt works well, where it breaks, and what you must provide before running it.
Good Fit: Multi-Judge Evaluation Pipelines
Use when: you run 3+ LLM judges scoring the same items and need Cohen's Kappa, Fleiss' Kappa, or percent agreement to prove consistency. Guardrail: feed the prompt a complete score matrix with judge IDs, item IDs, and scores—never partial or pre-aggregated data.
Bad Fit: Single-Judge or Binary Pass/Fail Only
Avoid when: you have only one judge or a simple accept/reject gate. Agreement metrics require multiple raters and meaningful score variance. Guardrail: use a pass/fail criteria prompt instead; this prompt will return misleadingly perfect agreement on uniform scores.
Required Input: Complete Score Matrix
What to watch: missing scores, judge dropouts, or sparse matrices break Kappa calculations and inflate agreement artificially. Guardrail: validate that every judge scored every item before invoking this prompt, or explicitly flag missingness in the input schema.
Operational Risk: Sparse Rating Collapse
What to watch: when judges rarely use certain score categories, Kappa can return paradoxically low values despite high observed agreement. Guardrail: include prevalence and bias-adjusted Kappa variants in the output, and flag low-variance categories for human review.
Operational Risk: Statistical Assumption Violations
What to watch: Kappa assumes independent raters and nominal categories. Violations produce scores that look authoritative but mislead. Guardrail: the prompt must output assumption checks—independence warnings, ordinal vs. nominal notes, and sample size sufficiency flags—alongside the scores.
Downstream Dependency: Divergence Diagnostics
What to watch: teams stop at the agreement number without understanding which items or judge pairs diverge. Guardrail: require the prompt to output per-item disagreement counts, judge-pair breakdowns, and severity tiers so operations teams can triage root causes.
Copy-Ready Prompt Template
Paste this prompt into your LLM interface to compute Cohen's Kappa, Fleiss' Kappa, and percent agreement from a score matrix, including divergence diagnostics and assumption checks.
This prompt template is designed to be copied directly into an LLM interface and adapted for your specific inter-rater agreement calculation task. It accepts a matrix of scores from multiple judges across multiple items and produces a comprehensive agreement report. The template uses square-bracket placeholders for all variable inputs, making it easy to swap in your own data, constraints, and output format requirements without modifying the core instruction structure.
codeYou are a statistical computation engine specializing in inter-rater agreement analysis. Your task is to compute agreement metrics from a provided score matrix and produce a structured diagnostic report. ## INPUT DATA ### Score Matrix [JUDGE_SCORE_MATRIX] Format: Provide scores as a JSON array of arrays, where each inner array represents one item and contains the scores from all judges for that item. Example: [[3, 4, 3], [2, 2, 1], [5, 5, 4]] represents 3 items rated by 3 judges. ### Scale Type [SCALE_TYPE] Specify one of: "nominal", "ordinal", "interval", or "ratio". ### Judge Identifiers (Optional) [JUDGE_IDS] Provide as a JSON array of judge labels. If omitted, judges will be referenced by index position. ### Item Identifiers (Optional) [ITEM_IDS] Provide as a JSON array of item labels. If omitted, items will be referenced by index position. ## COMPUTATION REQUIREMENTS 1. Compute the following agreement metrics: - Percent agreement (pairwise and overall) - Cohen's Kappa for each judge pair (if exactly 2 judges) - Fleiss' Kappa (if 3 or more judges) - Krippendorff's Alpha as a supplementary metric 2. For each metric, include: - The computed value rounded to 4 decimal places - A 95% confidence interval where calculable - An interpretation label: "Poor" (<0.20), "Fair" (0.21-0.40), "Moderate" (0.41-0.60), "Good" (0.61-0.80), "Excellent" (0.81-1.00) 3. Produce a divergence diagnostic section that: - Identifies the judge pair with the lowest agreement - Identifies items with the highest score variance across judges - Flags any judge whose mean score deviates more than [DEVIATION_THRESHOLD] standard deviations from the group mean - Lists the top [TOP_N_DIVERGENT_ITEMS] items where judges disagree most 4. Run assumption checks and report warnings for: - Sparse rating patterns (judges using only a subset of the scale) - Low variance items (all judges giving identical or near-identical scores) - Small sample size (fewer than [MIN_ITEMS_THRESHOLD] items) - Unbalanced judge counts per item ## CONSTRAINTS [CONSTRAINTS] Specify any additional constraints, such as: "Exclude items with missing scores from all calculations", "Treat score value [X] as missing data", or "Only compute pairwise metrics for judge pairs with at least [N] co-rated items". ## OUTPUT FORMAT Return a JSON object with this exact structure: { "agreement_metrics": { "percent_agreement": { "overall": number, "pairwise": { "judge_i_judge_j": number }, "confidence_interval_95": [lower, upper] }, "cohens_kappa": { "pairwise": { "judge_i_judge_j": { "value": number, "ci_95": [lower, upper], "interpretation": string } }, "note": "Computed only when exactly 2 judges present" }, "fleiss_kappa": { "value": number, "ci_95": [lower, upper], "interpretation": string, "note": "Computed when 3+ judges present" }, "krippendorff_alpha": { "value": number, "ci_95": [lower, upper], "interpretation": string } }, "divergence_diagnostics": { "lowest_agreement_pair": { "judges": [string, string], "metric": string, "value": number }, "highest_variance_items": [{ "item_id": string, "variance": number, "scores": [number] }], "outlier_judges": [{ "judge_id": string, "mean_score": number, "group_mean": number, "deviation_sds": number }], "top_divergent_items": [{ "item_id": string, "score_range": number, "scores": [number] }] }, "assumption_warnings": [ { "type": string, "severity": "warning" | "error", "detail": string, "recommendation": string } ], "summary": "One-paragraph plain-English interpretation of the overall agreement picture, highlighting the most important finding and any critical warnings." } ## EXAMPLES (for reference) [EXAMPLES] Provide 1-2 worked examples with small score matrices and expected outputs to calibrate the computation. If omitted, the model will compute without examples. ## RISK LEVEL [RISK_LEVEL] Specify "low", "medium", or "high". For high-risk contexts (e.g., clinical assessment, legal evaluation, safety-critical scoring), the output must include an explicit statement that results require human review before operational use.
To adapt this template, replace each square-bracket placeholder with your actual data. The [JUDGE_SCORE_MATRIX] is the only strictly required input; all others have sensible defaults or can be omitted. For high-stakes evaluation pipelines, set [RISK_LEVEL] to "high" and ensure the [CONSTRAINTS] field specifies how to handle missing or edge-case data. The [DEVIATION_THRESHOLD] and [TOP_N_DIVERGENT_ITEMS] parameters let you tune the sensitivity of the divergence diagnostics to match your operational tolerance for judge disagreement. After running the prompt, validate the output JSON against the schema before ingesting it into your monitoring dashboard or alerting system.
Prompt Variables
Every placeholder the Inter-Rater Agreement Score Calculation prompt expects, why it matters, and how to validate it before sending. Wire these into your evaluation harness to prevent malformed score matrices, missing metadata, and silent statistical errors.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SCORE_MATRIX] | Raw scores from N judges across M items. Each row is an item, each column is a judge. This is the primary input for computing Cohen's Kappa, Fleiss' Kappa, and percent agreement. | [[3,4,3],[2,2,3],[4,4,4],[1,2,1]] | Must be a 2D array of integers or floats. Validate row count >= 2 and column count >= 2. Reject if any cell is null, non-numeric, or missing. Check for consistent scale range across judges before computing agreement. |
[SCALE_TYPE] | Declares whether the scores are nominal, ordinal, or interval. Controls which agreement statistic is appropriate and whether weighted kappa variants should be used. | ordinal | Must be one of: nominal, ordinal, interval. Validate against an enum. If ordinal, the prompt will apply linear weighting. If nominal, unweighted kappa is used. Mismatch with actual score distribution produces misleading agreement scores. |
[JUDGE_LABELS] | Human-readable identifiers for each judge column in the score matrix. Used in divergence diagnostics to name which judges disagree. | ["judge-gpt4","judge-claude3","judge-gemini"] | Must be a string array with length equal to the number of columns in [SCORE_MATRIX]. Validate no duplicates and no empty strings. Missing labels cause unreadable diagnostic output. |
[ITEM_LABELS] | Optional identifiers for each scored item. Used to pinpoint which items drive disagreement. If absent, items are referenced by index. | ["item-001","item-002","item-003","item-004"] | If provided, must be a string array with length equal to the number of rows in [SCORE_MATRIX]. Validate no duplicates. Null is allowed if item-level diagnostics are not needed. Empty array triggers index-based output. |
[MINIMUM_AGREEMENT_THRESHOLD] | The acceptable Fleiss' Kappa floor before the system flags a reliability warning. Drives the pass/fail signal in the output. | 0.60 | Must be a float between 0.0 and 1.0. Validate range. Values below 0.40 indicate poor agreement; 0.60-0.75 is moderate; above 0.75 is strong. This threshold should be tuned per domain and risk tolerance. |
[SPARSE_RATING_STRATEGY] | Instructs the prompt how to handle items where not all judges provided a score. Controls whether to exclude incomplete rows or impute. | exclude | Must be one of: exclude, impute_mode, impute_median, flag. Validate against enum. exclude drops incomplete rows silently. impute_* methods fill gaps but can inflate agreement artificially. flag returns an error and requires human review. |
[OUTPUT_FORMAT] | Controls whether the response includes only the summary statistics or also the full per-item divergence diagnostics. | full | Must be one of: summary, full. Validate against enum. summary returns Kappa scores and percent agreement only. full adds per-item disagreement heatmap, outlier judge flags, and scale-usage histograms. Use full for debugging, summary for dashboards. |
Implementation Harness Notes
How to wire the inter-rater agreement calculation prompt into an evaluation pipeline with validation, retry, and logging.
This prompt is designed to be a stateless function within a larger evaluation pipeline. It expects a pre-assembled score matrix, not raw conversation logs. The calling application should first collect scores from all judges for all items, validate that the matrix is complete enough for the requested metrics, and then inject the matrix into the [SCORE_MATRIX] placeholder. Do not use this prompt to collect scores; it only computes agreement statistics from already-collected data.
Wrap the LLM call in a harness that performs pre-flight validation before sending the prompt. Check that the [SCORE_MATRIX] is a valid JSON array of arrays, that all rows have the same number of columns, and that the number of raters meets the minimum requirement for the requested statistic (e.g., Fleiss' Kappa requires at least 3 raters). If the matrix is sparse, pre-process it to either drop incomplete rows or impute values based on a configured strategy before passing it to the prompt. The harness should also enforce a maximum matrix size to avoid token limit errors—if the input exceeds 50 items or 10 raters, split the computation into batches and aggregate results in application code.
After receiving the LLM output, validate the JSON structure against the expected [OUTPUT_SCHEMA]. Confirm that all requested metrics (Cohen's Kappa, Fleiss' Kappa, percent agreement) are present and are numeric values within valid ranges (e.g., Kappa values between -1 and 1). If validation fails, retry once with an explicit error message injected into the [PREVIOUS_ERROR] field of the prompt. If the retry also fails, log the raw output and matrix for manual inspection and fall back to computing agreement scores using a deterministic statistical library like scikit-learn's cohen_kappa_score or statsmodels' fleiss_kappa.
Log every computation with the prompt version, model identifier, input matrix hash, output metrics, and validation status. For high-stakes evaluation pipelines where judge reliability directly impacts model release decisions, route all agreement scores below a configurable threshold (e.g., Kappa < 0.6) to a human review queue before the scores are used in downstream reporting. Never treat an LLM-computed agreement score as authoritative without verifying it against a deterministic implementation, especially when the score will be cited in model cards or compliance documentation.
Expected Output Contract
Every field the Inter-Rater Agreement Score Calculation prompt must return, its type, and the validation rule that confirms correctness before the output is consumed by dashboards or downstream pipelines.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
agreement_metrics.cohens_kappa | number (float) | Must be between -1.0 and 1.0 inclusive. Return null if fewer than 2 raters or constant ratings prevent calculation. | |
agreement_metrics.fleiss_kappa | number (float) | Must be between -1.0 and 1.0 inclusive. Return null if fewer than 3 raters or input matrix is not rectangular. | |
agreement_metrics.percent_agreement | number (float) | Must be between 0.0 and 100.0 inclusive. Calculated as (pairwise exact matches / total pairwise comparisons) * 100. | |
agreement_metrics.krippendorff_alpha | number (float) or null | If calculated, must be between -1.0 and 1.0 inclusive. Return null when data level is nominal and metric is not applicable. | |
divergence_diagnostics.divergent_judge_ids | array of strings | Each element must match a judge ID present in the input score matrix. Empty array if no outliers detected. | |
divergence_diagnostics.per_judge_deviation | object | Keys must be judge IDs from input. Values must be numbers representing mean absolute deviation from group mean. No missing judges. | |
divergence_diagnostics.severity_flags | array of strings | If present, each element must be one of: 'low_variance', 'high_deviation', 'sparse_ratings', 'systematic_skew'. No unrecognized flag values. | |
calculation_metadata.sample_size | integer | Must equal the number of items in the input score matrix. Must be greater than 0. |
Common Failure Modes
What breaks first when computing inter-rater agreement scores in production and how to guard against it.
Sparse Rating Matrix Collapse
What to watch: When judges rate different subsets of items, agreement metrics become unreliable. Cohen's Kappa requires paired ratings; Fleiss' Kappa requires complete rating blocks. Sparse matrices produce inflated or undefined scores. Guardrail: Validate matrix completeness before calculation. Require minimum overlap thresholds (e.g., at least 5 items rated by all judge pairs). If sparsity exceeds 30%, fall back to percent agreement on overlapping items only and flag the metric as partial.
Chance Agreement Inflation
What to watch: High percent agreement can mask low true agreement when rating categories are imbalanced. Two judges both rating 90% of items as 'pass' will show high agreement even if they disagree on every borderline case. Guardrail: Always report Cohen's or Fleiss' Kappa alongside percent agreement. If Kappa is below 0.4 while percent agreement is above 0.8, flag as suspected prevalence bias. Include category distribution in the output for manual review.
Scale Mismatch Between Judges
What to watch: Judges using different effective ranges (one uses 1-3, another uses 3-5 on a 5-point scale) produce artificially low agreement scores even when their relative rankings align. Guardrail: Normalize scores before computing agreement using z-score or min-max scaling. Include both raw and normalized agreement scores in output. If normalized agreement exceeds raw agreement by more than 0.2, flag as scale mismatch and recommend judge recalibration.
Small Sample Size Overfitting
What to watch: Agreement scores computed on fewer than 20 items produce wide confidence intervals and unreliable point estimates. Teams ship Kappa scores that look precise but are statistically meaningless. Guardrail: Compute and report 95% confidence intervals for all agreement metrics. If the confidence interval width exceeds 0.3, suppress the point estimate and return 'insufficient data for reliable agreement calculation.' Require minimum 30 jointly rated items before reporting Kappa.
Ordinal Data Treated as Nominal
What to watch: Using unweighted Kappa on ordinal scales (e.g., 1-5 severity ratings) penalizes near-misses as harshly as extreme disagreements. A judge rating 3 vs 4 is treated identically to rating 1 vs 5. Guardrail: Detect scale type from input metadata. For ordinal scales, compute weighted Kappa with linear or quadratic weights. Report both weighted and unweighted scores. If the difference exceeds 0.15, flag that ordinal distance matters and weighted Kappa is the primary metric.
Judge Pool Instability Over Time
What to watch: Agreement scores computed across different time windows can drift because judges change behavior, not because the evaluation task changed. Teams miss drift by only computing aggregate agreement. Guardrail: Partition the rating matrix by time window and compute agreement per window. If any window's Kappa drops more than 0.15 from baseline, trigger a drift alert with the affected judge pairs and time range. Include per-window sample sizes to distinguish drift from sparse-window noise.
Evaluation Rubric
Criteria for validating that the inter-rater agreement score calculation prompt produces correct, trustworthy output before production deployment. Each criterion includes a concrete pass standard, a detectable failure signal, and a test method that can be automated in a CI/CD pipeline.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Metric calculation accuracy | Cohen's Kappa, Fleiss' Kappa, and percent agreement match reference implementation within ±0.01 for a 3-rater 10-item matrix | Output deviates from expected values by more than 0.01 or returns null for valid input | Compare output against scikit-learn or irr package calculations on a golden test set of 20 matrices |
Sparse rating matrix handling | Prompt correctly computes agreement when some rater-item pairs are null, returning metrics with a note about effective sample size | Output returns error, zero, or silently drops null cells without documentation | Provide matrix with 30% null values and verify metrics are computed on remaining pairs with a non-null count annotation |
Statistical assumption validation | Output includes a flag when expected cell frequencies fall below 5 for Kappa, with a warning about reliability | Prompt returns Kappa without any assumption check or warning for small samples | Feed a 2-rater 5-item matrix with highly skewed categories and assert presence of assumption warning field |
Divergence diagnostic completeness | Output identifies the rater pair with lowest pairwise agreement and the item with highest disagreement variance | Diagnostic section is missing, empty, or identifies wrong rater pair when disagreement is obvious | Use a matrix where Rater C systematically disagrees and verify diagnostic correctly flags Rater C and the most contentious item |
Edge case: perfect agreement | All metrics return 1.0 with confidence interval [1.0, 1.0] and diagnostic notes zero divergence | Kappa returns less than 1.0 or confidence interval is missing for perfect agreement | Provide matrix where all raters assign identical scores to all items and assert exact 1.0 values |
Edge case: single rater | Prompt returns a clear refusal message explaining that inter-rater agreement requires at least 2 raters | Prompt hallucinates metrics for a single rater or returns division-by-zero error | Submit matrix with one rater column and assert refusal message with explanation |
Output schema compliance | JSON output contains all required fields: cohens_kappa, fleiss_kappa, percent_agreement, confidence_intervals, divergence_diagnostics, assumption_warnings | Output is missing one or more required fields or uses wrong types | Validate output against JSON Schema with required field list and type constraints |
Confidence interval correctness | 95% confidence intervals are computed using bootstrap or asymptotic formula and contain the point estimate | Confidence intervals are missing, inverted, or wider than [0, 1] range | Verify lower bound ≤ point estimate ≤ upper bound and interval width is reasonable for sample size |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a small score matrix (3 judges × 10 items). Remove strict schema enforcement and let the model output a narrative summary alongside the metrics. Use a single frontier model call with no retry logic.
codeCalculate inter-rater agreement for [SCORE_MATRIX] using Cohen's Kappa for pairs and Fleiss' Kappa for the full set. Include percent agreement. Flag any judge pairs below 0.4 Kappa.
Watch for
- Model inventing scores for missing cells instead of handling sparse matrices
- Confusing Cohen's Kappa (pairwise) with Fleiss' Kappa (multi-rater)
- Producing agreement scores without noting sample size limitations

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us