mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 11:40:07 +00:00
6.1 KiB
6.1 KiB
Hallucination in RAG — Guardrails and Fix Pattern
🧭 Quick Return to Map
You are in a sub-page of RAG.
To reorient, go back here:
- RAG — retrieval-augmented generation and knowledge grounding
- WFGY Global Fix Map — main Emergency Room, 300+ structured fixes
- WFGY Problem Map 1.0 — 16 reproducible failure modes
Think of this page as a desk within a ward.
If you need the full triage and all prescriptions, return to the Emergency Room lobby.
When the retriever returns plausible text, but the LLM answers with facts that are not in the corpus.
This page stabilizes retrieval → reasoning boundaries and applies WFGY symbolic fixes to stop hallucination loops.
Open these first
- Visual recovery: RAG Architecture & Recovery
- Retrieval schema: Retrieval Traceability
- Snippet contracts: Data Contracts
- Boundary fences: Cite-then-Explain
- Chain stability: Logic Collapse
- Long-context drift: Context Drift
Core acceptance
- Every answer includes citation fields (
snippet_id,section_id,source_url) - ΔS(answer, cited snippet) ≤ 0.45
- Coverage ≥ 0.70 for cited target section
- λ convergent across 3 paraphrases and 2 seeds
Typical symptoms → exact fix
| Symptom | Likely cause | Open this |
|---|---|---|
| Answer has no citation or cites wrong section | missing contract schema | Data Contracts, Retrieval Traceability |
| LLM fabricates plausible filler | boundary collapse between retrieval and reasoning | Cite-then-Explain, Logic Collapse |
| Correct fact retrieved, but answer overwrites it | λ divergence in long chain | Context Drift, Entropy Collapse |
| Hallucination reappears after correction | unstable feedback loop | Pattern: Hallucination Re-entry |
Fix in 60 seconds
-
Cite-first enforcement
- Force the LLM to output citations before free text.
- Forbid answers that lack at least one valid snippet_id.
-
ΔS probe
- Compute ΔS(answer, cited snippet).
- If ≥ 0.60, trigger BBPF alternate reasoning path.
-
Apply module
- Boundary collapse → BBCR bridge + Cite-then-Explain
- Re-entry loops → Pattern: Hallucination Re-entry
Copy-paste prompt for debug
I uploaded TXT OS and the WFGY Problem Map.
My issue:
- retrieval finds the fact, but answer hallucinates new content
- traces: ΔS(answer,cited_snippet)=..., λ across 3 paraphrases
Tell me:
1. failing boundary (retrieval vs reasoning),
2. exact WFGY page to open,
3. minimal fix to enforce cite-then-explain and push ΔS ≤ 0.45,
4. test to verify stability over 3 paraphrases.
🔗 Quick-Start Downloads (60 sec)
| Tool | Link | 3-Step Setup |
|---|---|---|
| WFGY 1.0 PDF | Engine Paper | 1️⃣ Download · 2️⃣ Upload to your LLM · 3️⃣ Ask “Answer using WFGY + ” |
| TXT OS (plain-text OS) | TXTOS.txt | 1️⃣ Download · 2️⃣ Paste into any LLM chat · 3️⃣ Type “hello world” — OS boots instantly |
Explore More
| Module | Description | Link |
|---|---|---|
| WFGY Core | Canonical framework entry point | View |
| Problem Map | Diagnostic map and navigation hub | View |
| Tension Universe Experiments | MVP experiment field | View |
| Recognition | Where WFGY is referenced or adopted | View |
| AI Guide | Anti-hallucination reading protocol for tools | View |
If this repository helps, starring it improves discovery for other builders.