Aligning with Logic: Measuring, Evaluating and Improving Logical Preference Consistency in Large Language Models

Yinhong Liu, Zhijiang Guo, Tianya Liang, Ehsan Shareghi, Ivan Vulić, Nigel Collier

Introduction

Large Language Models (LLMs) are increasingly deployed for complex decision-making and automated reasoning. However, as they take on these high-stakes roles, a critical flaw often emerges: they frequently violate basic logic. For instance, an LLM might claim item A is better than B, and B is better than C, but then contradictorily assert that C is better than A.

This paper introduces a comprehensive framework to measure these logical inconsistencies and proposes REPAIR (Ranking Estimation and Preference Augmentation through Information Refinement), a novel technique that refines noisy training data into logically consistent rankings to fine-tune more reliable and robust models.

The Problem: Preference Inconsistencies

As LLMs are tasked with comparing items, ranking documents, or evaluating summaries, their reliability is paramount. Yet, models often exhibit "preference inconsistencies." A model's judgment might change simply based on the order of the items in the prompt (positional bias) or if the question is framed in the negative (e.g., asking "which is worse?" instead of "which is better?").

The authors argue that logical preference consistency—the ability to maintain a coherent, non-contradictory set of judgments—is a foundational requirement for user trust. They address the lack of standardized metrics for this consistency and tackle the challenge of training models on real-world preference data, which is notoriously noisy and self-conflicting.

Overview of the logical preference consistency framework, illustrating how noisy human judgments lead to inconsistencies, and how the REPAIR process refines this data for reliable downstream algorithms.

Measuring Consistency

To quantify logical behavior, the authors define three core mathematical properties:

  1. Transitivity ($s_{tran}$): If a model prefers A over B, and B over C, it must logically prefer A over C. Violations of this rule create contradictory "cycles" in a preference graph.
  2. Commutativity ($s_{comm}$): The model’s judgment should be invariant to the order in which items are presented in the prompt. Failing this indicates positional bias.
  3. Negation Invariance ($s_{neg}$): The model should remain consistent when the relational question is inverted. For example, "A is better than B" must be treated as logically equivalent to "B is worse than A."

The REPAIR Framework

To improve these metrics and eliminate contradictions, the authors propose the REPAIR framework. Instead of training directly on noisy, contradictory human or model-generated comparisons, REPAIR processes the data through three steps:

  1. Estimates a Global Ranking: It uses a "win-loss rate" (similar to an Elo or Bradley-Terry system) to aggregate noisy pairwise data into a single, consistent linear ranking.
  2. Generates Conflict-Free Data: It extrapolates a full set of pairwise comparisons from that newly established linear ranking, ensuring perfect transitivity and commutativity by design.
  3. Augments with Negations: It adds negated versions of these comparisons to the training set to explicitly bake in negation invariance.

Key Insights and Results

The authors evaluated a wide range of state-of-the-art LLMs (including Llama-3, Phi-3, and Gemma-2) across tasks like abstractive summarization evaluation (SummEval), document reranking (NovelEval), and temporal event ordering (CaTeRS).

  • Transitivity as a Robustness Proxy: The study found a strong correlation between a model's transitivity and its "self-agreement" (how often it gives the same answer across multiple samples). Logical consistency is a strong indicator of overall model stability.
  • The Chain-of-Thought (CoT) Paradox: Surprisingly, CoT prompting—usually a silver bullet for reasoning—did not consistently improve logical preference. In some cases, it actually decreased transitivity, likely because the extra reasoning steps introduced more variance into the judgment process.
  • Positional Bias is a Logic Failure: A lack of commutativity correlates strongly with poor alignment with human preferences. Models "confused" by item order are generally less accurate overall.
  • REPAIR Effectiveness: Fine-tuning Llama-3-8B with REPAIR-ed data led to dramatic improvements. On the "Summarize from Feedback" task, negation invariance ($s_{neg}$) jumped from 63.8% (zero-shot) to 87.9%.
  • Downstream Efficiency: Logically consistent models are vastly more efficient in downstream algorithms like merge-sort-based ranking. Because they are stable, they require fewer "calibrations" (averaging results across different prompt orders), saving significant compute while achieving better Spearman correlations with human ground truth.

Limitations and Future Work

While REPAIR offers a massive step forward, the authors note a few limitations. The rank aggregation primarily relies on a simple win-loss rate; more sophisticated methods might offer better results in specific scenarios, though they can struggle with ties. Additionally, the authors observed a slight "forgetting effect" where adding negated relations occasionally led to a minor dip in other logical properties. Finally, this work focuses on first-order relations (comparing two or three items), paving the way for future research to explore whether these consistency gains hold up in highly complex, multi-step decision-making chains.

Summary updated

BibTeX
@inproceedings{liu2025aligning,
  author = {Yinhong Liu and Zhijiang Guo and Tianya Liang and Ehsan Shareghi and Ivan Vulić and Nigel Collier},
  title = {{Aligning with Logic: Measuring, Evaluating and Improving Logical Preference Consistency in Large Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=V61nluxFlR},
}
Figure