Inferensys

Prompt

Rubric for Self-Correction Success Rate Prompt Template

A practical prompt playbook for evaluating the effectiveness of AI self-correction and repair loops in production workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Define when to deploy a rubric for measuring self-correction success in retry and repair loops.

This prompt is for AI engineers and evaluation leads who need to measure whether self-correction attempts actually improve output quality. Use it when you have a retry or repair loop in production and need a repeatable, model-graded rubric to score each correction attempt. The rubric grades whether errors were fixed, whether new errors were introduced, and whether the output degraded. It also defines stopping criteria so your system knows when to stop retrying and escalate. The core job-to-be-done is turning an opaque, iterative repair process into a measurable, automated quality gate that prevents infinite retry loops and silent degradation.

Do not use this prompt for single-pass output evaluation where no correction history exists. It assumes you have the original output, the error or feedback that triggered correction, and the corrected output available for comparison. This prompt is also inappropriate for workflows where the cost of a bad correction is low and a simple retry without evaluation is sufficient. It is designed for high-stakes pipelines—such as code generation, structured data extraction, or compliance document drafting—where each correction attempt must be audited for regression. Before using this prompt, ensure your system logs the full correction chain: the initial output, the validator or human feedback that triggered the repair, and every subsequent correction attempt. Without this trace, the rubric has nothing to grade.

Once you have confirmed that your system captures correction history, use this prompt to generate a rubric that scores each attempt on fix completeness, regression introduction, and quality delta. The resulting rubric should be wired into your retry controller so that the system can decide whether to accept a correction, retry with modified instructions, or escalate to a human. Avoid using this prompt if your retry loop is purely syntactic—such as JSON repair—where deterministic validators are faster and cheaper than an LLM judge.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Self-Correction Success Rate rubric delivers reliable signal—and where it breaks down.

01

Good Fit: Structured Repair Loops

Use when: your system has a defined retry pipeline with a validator, a repair prompt, and a stopping condition. The rubric scores whether each correction attempt actually fixes the error without introducing new ones. Guardrail: Feed the rubric the original output, the validator error message, and the corrected output together so it can compare deltas.

02

Good Fit: Regression Gate for Prompt Changes

Use when: you modify the self-correction prompt and need to verify that repair success rate doesn't degrade. Run the rubric across a golden set of known failure cases before and after the change. Guardrail: Lock the rubric version and judge model during comparison to avoid measurement drift masquerading as quality change.

03

Bad Fit: Open-Ended Creative Refinement

Avoid when: there is no ground-truth validator or the error signal is purely subjective preference. The rubric requires a clear failure definition to score correction success. Guardrail: If you can't write a deterministic validator, use a pairwise preference rubric instead of a self-correction success rate rubric.

04

Bad Fit: Single-Attempt Workflows

Avoid when: your system makes one attempt and stops. The rubric measures correction attempt quality across retries, so it produces meaningless scores without at least one repair cycle. Guardrail: If you only have single-shot outputs, use a direct quality rubric or pass/fail gate instead.

05

Required Input: Validator Error Signal

Risk: without the specific error message that triggered the correction, the rubric judge can't assess whether the repair addressed the right problem. Guardrail: Always include the validator output, error code, or constraint violation description alongside the original and corrected outputs in the evaluation payload.

06

Operational Risk: Correction Loop Exhaustion

Risk: the rubric may score individual attempts well while the overall loop never converges. A system can produce good partial repairs that still fail final validation. Guardrail: Track loop-level metrics (attempts until success, terminal failure rate) alongside per-attempt rubric scores. Set a max retry budget and escalate when exhausted.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template for evaluating self-correction success rates with a structured rubric.

This prompt template instructs an LLM judge to evaluate a sequence of self-correction attempts against a defined rubric. It grades whether each correction fixes the original error, introduces new errors, or degrades output quality. The template is designed to be wired into an automated evaluation harness that tracks correction attempt quality and determines when retries should stop.

text
You are an evaluation judge grading self-correction attempts. Your task is to assess whether a correction attempt successfully resolves a previously identified error without introducing new problems.

## INPUT DATA
- Original Output: [ORIGINAL_OUTPUT]
- Error Description: [ERROR_DESCRIPTION]
- Correction Attempt: [CORRECTION_ATTEMPT]
- Correction Attempt Number: [ATTEMPT_NUMBER]
- Maximum Allowed Attempts: [MAX_ATTEMPTS]
- Domain Context: [DOMAIN_CONTEXT]

## EVALUATION RUBRIC
Score each correction attempt on the following dimensions using a 1-5 scale where 1 is worst and 5 is best:

### 1. Error Resolution (1-5)
- 5: Original error is completely resolved with no residual issues
- 4: Original error is resolved but minor stylistic or formatting differences remain
- 3: Original error is partially resolved; some aspects of the error persist
- 2: Original error is mostly unresolved; only superficial changes made
- 1: Original error is not resolved at all or made worse

### 2. Error Introduction (1-5, inverted scale)
- 5: No new errors introduced; output quality is maintained or improved
- 4: Minor new issues introduced that don't affect core correctness
- 3: One moderate new error introduced that affects non-critical aspects
- 2: Multiple new errors introduced or one significant error
- 1: Correction introduces critical errors worse than the original problem

### 3. Quality Preservation (1-5)
- 5: All original correct content preserved; only error portions changed
- 4: Most correct content preserved; minimal unnecessary changes
- 3: Some correct content unnecessarily modified but intent preserved
- 2: Significant correct content altered or removed unnecessarily
- 1: Output completely rewritten; original correct content lost

### 4. Correction Efficiency (1-5)
- 5: Minimal, targeted change that precisely addresses the error
- 4: Slightly broader change than necessary but still focused
- 3: Moderate scope change; some unnecessary modifications included
- 2: Overly broad correction attempt; significant unrelated changes
- 1: Complete rewrite or irrelevant changes that don't target the error

## STOPPING CRITERIA ASSESSMENT
Based on the scores above, determine if correction should continue:
- CONTINUE: Scores indicate progress; further attempts may succeed
- STOP_SUCCESS: Error resolved (Error Resolution >= 4, Error Introduction >= 4)
- STOP_DEGRADING: Quality is declining (any score <= 2, or scores decreasing across attempts)
- STOP_STALLED: No meaningful progress after [STALL_THRESHOLD] attempts
- STOP_MAX_ATTEMPTS: Maximum attempts reached without resolution

## OUTPUT FORMAT
Return a JSON object with this exact structure:
{
  "attempt_number": integer,
  "scores": {
    "error_resolution": integer (1-5),
    "error_introduction": integer (1-5),
    "quality_preservation": integer (1-5),
    "correction_efficiency": integer (1-5)
  },
  "composite_score": float (average of four dimensions),
  "stopping_decision": "CONTINUE" | "STOP_SUCCESS" | "STOP_DEGRADING" | "STOP_STALLED" | "STOP_MAX_ATTEMPTS",
  "justification": "Brief explanation of scores and stopping decision",
  "new_errors_detected": ["List of new errors introduced, if any"],
  "correction_quality_trend": "IMPROVING" | "STABLE" | "DEGRADING" | "FIRST_ATTEMPT"
}

## CONSTRAINTS
- Score only the correction attempt, not the original output in isolation
- If this is attempt 1, mark correction_quality_trend as "FIRST_ATTEMPT"
- For attempt 2+, compare against previous attempt scores to determine trend
- Flag any safety, compliance, or factual regression as critical (score <= 2 on error_introduction)
- If domain context is provided, apply domain-specific quality expectations

To adapt this template, replace each square-bracket placeholder with your actual data. The [DOMAIN_CONTEXT] field is critical for specialized domains like healthcare or legal where error severity definitions differ. For production use, wire this prompt into a retry loop that feeds the judge's stopping_decision back to your orchestrator. Always log the full score object for later analysis of correction attempt quality trends across your system.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder required by the Rubric for Self-Correction Success Rate prompt template. Validate these inputs before running the judge to prevent scoring errors and ambiguous evaluations.

PlaceholderPurposeExampleValidation Notes

[ORIGINAL_OUTPUT]

The initial model response before any self-correction attempt

The capital of France is London.

Must be non-empty string. Reject if identical to [CORRECTED_OUTPUT] when [ATTEMPT_COUNT] > 0.

[CORRECTED_OUTPUT]

The model response after one or more self-correction attempts

The capital of France is Paris.

Must be non-empty string. If [ATTEMPT_COUNT] is 0, set to null and skip correction quality dimensions.

[ATTEMPT_COUNT]

Number of self-correction attempts applied to produce the corrected output

3

Must be integer >= 0. If 0, only baseline quality dimensions are scored. If > 5, flag for potential loop runaway.

[ERROR_CATEGORY]

The type of error the self-correction loop was attempting to fix

factual_error

Must match one of the predefined enum values: factual_error, format_error, logic_error, completeness_error, refusal_error, tool_misuse. Reject unknown categories.

[GROUND_TRUTH]

Known-correct reference answer or evidence source for factual verification

Paris is the capital of France per CIA World Factbook 2024.

Optional but strongly recommended for factual_error category. If null, factual improvement scoring relies on internal consistency checks only.

[CORRECTION_LOG]

Step-by-step record of what each correction attempt changed

Attempt 1: Changed London to Berlin. Attempt 2: Changed Berlin to Paris.

Optional. If provided, enables per-attempt scoring. If null, only aggregate correction quality is scored. Validate log entries are sequential and non-empty.

[STOPPING_CRITERIA]

Rules that determine when the correction loop should terminate

Stop when output matches ground truth or after 3 attempts.

Must be non-empty string describing explicit stopping conditions. Used to evaluate whether loop termination was appropriate. Reject if criteria are circular or self-referential.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the self-correction success rate rubric into an evaluation pipeline with validation, retries, and human review gates.

This rubric is designed to operate as a post-hoc judge inside an automated evaluation pipeline, not as a real-time guardrail. The typical harness runs after a self-correction loop completes: the original output, the correction attempt, and any error signals or validator feedback are packaged into the [CORRECTION_LOG] input. The LLM judge then scores the correction attempt across the defined dimensions and returns a structured JSON verdict. Because this rubric evaluates a meta-process (the repair attempt itself), the harness must preserve the full chain of evidence—original failure, correction action, and final output—rather than just comparing two static texts.

Pipeline integration follows a standard eval loop pattern. After each self-correction attempt, serialize the attempt into a structured log containing: the original prompt, the initial output, the validator error or failure signal that triggered correction, the correction prompt used, and the final corrected output. Feed this log into the rubric prompt as [CORRECTION_LOG]. The judge returns a JSON object with dimension scores, an overall success classification (successful_correction, partial_fix, degraded_output, new_errors_introduced), and a stopping recommendation. Validation layer: parse the JSON response and validate that all required fields are present, scores fall within the defined scale, and the success classification matches one of the allowed enum values. If validation fails, retry once with a stripped-down prompt that asks only for the missing fields. After two failures, flag the evaluation record for human review rather than silently accepting a malformed score.

Model choice matters for this rubric. The judge must reason about whether a correction fixed the original problem without introducing new errors—a task that requires comparing three states (before, during, after) and detecting subtle regressions. Use a capable model (GPT-4o, Claude 3.5 Sonnet, or equivalent) for the judge role. Avoid using the same model that performed the self-correction as its own judge; self-evaluation bias inflates success rates. Logging and traceability: store the full correction log, the judge's raw response, the parsed scores, and any validation errors in your evaluation database. Tag each record with the prompt version, model IDs for both the worker and judge, and a unique correction attempt ID. This trace is essential for debugging when the rubric reports high success rates but human reviewers disagree.

Human review gates should trigger when: (a) the judge returns degraded_output or new_errors_introduced, (b) the overall success score falls below your calibrated threshold (start at 0.7 on a 0-1 scale and adjust based on your risk tolerance), or (c) the judge's confidence field (if you include one) drops below 0.8. For high-stakes domains like healthcare, legal, or finance, route all partial_fix classifications to human review as well. Calibration step: before trusting this rubric in production, run at least 50 correction attempts through both the LLM judge and a human evaluator. Compute agreement rates per dimension and adjust the rubric's anchor descriptions until Cohen's kappa exceeds 0.7. Recalibrate whenever you change the worker model, the correction strategy, or the underlying task domain.

What to avoid: Don't use this rubric to evaluate corrections in real-time user-facing loops—the judge adds latency and cost that belongs in offline evaluation. Don't treat the judge's scores as ground truth without periodic human spot-checks; judge drift is real, especially as worker model behavior changes. Don't aggregate success rates across different task types; a correction that works for format errors may fail for factual errors, and averaging hides this. Instead, segment your evaluation results by error category (format, factual, instruction-following, tool-use) and track correction success rates separately. Wire these segmented metrics into your eval dashboard with alerts when any category's success rate drops below your baseline.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, types, and validation rules for the judge response when scoring self-correction success rate. Use this contract to parse and validate judge outputs before aggregating scores.

Field or ElementType or FormatRequiredValidation Rule

correction_attempt_id

string

Must match the [ATTEMPT_ID] from the input. Non-empty and present in the request payload.

original_error_category

string (enum)

Must be one of: factual_error, hallucination, instruction_violation, format_error, logical_error, incompleteness, tool_misuse, other. Reject unknown values.

correction_success

boolean

Must be true or false. If null, treat as parse failure and retry judge call.

error_fixed

boolean

Required when correction_success is true. Must be true if the specific original error is resolved. Null allowed when correction_success is false.

new_errors_introduced

integer

Must be a non-negative integer. If greater than 0, new_error_details array must be present and non-empty.

new_error_details

array of objects

Required when new_errors_introduced > 0. Each object must contain error_type (string, enum matching original_error_category values) and description (string, non-empty). Max 10 entries.

output_quality_change

string (enum)

Must be one of: improved, unchanged, degraded, mixed. If degraded and correction_success is true, flag for human review.

stopping_criteria_met

boolean

Must be true or false. If true, stopping_reason must be present. If false, retry_recommended must be present.

stopping_reason

string (enum)

Required when stopping_criteria_met is true. Must be one of: error_resolved, max_retries_exceeded, quality_below_threshold, no_improvement_after_n_attempts, human_escalation_required.

retry_recommended

boolean

Required when stopping_criteria_met is false. Must be true or false. If true, retry_strategy must be present.

retry_strategy

string

Required when retry_recommended is true. Non-empty string describing the suggested correction approach for the next attempt.

confidence_score

float

Must be a float between 0.0 and 1.0 inclusive. If below 0.6, flag the entire correction assessment for human review regardless of other fields.

judge_rationale

string

Non-empty string. Must cite specific evidence from [ORIGINAL_OUTPUT] and [CORRECTED_OUTPUT] to justify correction_success and new_errors_introduced values.

PRACTICAL GUARDRAILS

Common Failure Modes

When grading self-correction attempts, these failures degrade trust in the metric before the first production run. Each card pairs a common breakage with a concrete guardrail.

01

The Correction Loop Makes It Worse

Risk: The model 'corrects' a valid output into an invalid one, or introduces a new error while fixing an old one. This inflates the failure rate and hides the original quality. Guardrail: Include a pre-correction baseline score in the rubric. Require the judge to compare the final output against both the original error and the correction target. Flag any correction that reduces the score.

02

Infinite Retry Without Stopping Criteria

Risk: The rubric only evaluates the final output, ignoring the cost and latency of 5, 10, or 20 correction attempts. A 'successful' correction after 15 retries is a system failure. Guardrail: Add a stopping-criteria dimension to the rubric that penalizes scores when correction attempts exceed a defined budget. Track attempts-per-success as a primary metric alongside the rubric score.

03

Judge Rewards Superficial Fixes

Risk: The rubric overweights surface-level changes (e.g., formatting, word count) and misses that the underlying logic or factual claim remains broken. The success rate looks high, but the output is still wrong. Guardrail: Weight substantive dimensions (correctness, groundedness) higher than format dimensions in the aggregated score. Include a 'masked error' check that tests whether the core error was actually resolved.

04

Context Collapse Across Attempts

Risk: The correction prompt accumulates previous errors, partial fixes, and judge feedback into a long context window. The model loses track of the original user intent and optimizes for pleasing the judge instead. Guardrail: Include an instruction-adherence dimension that checks the final output against the original user request, not just the correction instructions. Deduct points if the output drifts from the original intent.

05

Unscored Abstention or Refusal

Risk: The model 'corrects' an error by refusing to answer, returning an empty response, or outputting a generic disclaimer. The rubric counts this as a successful correction because the original error is gone, but the user gets nothing useful. Guardrail: Add a 'utility preservation' dimension. Score abstentions and refusals as failures unless the original task was unsafe. Require the judge to distinguish between error removal and value removal.

06

Judge and Corrector Collusion

Risk: Using the same model as both the corrector and the judge creates a self-reinforcing loop. The judge learns to accept the corrector's style of fixes, and the corrector learns to produce fixes the judge likes, masking real quality issues. Guardrail: Use a separate model or a structurally different prompt for judging versus correcting. Periodically cross-validate with human evaluators to detect judge-corrector drift.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the self-correction success rate judge's output quality before relying on it in production. Each row defines a pass standard, a failure signal, and a test method.

CriterionPass StandardFailure SignalTest Method

Score Validity

Output score is an integer within the defined [SCORING_SCALE] range

Score is missing, null, or outside the min-max bounds

Parse output; assert score is integer and min <= score <= max

Justification Presence

Justification field is non-empty string when [REQUIRE_JUSTIFICATION] is true

Justification is empty, null, or missing entirely

Assert field exists and length > 0 when justification is required

Correction Attempt Count Match

Reported attempt count equals the number of [CORRECTION_ATTEMPTS] provided in input

Count mismatch between input attempts and judge's reported count

Count input attempts; assert judge output count matches exactly

Error Resolution Classification Accuracy

Judge correctly labels each attempt as 'resolved', 'partial', 'new_error', or 'unchanged' per [ERROR_TAXONOMY]

Classification contradicts the before/after evidence in the attempt

Spot-check 20 labeled attempts against human review; require >= 90% agreement

Degradation Detection

Judge flags degradation when corrected output introduces errors absent in original

Judge scores correction as 'resolved' when new errors are present

Inject known degradation cases; assert judge returns 'new_error' or 'partial' not 'resolved'

Stopping Criteria Adherence

Judge recommends 'stop' when [MAX_ATTEMPTS] reached without resolution or when degradation occurs

Judge recommends 'continue' after max attempts or when output quality is declining

Test with terminal scenarios; assert recommendation equals 'stop'

Output Schema Compliance

Response is valid JSON matching [OUTPUT_SCHEMA] with all required fields present

Response is not parseable JSON or missing required fields

Validate against JSON Schema; assert no schema violations

Confidence Alignment

Confidence score is low (< 0.7) when attempts show ambiguous or borderline results

Confidence is high (> 0.9) for clearly ambiguous or contradictory correction evidence

Test with borderline cases; assert confidence < 0.7

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base rubric template but relax the scoring scale to a simple 3-point scale (Failed / Partial / Successful). Remove the stopping-criteria definitions and focus only on classifying whether the correction attempt improved, degraded, or left the output unchanged. Use a single LLM judge call without retry logic.

Watch for

  • Overly generous scoring when the correction introduces subtle new errors
  • No tracking of correction attempt count, making it impossible to measure efficiency
  • Missing comparison against the original output baseline
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.