Abstract
Large Language Models (LLMs) frequently exhibit logical inconsistencies, providing contradictory answers to related queries despite their high performance on individual tasks. This paper introduces ConCoRD (Consistency Correction through Relation Detection), a zero-shot, "plug-and-play" framework designed to improve the accuracy and logical coherence of pre-trained models. By leveraging off-the-shelf Natural Language Inference (NLI) models to detect relationships between predictions and employing a MaxSAT solver to find the most consistent set of answers, ConCoRD significantly boosts performance on complex reasoning tasks without the need for additional fine-tuning or weight updates.
Introduction
While state-of-the-art LLMs demonstrate remarkable capabilities, they often lack internal logical consistency. A model may correctly identify that a sparrow is a bird and that birds have feet, yet fail to conclude that a sparrow has feet when asked directly. This phenomenon occurs because standard models typically process inputs in isolation, ignoring the logical dependencies between related facts.
Existing attempts to rectify this—such as specialized loss functions during fine-tuning or hard-coded logical rules—often suffer from high computational costs or limited scalability. ConCoRD addresses these challenges by enforcing consistency "on the fly" at inference time, using existing pre-trained tools to ensure that a model's collective beliefs remain logically sound.
Methodology: The ConCoRD Framework
ConCoRD operates as a modular layer on top of existing language models. The process follows four distinct stages:
- Candidate Generation: For a given set of related questions, the base model (e.g., T5, Macaw, or LXMERT) generates multiple top candidate answers for each query, along with their associated confidence scores.
- Relation Detection: To evaluate logical compatibility, (Question, Answer) pairs are converted into declarative statements using a utility model (QA2D). A pre-trained NLI model (such as RoBERTa) then analyzes pairs of these statements to determine their logical relationship: entailment, contradiction, or neutrality.
- Factor Graph Inference: These relationships are used to construct a factor graph. This graph represents a balance between two objectives: maximizing the base model’s original confidence in its answers and maximizing the logical consistency between those answers as determined by the NLI model.
- MaxSAT Solving: The system employs a weighted MaxSAT solver to find the global assignment of answers that optimizes the objective function. This ensures the final output is both highly probable according to the base model and logically consistent across the entire batch of questions.
Crucially, ConCoRD requires zero weight updates to either the base LLM or the NLI model, making it a highly flexible solution for various architectures.
Experimental Evaluation
The researchers evaluated ConCoRD across several benchmarks to test its versatility in world knowledge, visual reasoning, and dynamic belief updating:
- BeliefBank: A dataset specifically designed to measure the consistency of a model's world knowledge across thousands of interconnected facts.
- ConVQA: A Visual Question Answering dataset where models must answer groups of related questions about specific images (e.g., identifying both the color and the specific identity of an object).
- Natural Questions (NQ): Used to evaluate "test-time information injection," testing whether the model can dynamically update its beliefs when provided with new external context.
Key Insights
NLI as a General-Purpose Reasoner
A central insight of this work is that pre-trained NLI models possess latent logical reasoning capabilities that can be repurposed. Rather than manually defining thousands of logical rules (e.g., "If X is a Y, then X has the properties of Y"), ConCoRD uses the NLI model to dynamically assess if two statements are compatible, allowing the system to scale to the infinite variety of natural language.
Strength in Numbers
By processing batches of related questions simultaneously, ConCoRD allows high-confidence predictions to "correct" lower-confidence ones. If a model is highly certain of a general premise, that certainty can override a shaky, inconsistent guess on a specific sub-question, leading to a more accurate overall knowledge state.
Results
ConCoRD consistently outperformed raw models across all tested benchmarks:
- Knowledge Consistency: On the BeliefBank dataset, ConCoRD improved the F1 score of a Macaw-Large model by 8.1% absolute and increased its logical consistency by 8.5%.
- Visual Reasoning: On the ConVQA dataset, the framework improved the accuracy of the LXMERT model by 5.0% absolute.
- Dynamic Editing: The system demonstrated the ability to propagate new information at test time. When provided with a single new fact (e.g., a change in a capital city), ConCoRD successfully updated related beliefs across the model's output without any retraining.
Limitations and Future Work
Despite its success, ConCoRD introduces certain trade-offs. The primary limitation is computational overhead; running an NLI model on every pair of candidate answers increases inference-time latency. Furthermore, the system's performance is intrinsically tied to the quality of the NLI model; errors in relation detection can lead the system to enforce incorrect but consistent beliefs.
Future research may focus on integrating this framework with models that generate self-explanations, potentially using those explanations to further refine the logical constraints and reduce the reliance on external NLI models.
Summary updated