Towards Automatic Bias Detection in Knowledge Graphs

Daphna Keidar, Mian Zhong, Ce Zhang, Yash Raj Shrestha, Bibek Paudel

Abstract

Knowledge Graph Embeddings (KGEs) are increasingly utilized in downstream AI tasks, yet they often inherit and amplify societal biases present in their source data. Current debiasing methods typically rely on manual selection of sensitive attributes, a process prone to human oversight and inefficiency. This paper presents a systematic, data-driven framework for automatically detecting and quantifying social biases in KGEs using multiple fairness metrics. Our evaluation across benchmark datasets reveals that non-obvious relations, such as nationality and given names, often exhibit higher bias than commonly audited attributes like gender.

Introduction

Knowledge Graphs (KGs) serve as structured repositories of real-world facts, powering applications from search engines to recommendation systems. However, the embeddings derived from these graphs frequently reflect human prejudices. While debiasing techniques exist, they generally require practitioners to pre-identify "sensitive" relations (e.g., gender). This manual approach is limited by human cognitive bias—where subtle discriminatory patterns like ZIP codes or names are overlooked—and is unscalable for massive graphs. We propose a multi-metric framework to automate this audit process, allowing for more targeted and effective debiasing.

Methodology: Quantifying Bias

The proposed framework evaluates bias through the lens of profession prediction, employing three distinct numerical metrics:

  1. Demographic Parity Distance (DPD): Measures whether a prediction (e.g., "is this person a doctor?") is statistically independent of a sensitive attribute. A high DPD indicates that the model's output varies significantly based on group membership.
  2. Predictive Parity Distance (PPD): Assesses whether the model's precision is consistent across different demographic groups. Discrepancies in accuracy between groups result in higher PPD scores.
  3. Translational Likelihood Bias (TLB): A KGE-specific metric that utilizes the model's internal score function. It quantifies how shifting an entity's embedding toward a sensitive attribute (e.g., "female") alters the likelihood of a specific target relation (e.g., "nurse").

Experimental Setup

We evaluated the framework on two standard benchmarks: FB15K-237 (a subset of Freebase) and Wikidata5m. To ensure the findings were not specific to a single architecture, we tested four prominent embedding methods: TransE, ComplEx, DistMult, and RotatE.

Key Results and Analysis

Bias in FB15K-237: The Role of Nationality

A significant finding was that "nationality" consistently exhibited higher bias scores than "gender" across nearly all metrics and models in the FB15K-237 dataset. This suggests that conventional focus on gender may miss more prominent vectors of discrimination.

Table 1: Bias metrics (DPD, PPD, TLB) for sensitive relations in FB15K-237. Nationality consistently shows higher bias than gender across most metrics.

Bias in Wikidata5m: Non-Obvious Discriminators

In the larger Wikidata5m dataset, the framework identified "position played on team/specialty" as the most biased relation, which is expected given its direct link to professional roles. More importantly, the framework flagged "given name" as a high-bias attribute, highlighting a non-obvious source of potential discrimination that manual audits might miss.

Table 2: Fairness metrics for various relations in the Wikidata5m dataset, highlighting high bias in 'position played' and 'given name'.

Algorithmic vs. Data Bias

Our analysis showed that DPD and PPD scores remained relatively stable across different embedding algorithms. This suggests that the primary source of bias lies in the underlying graph data or the classifier, rather than the specific embedding technique. In contrast, the TLB metric varied by algorithm, indicating that different architectures may internally represent or amplify these biases in distinct ways.

Conclusion

Automating bias detection is a crucial step toward building fairer AI systems. By providing a quantitative, multi-metric audit, this framework helps practitioners identify which relations require intervention. Future work will focus on establishing statistical significance thresholds for these scores and expanding the suite of metrics to cover a broader range of fairness definitions.

Summary updated

BibTeX
@inproceedings{keidar2021towards,
  author = {Daphna Keidar and Mian Zhong and Ce Zhang and Yash Raj Shrestha and Bibek Paudel},
  title = {{Towards Automatic Bias Detection in Knowledge Graphs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.321},
}
Figure