verify-answer-claims-against-chunks
Use when a generated answer may state things the retrieved chunks never said. Checks every claim sentence against its cited chunk and flags or drops unsupported ones before shipping.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- verify-answer-claims-against-chunks
- description
- Use when a generated answer may state things the retrieved chunks never said. Checks every claim sentence against its cited chunk and flags or drops unsupported ones before shipping.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md361 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Verify Answer Claims Against Chunks
RAG does not guarantee faithfulness: the model can blend retrieved facts with memory. Verification is mechanical — each claim must be entailed by a chunk it cites, or it does not ship.
Procedure
-
Split the answer into atomic claims (one fact per sentence or clause) so support can be checked per claim.
-
Require a citation marker per claim and map it to the chunk id (
attach-stable-citation-ids). -
For each claim, check entailment against its cited chunk: an NLI model (
facebook/bart-large-mnli) or a strict judge prompt returningsupported/unsupported/contradicted. -
Drop or flag any
unsupportedclaim; treatcontradictedas a hard failure that blocks the answer. -
Flag claims whose number, date or entity does not appear verbatim in the cited chunk — numeric drift is the common fabrication.
-
Distinguish
unsupported(not in the chunk) fromcontradicted(chunk says otherwise); they need different fixes. -
Sample the verifier's own decisions by hand — a lenient NLI model will pass fabrications.
-
Report the faithfulness rate (supported claims / total) as a metric that must not fall when generation changes.
-
Keep the claim-to-chunk map with the answer, so a reader can see the support for each line.
-
Re-run the check on any prompt or model change; faithfulness is a property of the pair, not the model alone.
-
Store the verifier output per claim with the answer, so a rejection can be reviewed rather than re-run.
Pitfalls
-
Checking the whole answer against the whole context instead of claim-by-claim, hiding one unsupported line in a supported paragraph.
-
A verifier that reads the claim and the chunk in one prompt and defers to the claim's confidence.
-
Treating a paraphrase with a wrong number as supported because the rest of the sentence matches.
-
Dropping the citation and keeping the claim, so an unsupported fact ships unlabelled.
-
Using the same model for generation and verification with no adversarial check on the verifier.
-
Ignoring
contradictedclaims because they are rarer thanunsupportedones. -
A verifier prompt that asks 'is this consistent' and accepts topical overlap as entailment.
-
Checking only claims that carry a citation, missing uncited claims added by the model.
Verification
python3 faithfulness.py --answer answer.md --context chunks.jsonl
# passes when every claim resolves to a chunk and the contradicted count is 0
Report to the user: claims checked, supported/unsupported/contradicted counts, faithfulness rate, and every dropped claim with its reason.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.