Truth-Aware Decoding: A Program-Logic Approach to Factual Language Generation
Faruk Alpay, Hamdi Alakkad
TL;DR
Truth-Aware Decoding (TAD) introduces a runtime guard that couples large language models with knowledge-centric agents to constrain decoding to knowledge-consistent, oracle-approved tokens, thereby reducing hallucinations while maintaining throughput. The method is formalized with a semantic-language-model framework, a joint multi-agent verification dynamic, and rigorous guarantees on consistency and local likelihood dominance under soundness and completeness conditions. Empirical evaluation demonstrates substantial improvements in token-level truthfulness and calibrated risk via safe-mass metrics, alongside detailed performance analyses showing modest throughput overheads that can be mitigated with caching and engineering. This work provides a practical bridge between large-scale empirical language models and formal verification, enabling auditable, ethically guided, knowledge-bound generation in reasoning-intensive tasks.
Abstract
This paper introduces Truth-Aware Decoding (TAD), a verification-oriented decoding scheme that aligns neural language generation with knowledge bases. Situated in the tradition of probabilistic program semantics for sequence models, TAD augments modern instruction-tuned systems with a lattice of semantic guards that operate at decode time. Our contributions are fourfold: (i) a constraint-based semantics that renders oracle filtering as a program-logic judgment, (ii) a proof that greedy selection enjoys local likelihood dominance under sound and complete guards (Theorem 2.7), (iii) an entropy-style invariant that quantifies factual risk via knowledge-aware safe mass, and (iv) a multi-agent operational calculus with verified Lean artefacts to certify implementation behaviour. Numerical and algorithmic case studies confirm that the resulting guardrails reduce hallucinations without sacrificing throughput, yielding a pragmatic bridge between large-scale empirical models and formal verification.
