Inferensys

Prompt

Pronoun Resolution Prompt Template

A practical prompt playbook for using Pronoun Resolution Prompt Template in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done for pronoun resolution in multi-turn chat, the ideal user, required context, and clear boundaries for when this prompt is not the right tool.

This prompt is designed for a single, high-leverage task: transforming a user's follow-up question that contains an ambiguous pronoun into a self-contained, fully resolved utterance. The core job-to-be-done is to substitute a pronoun like 'it', 'they', or 'its' with the correct antecedent from the dialogue history. For example, if a user previously asked about 'order #12345' and follows up with 'What is its status?', this prompt should output 'What is the status of order #12345?'. The ideal user is a chat assistant builder or AI engineer who needs to sanitize user turns before they reach downstream systems like NLU classifiers, RAG retrieval pipelines, or tool-calling functions that require explicit entity mentions to operate correctly. This is a pre-processing step that makes multi-turn conversation possible without forcing users to repeat entity names in every message.

To use this prompt effectively, you must provide the full dialogue history as [CONTEXT] and the current user turn as [INPUT]. The prompt is optimized for short-to-medium conversation histories, typically under 10 turns, where the antecedent is a named entity, a product, a ticket ID, or a similarly concrete referent from the immediately preceding turns. It works best when the dialogue is between a single user and an assistant, and the pronoun has a clear, unambiguous antecedent in the text. The output should be a single string: the resolved utterance. You can wire this into your application as a lightweight pre-call transformation, running it before any retrieval, classification, or tool-selection step. For production systems, you should validate the output by checking that the resolved entity actually appears in the dialogue history and that the pronoun's gender and number agree with the substituted antecedent.

Do not use this prompt for long-document coreference resolution, where the antecedent might be paragraphs or pages away and requires a dedicated coreference model. It is also not suitable for cross-session entity linking, where a user refers to an entity from a conversation that happened days ago and is stored in a CRM or knowledge base. For that, you need a retrieval-augmented entity linker, not a pronoun resolver. Additionally, avoid using this prompt to resolve references to visual elements in a UI, such as 'click the red button', where the antecedent is a pixel region, not a text span. If the dialogue history contains multiple plausible antecedents for a pronoun, this prompt may resolve incorrectly or with low confidence. In such cases, you should pair it with a clarification question generator or an unresolved reference flagging system to avoid guessing in high-stakes domains like healthcare or finance. The next step after understanding this use case is to copy the prompt template, adapt the placeholders to your dialogue format, and run it against a golden test set of ambiguous turns to measure resolution accuracy before integrating it into your pipeline.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Pronoun Resolution Prompt Template is the right tool for your current task and to understand the operational risks before you integrate it.

01

Good Fit: Multi-Turn Chat Assistants

Use when: You are building a chat assistant or copilot that must maintain context across multiple turns. The prompt excels at resolving 'it', 'he', 'she', 'they', and 'this' against a provided dialogue history. Guardrail: Always supply a structured dialogue history with speaker labels and turn indices. The model cannot resolve references it cannot see.

02

Bad Fit: Single-Turn, Isolated Queries

Avoid when: The user's input is a standalone question with no prior conversation. Applying a reference resolution prompt to a single turn introduces unnecessary latency and can cause the model to hallucinate a non-existent antecedent. Guardrail: Implement a pre-check that counts turns. If the session has only one turn, bypass the resolver and pass the utterance directly to downstream intent or RAG pipelines.

03

Required Inputs: Structured Dialogue History

Risk: The prompt will fail silently or guess if given a raw, unstructured text blob of the conversation. It needs to know who said what and when. Guardrail: The mandatory input is a JSON array of turns, each with a speaker and utterance field. A turn_id is strongly recommended for precise grounding in the output. Do not pass a single concatenated string.

04

Operational Risk: Gender and Number Disagreement

Risk: The model may resolve a pronoun to an entity that matches syntactically but violates real-world gender or number constraints (e.g., resolving 'she' to a male-coded name). This is a top cause of user trust erosion. Guardrail: Add a post-resolution validation step. Check the resolved entity's stored properties (like gender or type) against the pronoun. If they conflict, flag for human review or trigger a targeted clarification question.

05

Operational Risk: Entity Confusion in Long Sessions

Risk: In sessions with many entities of the same type (e.g., multiple error codes, several people), the model may swap one for another, especially after many turns. Guardrail: Implement a staleness check. If a candidate referent was last mentioned more than N turns ago, reduce its salience score. Pair this with a multi-entity tracking grid that assigns unique IDs to each entity at first mention to prevent identity swaps.

06

Bad Fit: Real-Time, Sub-Second Latency Budgets

Avoid when: Your application requires a response in under 200ms and you cannot afford an extra model round-trip. Adding a dedicated resolution step increases latency. Guardrail: For strict latency budgets, consider a hybrid approach. Use a fast, rules-based resolver for simple cases (e.g., regex for 'it' referring to the last-mentioned object) and escalate only complex, ambiguous pronouns to the LLM prompt. This keeps the common case fast.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready template for resolving ambiguous pronouns in multi-turn dialogue by substituting the correct antecedent from conversation history.

This template is designed to be dropped directly into your application's prompt assembly pipeline. It instructs the model to analyze the current user utterance against a provided dialogue history, identify any ambiguous pronouns, and return a fully resolved utterance. The core logic forces the model to ground its resolution in the provided history and to signal when resolution is impossible, preventing silent failures in production.

text
You are a precise reference resolution engine. Your task is to resolve ambiguous pronouns in the [CURRENT_UTTERANCE] by identifying their correct antecedents from the [DIALOGUE_HISTORY].

### CONSTRAINTS
- [CONSTRAINTS]

### DIALOGUE HISTORY
[DIALOGUE_HISTORY]

### CURRENT UTTERANCE
[CURRENT_UTTERANCE]

### RESOLUTION RULES
1. Identify all personal pronouns (he, she, they, it), possessive pronouns (his, her, their, its), and demonstrative pronouns (this, that, these, those) in the [CURRENT_UTTERANCE].
2. For each pronoun, find the most recent, grammatically compatible entity in the [DIALOGUE_HISTORY]. Prioritize entities that match in number (singular/plural) and, where known, gender.
3. If a pronoun cannot be confidently resolved to a single entity in the history, do not guess. Flag it as 'UNRESOLVED'.
4. Replace each pronoun in the [CURRENT_UTTERANCE] with its resolved entity name in square brackets, e.g., '[the red Honda Civic]'. Keep the rest of the utterance unchanged.

### OUTPUT FORMAT
Return a valid JSON object with the following keys:
{
  "resolved_utterance": "The final utterance with pronouns replaced by bracketed antecedents.",
  "unresolved_references": ["list of pronouns that could not be resolved"],
  "resolution_map": [{"pronoun": "it", "antecedent": "the red Honda Civic", "turn_index": 2}]
}

To adapt this template, replace the placeholders with your application's data. [DIALOGUE_HISTORY] should be a serialized list of prior turns, ideally with speaker labels and turn indices. [CURRENT_UTTERANCE] is the raw user input. Use [CONSTRAINTS] to inject domain-specific rules, such as 'Only resolve references to product SKUs' or 'Prioritize entities mentioned in the last 3 turns.' The resolution_map in the output is critical for logging and debugging; it creates an auditable link between the model's decision and the evidence in the history. Before deploying, test this prompt with a golden dataset that includes cases of gender mismatch, entity-type confusion, and unresolvable references to ensure the model respects the 'do not guess' rule.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the pronoun resolution prompt. Each placeholder must be populated from dialogue state or upstream processing before the prompt is assembled. Missing or malformed inputs are the most common cause of silent resolution failures.

PlaceholderPurposeExampleValidation Notes

[CURRENT_UTTERANCE]

The user turn containing the pronoun or ambiguous reference to resolve

and what did she say about it?

Must be a non-empty string. Check for ASR artifacts if sourced from voice. Reject if only whitespace or punctuation.

[DIALOGUE_HISTORY]

Prior turns formatted as speaker-labeled utterances, newest first

USER: I spoke with Dr. Chen yesterday. ASSISTANT: What did Dr. Chen recommend?

Must contain at least 2 turns. Validate that speaker labels are consistent. Truncate to last N turns if context budget is exceeded.

[ENTITY_CATALOG]

Structured list of candidate referents extracted from dialogue history with entity type, gender, number, and last-mentioned turn

[{"id":"e1","name":"Dr. Chen","type":"PERSON","gender":"unknown","number":"singular","last_turn":2}]

Must be valid JSON array. Each entry requires id, name, and type fields. Null allowed for gender if unknown. Validate no duplicate ids.

[PRONOUN_INVENTORY]

Target pronouns the resolver should detect, mapped to agreement features

{"she":{"gender":"feminine","number":"singular","animacy":"animate"},"it":{"gender":"neuter","number":"singular","animacy":"inanimate"}}

Must be valid JSON object. Keys must be lowercase pronoun forms. Validate that agreement features include gender and number at minimum.

[RESOLUTION_POLICY]

Instruction for handling ambiguous cases: prefer-recent, prefer-salient, require-clarification, or abstain

require-clarification

Must match one of the allowed enum values. Default to require-clarification for high-stakes domains. Reject unknown policy values.

[CLARIFICATION_BUDGET]

Maximum number of clarification turns allowed before the resolver must escalate or guess

2

Must be a positive integer. Validate range 0-5. Set to 0 for no-clarification mode. Log warning if budget is exhausted in session.

[OUTPUT_SCHEMA]

Expected JSON structure for the resolved output including resolved_utterance, antecedent_id, confidence, and clarification_needed fields

{"resolved_utterance":"string","antecedent_id":"string|null","confidence":0.0-1.0,"clarification_needed":true|false,"clarification_question":"string|null"}

Must be a valid JSON Schema or example structure. Validate that resolved_utterance is always populated. antecedent_id must match an id from ENTITY_CATALOG or be null.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the pronoun resolution prompt into a production chat pipeline with validation, retries, and state management.

The pronoun resolution prompt is not a standalone component. It sits inside a larger dialogue pipeline, typically between the turn intake layer and the downstream NLU or agent. The prompt receives the current user utterance and a structured representation of the prior dialogue turns, then returns a resolved utterance with pronouns replaced by their correct antecedents. This resolved output becomes the input to intent classification, entity extraction, tool calls, or response generation. Treating resolution as a discrete, testable step prevents downstream components from silently operating on ambiguous input.

Wire the prompt into your application with a pre-processing stage that assembles the dialogue history into a compact format. Pass only the last N turns (typically 3-5) plus any entity map your system already maintains. Avoid dumping raw JSON blobs into the prompt; instead, format history as numbered speaker-tagged lines: User: I need the Q3 report. Assistant: Here it is. User: Can you email it to finance?. The prompt's [DIALOGUE_HISTORY] placeholder should receive this formatted string. For the [CURRENT_UTTERANCE] placeholder, pass the raw user input exactly as received. If your system already tracks entities with unique IDs, include an [ENTITY_MAP] section mapping entity names to their canonical identifiers, which helps the model disambiguate when multiple entities share a type.

After the model returns a resolved utterance, run validation checks before passing it downstream. First, verify that every pronoun in the original utterance has been replaced or explicitly flagged as unresolvable. Second, check that the resolved referent matches the gender, number, and entity type of the antecedent in your dialogue state. For example, if the user said 'send it to her' and your state shows the antecedent for 'it' is a document and 'her' is a contact named Sarah, the resolved output must reflect those types. A lightweight validator can compare the model's output against your state store and flag mismatches for human review or a retry loop. In high-stakes domains such as healthcare or finance, require human approval when the model's confidence score falls below a threshold or when the validator detects a type mismatch.

For retry logic, implement a two-stage approach. If the validator rejects the output, construct a retry prompt that includes the original input, the rejected output, and the specific validation error (e.g., 'Resolved referent for "it" does not match the entity type in state: expected Document, got Contact'). This gives the model targeted feedback to correct its mistake. Limit retries to two attempts; if both fail, escalate to a clarification question directed at the user rather than guessing. Log every resolution attempt, including the original utterance, the dialogue history snapshot, the model's output, the validator result, and any retry attempts. These logs are essential for debugging resolution failures and for building a golden dataset to improve the prompt over time.

Choose your model and latency budget based on the criticality of the downstream task. For real-time chat, a smaller, faster model (such as Claude Haiku or GPT-4o-mini) is usually sufficient for pronoun resolution, as the task is well-scoped and does not require deep reasoning. Reserve larger models for cases where the validator has flagged a complex or ambiguous reference. If your system uses Retrieval-Augmented Generation, be aware that pronouns may refer to entities in retrieved documents rather than dialogue history. In that case, extend the prompt's [CONTEXT] placeholder to include relevant retrieved chunks, and add an [OUTPUT_SCHEMA] field that requires the model to cite whether the antecedent came from dialogue history or a retrieved document. This prevents silent misattribution when a user says 'what about the deadline it mentions' and 'it' refers to a contract clause in a retrieved PDF rather than anything previously discussed.

Finally, avoid wiring this prompt directly into a state-mutating path without safeguards. The resolved utterance should update your dialogue state only after validation passes. If your system maintains a structured belief state (slots, intents, entity grid), apply the resolved references as a patch to that state and run a consistency check before committing. A common failure mode is allowing an incorrectly resolved pronoun to overwrite a correct entity in state, which then cascades into every subsequent turn. By treating the resolution step as a read-only transformation with a validated write gate, you prevent a single bad resolution from corrupting the entire session.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the strict JSON schema for the resolved utterance. Use this contract to validate the model's output before passing it downstream. Any field failing validation should trigger a retry or fallback.

Field or ElementType or FormatRequiredValidation Rule

resolved_utterance

string

Must not be identical to [AMBIGUOUS_UTTERANCE]. Must contain the substituted antecedent in place of the pronoun.

resolved_antecedent

string

Must exactly match a named entity or noun phrase present in [DIALOGUE_HISTORY]. Perform a substring or fuzzy match check against the history.

target_pronoun

string

Must be one of the pronouns explicitly listed in [AMBIGUOUS_UTTERANCE]. Validate against a predefined list of English pronouns.

resolution_confidence

number

Must be a float between 0.0 and 1.0. If below [CONFIDENCE_THRESHOLD], the caller should discard the output and trigger a clarification prompt.

candidate_referents

array[string]

Must contain 1-5 strings. The [resolved_antecedent] must be the first element. Every element must be a substring match in [DIALOGUE_HISTORY].

agreement_check

object

Must contain boolean fields for 'gender', 'number', and 'entity_type'. All must be true for a valid resolution. If any are false, the confidence should be < 0.5.

source_turn_index

integer

Must be a non-negative integer indexing the turn in [DIALOGUE_HISTORY] where the antecedent was found. Must not be null.

PRACTICAL GUARDRAILS

Common Failure Modes

Pronoun resolution breaks silently in production. These are the most common failure patterns, why they happen, and how to build guardrails that catch them before users notice.

01

Gender or Number Mismatch

What to watch: The model resolves a pronoun to an entity with the wrong gender or number (e.g., 'she' → a male-coded name, 'they' → a singular entity). This happens when the model relies on world knowledge stereotypes instead of dialogue evidence. Guardrail: Add a validator that checks the resolved entity's attributes against the pronoun's grammatical features. If the dialogue state tracks gender or number, enforce agreement before accepting the resolution.

02

Recency Bias Overriding Salience

What to watch: The model picks the most recently mentioned entity instead of the most discursively salient one. For example, 'Send it to him' after discussing both a document and a person may resolve 'it' to the person because 'him' appeared last. Guardrail: Include explicit salience scoring in the prompt—rank candidates by discourse prominence, not just recency. Test with pairs of same-gender entities where proximity and salience conflict.

03

Cross-Turn Entity Confusion

What to watch: When multiple entities of the same type appear across turns (two customers, three files, four dates), the model swaps their identities. The resolved reference points to the wrong entity ID. Guardrail: Maintain a structured entity grid with unique IDs and last-mentioned turn numbers. Require the prompt to output the entity ID, not just the name. Validate that the resolved ID exists in the active session state.

04

Silent Resolution with Low Confidence

What to watch: The model resolves an ambiguous reference without signaling uncertainty. The output looks fluent and confident but is wrong. This is the most dangerous failure mode because downstream systems act on incorrect data. Guardrail: Require a confidence score in the output schema. Set a threshold below which the system must ask a clarification question instead of resolving. Log all low-confidence resolutions for review.

05

Stale Reference Without Re-Confirmation

What to watch: A user refers to 'the report' after 12 turns of unrelated conversation. The model resolves to a report mentioned early in the session, but the user meant a different one introduced elsewhere or not yet mentioned. Guardrail: Implement a staleness check—if the candidate referent was last mentioned more than N turns ago, flag it for re-confirmation. Include a 'staleness_score' field in the output and escalate when it exceeds a threshold.

06

Implicit Reference Treated as Explicit

What to watch: The user says 'What about the error?' without any prior mention of an error in the dialogue. The model hallucinates a referent instead of recognizing this as an unresolvable implicit reference. Guardrail: Add a binary 'is_resolvable' flag to the output. If no candidate exceeds the confidence threshold, set it to false and trigger a structured clarification question. Never allow the model to invent referents to satisfy the schema.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the quality of resolved utterances before integrating the Pronoun Resolution Prompt Template into a production pipeline. Each criterion targets a specific failure mode common in multi-turn reference resolution.

CriterionPass StandardFailure SignalTest Method

Antecedent Accuracy

The resolved pronoun maps to the correct antecedent from [DIALOGUE_HISTORY] with the matching entity type.

The output substitutes a different entity of the same type, resolves to an entity from an older turn, or hallucinates a new entity not present in the history.

Automated check: Extract the substituted noun phrase and verify it exists in the target turn of [DIALOGUE_HISTORY] with a matching entity type label.

Gender Agreement

The resolved utterance uses pronouns and possessive adjectives that agree with the antecedent's gender attribute as stated in [DIALOGUE_HISTORY].

The output uses a gendered pronoun that contradicts the established gender of the resolved entity, or defaults to a gender when none was specified.

Automated check: Parse the resolved utterance for gendered pronouns and compare against the gender attribute of the resolved entity in the dialogue state.

Number Agreement

The resolved utterance uses singular or plural forms that match the grammatical number of the antecedent.

The output substitutes a singular pronoun for a plural antecedent or vice versa, causing a number mismatch in the resolved sentence.

Automated check: Compare the grammatical number of the substituted noun phrase with the original pronoun's number requirement.

No Extraneous Resolution

The output leaves unambiguous pronouns or non-referential pronouns unchanged and does not force a resolution where none is needed.

The prompt over-resolves and substitutes a noun phrase for a pronoun that was already unambiguous, a dummy subject, or an idiomatic expression.

Automated check: Diff the input [CURRENT_UTTERANCE] and the output. Flag any substitutions where the original pronoun had a single, unambiguous candidate within the same turn.

Clarification Trigger

When no antecedent in [DIALOGUE_HISTORY] meets the confidence threshold, the output is a structured clarification request instead of a guess.

The prompt resolves the pronoun to a low-confidence candidate without flagging the ambiguity, or it returns a resolved utterance with a confidence score below the [CONFIDENCE_THRESHOLD].

Automated check: Assert that the output contains a clarification object when the top candidate score is below [CONFIDENCE_THRESHOLD]. Verify the clarification question targets the ambiguous pronoun.

Utterance Integrity

The resolved utterance is a fluent, grammatically correct sentence that preserves all non-pronoun tokens from [CURRENT_UTTERANCE].

The output drops words, changes verb tense, alters punctuation, or rewrites parts of the original utterance that were not pronouns.

Automated check: Tokenize both [CURRENT_UTTERANCE] and the output. Verify that all non-pronoun tokens are present and in the same order, allowing only for the substituted noun phrase.

Cross-Turn Stability

Resolving the same pronoun across multiple turns with identical history yields the same antecedent, preventing flip-flopping.

Running the prompt on a static [DIALOGUE_HISTORY] with the same [CURRENT_UTTERANCE] produces different resolved entities on successive calls.

Regression test: Run the prompt 5 times with identical inputs and a temperature of 0. Assert that the resolved antecedent ID is identical across all runs.

Edge Case: Nested References

The prompt correctly resolves a pronoun when its antecedent is itself a pronoun resolved in the immediately preceding turn.

The output resolves to the literal pronoun string from the prior turn instead of the original entity, or it fails to resolve entirely.

Unit test: Provide a [DIALOGUE_HISTORY] where Turn N-1 contains a resolved pronoun. Verify that Turn N's pronoun resolves to the original entity, not the pronoun string.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base template and a small dialogue history of 3-5 turns. Use a frontier model with default temperature. Focus on getting correct antecedent substitution for simple gendered pronouns and singular/plural agreement before adding edge cases.

code
SYSTEM: You are a pronoun resolver. Given [DIALOGUE_HISTORY] and [CURRENT_UTTERANCE], replace all ambiguous pronouns with their correct antecedents. Return only the resolved utterance.

Watch for

  • Over-resolution: the model replaces pronouns that don't need resolution (e.g., generic 'it' in idioms)
  • Entity type mismatches: resolving 'she' to an organization or object
  • Missing dialogue context causing hallucinated antecedents
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.