Inferensys

Prompt

Feedback Signal Correlation Prompt for Model Behavior

A practical prompt playbook for correlating explicit and implicit user feedback signals with model behavior captured in production traces. Produces a correlation matrix with statistical confidence notes and requires ground-truth validation against a labeled dataset.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
PROMPT PLAYBOOK

When to Use This Prompt

Identify when to use the Feedback Signal Correlation Prompt to connect user feedback signals with production trace patterns for systemic failure analysis.

This prompt is designed for AI product teams, quality engineers, and observability engineers who need to move beyond treating each user report as an isolated incident. The core job-to-be-done is connecting explicit and implicit user feedback signals—such as thumbs down, manual corrections, session abandonment, or direct complaints—to specific model behaviors recorded in production traces. The output is a correlation matrix that links feedback types to trace patterns, enabling teams to identify systemic failures like a recurring retrieval gap or a brittle prompt instruction that fails under specific conditions. This is a batch analysis workflow, not a real-time diagnostic tool.

Use this prompt when you have a collection of user sessions with associated feedback signals and corresponding production traces that capture the full request context: model inputs, outputs, tool calls, retrieval steps, and state transitions. You must also have a labeled ground-truth dataset to validate the correlation output. Without ground-truth labels, the prompt's statistical confidence notes become unreliable, and you risk confirming spurious correlations. The prompt expects structured input that maps each session ID to its feedback type, trace data, and any known root-cause labels for evaluation. If your traces are incomplete or missing key spans like retrieval calls or tool arguments, the correlation analysis will have blind spots.

Do not use this prompt for real-time alerting or single-session diagnosis. For live debugging of a specific user complaint, use the User Feedback to Trace Mapping Prompt to isolate the exact trace events. For deep-dive analysis of one negative session, use the Negative Feedback Trace Deep-Dive Prompt. This prompt is optimized for aggregate pattern detection across multiple sessions. Also avoid using it when your feedback signals are too sparse to form meaningful clusters—correlation analysis requires a minimum volume of similar feedback events to produce statistically useful output. If you are unsure whether the pattern is real or noise, run the Feedback Cluster to Trace Pattern Matching Prompt first to validate that your feedback clusters have enough density.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Feedback Signal Correlation Prompt adds value and where it falls short. Use this to decide whether the prompt fits your current workflow before investing in integration.

01

Good Fit: Post-Deployment Feedback Triage

Use when: You have production traces and explicit feedback signals (thumbs down, corrections, abandonment) that need systematic correlation. Guardrail: The prompt excels at pattern matching across structured trace data and feedback types, but requires both data sources to be complete and timestamp-aligned before execution.

02

Bad Fit: Real-Time Intervention

Avoid when: You need to intercept and correct model behavior during an active session. Guardrail: This prompt is designed for post-hoc analysis of completed traces. For real-time correction, use a guardrail or policy-enforcement prompt that operates on the live request, not a retrospective correlation.

03

Required Inputs: Labeled Feedback and Raw Traces

What to watch: The prompt cannot infer feedback signals from traces alone. Guardrail: You must supply explicit feedback labels (thumbs down, correction event, session abandonment) paired with the corresponding trace spans. Missing or inferred feedback labels produce unreliable correlations and should be flagged before the prompt runs.

04

Operational Risk: False Attribution to Model Behavior

What to watch: The correlation matrix may attribute feedback to model behavior when the root cause is a retrieval gap, tool timeout, or infrastructure failure. Guardrail: Always validate the prompt's output against a labeled ground-truth dataset. Require statistical confidence notes on each correlation and flag low-confidence attributions for human review before acting on them.

05

Operational Risk: Feedback Signal Sparsity

What to watch: Low feedback volume produces statistically meaningless correlations. Guardrail: Set a minimum feedback threshold before running the prompt. If the sample size is below the threshold, the prompt should return an insufficient-data warning instead of producing a misleading correlation matrix. Log this as a non-actionable result.

06

Integration Point: Eval Pipeline and Prompt Repair Loop

Use when: You want to close the loop between user feedback and prompt improvement. Guardrail: Feed the prompt's correlation output into a defect-detection prompt that identifies specific instruction violations. Require human review of any suggested prompt rewrite before deployment. Never auto-apply prompt changes from correlation data alone.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt template for correlating user feedback signals with model behavior captured in traces, producing a statistical correlation matrix with confidence scores.

This prompt template is designed to be copied directly into your AI harness and adapted with your specific feedback taxonomy, trace event categories, and session datasets. It instructs the model to act as an observability analyst, systematically linking user feedback signals to trace patterns and producing a structured JSON output that can be ingested by downstream monitoring dashboards, alerting systems, or automated remediation pipelines. The template includes placeholders for all required inputs, statistical thresholds, and output constraints, making it suitable for both ad-hoc investigation and automated batch processing of production traces.

text
You are an observability analyst specializing in AI system diagnostics. Your task is to correlate user feedback signals with model behavior captured in production traces. You will receive a dataset of user sessions, each containing a feedback signal and a corresponding trace. You must produce a correlation matrix that links feedback types to trace patterns, with statistical confidence notes.

## INPUT DATA

### Feedback Taxonomy
[FEEDBACK_TAXONOMY]

### Trace Event Categories
[TRACE_EVENT_CATEGORIES]

### Session Dataset
[SESSIONS_DATASET]

### Ground-Truth Labeled Dataset (for validation only, do not train on this)
[GROUND_TRUTH_DATASET]

## INSTRUCTIONS

1. For each session in the dataset, extract the feedback signal and classify it according to the provided feedback taxonomy.
2. For each session, identify the trace events that occurred within the session window and classify them according to the provided trace event categories.
3. Build a correlation matrix where rows are feedback types and columns are trace event categories. Each cell contains the count of sessions where that feedback type co-occurred with that trace event category.
4. For each cell in the matrix, compute a statistical confidence score using the following method: calculate the pointwise mutual information (PMI) between the feedback type and the trace event category, normalized to a 0-1 scale where 1 indicates strong positive correlation and 0 indicates no correlation above chance.
5. Flag any cell where the correlation is statistically significant (PMI > [SIGNIFICANCE_THRESHOLD]) but the session count is below [MINIMUM_SESSION_COUNT]. These are low-confidence correlations that require more data.
6. Compare your correlation matrix against the ground-truth labeled dataset. Report precision, recall, and F1 score for the top [TOP_N] correlations.
7. Identify any feedback types that do not correlate with any trace event category above the significance threshold. These may indicate feedback signals that are not captured by the current trace instrumentation.

## OUTPUT FORMAT

Return a valid JSON object conforming to the output contract specified below. Do not include any text outside the JSON object.

## CONSTRAINTS

- Do not invent feedback signals or trace events not present in the input data.
- Do not report correlations with fewer than [MINIMUM_SESSION_COUNT] sessions as actionable.
- If the ground-truth dataset contains fewer than [MINIMUM_GROUND_TRUTH_SAMPLES] labeled examples, include a warning in the output and reduce confidence scores accordingly.
- All confidence scores must be accompanied by the computation method used.

To adapt this template for your production environment, replace each square-bracket placeholder with your actual data and configuration values. The [FEEDBACK_TAXONOMY] should be a structured list of feedback types you track, such as thumbs_down, correction, abandonment, or escalation. The [TRACE_EVENT_CATEGORIES] should map to the event types your instrumentation captures, like tool_call_failure, retrieval_empty, refusal_triggered, or latency_spike. The [SESSIONS_DATASET] must be a JSON array of session objects, each containing a session_id, feedback_signal, and trace_events array. Set [SIGNIFICANCE_THRESHOLD] to a value like 0.3 for initial exploration and tighten to 0.5 or higher for production alerting. Set [MINIMUM_SESSION_COUNT] to at least 10 to avoid acting on noise, and [MINIMUM_GROUND_TRUTH_SAMPLES] to 50 for reliable validation. Before deploying this prompt into an automated pipeline, validate the output JSON against a schema that enforces the expected structure, and log any parse failures for human review. For high-stakes decisions—such as triggering a prompt rollback or blocking a model version—require human approval on the correlation report before action is taken.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. Validate each before running the correlation.

PlaceholderPurposeExampleValidation Notes

[FEEDBACK_SIGNAL]

The explicit or implicit user feedback event to correlate

{"type": "thumbs_down", "turn_index": 4, "timestamp": "2025-01-15T10:23:00Z"}

Must be a valid JSON object with a 'type' field. Allowed types: thumbs_up, thumbs_down, correction, abandonment, regrade. Reject if type is missing or unrecognized.

[TRACE_DATA]

The full production trace for the session containing the feedback event

[{...trace span objects...}]

Must be a valid JSON array of trace spans. Each span requires trace_id, span_id, start_time, and end_time. Reject if the array is empty or missing required fields.

[SESSION_METADATA]

Contextual information about the user session

{"session_id": "sess_abc123", "user_id": "user_xyz", "model_version": "gpt-4o-2024-08-06", "prompt_version": "v2.3.1"}

Must include session_id and model_version. user_id is optional but recommended. Reject if session_id is missing or not a string.

[LABELED_DATASET]

Ground-truth dataset for statistical validation of correlation claims

[{"trace_id": "...", "feedback_type": "thumbs_down", "root_cause": "retrieval_gap"}]

Must be a valid JSON array. Each entry requires trace_id, feedback_type, and root_cause. Reject if fewer than 50 labeled examples are provided for statistical significance.

[CORRELATION_THRESHOLD]

Minimum confidence score required to assert a correlation

0.85

Must be a float between 0.0 and 1.0. Default is 0.85. Reject if value is outside range or not a number. Lower thresholds increase false-positive risk.

[OUTPUT_SCHEMA]

The expected structure for the correlation matrix output

{"correlations": [...], "confidence_scores": {...}, "evidence_links": [...]}

Must be a valid JSON Schema object. Reject if schema is missing required fields: correlations, confidence_scores, evidence_links. Validate that evidence_links reference valid trace span IDs.

[TIME_WINDOW]

The time range to consider for feedback-to-trace correlation

{"start": "2025-01-15T10:20:00Z", "end": "2025-01-15T10:25:00Z"}

Must be a valid JSON object with ISO 8601 start and end timestamps. Window must be between 1 second and 24 hours. Reject if start is after end or window exceeds 24 hours.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Feedback Signal Correlation Prompt into a production batch workflow with validation, retries, and human review gates.

This prompt is designed to run as a scheduled batch job, not a real-time API call. Wire it into a workflow that pulls session data from your observability store, runs the correlation, and writes the output to a dashboard or alerting system. The batch design is intentional: feedback signals accumulate over hours or days, and correlation requires enough session volume to produce statistically meaningful results. Running this prompt on every new feedback event would produce noisy, low-confidence correlations that waste engineering time.

Pre-processing requirements are critical before the prompt sees any data. First, normalize all feedback signals to your taxonomy—free-text feedback must be classified by a separate triage prompt before correlation. Second, flatten and categorize trace events so nested spans are reduced to their parent event category. Third, deduplicate sessions: a single user session with multiple feedback signals should be split into separate rows or the dominant signal selected. These steps prevent the model from correlating against inconsistent or duplicate data, which is the most common cause of false-positive correlations in production.

Post-processing starts with parsing the JSON output and validating it against the output contract schema. If the model returns a low-confidence warning due to insufficient ground-truth data, route the results for human review before publishing to any dashboard. Store the correlation matrix with a timestamp and the prompt version used—this enables trend analysis over time and makes it possible to detect when a prompt version change alters correlation behavior. Without versioned storage, you cannot distinguish a real behavioral shift from a measurement artifact.

Retry logic must handle two distinct failure modes. If the model returns malformed JSON, retry once with a stricter output format instruction that emphasizes valid JSON and the exact schema. If the second attempt fails, log the raw output and escalate to the on-call channel—do not silently drop the batch. If the model reports correlations that violate the minimum session count constraint, discard those correlations and flag the session count validation logic for review. This usually indicates a pre-processing bug where sessions were not properly deduplicated or counted.

Human review gates are mandatory for two scenarios. Any correlation flagged as statistically significant but below the minimum session count must be reviewed by a human before being treated as a signal—small sample sizes produce spurious correlations that look compelling but vanish with more data. If the ground-truth validation F1 score is below 0.7, the entire correlation matrix should be reviewed before product decisions are made. A low F1 score means the prompt is finding patterns that do not match your labeled ground truth, and acting on those patterns will lead to wasted engineering effort on false root causes.

Model choice matters for this workflow. Use a model with strong JSON output capabilities and a context window large enough to hold the full session-feedback dataset. If your dataset exceeds the context window, batch the sessions into groups of 50-100 and run the prompt on each group, then merge the correlation matrices with a weighted average. Do not truncate sessions to fit the window—truncation introduces sampling bias that invalidates the statistical confidence notes. For high-volume production systems, consider running this prompt daily on the previous day's sessions and weekly on a larger rolling window to catch slow-emerging patterns.

IMPLEMENTATION TABLE

Expected Output Contract

The Feedback Signal Correlation Prompt must return a valid JSON object with the following structure. Validate each field before downstream consumption. Reject or repair any response that does not conform to this contract.

Field or ElementType or FormatRequiredValidation Rule

correlation_matrix

Array of objects

Must be a non-empty array. Each object must have the keys 'feedback_type', 'trace_pattern', 'correlation_score', and 'confidence_interval'.

correlation_matrix[].feedback_type

String (enum)

Must match one of the allowed feedback types: 'thumbs_down', 'correction', 'abandonment', 'negative_rating', 'escalation'. Case-sensitive.

correlation_matrix[].trace_pattern

String

Must be a non-empty string describing the trace pattern. Must reference at least one specific trace span type (e.g., 'tool_call', 'retrieval', 'generation', 'routing').

correlation_matrix[].correlation_score

Number (float)

Must be a float between -1.0 and 1.0 inclusive. Values outside this range indicate a parsing error or model hallucination.

correlation_matrix[].confidence_interval

Array of two numbers

Must be an array of exactly two floats [lower_bound, upper_bound] where lower_bound <= upper_bound. Both values must be between -1.0 and 1.0.

statistical_confidence_notes

String

Must be a non-empty string. Must include a statement about sample size or data limitations. If sample size is unknown, must explicitly state 'sample size not provided'.

ground_truth_validation

Object

Must contain the keys 'labeled_dataset_used', 'validation_method', and 'validation_score'. If no labeled dataset was used, 'labeled_dataset_used' must be false and 'validation_score' must be null.

ground_truth_validation.labeled_dataset_used

Boolean

Must be true or false. If true, 'validation_method' and 'validation_score' must contain concrete values. If false, 'validation_score' must be null.

PRACTICAL GUARDRAILS

Common Failure Modes

When correlating user feedback with model traces, these failure modes surface first. Each card explains what breaks, why it breaks, and how to guard against it before shipping the prompt into production.

01

False-Positive Trace Attribution

What to watch: The prompt blames a specific trace event for the user's feedback, but the real cause is in a different span or an earlier turn. This happens when the model latches onto the most visible error rather than the root cause. Guardrail: Require the prompt to list candidate causes with confidence scores, not a single attribution. Validate against a labeled dataset where the true cause is known, and flag any correlation where confidence exceeds accuracy.

02

Feedback Signal Misclassification

What to watch: The prompt treats all negative feedback as equivalent, conflating a thumbs-down on tone with a correction for factual error. Implicit signals like abandonment are especially prone to misinterpretation. Guardrail: Define a strict feedback taxonomy in the prompt with mutually exclusive categories. Include a 'cannot determine' option. Run eval checks where human reviewers have labeled the true feedback type and measure precision per category.

03

Correlation Without Causation

What to watch: The prompt finds a trace pattern that co-occurs with negative feedback and reports it as causal, even when the pattern is present in successful sessions too. This produces misleading correlation matrices that drive unnecessary prompt rewrites. Guardrail: Require the prompt to compare the frequency of the pattern in negative-feedback sessions versus positive-feedback sessions. Include a statistical note when the difference is not significant. Validate against a balanced dataset.

04

Incomplete Trace Coverage

What to watch: The prompt analyzes only the final model response span and ignores tool-call failures, retrieval gaps, or state corruption in earlier turns. The reported correlation misses the upstream cause entirely. Guardrail: Explicitly instruct the prompt to walk the full trace DAG from entry to exit before forming conclusions. Add a completeness check that verifies every span type in the trace is referenced in the analysis output.

05

Overconfident Ground-Truth Claims

What to watch: The prompt asserts that a trace event 'caused' the feedback without qualifying the strength of evidence. This is dangerous when the output feeds automated fix pipelines or rollback decisions. Guardrail: Require the prompt to output a confidence score and an evidence-strength label for each correlation. Human review is mandatory for any correlation that would trigger a prompt change or model rollback. Never auto-apply fixes from unverified correlations.

06

Session Boundary Confusion

What to watch: The prompt mixes trace events from different user sessions or includes stale context from a prior session when the user's feedback applies only to the current one. This produces correlation matrices that span unrelated events. Guardrail: Enforce strict session-ID scoping in the prompt instructions. Include a pre-processing step that filters traces to a single session before correlation begins. Validate that no cross-session event leakage occurs in eval runs.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks on a held-out dataset of [TRACE_EVENT] and [USER_FEEDBACK] pairs that were not used for prompt development. Each criterion validates a specific dimension of the correlation output before shipping.

CriterionPass StandardFailure SignalTest Method

Feedback-to-Trace Mapping Accuracy

At least 90% of [FEEDBACK_SIGNAL] entries are mapped to the correct [TRACE_SPAN_ID] in the ground-truth dataset.

Mapped span ID does not match the labeled span ID; feedback is attributed to an unrelated tool call or retrieval step.

Compare prompt output span IDs against a labeled validation set. Compute precision and recall per feedback type.

Correlation Matrix Completeness

Every [FEEDBACK_TYPE] present in the input appears in the output correlation matrix with a non-null [TRACE_PATTERN].

A feedback type from the input is missing from the matrix; a row contains null or empty trace pattern.

Parse the output JSON. Assert that the set of feedback types in the matrix equals the set in the input. Check for null fields.

Statistical Confidence Note Validity

Every [CONFIDENCE_NOTE] references a real count or rate from the input data, not a fabricated number.

Confidence note cites a sample size or percentage not present in the input; note uses qualitative language without supporting counts.

Extract all numeric claims from confidence notes. Cross-reference each claim against the input trace and feedback counts.

Trace Pattern Specificity

Each [TRACE_PATTERN] describes a concrete, observable sequence of events (e.g., 'tool_timeout followed by empty_context'), not a vague category.

Trace pattern is a generic label like 'bad response' or 'error'; pattern does not reference specific tool names, event types, or span attributes from the trace.

Check that each pattern string contains at least one trace event type or tool name from the input schema. Flag patterns shorter than 3 words.

Ground-Truth Alignment

At least 85% of high-confidence correlations (confidence >= 0.8) match the labeled ground-truth causal relationship.

A high-confidence correlation asserts a causal link that the labeled dataset marks as unrelated or spurious.

Filter outputs where confidence >= 0.8. Compare the asserted feedback-to-pattern link against the labeled causal column. Compute agreement rate.

Output Schema Compliance

The output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys.

Output is missing required fields such as correlation_matrix or evidence_summary; output contains extra keys not in the schema; JSON is malformed.

Validate output against the JSON Schema definition. Reject on schema validation errors. Check for required field presence.

False-Positive Correlation Flagging

The prompt correctly flags correlations with confidence below [CONFIDENCE_THRESHOLD] as 'tentative' and recommends human review.

A low-confidence correlation is presented as definitive; no human-review flag appears on a correlation with confidence below threshold.

Set [CONFIDENCE_THRESHOLD] to 0.7. Assert that every correlation with confidence < 0.7 has review_flag set to true.

Evidence Excerpt Grounding

Every correlation includes at least one [EVIDENCE_EXCERPT] that is a verbatim substring from the input trace or feedback text.

Evidence excerpt is a paraphrase or summary not present in the input; excerpt is hallucinated; excerpt field is empty on a non-tentative correlation.

For each evidence excerpt, perform an exact substring search against the concatenated input trace and feedback text. Flag any excerpt with zero matches.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a smaller labeled dataset (50–100 sessions) and lighter validation. Replace [LABELED_DATASET] with a CSV of feedback labels and trace IDs. Drop the statistical confidence section and focus on pattern discovery.

Watch for

  • Overfitting to small sample sizes
  • Missing schema checks on the correlation matrix
  • False positives from unrepresentative feedback samples
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.