Factored (default)

Chain-of-Verification diagramQuestion, Draft, Plan checks, Check 1, Check 2, Check 3, Revise, Answer. Step captions follow the diagram.Never shown the draftQuestionDraftPlan checksreads the draftCheck 1answered aloneCheck 2answered aloneCheck 3answered aloneReviseAnswerChain-of-Verification diagramQuestion, Draft, Plan checks, Check 1, Check 2, Check 3, Revise, Answer. Step captions follow the diagram.Never shown the draftQuestionDraftPlan checksreads thedraftCheck 1answeredaloneCheck 2answeredaloneCheck 3answeredaloneReviseAnswer

All steps

Catches a made-up claim

Every claim holds

Parts of this pattern
Question Input / output
A question whose answer is a list of facts: 'Name some politicians who were born in New York City.'
Draft LLM call
Writes a baseline answer the usual way. It may contain made-up or wrong facts.
Plan checks LLM call
Reads the draft and writes one stand-alone question per claim, such as 'Where was Hillary Clinton born?'
Check 1 LLM call
Answers the first verification question in its own call. It sees only that question, so it cannot copy the draft's claim.
Check 2 LLM call
Answers the second verification question in a separate call, with no draft and no other checks in view.
Check 3 LLM call
Answers the third verification question in its own call. All the checks can run in parallel.
Revise LLM call
Compares the draft with the checks' answers and rewrites it, dropping any claim a check contradicts.
Answer Input / output
The revised answer, which keeps only the claims that the independent checks support.
Question → Draft
The question goes to the model for a first, unchecked answer.Name some politicians who were born in New York City.
Draft → Plan checksdraft
The draft goes to the planner, which turns each of its claims into a question.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Plan checks → Check 1
The first verification question goes out on its own; the draft stays with the planner.Where was Hillary Clinton born?
Plan checks → Check 2
The second verification question goes out in parallel, again without the draft.Where was Donald Trump born?
Plan checks → Check 3
The third verification question goes out in parallel with the others.Where was Theodore Roosevelt born?
Check 1 → Revise
The first check's answer, given with no idea what the draft claimed.Hillary Clinton was born in Chicago, Illinois.
Check 2 → Revise
The second check's answer goes to the reviser.Donald Trump was born in Queens, New York City.
Check 3 → Revise
The third check's answer goes to the reviser.Theodore Roosevelt was born in Manhattan, New York City.
Draft → Revisebypass
The draft goes straight to the reviser, bypassing the checks, so it can be compared with their answers.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Revise → Answerrevised
The rewritten answer, with every contradicted claim removed.Donald Trump (born in Queens) and Theodore Roosevelt (born in Manhattan).

Joint

One prompt both plans the checks and answers them, with the draft in view. Cheapest, but the answers tend to repeat the draft's mistakes.

Chain-of-Verification: Joint diagramQuestion, Draft, Plan + answer, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan + answerdraft in viewReviseAnswerChain-of-Verification: Joint diagramQuestion, Draft, Plan + answer, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan +answerdraftin viewReviseAnswer

All steps
Parts of this pattern
Question Input / output
A question whose answer is a list of facts: 'Name some politicians who were born in New York City.'
Draft LLM call
Writes a baseline answer the usual way. It may contain made-up or wrong facts.
Plan + answer LLM call
Writes the verification questions and answers them in the same reply, with the draft in front of it.
Revise LLM call
Rewrites the draft to agree with the checks. It can only remove what the checks contradict.
Answer Input / output
The revised answer. If the checks copied the draft's mistake, the mistake survives.
Question → Draft
The question goes to the model for a first, unchecked answer.Name some politicians who were born in New York City.
Draft → Plan + answer
The draft goes to the joint step, which reads it while writing and answering the checks.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Plan + answer → ReviseQ and A
The questions and their answers, written in one reply right after reading the draft.Q: Where was Hillary Clinton born? A: New York City. Q: Where was Donald Trump born? A: Queens, New York City.
Draft → Revisedraft
The draft also goes straight to the reviser, so it can be compared with the checks.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Revise → Answerrevised
The rewritten answer, which can only be as good as the checks behind it.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.

Two-step

One call plans the checks with the draft in view; a second call answers them all together without it.

Chain-of-Verification: Two-step diagramQuestion, Draft, Plan checks, Answer checks, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan checksreads the draftAnswer checksall Qs, no draftReviseAnswerChain-of-Verification: Two-step diagramQuestion, Draft, Plan checks, Answer checks, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan checksreads thedraftAnswerchecksall Qs,no draftReviseAnswer

All steps
Parts of this pattern
Question Input / output
A question whose answer is a list of facts: 'Name some politicians who were born in New York City.'
Draft LLM call
Writes a baseline answer the usual way. It may contain made-up or wrong facts.
Plan checks LLM call
Reads the draft and writes one stand-alone question per claim.
Answer checks LLM call
Answers every verification question in one call. It never sees the draft, but it does see the other questions.
Revise LLM call
Compares the draft with the answers and rewrites it, dropping any claim they contradict.
Answer Input / output
The revised answer, keeping only the claims the checks support.
Question → Draft
The question goes to the model for a first, unchecked answer.Name some politicians who were born in New York City.
Draft → Plan checksdraft
The draft goes to the planner, which turns each of its claims into a question.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Plan checks → Answer checksquestions
Only the list of questions crosses over; the draft stays behind.1. Where was Hillary Clinton born? 2. Where was Donald Trump born? 3. Where was Theodore Roosevelt born?
Answer checks → Reviseanswers
The numbered answers go to the reviser, each matched to its question.1. Chicago, Illinois. 2. Queens, New York City. 3. Manhattan, New York City.
Draft → Revisedraft
The draft goes straight to the reviser, bypassing the checks, so it can be compared with their answers.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Revise → Answerrevised
The rewritten answer, with every contradicted claim removed.Donald Trump (born in Queens) and Theodore Roosevelt (born in Manhattan).

Factor + revise

Factored checks, plus an explicit cross-check that compares each check's answer with the claim it tests before the rewrite.

Chain-of-Verification: Factor + revise diagramQuestion, Draft, Plan checks, Checks, Cross-check, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan checksclaim + question pairsChecksone call per questionCross-checkclaim vs evidenceReviseAnswerChain-of-Verification: Factor + revise diagramQuestion, Draft, Plan checks, Checks, Cross-check, Revise, Answer. Step captions follow the diagram.QuestionDraftPlan checksclaim +question pairsChecksone call perquestionCross-checkclaim vsevidenceReviseAnswer

All steps
Parts of this pattern
Question Input / output
A question whose answer is a list of facts: 'Name some politicians who were born in New York City.'
Draft LLM call
Writes a baseline answer the usual way. It may contain made-up or wrong facts.
Plan checks LLM call
Reads the draft and lists each claim with a stand-alone question that checks it.
Checks LLM call
Answers each verification question in its own call, never seeing the draft, as in the factored form.
Cross-check Evaluator
Puts each claim next to its check's answer: CONSISTENT, INCONSISTENT, or PARTIALLY CONSISTENT with the part that holds.
Revise LLM call
Splices the final answer together from the consistent claims and the consistent parts of partial ones.
Answer Input / output
The final answer, with a verdict on record for every claim it started from.
Question → Draft
The question goes to the model for a first, unchecked answer.Name some politicians who were born in New York City.
Draft → Plan checksdraft
The draft goes to the planner, which splits it into claims and writes a question for each.Hillary Clinton, Donald Trump and Theodore Roosevelt were all born in New York City.
Plan checks → Checksquestions
Only the questions go to the checks; the claims and the draft stay behind.Where was Hillary Clinton born? / Where was Donald Trump born? / Where was Theodore Roosevelt born?
Plan checks → Cross-checkclaims
Each claim goes to the cross-check, to be set against the answer to its own question.Claim: Hillary Clinton was born in New York City.
Checks → Cross-checkanswers
Each check's answer, given without knowing the claim, goes to the cross-check as evidence.Q: Where was Hillary Clinton born? A: Chicago, Illinois.
Cross-check → Reviseverdicts
A verdict for each claim, with the supported part of any partly consistent claim, goes to the reviser.Clinton: INCONSISTENT (born in Chicago). Trump: CONSISTENT. Roosevelt: CONSISTENT.
Revise → Answerrevised
The answer rebuilt from consistent material only.Donald Trump (born in Queens) and Theodore Roosevelt (born in Manhattan).

← → neighboursesc atlas

Reasoning & Prompting

Chain-of-Verification

Also known as CoVe · Factored verification · Draft-verify-revise

Draft an answer, plan questions that check its claims, answer each one without seeing the draft, then rewrite the answer to match.

Introduced by Dhuliawala et al. (2023) · Meta AI & ETH Zürich

The paper compares four ways to run the verification step: joint, two-step, factored and factor+revise. Both factored (shown first here) and two-step beat joint, and factor+revise raised the FActScore on biographies from 63.7 (factored) to 71.4.

Measured over one run

Factored

Nodes
8. Boxes in the diagram: models, tools, stores, people and plain code.
LLM calls
5. Model invocations in the first scenario: each time a model or agent node starts thinking, plus each branch it decides.
Tool calls
0. Messages sent to a tool node in the first scenario.
Steps
4. Steps in the first scenario, with repeated steps counted every time they run.
Scenarios
2. Distinct example runs you can switch between on the diagram.
Loop
no. Whether the flow cycles back on itself until a condition is met.
Parallel
yes. Whether two or more messages are in flight at the same time.
Branch
no. Whether the flow takes one path out of several, chosen at run time.
Human in the loop
no. Whether a person appears as a node, to approve, correct or answer.
Autonomy
low. How much the model decides the control flow itself, from fixed code paths (low) to open-ended (high).
Cost
high. Relative token spend per request.
Latency
high. Relative wall-clock time per request.

Joint

Nodes
5. Boxes in the diagram: models, tools, stores, people and plain code.
LLM calls
3. Model invocations in the first scenario: each time a model or agent node starts thinking, plus each branch it decides.
Tool calls
0. Messages sent to a tool node in the first scenario.
Steps
3. Steps in the first scenario, with repeated steps counted every time they run.
Scenarios
1. Distinct example runs you can switch between on the diagram.
Loop
no. Whether the flow cycles back on itself until a condition is met.
Parallel
yes. Whether two or more messages are in flight at the same time.
Branch
no. Whether the flow takes one path out of several, chosen at run time.
Human in the loop
no. Whether a person appears as a node, to approve, correct or answer.
Autonomy
low. How much the model decides the control flow itself, from fixed code paths (low) to open-ended (high).
Cost
high. Relative token spend per request.
Latency
high. Relative wall-clock time per request.

Two-step

Nodes
6. Boxes in the diagram: models, tools, stores, people and plain code.
LLM calls
4. Model invocations in the first scenario: each time a model or agent node starts thinking, plus each branch it decides.
Tool calls
0. Messages sent to a tool node in the first scenario.
Steps
4. Steps in the first scenario, with repeated steps counted every time they run.
Scenarios
1. Distinct example runs you can switch between on the diagram.
Loop
no. Whether the flow cycles back on itself until a condition is met.
Parallel
yes. Whether two or more messages are in flight at the same time.
Branch
no. Whether the flow takes one path out of several, chosen at run time.
Human in the loop
no. Whether a person appears as a node, to approve, correct or answer.
Autonomy
low. How much the model decides the control flow itself, from fixed code paths (low) to open-ended (high).
Cost
high. Relative token spend per request.
Latency
high. Relative wall-clock time per request.

Factor + revise

Nodes
7. Boxes in the diagram: models, tools, stores, people and plain code.
LLM calls
5. Model invocations in the first scenario: each time a model or agent node starts thinking, plus each branch it decides.
Tool calls
0. Messages sent to a tool node in the first scenario.
Steps
5. Steps in the first scenario, with repeated steps counted every time they run.
Scenarios
1. Distinct example runs you can switch between on the diagram.
Loop
no. Whether the flow cycles back on itself until a condition is met.
Parallel
yes. Whether two or more messages are in flight at the same time.
Branch
no. Whether the flow takes one path out of several, chosen at run time.
Human in the loop
no. Whether a person appears as a node, to approve, correct or answer.
Autonomy
low. How much the model decides the control flow itself, from fixed code paths (low) to open-ended (high).
Cost
high. Relative token spend per request.
Latency
high. Relative wall-clock time per request.

Counted from the first scenario's timeline when the site is built.

Problem

Ask a model “Name some politicians who were born in New York City” and you may get “Hillary Clinton, Donald Trump and Theodore Roosevelt”. Two are right. Clinton was born in Chicago. The model did not lie on purpose: the list sounded right, and once it had written one name, the next names followed the same pattern. Asked directly “Where was Hillary Clinton born?”, the same model usually says Chicago. It knows the fact; it just did not check it while writing the list.

How it works

Chain-of-verification makes the model check its own claims with questions it answers separately. It runs in four stages and makes one pass.

First the question goes to the draft call, which answers it the usual way. Then plan reads the draft and writes one stand-alone question per claim: “Where was Hillary Clinton born?”, “Where was Donald Trump born?”, “Where was Theodore Roosevelt born?”

Each question is then answered in its own call: check 1, check 2 and check 3. This is the important part. The checks never see the draft. A model that has just read “Clinton was born in New York” tends to agree with it, but a model asked the bare question answers from what it knows, and says Chicago.

Finally the revise call gets the draft and every question with its answer. Chicago contradicts the draft, so Clinton is removed, and the answer names only Trump and Roosevelt.

The paper tried four ways to run the checks, shown as tabs. Joint plans and answers the checks in one prompt with the draft in view; it is the cheapest and the weakest, because the answers copy the draft. Two-step answers all the checks in one call without the draft. Factored, the default here, gives each check its own call. Both beat joint in the paper’s list tasks, which supports the central idea: the checks should not see the draft. Factor + revise adds an explicit cross-check that labels each claim consistent, inconsistent or partly consistent before the answer is rebuilt from the consistent parts; on biographies it raised the paper’s factuality score from 63.7 (factored) to 71.4.

When to use

  • The answer is a list of facts or a long passage, and made-up facts are the main risk.
  • You have no trustworthy source to check against, so the model’s own knowledge is the best evidence available.
  • The answer is worth several extra calls: biographies, summaries for publication, list-style questions.

When to avoid

  • The claims can be checked against a real source. Retrieval or a tool lookup gives better evidence than the model asking itself.
  • The answer is short and atomic. There is only one claim to check, so ask the question directly.
  • The model does not know the facts at all. Checks answered from the same missing knowledge cannot fix it.

Trade-offs

The factored form makes two calls plus one per claim plus one, so a ten-claim answer costs about thirteen calls. The checks run in parallel, so latency is closer to four calls than thirteen. In return you get far fewer made-up claims, and a record of which check removed which claim. The cheaper joint and two-step forms trade some of that accuracy for fewer calls. None of the forms loops: if the rewrite introduces a new mistake, nothing catches it.

Failure modes

  • Checks that see the draft: if the draft leaks into a verify prompt, the check tends to agree with it. Build verify prompts from the question alone.
  • Questions that are not stand-alone: “Was he born there?” cannot be answered without the draft. Require each question to make sense on its own.
  • The checks are wrong too: the model can be wrong about a fact both times. Treat the result as fewer errors, not none.
  • Over-pruning: the reviser removes claims the checks were merely unsure about. The revise prompt tells it to keep those unless another check contradicts them.

Build it with your AI

Factored

Paste this into Claude Code, Cursor, ChatGPT or any AI coding assistant.

Implement the Chain-of-Verification pattern in this codebase, using the LLM client and language we already use.

## Goal

Reduce made-up facts in an answer by checking each of its claims with a separate question the model answers without seeing the answer, then rewriting the answer to agree with those checks.

## How it works

1. Call the model with the Draft prompt to write a baseline answer to the user's question.
2. Call the model with the Plan verification prompt, passing the question and the draft, and parse one verification question per line.
3. Answer every verification question in its own call with the Verification prompt. Pass only that question: never the draft, the user's question or the other checks. Run these calls in parallel.
4. Call the model with the Revise prompt, passing the question, the draft and every verification question with its answer.
5. Return the revised answer, and keep the verification questions and answers alongside it for logs and review.

## Prompts

### Draft prompt

```markdown
Answer the question.

<question>{{question}}</question>
```

### Plan verification prompt

```markdown
Below is a question and a draft answer. Write questions that check each
factual claim in the draft. Each question must make sense on its own,
without the draft, and must be answerable with a short fact.

<question>{{question}}</question>
<draft>{{draft}}</draft>

Write one verification question per line, and nothing else.
```

### Verification prompt

```markdown
Answer the question with a short, factual answer. If you are not sure,
say "unsure".

<question>{{verification_question}}</question>
```

### Revise prompt

```markdown
Below is a question, a draft answer, and checks of the draft's claims that
were answered independently. Rewrite the answer so it agrees with the checks.
Remove any claim a check contradicts, and add nothing new. A check answered
"unsure" neither confirms nor contradicts; keep that claim unless another
check contradicts it.

<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>
{{#each checks}}
Q: {{question}}
A: {{answer}}
{{/each}}
</checks>

Return only the revised answer.
```

## Stop rule

Stop after the revise call: the pattern makes one pass and never loops. If the plan produces no questions, return the draft unchanged with a status saying nothing was checked.

## Requirements

- Never include the draft in a verify call; build those prompts from the verification question alone, so a hallucination cannot be copied into its own check.
- Cap the verification questions (default 10) and run the verify calls concurrently with a configurable limit.
- Keep each verification question and answer paired, in plan order, when passing them to the revise prompt.
- If a verify call fails, retry it once, then record its answer as 'unsure' so the claim is neither confirmed nor removed by it.
- Log the draft, the plan, every check and the revised answer, so a removed claim can be traced to the check that removed it.
- Add a test with a stub LLM: draft 'Hillary Clinton, Donald Trump, Theodore Roosevelt', checks answer Chicago, Queens, Manhattan; assert three verify calls, none containing the draft, and that the revise prompt contains 'Chicago'.

Joint

Paste this into Claude Code, Cursor, ChatGPT or any AI coding assistant.

Implement the Chain-of-Verification pattern (Joint variant) in this codebase, using the LLM client and language we already use.

## Goal

Check a draft's claims with the fewest calls: one call writes the verification questions and answers them, then a second rewrites the draft.

## How it works

1. Call the model with the Draft prompt to write a baseline answer.
2. Call the model with the Plan and answer prompt, passing the question and the draft. It writes each verification question followed by its answer.
3. Parse the reply into question and answer pairs.
4. Call the model with the Revise prompt, passing the question, the draft and the pairs, and return the revised answer.

## Prompts

### Draft prompt

```markdown
Answer the question.

<question>{{question}}</question>
```

### Plan and answer prompt

```markdown
Below is a question and a draft answer. For each factual claim in the
draft, write a question that checks it, then answer that question.

<question>{{question}}</question>
<draft>{{draft}}</draft>

Use this format, one pair per claim:
Q: <verification question>
A: <short factual answer>
```

### Revise prompt

```markdown
Below is a question, a draft answer, and checks of the draft's claims.
Rewrite the answer so it agrees with the checks. Remove any claim a
check contradicts, and add nothing the checks do not support.

<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>{{checks}}</checks>

Return only the revised answer.
```

## Stop rule

Stop after the revise call; the pattern makes one pass. If no pairs can be parsed, return the draft with a status saying nothing was checked.

## Requirements

- Parse pairs strictly as alternating 'Q:' and 'A:' lines, and skip a question with no answer.
- Log the joint reply in full; it is the only record of what was checked.
- Measure how often the checks agree with the draft; if they almost always do, switch to the factored form.
- Add a test with a stub LLM whose joint reply has three Q and A pairs; assert exactly three model calls and that the revise prompt contains all three answers.

Two-step

Paste this into Claude Code, Cursor, ChatGPT or any AI coding assistant.

Implement the Chain-of-Verification pattern (Two-step variant) in this codebase, using the LLM client and language we already use.

## Goal

Check a draft's claims in two calls, keeping the draft out of the call that answers the checks, then rewrite the draft to match.

## How it works

1. Call the model with the Draft prompt to write a baseline answer.
2. Call the model with the Plan verification prompt, passing the question and the draft, and parse one verification question per line.
3. Call the model once with the Answer all checks prompt, passing only the verification questions as objects with number (counting from 1) and text. It must not see the draft.
4. Parse the numbered answers and pair each with its question.
5. Call the model with the Revise prompt, passing the question, the draft and the pairs, and return the revised answer.

## Prompts

### Draft prompt

```markdown
Answer the question.

<question>{{question}}</question>
```

### Plan verification prompt

```markdown
Below is a question and a draft answer. Write questions that check each
factual claim in the draft. Each question must make sense on its own,
without the draft, and must be answerable with a short fact.

<question>{{question}}</question>
<draft>{{draft}}</draft>

Write one verification question per line, and nothing else.
```

### Answer all checks prompt

```markdown
Answer each question with a short, factual answer. If you are not sure,
say "unsure". Number your answers to match the questions.

{{#each questions}}
{{number}}. {{text}}
{{/each}}
```

### Revise prompt

```markdown
Below is a question, a draft answer, and checks of the draft's claims that
were answered without seeing the draft. Rewrite the answer so it agrees
with the checks. Remove any claim a check contradicts.

<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>{{checks}}</checks>

Return only the revised answer.
```

## Stop rule

Stop after the revise call; the pattern makes one pass. If the plan produces no questions, return the draft with a status saying nothing was checked.

## Requirements

- Never include the draft or the user's question in the verify-all call.
- Number the verification questions from 1 and require answers with the same numbers, so each answer can be matched to its question.
- Cap the verification questions (default 10).
- Add a test with a stub LLM: draft three names, plan three questions, answers 'Chicago', 'Queens', 'Manhattan'; assert four model calls and that the verify-all prompt does not contain the draft.

Factor + revise

Paste this into Claude Code, Cursor, ChatGPT or any AI coding assistant.

Implement the Chain-of-Verification pattern (Factor + revise variant) in this codebase, using the LLM client and language we already use.

## Goal

Check each claim of a draft with an independent question, mark each claim consistent, inconsistent or partly consistent with its check, then rebuild the answer from the consistent parts.

## How it works

1. Call the model with the Draft prompt to write a baseline answer.
2. Call the model with the Plan claims and checks prompt, passing the question and the draft, and parse its reply into pairs: each claim, quoted from the draft, with the question that checks it.
3. Answer every question in its own call with the Verification prompt, passing only that question, in parallel.
4. For each pair, call the model with the Cross-check prompt, passing the claim and its check's question and answer. Parse CONSISTENT, INCONSISTENT, or PARTIALLY CONSISTENT with the consistent part.
5. Call the model with the Revise prompt, passing the question and every claim with its verdict line (for a partial one, 'PARTIALLY CONSISTENT: ' plus the consistent part), and return the answer it splices together from the consistent parts.

## Prompts

### Draft prompt

```markdown
Answer the question.

<question>{{question}}</question>
```

### Plan claims and checks prompt

```markdown
Below is a question and a draft answer. List each factual claim in the
draft, quoted or closely restated, and a question that checks it. Each
question must make sense on its own, without the draft, and must be
answerable with a short fact.

<question>{{question}}</question>
<draft>{{draft}}</draft>

Use this format, one pair per claim:
Claim: <the claim>
Question: <the verification question>
```

### Verification prompt

```markdown
Answer the question with a short, factual answer.

<question>{{verification_question}}</question>
```

### Cross-check prompt

```markdown
Is the claim consistent with the evidence?

<claim>{{claim}}</claim>
<evidence>
Q: {{verification_question}}
A: {{verification_answer}}
</evidence>

Reply with one of:
CONSISTENT
INCONSISTENT
PARTIALLY CONSISTENT: <the part of the claim the evidence supports>
```

### Revise prompt

```markdown
Below is a question and the verdict on each claim of a draft answer.
Write the final answer from the consistent material only: keep CONSISTENT
claims, keep only the supported part of PARTIALLY CONSISTENT claims, and
leave out INCONSISTENT claims. Add nothing new.

<question>{{question}}</question>
<verdicts>{{claims_with_verdicts}}</verdicts>

Return only the final answer.
```

## Stop rule

Stop after the revise call; the pattern makes one pass. If the plan produces no claim and question pairs, return the draft with a status saying nothing was checked.

## Requirements

- Never include the draft in a verify call; the cross-check is the only step that sees a claim next to its check.
- Give each cross-check exactly one claim, so verdicts cannot bleed between claims.
- Treat a cross-check reply that does not start with one of the three verdicts as INCONSISTENT, and log it.
- Cap the claims (default 10), and run the verify and cross-check calls concurrently with a limit.
- Add a test with a stub LLM: claim 'Donald Trump was born in Queens in 1948' gets PARTIALLY CONSISTENT, consistent part 'Donald Trump was born in Queens'; assert the revise prompt pairs that claim with 'PARTIALLY CONSISTENT: Donald Trump was born in Queens'.

Prompt templates

Factored

Draft prompt
Answer the question.
<question>{{question}}</question>
Plan verification prompt
Below is a question and a draft answer. Write questions that check each
factual claim in the draft. Each question must make sense on its own,
without the draft, and must be answerable with a short fact.
<question>{{question}}</question>
<draft>{{draft}}</draft>
Write one verification question per line, and nothing else.
Verification prompt
Answer the question with a short, factual answer. If you are not sure,
say "unsure".
<question>{{verification_question}}</question>
Revise prompt
Below is a question, a draft answer, and checks of the draft's claims that
were answered independently. Rewrite the answer so it agrees with the checks.
Remove any claim a check contradicts, and add nothing new. A check answered
"unsure" neither confirms nor contradicts; keep that claim unless another
check contradicts it.
<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>
{{#each checks}}
Q: {{question}}
A: {{answer}}
{{/each}}
</checks>
Return only the revised answer.

Joint

Draft prompt
Answer the question.
<question>{{question}}</question>
Plan and answer prompt
Below is a question and a draft answer. For each factual claim in the
draft, write a question that checks it, then answer that question.
<question>{{question}}</question>
<draft>{{draft}}</draft>
Use this format, one pair per claim:
Q: <verification question>
A: <short factual answer>
Revise prompt
Below is a question, a draft answer, and checks of the draft's claims.
Rewrite the answer so it agrees with the checks. Remove any claim a
check contradicts, and add nothing the checks do not support.
<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>{{checks}}</checks>
Return only the revised answer.

Two-step

Draft prompt
Answer the question.
<question>{{question}}</question>
Plan verification prompt
Below is a question and a draft answer. Write questions that check each
factual claim in the draft. Each question must make sense on its own,
without the draft, and must be answerable with a short fact.
<question>{{question}}</question>
<draft>{{draft}}</draft>
Write one verification question per line, and nothing else.
Answer all checks prompt
Answer each question with a short, factual answer. If you are not sure,
say "unsure". Number your answers to match the questions.
{{#each questions}}
{{number}}. {{text}}
{{/each}}
Revise prompt
Below is a question, a draft answer, and checks of the draft's claims that
were answered without seeing the draft. Rewrite the answer so it agrees
with the checks. Remove any claim a check contradicts.
<question>{{question}}</question>
<draft>{{draft}}</draft>
<checks>{{checks}}</checks>
Return only the revised answer.

Factor + revise

Draft prompt
Answer the question.
<question>{{question}}</question>
Plan claims and checks prompt
Below is a question and a draft answer. List each factual claim in the
draft, quoted or closely restated, and a question that checks it. Each
question must make sense on its own, without the draft, and must be
answerable with a short fact.
<question>{{question}}</question>
<draft>{{draft}}</draft>
Use this format, one pair per claim:
Claim: <the claim>
Question: <the verification question>
Verification prompt
Answer the question with a short, factual answer.
<question>{{verification_question}}</question>
Cross-check prompt
Is the claim consistent with the evidence?
<claim>{{claim}}</claim>
<evidence>
Q: {{verification_question}}
A: {{verification_answer}}
</evidence>
Reply with one of:
CONSISTENT
INCONSISTENT
PARTIALLY CONSISTENT: <the part of the claim the evidence supports>
Revise prompt
Below is a question and the verdict on each claim of a draft answer.
Write the final answer from the consistent material only: keep CONSISTENT
claims, keep only the supported part of PARTIALLY CONSISTENT claims, and
leave out INCONSISTENT claims. Add nothing new.
<question>{{question}}</question>
<verdicts>{{claims_with_verdicts}}</verdicts>
Return only the final answer.

Related patterns

Composes well with:

Sources

  1. Chain-of-Verification Reduces Hallucination in Large Language Models (Dhuliawala et al., 2023)

From the Agentic Atlas by Joran Kikke · Edit on GitHub · Suggest a correction