Logic-Guided Data Augmentation and Regularization for Consistent Question Answering

Akari Asai, Hannaneh Hajishirzi

Abstract

State-of-the-art language models frequently struggle with logical consistency, often providing contradictory answers to semantically equivalent or logically related queries. This paper introduces a novel framework that integrates symbolic logic with neural architectures through logic-guided data augmentation (DA) and consistency regularization (Reg). By enforcing symmetric and transitive logical constraints during training, the approach significantly enhances model performance on complex reasoning tasks while drastically reducing internal contradictions. Evaluations across three diverse datasets—WIQA, QuaRel, and HotpotQA—demonstrate that this method not only improves accuracy but also exhibits remarkable data efficiency, outperforming baselines even with limited training samples.

Introduction: The Challenge of Logical Inconsistency

While transformer-based models like RoBERTa excel at pattern recognition, they often lack a robust underlying world model. This deficiency manifests as logical inconsistency: a model might correctly identify that "Object A is heavier than Object B" but fail to conclude that "Object B is lighter than Object A." Such failures are particularly prevalent in tasks requiring causal, qualitative, or quantitative reasoning.

Examples of logical inconsistencies in standard RoBERTa models where changing the phrasing of a question leads to contradictory answers.

These inconsistencies stem from models exploiting "annotation artifacts"—statistical shortcuts in training data—rather than learning the actual logical structure of the domain. Furthermore, annotating complex reasoning tasks is expensive, leading to small datasets that hinder a model's ability to generalize logical rules purely from examples.

Methodology

The proposed framework addresses these issues through two primary mechanisms:

1. Logic-Guided Data Augmentation (DA)

The authors utilize symbolic logic to automatically expand the training set:

  • Symmetric Consistency: For a given question-answer pair, the system generates a logically equivalent version by using antonyms (e.g., "more" to "less") or negations and appropriately flipping the target label.
  • Transitive Consistency: In causal reasoning contexts, if the training data contains relationships $A \rightarrow B$ and $B \rightarrow C$, the system synthesizes a new example representing the inferred relationship $A \rightarrow C$.

2. Logic-Guided Consistency Regularization (Reg)

Beyond standard task-specific loss, the authors introduce a Consistency Loss term. This regularizer penalizes the model when its predictions for logically related question pairs (e.g., a question and its symmetric counterpart) are inconsistent. To ensure training stability, an annealing schedule is employed, gradually increasing the weight of the consistency loss as the model converges on the primary task.

Experimental Setup and Datasets

The framework was evaluated on three benchmarks requiring distinct reasoning types:

  • WIQA: Focuses on causal reasoning (e.g., predicting the effects of environmental changes).
  • QuaRel: Involves qualitative reasoning about physical properties like speed, friction, and distance.
  • HotpotQA: A subset of comparison questions requiring multi-hop reasoning across multiple documents.

Results and Discussion

The combination of logic-guided DA and regularization (DA + Reg) consistently outperformed the baseline RoBERTa model across all metrics and datasets.

Performance comparison of RoBERTa vs. Logic-Guided methods across different data percentages and datasets. v(%) represents the consistency violation rate.

Key Findings:

  • Accuracy and Consistency: The method achieved an absolute accuracy boost of 4.7% on WIQA and 8.4% on QuaRel. Crucially, consistency violations on HotpotQA were reduced by 58%.
  • Data Efficiency: The logic-guided approach proved exceptionally robust in low-resource settings. Using only 20% of the training data, the DA+Reg model achieved performance comparable to a baseline trained on 100% of the data.
  • Robustness to Surface Variations: Qualitative analysis indicates that the model becomes significantly more resilient to linguistic changes, such as the introduction of negations or antonyms, which typically cause standard models to flip their answers unpredictably.

Conclusion and Future Directions

This work demonstrates that symbolic logic can serve as an effective inductive bias for neural networks, guiding them toward more consistent and accurate reasoning. While the current implementation relies on predefined templates and dictionaries for symmetric augmentation, it provides a general-purpose framework applicable to various transformer architectures. Future research may explore extending this approach to more complex logical structures, such as temporal logic or quantification, and improving the model's handling of nuanced linguistic negations.

Summary updated

BibTeX
@inproceedings{asai2020logic,
  author = {Akari Asai and Hannaneh Hajishirzi},
  title = {{Logic-Guided Data Augmentation and Regularization for Consistent Question Answering}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.499},
}
Figure