This prompt is for RAG pipeline operators and search engineers who are debugging unexpected evidence ranking behavior in production. Use it when a scoring model consistently overranks irrelevant passages, underranks authoritative sources, or produces scores that do not align with human judgment. The prompt takes a batch of scored passages, the original query, and the scoring configuration, then performs a structured audit to identify anomalies, miscalibrated factors, and systematic biases. It is designed for post-hoc diagnosis, not real-time scoring. Run this audit before adjusting scoring weights, retraining rankers, or modifying retrieval logic.
Prompt
Evidence Score Audit Prompt for Pipeline Debugging

When to Use This Prompt
Diagnose unexpected evidence ranking behavior in production RAG pipelines by auditing scored passages for anomalies, miscalibrated factors, and systematic biases.
The ideal user has access to production scoring logs, the original query, the retrieved passage set, and the scoring model's configuration including factor weights, thresholds, and normalization parameters. You should have at least 20 scored passages to establish meaningful patterns. The prompt expects structured input: each passage must include its text, the assigned score, and ideally the per-factor breakdown if your scoring model produces one. Without factor-level detail, the audit can still detect ranking anomalies but cannot isolate which specific weight or signal is miscalibrated. Do not use this prompt for real-time scoring decisions, for evaluating a single passage in isolation, or when you lack access to the scoring configuration that produced the scores under review.
After running the audit, expect a structured output that identifies specific passages where the score appears misaligned with evidence quality, flags systematic patterns such as recency bias overwhelming relevance or authority signals being ignored, and provides root cause hypotheses with recommended remediation steps. The output is designed to feed directly into your scoring model adjustment workflow. Before acting on the audit findings, validate the identified anomalies against a small set of human judgments to confirm the audit's accuracy. Then prioritize remediation based on impact: fix systematic biases first, then address individual passage misrankings that indicate edge cases in your scoring logic.
Use Case Fit
Where the Evidence Score Audit Prompt delivers value and where it introduces risk. This audit prompt is designed for diagnosing systematic scoring failures in production RAG pipelines, not for real-time filtering or initial evidence ranking.
Good Fit: Post-Hoc Pipeline Debugging
Use when: You are investigating unexpected ranking behavior in a live RAG system and need a root cause analysis. Guardrail: Run the audit on a representative sample of scored passages, not on every production request, to control cost and latency.
Bad Fit: Real-Time Evidence Filtering
Avoid when: You need to filter or re-rank evidence before answer generation in a user-facing request path. Guardrail: Use the Evidence Score Audit Prompt offline to calibrate your scoring models, then deploy the fixed scoring logic separately.
Required Inputs: Scored Passages and Factor Weights
What to watch: The audit prompt needs raw scored passages with factor breakdowns, not just final rankings. Guardrail: Ensure your pipeline logs per-factor scores before aggregation, or the audit cannot detect miscalibration at the factor level.
Operational Risk: Audit Prompt Hallucination
What to watch: The audit prompt itself can hallucinate a plausible-sounding root cause that does not match the actual pipeline bug. Guardrail: Treat the audit output as a diagnostic hypothesis, not a confirmed fix. Validate findings against raw score logs and retrieval traces before applying remediation.
Operational Risk: Over-Indexing on a Single Anomaly
What to watch: The audit may highlight one obvious scoring anomaly while missing a systematic bias across the entire retrieval set. Guardrail: Run the audit across multiple query categories and evidence sources. Aggregate findings before concluding the root cause is isolated.
Bad Fit: Pre-Launch Scoring Design
Avoid when: You are designing a new evidence scoring model from scratch and have no production data to audit. Guardrail: Use the Multi-Factor Evidence Weighting Prompt Template for initial design and calibration. Reserve the audit prompt for diagnosing live behavior after deployment.
Copy-Ready Prompt Template
A reusable prompt template for auditing scored evidence passages to detect anomalies, miscalibration, and systematic bias in RAG pipelines.
This template is designed to be dropped directly into your debugging workflow when a retrieval-augmented generation (RAG) pipeline produces unexpected or low-quality answers. Instead of guessing why evidence selection failed, this prompt instructs the model to act as an auditor, systematically examining a batch of scored passages against the original query and the scoring criteria. The output is a structured root cause analysis, not just a new score.
textYou are an evidence scoring auditor for a production RAG pipeline. Your task is to diagnose why the evidence ranking for a given query may have failed. You will receive the original user query, a list of retrieved passages with their assigned scores and the factor breakdowns for those scores, and the scoring rubric that was supposed to be applied. Analyze the provided [SCORED_PASSAGES] against the [QUERY] and the [SCORING_RUBRIC]. Your goal is to identify anomalies, miscalibrations, and systematic biases. For each passage, determine if its score and rank are justifiable. After your per-passage analysis, produce a root cause summary. Classify the primary failure mode into one of the following categories: `factor_miscalibration`, `source_authority_overweighted`, `recency_bias`, `specificity_undervalued`, `query_intent_mismatch`, `score_normalization_error`, or `no_anomaly_detected`. Your final output must be a JSON object conforming to [OUTPUT_SCHEMA]. Do not include any text outside the JSON object. [INPUT] QUERY: [QUERY] SCORING_RUBRIC: [SCORING_RUBRIC] SCORED_PASSAGES: [SCORED_PASSAGES] [OUTPUT_SCHEMA] { "audit_report": { "query": "string", "per_passage_analysis": [ { "passage_id": "string", "assigned_score": number, "assigned_rank": number, "score_justifiable": boolean, "anomaly_detected": boolean, "anomaly_description": "string | null", "miscalibrated_factors": ["string"] } ], "root_cause_analysis": { "primary_failure_mode": "factor_miscalibration | source_authority_overweighted | recency_bias | specificity_undervalued | query_intent_mismatch | score_normalization_error | no_anomaly_detected", "summary": "string", "impacted_passage_ids": ["string"], "remediation_recommendations": ["string"] } } } [CONSTRAINTS] - The `miscalibrated_factors` list must only contain factor names present in the provided [SCORING_RUBRIC]. - If no anomalies are found, `primary_failure_mode` must be `no_anomaly_detected` and `impacted_passage_ids` must be an empty array. - `remediation_recommendations` must be actionable, specific changes to the scoring prompt, weights, or normalization logic, not generic advice.
To adapt this template, start by replacing the [SCORED_PASSAGES] placeholder with a structured JSON array of your retrieved documents, each containing the passage_id, the assigned_score, and a breakdown of the factor scores that produced it. The [SCORING_RUBRIC] should be the exact text of the prompt or logic used to generate those scores, ensuring the audit can detect discrepancies between the rubric's intent and its actual output. The [OUTPUT_SCHEMA] is strict JSON; enforce this in your application layer with a schema validator before acting on the results. For high-stakes debugging, always log the full audit report alongside the original query and scores for later review.
Prompt Variables
Inputs required for the Evidence Score Audit Prompt. Each variable must be populated before invoking the prompt to ensure reliable root cause analysis of ranking anomalies.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[QUERY] | The original user query that triggered the retrieval and ranking pipeline | What are the side effects of drug X? | Check for empty string; ensure query is exactly as received by the retriever, not a rewritten version |
[RANKED_PASSAGES] | The final ordered list of evidence passages with their composite scores and individual factor breakdowns | JSON array of passage objects with id, text, relevance_score, recency_score, authority_score, specificity_score, composite_score | Validate JSON parse succeeds; confirm array length > 0; verify each object contains all expected factor fields |
[SCORING_CONFIG] | The pipeline configuration specifying factor weights, normalization method, and threshold values used during scoring | {"weights": {"relevance": 0.4, "recency": 0.2, "authority": 0.25, "specificity": 0.15}, "normalization": "min-max", "min_threshold": 0.3} | Validate JSON parse succeeds; confirm weights sum to 1.0; check that all factor names match those in RANKED_PASSAGES |
[EXPECTED_ORDERING] | The human-annotated or baseline correct ranking for a subset of passages, used as ground truth for anomaly detection | Array of passage IDs in expected rank order: ["p4", "p1", "p7", "p2"] | Validate array is non-empty; confirm all IDs exist in RANKED_PASSAGES; allow null if no ground truth is available for this query |
[DOMAIN] | The knowledge domain context for calibrating authority and recency expectations | medical, legal, financial, general | Must match one of the predefined domain enums; used to adjust staleness thresholds and authority source-type weights |
[AUDIT_DEPTH] | Controls whether the audit performs a surface-level score check or a deep factor-level root cause analysis | surface, deep | Must be exactly 'surface' or 'deep'; surface mode checks for score anomalies only; deep mode traces anomalies to specific factor miscalibrations |
[OUTPUT_FORMAT] | Specifies the structure of the audit report output | json, markdown_report, inline_annotations | Must be one of the three allowed values; json returns structured machine-readable output; markdown_report returns human-readable findings; inline_annotations returns passages with score corrections appended |
Common Failure Modes
When auditing evidence scores in production, these failure modes surface first. Each card identifies a specific breakdown pattern and the guardrail that catches it before downstream systems act on bad scores.
Score Inflation on Vague Passages
What to watch: Passages with domain-appropriate vocabulary but no specific facts receive high relevance scores because they sound authoritative. The model confuses stylistic alignment with evidentiary value. Guardrail: Add a specificity sub-score requirement. If the specificity rating falls below 0.4, cap the composite score regardless of other factors. Log all capped passages for review.
Recency Override on Evergreen Topics
What to watch: The recency factor dominates composite scores, pushing recent but shallow content above older authoritative sources. Common in medical, legal, and scientific domains where foundational literature matters more than publication date. Guardrail: Implement domain-aware decay configuration. For queries classified as evergreen, reduce recency weight to 10% of the composite score and log when recency would have changed the ranking.
Position Bias in Pairwise Comparisons
What to watch: When using pairwise comparison for evidence ranking, the first passage shown systematically receives higher scores regardless of actual quality. This skews calibration datasets and final rankings. Guardrail: Run each pair in both orders and require score consistency within a 0.15 tolerance. Flag pairs with order-dependent scores for human review or automatic exclusion from calibration data.
Authority Score Collapse on Unknown Sources
What to watch: The authority scorer assigns near-zero scores to legitimate but unrecognized sources such as niche industry publications, regional academic journals, or new research institutions. This silently excludes valid evidence. Guardrail: Separate authority into two signals: institutional recognition and content quality. When institutional recognition is low but content quality signals are strong, flag for human authority review rather than automatic exclusion.
Composite Score Dominance by Single Factor
What to watch: One scoring factor such as relevance overwhelms the weighted composite, making other signals like recency or authority effectively invisible. The aggregated score becomes a disguised single-factor ranking. Guardrail: Run sensitivity analysis on each batch. If any single factor correlates with the final composite above 0.85, log a dominance warning and surface the factor distribution for operator review before downstream consumption.
Threshold Over-Filtering on Ambiguous Queries
What to watch: Configurable score thresholds exclude all passages for queries where evidence is inherently ambiguous or sparse, producing empty retrieval sets when partial evidence would be better than none. Guardrail: Implement a floor threshold that triggers a relaxed re-scoring pass when zero passages survive initial filtering. Log every relaxation event with the original threshold, relaxed threshold, and surviving passage count for threshold tuning.
Evaluation Rubric
Use this rubric to test the Evidence Score Audit Prompt before shipping. Each criterion targets a specific failure mode in pipeline debugging: hallucinated root causes, miscalibration misdiagnosis, and remediation recommendations that don't match the detected anomaly.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Anomaly Detection Accuracy | Audit correctly identifies whether a scoring anomaly exists and classifies its type (miscalibration, bias, outlier) matching the injected fault in the test dataset. | Audit reports no anomaly when a known miscalibration was injected, or misclassifies a recency bias as a relevance failure. | Run against a golden dataset of 20 scored passage sets with known injected anomalies. Require >=90% detection rate and >=85% classification accuracy. |
Root Cause Attribution | Root cause explanation traces the anomaly to a specific scoring factor (relevance, recency, authority, specificity) with a direct reference to the passage content that exposes the error. | Root cause is generic (scoring seems off) or attributes the problem to a factor that is not actually contributing to the anomaly. | For each detected anomaly in the golden dataset, check that the cited root cause factor matches the injected fault. Require exact factor match in >=80% of cases. |
Remediation Actionability | Remediation recommendation includes a concrete, testable change: a specific threshold adjustment, a factor weight change, a decay function parameter, or a re-ranking rule. | Remediation is vague (improve scoring, check weights) or recommends a change that would not actually address the diagnosed root cause. | Have two engineers independently rate each remediation on a 1-5 actionability scale. Require mean score >=4.0 and inter-rater agreement >=0.7. |
Evidence Citation in Audit | Every anomaly claim and root cause statement is backed by a citation to a specific passage ID, score value, or factor breakdown from the input scored-evidence set. | Audit makes claims about score problems without pointing to which passage or which factor value demonstrates the problem. | Parse audit output for citation markers. Require that 100% of anomaly claims have at least one linked passage reference. Flag uncited claims as failures. |
False Positive Control | Audit correctly returns no anomaly found when run against a well-calibrated evidence set with no injected faults. | Audit fabricates an anomaly or over-interprets normal score variance as a systematic problem. | Run against 10 clean scored-evidence sets with human-verified correct scoring. Require false positive rate <=10%. |
Bias Detection Coverage | Audit detects and names systematic biases: position bias, length bias, source-type bias, or recency dominance when these are present in the scored set. | Audit misses a known systematic bias that affects multiple passages in the set, or reports a bias that is not actually present. | Include 5 test sets with known systematic biases injected. Require detection of the correct bias type in >=4 of 5 sets. |
Output Schema Compliance | Audit output is valid JSON matching the expected schema with all required fields present and correctly typed. | Output is missing required fields, uses wrong types, or is not parseable as JSON. | Validate output against the JSON schema defined in the output contract. Require 100% schema compliance across all test runs. |
Confidence Calibration | When the audit expresses uncertainty about a finding, the confidence level correlates with actual correctness: high-confidence findings are more often correct than low-confidence ones. | Audit expresses high confidence in incorrect root cause attributions, or low confidence in obviously correct findings. | Bin audit findings by reported confidence level. Compute accuracy per bin. Require monotonic relationship: higher confidence bins must have equal or higher accuracy. |
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 audit prompt but relax output schema requirements. Use a single model call without retry logic. Focus on getting readable audit narratives rather than structured JSON. Replace [OUTPUT_SCHEMA] with a free-text instruction: Explain what looks wrong with these evidence scores and why.
Watch for
- The model producing vague observations instead of specific score anomalies
- No separation between root cause and remediation suggestions
- Over-auditing: flagging every passage when only a few are miscalibrated
- Missing factor-level analysis when a composite score is wrong but sub-scores look fine

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