This prompt is designed for AI engineers and platform developers running ensemble or multi-model pipelines where conflicting duplicate entries appear across different model outputs. The core job-to-be-done is resolving disagreements about which records are duplicates and what the canonical value should be by using a majority vote across multiple model responses. You need this when a single deduplication pass produces unreliable results, when you are routing the same input to multiple models for redundancy, or when you are sampling multiple responses from a single model and need to reconcile conflicting duplicate/non-duplicate classifications. The ideal user is integrating this prompt into a production data pipeline, an agent loop, or a batch processing system where consistency and auditability matter more than raw speed.
Prompt
Duplicate Resolution with Majority Vote Prompt

When to Use This Prompt
Define the job, reader, and constraints for the Duplicate Resolution with Majority Vote Prompt.
Do not use this prompt when you have a single, high-confidence model output with a clear deduplication signal. In that case, a simpler exact or fuzzy deduplication prompt from this pillar is more appropriate and less expensive. This prompt is also a poor fit for real-time, low-latency user-facing features where running multiple models in parallel violates your latency budget. The majority vote mechanism assumes you have at least three independent outputs to compare; with only two, you cannot break ties without falling back to a configurable tie-breaking rule, which reduces the value of the voting approach. If your duplicates are always exact string matches, skip the voting overhead and use the Exact Duplicate Removal Prompt Template instead.
Before wiring this prompt into your application, ensure you have a clear definition of what constitutes a duplicate for your domain. The prompt requires you to supply a [DUPLICATE_DEFINITION] that tells the voting models how to compare records. Ambiguous definitions produce inconsistent votes and undermine the majority decision. You should also define your tie-breaking policy upfront—options include 'keep the most conservative result,' 'escalate for human review,' or 'use the highest-confidence model's vote.' After reading this section, proceed to the prompt template to see the exact input structure, then review the implementation harness for validation, logging, and model selection guidance.
Use Case Fit
Where the Duplicate Resolution with Majority Vote Prompt works and where it introduces risk. Use this to decide if the prompt fits your pipeline before integrating it.
Good Fit: Ensemble Pipelines
Use when: You have 3+ model outputs containing conflicting duplicate records and need a deterministic resolution. Guardrail: Require an odd number of voters to prevent tie-breaking ambiguity. Log the vote tally for every resolved record.
Bad Fit: Single-Model Outputs
Avoid when: You are deduplicating records from a single model response. Majority vote adds unnecessary complexity and latency. Guardrail: Use a simpler exact or fuzzy deduplication prompt for single-source outputs.
Required Inputs
What to watch: The prompt needs multiple output payloads, a record identity key, and tie-breaking rules. Missing any of these causes silent failures. Guardrail: Validate that all input payloads share a common schema and that the identity key is present in every record before invoking the vote.
Operational Risk: Voter Collusion
What to watch: If all models share the same base architecture or training data, they may produce identical errors, making the vote a rubber stamp. Guardrail: Use models from different providers or fine-tuned on distinct datasets to ensure genuine independence. Track inter-model agreement rates as a health metric.
Operational Risk: Latency Budget
What to watch: Waiting for multiple model calls plus a resolution pass can exceed latency budgets for real-time applications. Guardrail: Run model calls in parallel with a strict timeout. If the required quorum is not met, fall back to a single high-confidence output or escalate for human review.
Operational Risk: Confidence-Weighted Drift
What to watch: When using confidence-weighted voting, a single overconfident model can dominate the resolution, defeating the purpose of the ensemble. Guardrail: Cap individual model weights and require a minimum number of distinct models to agree before accepting a weighted decision.
Copy-Ready Prompt Template
A reusable prompt template for resolving conflicting duplicate entries across multiple model outputs using majority vote with configurable tie-breaking rules.
This prompt template is designed for ensemble and multi-model pipelines where multiple outputs contain conflicting duplicate entries. Instead of manually reconciling differences, the prompt instructs the model to tally votes across outputs, apply tie-breaking rules, and produce a single resolved record set with full vote transparency. Use this when you have 3+ model outputs that may disagree on field values for the same logical record, and you need an auditable resolution path.
codeYou are a duplicate resolution engine operating on [NUM_OUTPUTS] model outputs that may contain conflicting entries for the same logical records. Your task is to resolve duplicates using majority vote with configurable tie-breaking. ## INPUTS - Model Outputs: [OUTPUTS_LIST] - Record Identity Field: [IDENTITY_FIELD] - Fields to Resolve: [FIELDS_TO_RESOLVE] - Tie-Breaking Rule: [TIE_BREAKING_RULE] - Confidence Threshold: [CONFIDENCE_THRESHOLD] ## OUTPUT SCHEMA Return a JSON object with this structure: { "resolved_records": [ { "[IDENTITY_FIELD]": "value", "resolved_fields": { "[field_name]": { "value": "resolved_value", "vote_tally": { "[value_option]": count, ... }, "winning_criterion": "majority | tie_broken | below_threshold", "confidence": 0.0-1.0 } }, "source_output_ids": ["output_1", "output_2"], "resolution_status": "resolved | tied | below_threshold" } ], "unresolved_conflicts": [ { "record_identity": "value", "field": "field_name", "vote_distribution": {}, "reason": "no_majority | below_confidence | tie_not_broken" } ], "summary": { "total_input_records": N, "total_resolved_records": N, "total_unresolved_conflicts": N, "tie_breaks_applied": N, "below_threshold_flagged": N } } ## VOTING RULES 1. Group outputs by [IDENTITY_FIELD] to identify duplicate candidates. 2. For each [FIELDS_TO_RESOLVE], tally values across all outputs containing that record. 3. If one value has >50% of votes, select it as the resolved value with winning_criterion "majority". 4. If no value has majority, apply [TIE_BREAKING_RULE]: - "keep_highest_confidence": Select the value from the output with highest model confidence score. - "keep_most_recent": Select the value from the most recent output timestamp. - "keep_longest": Select the longest non-null value. - "flag_for_review": Do not resolve; add to unresolved_conflicts. - "first_output_wins": Select the value from the first output in [OUTPUTS_LIST]. 5. If the winning value's vote proportion is below [CONFIDENCE_THRESHOLD], set resolution_status to "below_threshold" and add to unresolved_conflicts. 6. Preserve all vote tallies for auditability. ## CONSTRAINTS - Do not invent values not present in the input outputs. - If a record appears in only one output, include it as resolved with vote_tally showing single-source. - Handle null/missing field values by excluding them from vote tally. - If [IDENTITY_FIELD] is missing for a record, flag it in unresolved_conflicts. - Maintain the original output IDs for traceability.
To adapt this template, replace the square-bracket placeholders with your pipeline's specific configuration. [OUTPUTS_LIST] should be a structured array of model outputs with unique IDs and optional confidence scores. [IDENTITY_FIELD] is the field that determines whether two records refer to the same entity—choose a stable identifier like email, record_id, or a composite key. [TIE_BREAKING_RULE] must match one of the enumerated options; if your use case requires a custom rule, extend the list and document the behavior. For high-stakes pipelines, set [CONFIDENCE_THRESHOLD] to a conservative value like 0.8 and route below_threshold cases to a human review queue. Always validate the output JSON against the schema before ingesting resolved records into downstream systems.
Prompt Variables
Required and optional inputs for the Duplicate Resolution with Majority Vote Prompt. Wire these variables into your ensemble pipeline before invoking the prompt.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CANDIDATE_OUTPUTS] | Array of conflicting model outputs containing duplicate entries to resolve | ["output_a": {"items": ["Alice", "Alice", "Bob"]}, "output_b": {"items": ["Alice", "Bob", "Bob"]}] | Must be a non-empty array with at least 2 outputs. Each output must contain the target field to deduplicate. Reject if fewer than 2 candidates provided. |
[DEDUP_FIELD] | JSONPath or key name identifying the array or field containing potential duplicates | items | Must resolve to an array or iterable field in each candidate output. Validate field exists in all candidates before voting. Reject if field missing in any candidate. |
[IDENTITY_FUNCTION] | Rule defining when two entries count as the same item for voting purposes | exact_string_match | Acceptable values: exact_string_match, normalized_lowercase, fuzzy_0.9, or custom function reference. Validate function is callable and returns boolean. Default to exact_string_match if null. |
[TIE_BREAKING_RULE] | Policy for resolving votes when no majority exists | keep_all_with_confidence_flag | Acceptable values: keep_all_with_confidence_flag, drop_tied_items, prefer_highest_confidence_source, escalate_for_human_review. Validate against allowed enum. Reject unrecognized values. |
[CONFIDENCE_WEIGHTS] | Optional per-output weight for confidence-weighted voting | [0.9, 0.7, 0.8] | If provided, array length must equal number of candidate outputs. Values must be floats between 0.0 and 1.0. If null, equal weighting assumed. Validate sum > 0 to avoid zero-weight deadlock. |
[OUTPUT_SCHEMA] | Expected structure for the resolved output | {"resolved_items": [], "vote_tally": {}, "ties": [], "dropped_duplicates": []} | Must be a valid JSON Schema or example structure. Validate that resolved_items, vote_tally, and ties fields are present. Reject schemas missing audit trail fields. |
[MIN_VOTE_THRESHOLD] | Minimum proportion of votes required to include an item | 0.5 | Float between 0.0 and 1.0. Items below threshold are dropped or flagged. Validate threshold is achievable given number of candidates. Warn if threshold > 1.0 or < 0.0. |
[HUMAN_REVIEW_FLAG] | Boolean controlling whether ambiguous cases are flagged for human review | Must be true or false. When true, ties and below-threshold items are routed to [HUMAN_REVIEW_QUEUE]. Validate queue endpoint exists if flag is true. Reject if flag is true but no queue configured. |
Implementation Harness Notes
How to wire the majority-vote deduplication prompt into a production ensemble pipeline with validation, tie-breaking, and audit logging.
The majority-vote deduplication prompt operates as a post-generation aggregator in an ensemble pipeline. It expects multiple model outputs—each containing a list of records, claims, or entities—and resolves conflicts by tallying votes across outputs. The prompt itself is stateless, so the application layer must collect all candidate outputs, normalize them into a consistent format, and inject them into the [CANDIDATE_OUTPUTS] placeholder. Each candidate should be labeled with a source identifier (e.g., model name, run ID, or timestamp) so the vote tally can attribute decisions. The prompt does not handle retrieval or tool calls; it is a pure reasoning step that consumes pre-generated outputs and emits a resolved canonical list with a vote breakdown.
Wire the prompt into a post-inference stage that fires after all ensemble models have returned. Validate each candidate output before feeding it into the deduplication step: reject malformed JSON, empty lists, or outputs that failed upstream schema validation. The harness should normalize field casing, trim whitespace, and optionally canonicalize values (e.g., date formats, identifier casing) before voting, because surface-form differences can split votes on semantically identical records. For confidence-weighted voting, attach a confidence field to each candidate record and include a [VOTING_MODE] parameter set to "weighted" in the prompt. The prompt template expects a [TIE_BREAKING_RULE] parameter—options include "keep_all", "drop_conflict", "prefer_source" with a specified [PREFERRED_SOURCE], or "human_review" which flags ties for manual resolution. Log every tie-breaking decision with the conflicting records, vote distribution, and chosen resolution for auditability.
Model choice matters: use a model with strong reasoning and structured output discipline for the aggregation step. GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are suitable; avoid smaller or older models that may miscount votes or hallucinate canonical records. Set temperature=0 and enforce the output schema strictly—validate the resolved list against the expected schema before passing it downstream. If the output fails validation, retry once with the error message injected into the [CONSTRAINTS] field. For high-stakes pipelines (e.g., clinical data, financial records, legal claims), route all tie-broken or low-agreement records to a human review queue with the full vote tally and source attribution. Do not silently resolve conflicts when agreement falls below a configurable [MIN_AGREEMENT_THRESHOLD]. The prompt is not a substitute for upstream output quality—if ensemble models consistently produce conflicting garbage, fix the generation step before relying on majority vote to paper over systemic failures.
Expected Output Contract
Defines the exact structure, types, and validation rules for the majority-vote deduplication output. Use this contract to build a parser, validator, and retry harness before integrating the prompt into a production pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
resolved_records | Array of objects | Must be a JSON array. Length must be less than or equal to the total unique records across all inputs. No duplicate 'canonical_id' values within the array. | |
resolved_records[].canonical_id | String | Must be a non-empty string. Must be unique within the 'resolved_records' array. Use a stable identifier from the source data if available; otherwise, generate a UUID. | |
resolved_records[].resolved_value | Object | Must be a valid JSON object representing the merged record. Must contain all required fields defined in [OUTPUT_SCHEMA]. No null values for required downstream fields. | |
resolved_records[].vote_tally | Object | Must be a JSON object mapping each distinct source value to its integer vote count. Sum of all counts must equal the total number of model outputs that contributed to this cluster. | |
resolved_records[].tie_broken | Boolean | Must be a strict boolean (true or false). If true, the 'tie_break_method' field must be present and non-null. | |
resolved_records[].tie_break_method | String or null | If 'tie_broken' is true, this must be a non-empty string matching one of the allowed values from [TIE_BREAK_RULES]. If 'tie_broken' is false, this must be null. | |
resolved_records[].contributing_output_ids | Array of strings | Must be an array of non-empty strings. Each string must correspond to an 'output_id' provided in the [INPUT_OUTPUTS] array. Array must not be empty. | |
unresolved_conflicts | Array of objects | Must be a JSON array. Can be empty. Each object must contain 'record_a_id', 'record_b_id', and 'conflict_reason' fields. 'conflict_reason' must be a non-empty string. |
Common Failure Modes
What breaks first when using majority vote for duplicate resolution and how to guard against it.
Tie-Breaking Deadlock
What to watch: When an even number of models split evenly on whether a record is a duplicate, the vote produces no majority, stalling the pipeline. Guardrail: Define a deterministic tie-breaker in the prompt (e.g., prefer the output from the highest-confidence model, or default to 'keep' to avoid data loss). Log all ties for review.
Confidence Score Misalignment
What to watch: Each model may use a different internal scale for confidence, making weighted voting unreliable when scores are not normalized. A 0.9 from one model might equal a 0.5 from another. Guardrail: Implement a calibration pass that normalizes confidence scores across models using a shared rubric or historical performance data before applying weights.
Majority Hallucination Amplification
What to watch: If multiple models share a common training bias or failure mode, they may all confidently agree on a false duplicate, causing the majority vote to amplify the error rather than correct it. Guardrail: Include a 'devil's advocate' instruction in the prompt that forces each model to articulate a reason the records might not be duplicates before voting. Flag unanimous decisions for spot-checking.
Vote Tally Opacity
What to watch: A simple 'merge' or 'keep' output hides the underlying disagreement. An 8-2 vote and a 6-4 vote produce the same action but have very different risk profiles. Guardrail: Require the prompt to output the full vote tally, per-model decisions, and confidence scores alongside the final resolution. Route close votes (e.g., within a 20% margin) to a human review queue.
Context Window Truncation in Ensemble
What to watch: When feeding multiple full model outputs into the voting prompt, the combined context can exceed the token limit, causing silent truncation of later outputs and skewing the vote. Guardrail: Pre-process outputs into concise, structured summaries before the voting stage. Implement a token-count check that aborts and alerts if the combined input exceeds a safe threshold.
Canonical Record Drift
What to watch: When the vote decides to merge duplicates, the prompt may synthesize a new canonical record that introduces subtle factual changes not present in any original output. Guardrail: Constrain the merge operation to 'select the most complete record from the winning set' rather than generating a new one. If synthesis is required, diff the result against all source records and flag any novel claims.
Evaluation Rubric
Use this rubric to evaluate the quality of a majority-vote deduplication output before integrating it into a production pipeline. Each criterion targets a specific failure mode common in ensemble resolution workflows.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Vote Tally Accuracy | The resolved output correctly reflects the majority choice for each conflicting duplicate entry across all model inputs. | The resolved entry matches a minority model output or a hallucinated record not present in any input. | Assert that for every resolved entry, the count of input models that produced it is greater than or equal to the count for any conflicting entry. |
Tie-Breaking Rule Adherence | When no strict majority exists, the output consistently applies the configured tie-breaking rule (e.g., keep-highest-confidence, keep-longest, or escalate). | The output arbitrarily selects a winner, omits the entry, or applies a different rule than the one specified in [TIE_BREAKING_RULE]. | Inject a synthetic test case with a known tie. Verify the resolved output matches the expected outcome of the configured rule. |
Confidence Score Integrity | The output's | The confidence score is a flat 1.0, null, or a number that does not match the weighted average of the winning votes. | Parse the |
Non-Duplicate Preservation | All records that are unique across all model inputs are present in the final resolved output exactly once, with no modification. | A unique record is missing from the output, has been merged with an unrelated record, or its fields have been altered. | Create a set of all unique record IDs from the input models. Assert that this set is identical to the set of IDs for records in the output that have a |
Output Schema Conformance | The final output is a valid JSON array where every object strictly matches the [OUTPUT_SCHEMA], including all required fields and correct types. | The output is missing the | Validate the entire output string against the [OUTPUT_SCHEMA] using a JSON Schema validator. The validation must pass with no errors. |
Audit Trail Completeness | For every resolved entry, the | The | For each resolved entry, collect all input model IDs. Assert that the union of |
Idempotency | Running the same set of inputs through the prompt multiple times produces a structurally and semantically identical resolved output. | Subsequent runs produce a different record ordering, a different tie-break winner, or a slightly altered confidence score. | Execute the prompt three times with identical inputs. Assert that the JSON outputs are deeply equal. If non-deterministic, assert that the set of resolved record IDs and their winning values are identical. |
Empty Input Handling | When all input model outputs are empty or contain no records, the prompt returns a valid empty | The prompt returns a string error message, a JSON object with a null | Pass an input object where every model's output is an empty list. Assert the output is a JSON object with |
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 a simple majority vote across 3 model outputs. Use the base prompt with a single tie-breaking rule: If votes are equal, prefer the entry with the highest confidence score. Skip formal vote tally output and just return the resolved list.
code[INPUT]: List of conflicting duplicate entries from multiple model outputs [OUTPUT]: Single deduplicated list with resolved conflicts [TIE_BREAK]: Prefer entry with highest confidence score
Watch for
- Models may assign arbitrary confidence scores that don't reflect actual reliability
- Equal vote splits with equal confidence will still produce ties
- No audit trail to debug why one entry won over another

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