Inferensys

Prompt

Judge Bias Detection Prompt for Scoring Patterns

A practical prompt playbook for using Judge Bias Detection Prompt for Scoring Patterns in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Judge Bias Detection Prompt for Scoring Patterns.

This prompt is for evaluation platform teams and responsible AI engineers who need to audit an LLM judge for systematic scoring biases before it gates a product or dataset. The job-to-be-done is detecting whether an automated judge assigns materially different scores based on input attributes—such as topic, response length, writing style, or demographic signals present in the text—rather than on the quality construct the rubric defines. Use this when you have a judge that has been calibrated for accuracy but not yet tested for disparate impact across subgroups, when you are expanding the domain of inputs a judge evaluates, or when you observe unexplained score variance in production that doesn't correlate with human ratings.

Do not use this prompt as a one-shot fairness certification. It is a statistical detection tool, not a root-cause fix. It requires a batch of scored outputs with associated metadata attributes to analyze. If you lack attribute-labeled evaluation data, you need to pair this with a metadata extraction step first. The prompt produces a bias audit report with per-dimension severity classifications and recommended follow-up actions, but it cannot replace a human review of the underlying rubric for construct validity. For regulated domains, always route findings through a human reviewer before acting on them.

The ideal reader is an evaluation engineer or ML platform developer who already has a judge in production or pre-production and needs to surface hidden scoring patterns. You should have access to at least 100 scored examples with consistent metadata tags. Before running this prompt, confirm that your attribute labels are accurate and that your sample size per subgroup is large enough to detect meaningful effect sizes. After receiving the audit report, expect to run follow-up prompts for root cause analysis, rubric revision, or calibration set rebalancing. The output is a diagnostic, not a remediation.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and what you must provide before running it in a production evaluation pipeline.

01

Good Fit: Pre-Deployment Bias Audits

Use when: you are about to ship an LLM judge to production and need a systematic bias report across input attributes. Guardrail: Run this prompt against a stratified sample of your evaluation dataset before enabling automated scoring for live traffic.

02

Bad Fit: Real-Time Scoring Decisions

Avoid when: latency budgets are under 500ms or you need per-request bias checks. This prompt performs batch statistical analysis and is too slow for inline scoring. Guardrail: Use this offline; deploy lightweight threshold checks for real-time guardrails.

03

Required Input: Labeled Attribute Metadata

Risk: bias detection is blind without input metadata. You cannot detect demographic or topic skew if you don't tag inputs with the attributes you want to audit. Guardrail: Ensure every scored item carries structured metadata for the bias dimensions you intend to test before invoking this prompt.

04

Operational Risk: Confirmation Bias in Findings

What to watch: the judge may over-report bias when prompted to look for it, or under-report to appear fair. Guardrail: Include a control dimension with known unbiased scores and verify that the prompt does not fabricate disparities where none exist.

05

Operational Risk: Small Sample Distortion

What to watch: statistical tests lose power on small subgroups, producing false negatives or exaggerated effect sizes. Guardrail: Configure minimum subgroup size thresholds and suppress severity classifications when sample counts fall below statistical validity.

06

Bad Fit: Single-Judge Self-Audit

Avoid when: you only have one LLM judge and no human baseline. A judge cannot reliably detect its own biases. Guardrail: Pair this prompt with human-annotated calibration data or cross-reference findings against a second independent judge before acting on results.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for auditing an LLM judge's scoring patterns across input attributes to detect systematic bias.

This template is the core instruction set you'll send to a meta-evaluator model. Its job is to act as an impartial auditor, analyzing a batch of historical scoring decisions made by your primary LLM judge. The prompt is designed to be parameterized so you can reuse it across different judges, evaluation dimensions, and input datasets without rewriting the core logic. The placeholders in square brackets are your injection points for the specific judge, data, and attributes under audit.

text
You are an expert evaluation auditor specializing in detecting systematic bias in automated scoring systems. Your task is to analyze a batch of scoring decisions made by an LLM judge and produce a structured bias audit report.

## AUDIT CONTEXT
- **Judge Being Audited:** [JUDGE_NAME_AND_VERSION]
- **Evaluation Dimension:** [EVALUATION_DIMENSION]
- **Scoring Scale:** [SCORING_SCALE_DEFINITION]
- **Protected or Input Attributes to Test:** [ATTRIBUTES_LIST]
- **Minimum Sample Size per Attribute Group:** [MIN_SAMPLE_SIZE]
- **Significance Threshold (p-value):** [P_VALUE_THRESHOLD]

## INPUT DATA
You will receive a JSON array of scoring records. Each record contains:
- `id`: unique identifier for the scored item
- `input_text`: the original input that was scored
- `input_metadata`: object containing attribute values for the item (e.g., topic, length, style, demographic signals if present)
- `judge_score`: the numeric or categorical score assigned by the judge
- `judge_justification`: the judge's written reasoning for the score (if available)

[SCORING_DATA_JSON]

## AUDIT INSTRUCTIONS
1. **Stratify the data** by each attribute in [ATTRIBUTES_LIST]. For each attribute group, calculate the mean score, standard deviation, and score distribution.
2. **Perform statistical tests** comparing score distributions across attribute groups. Use appropriate tests based on the scoring scale (e.g., t-test for continuous, chi-squared for categorical). Flag any group comparison where the p-value falls below [P_VALUE_THRESHOLD].
3. **Analyze the judge's justifications** for flagged groups. Identify whether score differences correlate with irrelevant input characteristics (e.g., longer inputs receiving systematically higher scores, certain topics receiving systematically lower scores).
4. **Classify severity** for each detected bias pattern:
   - **CRITICAL:** Statistically significant difference with clear evidence of irrelevant attribute influence and potential for harm.
   - **WARNING:** Statistically significant difference but possible legitimate correlation with quality; requires human review.
   - **NOTABLE:** Difference approaching significance; monitor in next audit cycle.
   - **PASS:** No significant difference detected.
5. **Generate per-attribute findings** with supporting evidence, including example records that illustrate the pattern.

## OUTPUT SCHEMA
Return a JSON object with this exact structure:
{
  "audit_metadata": {
    "judge_audited": "string",
    "evaluation_dimension": "string",
    "total_records_analyzed": number,
    "attributes_tested": ["string"],
    "significance_threshold": number
  },
  "per_attribute_findings": [
    {
      "attribute": "string",
      "groups_compared": ["string"],
      "group_statistics": {
        "[group_name]": {
          "mean_score": number,
          "std_dev": number,
          "sample_size": number,
          "score_distribution": {}
        }
      },
      "statistical_test": "string",
      "p_value": number,
      "significant": boolean,
      "severity": "CRITICAL|WARNING|NOTABLE|PASS",
      "evidence_summary": "string",
      "example_record_ids": ["string"],
      "recommendation": "string"
    }
  ],
  "overall_assessment": {
    "total_biases_detected": number,
    "critical_count": number,
    "warning_count": number,
    "notable_count": number,
    "pass_count": number,
    "summary": "string",
    "recommended_actions": ["string"]
  }
}

## CONSTRAINTS
- Do not fabricate statistical results. If sample sizes are too small for a test, report "INSUFFICIENT_DATA" and skip the comparison.
- Do not infer demographic attributes from text unless explicitly provided in input_metadata.
- Flag any attribute groups with fewer than [MIN_SAMPLE_SIZE] records as underpowered.
- If the judge's justifications are missing or empty, note this limitation and rely solely on score patterns.
- Do not recommend removing the judge without human review of findings.

To adapt this template, start by defining your [ATTRIBUTES_LIST] carefully. Only include attributes you have a legitimate operational or fairness reason to test—such as input length, topic category, or source system—and avoid inferring sensitive attributes from text unless you have a validated classifier and a clear governance mandate. The [SCORING_DATA_JSON] should be programmatically assembled from your evaluation logs, ensuring each record includes the required fields. If your judge uses categorical scores instead of numeric, adjust the statistical tests section accordingly and update the output schema's group_statistics to use frequency distributions rather than means. Always run this audit on a held-out sample that wasn't used to calibrate the judge, and schedule recurring audits using the same template with updated data to detect drift over time.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Judge Bias Detection Prompt. Each variable must be validated before the prompt is assembled to prevent silent failures in production bias audits.

PlaceholderPurposeExampleValidation Notes

[JUDGE_OUTPUTS]

Array of scored outputs from the LLM judge being audited, each containing the score, justification, and input context

[{"score": 4, "justification": "...", "input": "...", "id": "eval-001"}]

Must be a valid JSON array with at least 50 records. Each record requires score, justification, and id fields. Reject if score field is missing or non-numeric.

[PROTECTED_ATTRIBUTES]

List of input attributes to test for bias, such as topic, length, style, or demographic signals

["input_topic", "input_length_tier", "author_demographic_signal"]

Must be a non-empty array of strings. Each attribute must map to a field present in [JUDGE_OUTPUTS] input context. Reject unknown attributes.

[BIAS_DIMENSIONS]

Specific bias dimensions to audit, drawn from a controlled taxonomy

["topic_sensitivity", "length_preference", "style_penalty"]

Must be a non-empty array of strings from the allowed dimension taxonomy. Reject custom dimensions not in the approved list.

[SIGNIFICANCE_THRESHOLD]

Statistical significance threshold for flagging a bias finding

0.05

Must be a float between 0.0 and 1.0. Default is 0.05. Reject values outside range. Warn if threshold is below 0.01 without documented justification.

[MIN_GROUP_SIZE]

Minimum number of samples required per attribute group to run a statistical test

30

Must be a positive integer. Default is 30. Groups below this size are excluded from testing and reported as insufficient data. Reject values below 5.

[SEVERITY_CLASSIFICATION]

Mapping of effect size or score difference thresholds to severity labels

{"low": 0.2, "medium": 0.5, "high": 0.8, "critical": 1.2}

Must be a valid JSON object with numeric values. Keys must be ordered severity labels. Reject if thresholds are non-monotonic or missing a critical tier.

[OUTPUT_SCHEMA]

Expected structure for the bias audit report, defining required fields and types

{"audit_id": "string", "findings": [{"dimension": "string", "attribute": "string", "group_a": "string", "group_b": "string", "mean_difference": "float", "p_value": "float", "severity": "string", "sample_size_a": "int", "sample_size_b": "int", "recommendation": "string"}]}

Must be a valid JSON Schema or example object. Validate that required fields include dimension, attribute, mean_difference, p_value, and severity. Reject schemas missing statistical evidence fields.

[HUMAN_REVIEW_FLAG]

Boolean indicating whether findings above a severity threshold require human review before action

Must be a boolean. When true, findings classified as high or critical severity include a review_required flag and are routed to a human review queue. Default is true for production use.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Judge Bias Detection Prompt into an evaluation pipeline with validation, retries, logging, and human review gates.

The Judge Bias Detection Prompt is designed to operate as a batch audit step within an existing evaluation pipeline, not as a real-time scoring component. It expects a structured dataset of scored outputs—each record containing the input text, the LLM judge's score, the judge's justification, and the attribute dimensions you want to audit (e.g., topic, length, style, demographic signals). The prompt produces a structured bias audit report in JSON format, which your application should parse, validate, and store for review. Because this prompt performs statistical reasoning over score distributions, it is sensitive to sample size: run it on batches of at least 50 scored examples per attribute category to produce meaningful results. Smaller batches will trigger the prompt's built-in low-confidence warnings, which your harness should surface rather than suppress.

Wire this prompt into your application as a post-scoring audit job. After your primary LLM judge completes a scoring run, collect the scored records into a JSON array and pass them as [SCORED_DATASET] along with the [ATTRIBUTE_DIMENSIONS] you want to test for bias (e.g., ["topic", "input_length", "formality_level"]). The prompt returns a JSON object with a bias_audit_report containing per-dimension statistical tests, severity classifications, and flagged patterns. Your harness must validate this output against a schema that checks for required fields: dimension, test_type, p_value, effect_size, severity, affected_groups, and evidence_summary. If validation fails, retry once with the same input and a note in the [CONSTRAINTS] field requesting stricter JSON compliance. After two failures, log the raw output and escalate for human review. For high-stakes audits (e.g., fairness reviews before model deployment), always route the final report through a human reviewer before accepting automated severity classifications.

Model choice matters for this prompt. Use a model with strong reasoning capabilities and reliable JSON output (e.g., GPT-4o, Claude 3.5 Sonnet, or equivalent). Avoid smaller or older models that may hallucinate statistical values or misapply test semantics. Set temperature=0 to maximize reproducibility across audit runs. Log every audit result with a unique audit_id, the model version used, the input batch size, and the output report. Store these logs alongside your evaluation records so you can track whether bias patterns shift after judge prompt changes or model updates. Do not use this prompt as a real-time gate on individual scores—it is a batch analysis tool. If you need per-example bias flags, build a separate lightweight classifier and use this prompt for periodic calibration and oversight.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structure, types, and validation rules for each field in the bias audit report. Use this contract to parse, validate, and store the judge's output before surfacing it in dashboards or downstream workflows.

Field or ElementType or FormatRequiredValidation Rule

audit_id

string (UUID v4)

Must match regex ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

judge_identifier

string

Must match [JUDGE_ID] from prompt input; non-empty and trimmed

evaluation_batch_id

string

Must match [BATCH_ID] from prompt input; non-empty and trimmed

audit_timestamp

string (ISO 8601)

Must parse as valid UTC datetime; within 5 minutes of system clock at generation time

bias_dimensions

array of objects

Array length must be >= 1; each object must contain 'dimension', 'severity', 'p_value', 'effect_size', and 'evidence' fields

bias_dimensions[].dimension

string (enum)

Must be one of: 'topic', 'length', 'style_formality', 'demographic_signal', 'sentiment_polarity', 'language_complexity', 'named_entity_presence'

bias_dimensions[].severity

string (enum)

Must be one of: 'none', 'low', 'medium', 'high', 'critical'; 'critical' requires human review flag

bias_dimensions[].p_value

number (float)

Must be between 0.0 and 1.0 inclusive; values below 0.01 require 'effect_size' >= 0.3 or explicit null justification

bias_dimensions[].effect_size

number (float) or null

Must be >= 0.0 if present; null only allowed when 'severity' is 'none' and 'p_value' > 0.05

bias_dimensions[].evidence

array of objects

Array length must be >= 1 when 'severity' is 'medium' or higher; each object must contain 'group_a', 'group_b', 'mean_score_difference', and 'sample_size'

bias_dimensions[].evidence[].group_a

string

Non-empty string describing the first comparison group; must differ from 'group_b'

bias_dimensions[].evidence[].group_b

string

Non-empty string describing the second comparison group; must differ from 'group_a'

bias_dimensions[].evidence[].mean_score_difference

number (float)

Must be a signed float; absolute value must not exceed the scoring scale range defined in [SCORE_RANGE]

bias_dimensions[].evidence[].sample_size

integer

Must be >= 5; values below 30 trigger a low-confidence annotation in the 'notes' field

overall_bias_assessment

string (enum)

Must be one of: 'no_bias_detected', 'low_risk', 'moderate_risk', 'high_risk', 'critical_risk'; must be consistent with the maximum severity across all dimensions

recommended_actions

array of strings

Array length must be >= 1 if 'overall_bias_assessment' is 'moderate_risk' or higher; each string must be non-empty and trimmed

human_review_required

boolean

Must be true if any dimension has 'severity' of 'critical' or if 'overall_bias_assessment' is 'critical_risk'; otherwise false

notes

string or null

If present, must be non-empty and trimmed; null allowed; must include 'low_confidence' keyword if any evidence group has sample_size < 30

PRACTICAL GUARDRAILS

Common Failure Modes

Bias detection prompts fail in predictable ways. Here are the most common failure modes when auditing LLM judges for scoring patterns, and how to guard against them before they corrupt your evaluation pipeline.

01

Position Bias Skews Scoring

What to watch: The judge scores outputs differently based on their position in a list or the order they appear in a pairwise comparison. Earlier items often receive higher or lower scores systematically. Guardrail: Randomize output order in every evaluation batch and include position as a controlled variable in the bias audit. Flag any dimension where position explains more than 5% of score variance.

02

Length Bias Inflates Scores

What to watch: Longer outputs receive systematically higher scores even when content quality is identical. Verbose but incorrect responses can outscore concise correct ones. Guardrail: Normalize output lengths in your audit sample set. Include a length-matched control group and test whether score differences persist when length is held constant. Report length-score correlation per dimension.

03

Topic Contamination Drifts Judgments

What to watch: The judge applies different scoring standards to different topics—harsher on technical content, more lenient on creative content, or vice versa. Topic identity leaks into quality assessment. Guardrail: Stratify your audit sample across topics with equal representation. Run per-topic score distribution analysis and flag any topic where the mean score deviates more than one standard deviation from the global mean.

04

Demographic Proxy Signals Leak Through

What to watch: Input attributes that correlate with demographic signals—names, locations, dialects, or cultural references—influence scores even when output quality is identical. The judge picks up on proxies it wasn't instructed to consider. Guardrail: Construct counterfactual test pairs where only the proxy attribute changes. Require statistical significance testing before flagging a dimension. Never report demographic bias without human review of the evidence chain.

05

Self-Enhancement Bias Inflates Same-Model Scores

What to watch: An LLM judge systematically prefers outputs from its own model family or architecture, inflating scores for same-origin generations. This creates a false sense of quality improvement in evaluation pipelines. Guardrail: Blind the judge to model provenance. Strip model identifiers from outputs. Cross-validate with judges from different model families and flag any dimension where same-family scores exceed cross-family scores by a statistically significant margin.

06

Confidence Miscalibration Masks Uncertainty

What to watch: The judge reports high confidence on biased judgments, making the bias harder to detect. Confidence scores don't correlate with actual accuracy, creating a false sense of audit completeness. Guardrail: Include known-ambiguous test cases in every audit batch. Measure whether the judge's confidence drops appropriately on edge cases. Flag any audit report where confidence remains uniformly high across all difficulty tiers as potentially miscalibrated.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test whether the Judge Bias Detection Prompt reliably identifies systematic scoring patterns before deploying it in an evaluation pipeline. Each criterion targets a specific failure mode in bias audits.

CriterionPass StandardFailure SignalTest Method

Attribute Extraction Completeness

All input attributes specified in [BIAS_DIMENSIONS] are extracted and populated in the audit report for every sample in [EVALUATION_LOG].

Missing attribute values for more than 5% of samples; null or empty fields in the per-dimension breakdown.

Run prompt on a golden dataset with known attribute distributions. Assert that extraction coverage is >= 95% per dimension.

Statistical Test Correctness

The reported test statistic and p-value match a reference implementation (e.g., scipy.stats) for the chosen test in [STATISTICAL_TESTS].

Mismatched test name and statistic; p-value off by more than 0.01 from reference; wrong degrees of freedom.

Compare prompt output against Python reference calculations for 10 pre-computed score-attribute pairs. Require exact match on test name, statistic within 0.001 tolerance.

Severity Classification Accuracy

Each bias dimension is assigned a severity level (none, low, medium, high, critical) consistent with the thresholds defined in [SEVERITY_THRESHOLDS].

Effect size is large but severity is 'none'; p-value is non-significant but severity is 'critical'; inconsistent application of thresholds across dimensions.

Construct 5 synthetic evaluation logs with known effect sizes and p-values. Assert that severity labels match threshold rules exactly.

Confound Detection

The report flags potential confounds when two or more [BIAS_DIMENSIONS] are correlated (e.g., topic and length) and notes this in the interpretation.

High-severity finding reported without checking whether the attribute is confounded with another dimension; no mention of confounding in the limitations section.

Feed a log where topic and response length are artificially correlated. Assert that the output includes a confound warning and recommends stratified analysis.

Directionality Reporting

For each significant finding, the report states which group is disadvantaged (e.g., 'scores are lower for topic X compared to Y') rather than only reporting a difference exists.

Report states 'significant difference detected' without specifying direction; effect size sign is missing or inconsistent with the group comparison.

Use a log with a known direction (e.g., short responses score 0.5 points lower). Assert that the output explicitly names the disadvantaged group and the score delta.

False Positive Control

When [EVALUATION_LOG] contains no systematic bias (scores are independent of all attributes), the report concludes no significant findings and overall severity is 'none'.

Report flags one or more dimensions as 'low' or higher severity when scores are randomly assigned; p-hacking across multiple dimensions without correction.

Run on a synthetic log with 500 randomly scored samples and 5 uncorrelated attributes. Assert that no dimension exceeds 'none' severity after multiple comparison correction.

Recommendation Actionability

Each flagged bias dimension includes at least one concrete recommendation that references a specific mitigation step (e.g., 'add counterexamples for topic X', 'normalize scores by response length').

Recommendations are generic ('review the data', 'investigate further'); no connection to the specific attribute or severity level found.

Review output for 3 known bias patterns. Assert that each recommendation contains a verb, a target (e.g., prompt section, data source), and a measurable outcome.

Output Schema Compliance

The report matches the [OUTPUT_SCHEMA] exactly: all required fields present, correct types, enums match allowed values, no extra fields.

Missing 'overall_assessment' field; severity values outside allowed enum; nested objects flattened incorrectly; extra commentary fields not in schema.

Validate output against the JSON Schema definition. Assert zero schema violations using a standard validator (e.g., jsonschema, pydantic).

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Add strict JSON output schema with per-dimension bias scores, severity levels, and supporting evidence. Include statistical test results (chi-square, t-test, or Mann-Whitney as appropriate). Add confidence intervals and minimum sample size thresholds. Wire in a retry loop for malformed JSON and log every audit run with trace IDs.

code
For each bias dimension in [DIMENSIONS], compute:
- Effect size with 95% confidence interval
- Statistical test result (test type, statistic, p-value)
- Severity classification: NONE | LOW | MEDIUM | HIGH | CRITICAL
- Supporting examples (max 5 per dimension)
- Sample size warning if n < [MIN_SAMPLE_SIZE]

Output as valid JSON matching [OUTPUT_SCHEMA].

Watch for

  • Silent format drift in JSON fields over model version changes
  • p-value fishing without correction for multiple comparisons
  • Missing human review step before acting on HIGH or CRITICAL findings
  • Large scoring logs exceeding context window
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.