UniArk: Improving Generalisation and Consistency for Factual Knowledge Extraction through Debiasing

Yijun Yang, Jie He, Pinzhen Chen, Víctor Gutiérrez-Basulto, Jeff Z. Pan

Introduction

Pre-trained Language Models (LMs) are frequently utilized as implicit knowledge bases, queried via prompts like "The official language of [Subject] is [MASK]." However, these models often exhibit significant brittleness; minor changes in prompt wording (e.g., "In [Subject], people speak [MASK]") can lead to wildly inconsistent answers. This lack of consistency stems from inherent biases: object likelihood bias, where the model guesses common answers based on the template alone, and template prior bias, where certain prompt styles are favored due to their frequency in pre-training data.

UniArk is a parameter-free framework designed to address these issues by mathematically decomposing the probing objective and mitigating these specific biases. It significantly enhances an LM's ability to provide consistent and accurate factual extractions across diverse, unseen prompt styles.

Methodology: Decomposing and Debiasing

The UniArk framework is built upon three core pillars designed to align probing with the model's internal knowledge while removing spurious correlations.

Overview of factual knowledge extraction and the biases addressed by UniArk.
  1. Adapter-Tuning: Rather than fine-tuning all parameters or merely optimizing input embeddings (P-tuning), UniArk utilizes small, trainable "adapter" layers within transformer blocks. This approach more effectively accesses knowledge embedded deep within the model's parameters.
  2. Object Likelihood Bias Mitigation: To prevent the model from guessing based solely on the prompt template, UniArk introduces a Max Entropy Loss. This objective forces the model to produce a uniform probability distribution when the subject is masked. If the subject is missing, the model should ideally be unable to predict the object.
  3. Template Prior Bias Mitigation: To counteract the influence of common pre-training prompt patterns, a self-data augmentation strategy is employed. Prompts are wrapped in various prefixes (e.g., "It is true that..."), and the resulting distributions are averaged to create a robust, unbiased prediction.

The authors demonstrate that standard tuning for probing is often mathematically misaligned with pre-training objectives, which allows these biases to manifest. By mitigating both biases simultaneously, UniArk achieves a synergistic effect, making the model more consistent across various ways of asking the same question.

Experimental Setup and Datasets

The framework was evaluated using standard benchmarks and a newly introduced dataset:

  • LAMA-TREx: The foundational benchmark for factual probing.
  • ParaRel: A dataset consisting of rule-based paraphrased prompts.
  • ParaTrex: A new, large-scale dataset created using GPT-3.5, containing over 1,500 paraphrases for 40 relations. ParaTrex offers significantly higher lexical and syntactical diversity than previous benchmarks, providing a more rigorous test of generalization.

Key Results

UniArk demonstrates substantial improvements in both accuracy and consistency across multiple models and datasets.

Performance comparison of UniArk against baselines on ParaTrex and ParaRel datasets.
  • Generalization: Compared to standard adapter baselines, UniArk improved out-of-domain (OOD) F1 scores by up to 7% on RoBERTa-large and 13% on BERT-large.
  • Bias Reduction: The "Counterfactual Hitting Rate"—the model's success rate when the subject is deleted—dropped to nearly 0.0%, indicating that the model relies on actual facts rather than template-based guessing.
  • Consistency: On the diverse ParaTrex dataset, UniArk outperformed the previous state-of-the-art (MeCoD) in consistency, maintaining stable answers across varied paraphrases.

Conclusion and Future Work

UniArk effectively addresses the "guessing" behavior of LMs in factual extraction tasks. While the current implementation uses naive averaging for template bias mitigation, future research could explore more sophisticated weighting schemes. Additionally, while this study focused on encoder-only models like BERT and RoBERTa, extending these debiasing techniques to large-scale decoder-only models (e.g., GPT-4) remains a promising direction. Addressing challenges with highly unidiomatic or syntactically unusual templates also remains an open area for improvement.

Summary updated

BibTeX
@inproceedings{yang2024uniark,
  author = {Yijun Yang and Jie He and Pinzhen Chen and Víctor Gutiérrez-Basulto and Jeff Z. Pan},
  title = {{UniArk: Improving Generalisation and Consistency for Factual Knowledge Extraction through Debiasing}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.388},
}
Figure