mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 11:40:07 +00:00
7.7 KiB
7.7 KiB
Hallucination in RAG — Guardrails and Fix Pattern
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 | WFGY 2.0 engine is live: full symbolic reasoning architecture and math stack | View → |
| Problem Map 1.0 | Initial 16-mode diagnostic and symbolic fix framework | View → |
| Problem Map 2.0 | RAG-focused failure tree, modular fixes, and pipelines | View → |
| Semantic Clinic Index | Expanded failure catalog: prompt injection, memory bugs, logic drift | View → |
| Semantic Blueprint | Layer-based symbolic reasoning & semantic modulations | View → |
| Benchmark vs GPT-5 | Stress test GPT-5 with full WFGY reasoning suite | View → |
| 🧙♂️ Starter Village 🏡 | New here? Lost in symbols? Click here and let the wizard guide you through | Start → |
👑 Early Stargazers: See the Hall of Fame — Engineers, hackers, and open source builders who supported WFGY from day one. ⭐ WFGY Engine 2.0 is already unlocked. ⭐