mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 19:50:17 +00:00
6.7 KiB
6.7 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
| Layer | Page | What it’s for |
|---|---|---|
| ⭐ Proof | WFGY Recognition Map | External citations, integrations, and ecosystem proof |
| ⚙️ Engine | WFGY 1.0 | Original PDF tension engine and early logic sketch (legacy reference) |
| ⚙️ Engine | WFGY 2.0 | Production tension kernel for RAG and agent systems |
| ⚙️ Engine | WFGY 3.0 | TXT based Singularity tension engine (131 S class set) |
| 🗺️ Map | Problem Map 1.0 | Flagship 16 problem RAG failure taxonomy and fix map |
| 🗺️ Map | Problem Map 2.0 | Global Debug Card for RAG and agent pipeline diagnosis |
| 🗺️ Map | Problem Map 3.0 | Global AI troubleshooting atlas and failure pattern map |
| 🧰 App | TXT OS | .txt semantic OS with fast bootstrap |
| 🧰 App | Blah Blah Blah | Abstract and paradox Q&A built on TXT OS |
| 🧰 App | Blur Blur Blur | Text to image generation with semantic control |
| 🏡 Onboarding | Starter Village | Guided entry point for new users |
If this repository helped, starring it improves discovery so more builders can find the docs and tools.