🤖 AI Summary
Large language models (LLMs) frequently generate factually inaccurate content—so-called “hallucinations”—and existing representation intervention methods rely on fixed, query-agnostic correction vectors, limiting adaptability to diverse inputs. Method: We propose the first flow matching–based approach for enhancing LLM truthfulness, introducing a query-specific latent-space representation correction framework. During inference, it dynamically models input-dependent correction trajectories in the model’s internal representations, enabling fine-grained, adaptive intervention without parameter updates. Contribution/Results: Our method is training-free and supports zero-shot transfer. It significantly improves truthfulness scores across TruthfulQA and multiple open-ended generation benchmarks for mainstream LLMs—including Llama-2, Llama-3, and Qwen—while demonstrating strong cross-task generalization and robustness to distributional shifts.
📝 Abstract
Large language models (LLMs) are known to struggle with consistently generating truthful responses. While various representation intervention techniques have been proposed, these methods typically apply a universal representation correction vector to all input queries, limiting their effectiveness against diverse queries in practice. In this study, we introduce TruthFlow, a novel method that leverages the Flow Matching technique for query-specific truthful representation correction. Specifically, TruthFlow first uses a flow model to learn query-specific correction vectors that transition representations from hallucinated to truthful states. Then, during inference, the trained flow model generates these correction vectors to enhance the truthfulness of LLM outputs. Experimental results demonstrate that TruthFlow significantly improves performance on open-ended generation tasks across various advanced LLMs evaluated on TruthfulQA. Moreover, the trained TruthFlow model exhibits strong transferability, performing effectively on other unseen hallucination benchmarks.