SERC: LDPC-Inspired Semantic Error Correction for Retrieval-Augmented Generation
Organizations: Department of Information Communications Engineering, Hankuk University of Foreign Studies, Republic of Korea · Division of Computer Engineering, Hankuk University of Foreign Studies, Republic of Korea · Department of Statistics, Hankuk University of Foreign Studies, Republic of Korea
Abstract
While Large Language Models (LLMs) have demonstrated remarkable capabilities, their reliability is significantly compromised by hallucinations. Existing intrinsic self-correction methods attempt to address this, but often fail due to self-bias, where models struggle to identify errors in their own outputs without external verification. To overcome these limitations, we propose the LDPC-inspired semantic error correction for retrieval-augmented generation (SERC), providing a theoretical framework to interpret and mitigate LLM hallucinations. We reformulate the text generation process as a semantic noisy channel, treating generated responses as noise-corrupted codewords. Inspired by low-density parity-check (LDPC) codes, SERC employs a sparse verification strategy: instead of exhaustively checking all facts, it generates low-density verification queries and validates them against external evidence to efficiently detect and correct errors. We evaluate SERC on LongForm Bio and TruthfulQA benchmarks using Llama-3-8B and Qwen2.5-14B. Experimental results demonstrate that SERC outperforms both intrinsic self-correction methods and strong retrieval-augmented baselines, demonstrating significant gains especially in factual precision (FactScore). Notably, SERC enables small language models (SLMs) to surpass the performance of larger baselines in hallucination reduction and information preservation. Our findings demonstrate that SERC provides a training-free, model-agnostic solution that significantly reduces verification overhead compared to dense methods, achieving an optimal trade-off between cost and fidelity in resource-constrained environments.
Figures & tables
| Model | Method | LongForm Bio (FactScore) | Avg Facts (Preserve %) | TruthfulQA (Acc%) | TruthfulQA (Avg Score) |
|---|---|---|---|---|---|
| 8B | Initial Answer | 0.5976 | 23.86 (100.0%) | 50.0% | 5.45 |
| CoVe [ 3 ] | 0.5551 | 17.23 (72.2%) | 47.5% | 5.45 | |
| CoVe+RAG | 0.7265 | 17.70 (74.2%) | 75.0% | 7.55 | |
| RARR [ 5 ] | 0.7999 | 22.96 (96.2%) | 68.5% | 7.25 | |
| Re-Ex [ 9 ] | 0.7636 | 23.53 (98.6%) | 77.5% | 7.65 | |
| SERC(ours) | 0.8568 | 18.53 (77.7%) | 80.0% | 8.25 |
| Method | Average Token Usage | FactScore (8B) |
|---|---|---|
| CoVe+RAG | 21,994 | 0.7265 |
| Re-Ex | 27,352 | 0.7636 |
| RARR | 29,658 | 0.7999 |
| SERC (Ours) | 39,492 | 0.8568 |
| Model | Metric | Initial Answer | SERC w/o RAG | SERC |
|---|---|---|---|---|
| 8B | FactScore | 0.6825 | 0.6695 | 0.8568 |
| Avg # Facts | 25.15 | 17.40 | 18.53 | |
| 14B | FactScore | 0.5426 | 0.5374 | 0.8146 |
| Avg # Facts | 21.75 | 23.90 | 22.53 |
| Stage | Text content & Analysis |
|---|---|
| User Query | “Tell me a bio of Fernando da Costa Novaes” |
| Initial Answer | “…a Brazilian footballer who played as an attacking midfielder …” |
| Local Correction | [Corrected] DoB, Identity (to Ornithologist) but Failed to remove football context. |
| Final Output | “…was a Brazilian ornithologist and former attacking midfielder …” |
| Model | Method | Efficiency | Performance | ||
|---|---|---|---|---|---|
| Tokens | Reduct. | FactScore | Facts (Pres.%) | ||
| 8B | Initial | - | - | 0.6572 | 23.55 (100.0%) |
| High-Density | 72,634 | - | 0.7002 | 14.50 (61.6%) | |
| SERC | 39,492 | 45.6% | 0.8568 | 18.53 (77.7%) | |
| 14B | Initial | - | - | 0.5050 | 21.25 (100.0%) |
| High-Density | 54,407 | - | 0.8128 | 24.75 (116.5%) | |
| Stage | Content & Semantic Analysis |
|---|---|
| Initial Answer | “Josh Mansour is a cricket player … known for his fast bowling skills .” |
| Syndrome Det. | Fact: “Cricket player” CONTRADICTED (Evidence: “Rugby player”). |
| BP Correction | <fixed> Rugby league player </fixed> Triggers update: <fixed> Strong ball-carrying skills </fixed> . |
| Final Output | “Josh Mansour is a rugby league player … known for his strong ball-carrying skills .” |
LLM Hallucination Mitigation
Large language model hallucination mitigation develops ways to detect and reduce unsupported, fabricated, or inconsistent outputs.
See all 179 papers