Mitigating social bias in knowledge graph embeddings

Method significantly reduces bias while maintaining comparable performance on machine learning tasks.

Question-answering systems frequently rely on knowledge graphs, large collections of facts about real-world entities (people, organizations, countries, etc.). To make use of the information in knowledge graphs, machine learning models often employ knowledge graph embeddings, vector representations of the entities in the graphs. 

A potential problem with this approach is that the distributions of data in knowledge graphs reflect current and historical social biases. For instance, most knowledge graphs include more male entities than female with the profession “banker”, or more “white American” entities than “African-American” entities with the profession “ballet dancer”. 

If knowledge graph embeddings end up encoding these biases, so will the question-answering systems that use them. If a little girl talking to a chatbot asks, “What should I be when I grow up?”, a biased embedding might rule out possible answers that are predominantly associated with men in the knowledge graph. For some professions — “baritone”, for instance — that may be fine. But in other cases, the biases may be relics of a less egalitarian past.

A two-dimensional representation of our method for measuring bias in knowledge graph embeddings.
A two-dimensional representation of our method for measuring bias in knowledge graph embeddings. In each diagram, the blue dots labeled person1 indicate the shift in an embedding as we tune its parameters. The orange arrows represent relation vectors and the orange dots the resulting sums. As we shift the gender relation toward maleness, the profession relation shifts away from nurse and closer to doctor.
Credit: Glynis Condon

Earlier this year, at the AKBC Workshop on Bias in Knowledge Graphs, we presented a paper that examines this problem. Using a standard embedding technique, we looked for correlations between the professions of people listed in Wikidata and demographic factors, such as gender, ethnicity, and religion, to see whether the embeddings do indeed encode harmful social biases. 

Following on from this, at last week’s Conference on Empirical Methods in Natural Language Processing (EMNLP), we presented “Debiasing knowledge graph embeddings”, in which we attempt to address this problem by developing a lightweight alteration to the standard method of training graph embeddings that reduces bias. 

As knowledge graph embeddings become more widely used within the machine learning community, we hope this work raises awareness of the biases they may encode and moves us closer to the goal of effective debiasing.

Knowledge graph embedding

Knowledge graph consisting of a left entity, a relation, and a right entity.
Knowledge graphs generally store facts as triples consisting of a left entity, a relation, and a right entity.
Credit: Joseph Fisher

A standard knowledge graph represents data using triples, each of which consists of two entities and the relationship between them: for instance, the entities emmanuelle_charpentier and germany are related by the relation lives_in.

Knowledge graph embeddings represent the entities in a knowledge graph as points in a multidimensional space. The idea is that spatial relationships between the points encode the relationships captured by the graph. 

With the common embedding framework TransE, for instance, adding the vector representing the relationship lives_in to the point representing emmanuelle_charpentier should bring us close to the location of the point representing germany. 

During training, the embedding model learns to maximize the accuracy of these spatial relationships across all the triples captured in the knowledge graph. Among other applications, embeddings can be used for link prediction, or inferring relationships between entities that do not yet feature in the graph.

Do trained knowledge graph embeddings encode social biases?

To see why knowledge graph embeddings might encode social biases, let’s look at the counts of male and female entities in Wikidata, the most extensive open-source knowledge graph.

Counts of male and female entities in Wikidata
Counts of male and female entities in Wikidata
Credit: Joseph Fisher

There are more than four times as many male entities in Wikidata as there are female, a reflection of long-persisting social biases in the real world. 

In our paper “Measuring social bias in knowledge graph embeddings”, we determine whether such differences in counts become encoded in embeddings. To do this, we take the embedding of a human entity and tune it so that the addition of a relation vector — such has has_religion or has_gender — edges closer to the embedding for some particular right-hand attribute — such as “Catholic” or “female”.

List of top 20 'most female' professions in Wikidata according to TransE embeddings. 
The top 20 “most female” professions in Wikidata according to TransE embeddings. B_p denotes the bias score, C_fem the counts of female entities in the knowledge graph with these professions, and C_male the counts of male entities with these professions.
From “Measuring social bias in knowledge graph embeddings”

As we tune the embedding, we observe how the result of adding the has_profession vector changes. That is, for each potential profession, we determine whether the model assigns it to the person with greater or lesser probability as the embedding changes. 

Running this calculation across all humans and professions, we are able to identify the professions that the embeddings encode as the “most male” and the “most female”. The table at right shows the top 20 “most female” professions according to our measure. (The number of entities in Wikipedia with non-binary genders is comparatively negligible; although this represents another bias in the data, it also means that the resulting embeddings would be too noisy to yield meaningful results in our study.)

List of the top 20 'most male' professions in Wikidata according to TransE embeddings.
Top 20 "most male" professions in Wikidata according to TransE embeddings.
From “Measuring social bias in knowledge graph embeddings”

The differences in the counts of entities in the knowledge graph with these professions appear to translate to biases in the embeddings. There are some professions, such as “homekeeper”, that we would prefer were not associated with a particular gender; others, such as “woman of letters”, may be less controversial. 

We also calculate the top 20 “male” professions, where the conclusions are similar.

Can we adjust the training of knowledge graph embeddings to reduce encoded biases?

In “Debiasing knowledge graph embeddings”, we turn our attention to reducing such biases and their potentially harmful consequences for downstream applications, such as chatbots. To do this, we train the embedding model not only on how faithfully it reconstructs triples but also on how well it approximates even distributions for gender and other sensitive characteristics, such as religion. 

Put another way, we update the embedding of person1 so that it becomes impossible for the model to predict gender. If this is done precisely, it should also break correlations between gender and profession.

Diagram that demonstrates measurement of how well a knowledge graph embedding scheme matches target distributions.
Our debiasing approach uses Kullback-Leibler (KL) divergence to measure how well a knowledge graph embedding scheme matches our target distributions.
Credit: Joseph Fisher

A potential drawback is that this approach prevents the model from using gender, religion, nationality, or ethnicity to predict noncontroversial triples. For instance, we may like the embeddings to reflect that a nun is more likely to be female than male.

To allow this, we introduce attribute embeddings. In cases where we wish to make use of sensitive information, we can simply add these attribute vectors back in to the embeddings.

Attribute vector: the male attribute embedding back into the model for the profession nun but not for the profession doctor.
Here, we add the male attribute embedding back into the model for the profession nun but not for the profession doctor.
Credit: Joseph Fisher

We evaluate our model against a Basic TransE model with no debiasing and against the debiasing approach adopted by Bose et al., which uses neural-network filters proposed in the literature previously. We measure the usefulness of the embeddings for link prediction (according to mean reciprocal rank, or MRR), their bias, and training time.

During training, embeddings are scored on their accuracy — the degree to which they reproduce the corresponding triples in the knowledge graph. We measure bias as the difference between those scores for entities that fall into one category or another — religion, gender, and so on. We find that our model incurs a slight (roughly 3%) dropoff in link prediction accuracy in exchange for a dramatic reduction in bias.

MRR

Gender bias

Seconds per epoch

Basic

0.68

2.79

68.4

Bose et al.

0.426

2.75

533.3

Ours

0.66

0.19

89.4

Related content

US, CA, Pasadena
The Amazon Center for Quantum Computing in Pasadena, CA, is looking to hire an Applied Scientist specializing in Mixed-Signal Design. Working alongside other scientists and engineers, you will design and validate hardware performing the control and readout functions for AWS quantum processors. Candidates must have a solid background in mixed-signal design at the printed circuit board (PCB) level. Working effectively within a cross-functional team environment is critical. The ideal candidate will have demonstrated the capability to contribute to all phases of product life cycle development, from requirements gathering to verification. Diverse Experiences Amazon values diverse experiences. Even if you do not meet all of the preferred qualifications and skills listed in the job description, we encourage candidates to apply. If your career is just starting, hasn’t followed a traditional path, or includes alternative experiences, don’t let it stop you from applying. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve in the cloud. Inclusive Team Culture Here at Amazon, it’s in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (gender diversity) conferences, inspire us to never stop embracing our uniqueness. Mentorship and Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional. Key job responsibilities Our scientists and engineers collaborate across diverse teams and projects to offer state of the art, cost effective solutions for the control of Amazon quantum processor systems. You’ll bring a passion for innovation, collaboration, and mentoring to: Solve layered technical problems, often ones not encountered before, across our hardware stack. Develop requirements with key system stakeholders, including quantum device, test and measurement, and cryogenic hardware teams. Design, implement, test, deploy, and maintain innovative solutions that meet both strict performance and cost metrics. Research enabling control system technologies necessary for Amazon to produce commercially viable quantum computers.
IN, KA, Bengaluru
Interested to build the next generation Financial systems that can handle billions of dollars in transactions? Interested to build highly scalable next generation systems that could utilize Amazon Cloud? Massive data volume + complex business rules in a highly distributed and service oriented architecture, a world class information collection and delivery challenge. Our challenge is to deliver the software systems which accurately capture, process, and report on the huge volume of financial transactions that are generated each day as millions of customers make purchases, as thousands of Vendors and Partners are paid, as inventory moves in and out of warehouses, as commissions are calculated, and as taxes are collected in hundreds of jurisdictions worldwide. Key job responsibilities • Understand the business and discover actionable insights from large volumes of data through application of machine learning, statistics or causal inference. • Analyse and extract relevant information from large amounts of Amazon’s historical transactions data to help automate and optimize key processes • Research, develop and implement novel machine learning and statistical approaches for anomaly, theft, fraud, abusive and wasteful transactions detection. • Use machine learning and analytical techniques to create scalable solutions for business problems. • Identify new areas where machine learning can be applied for solving business problems. • Partner with developers and business teams to put your models in production. • Mentor other scientists and engineers in the use of ML techniques. A day in the life • Understand the business and discover actionable insights from large volumes of data through application of machine learning, statistics or causal inference. • Analyse and extract relevant information from large amounts of Amazon’s historical transactions data to help automate and optimize key processes • Research, develop and implement novel machine learning and statistical approaches for anomaly, theft, fraud, abusive and wasteful transactions detection. • Use machine learning and analytical techniques to create scalable solutions for business problems. • Identify new areas where machine learning can be applied for solving business problems. • Partner with developers and business teams to put your models in production. • Mentor other scientists and engineers in the use of ML techniques. About the team The FinAuto TFAW(theft, fraud, abuse, waste) team is part of FGBS Org and focuses on building applications utilizing machine learning models to identify and prevent theft, fraud, abusive and wasteful(TFAW) financial transactions across Amazon. Our mission is to prevent every single TFAW transaction. As a Machine Learning Scientist in the team, you will be driving the TFAW Sciences roadmap, conduct research to develop state-of-the-art solutions through a combination of data mining, statistical and machine learning techniques, and coordinate with Engineering team to put these models into production. You will need to collaborate effectively with internal stakeholders, cross-functional teams to solve problems, create operational efficiencies, and deliver successfully against high organizational standards.
IN, KA, Bengaluru
Interested to build the next generation Financial systems that can handle billions of dollars in transactions? Interested to build highly scalable next generation systems that could utilize Amazon Cloud? Massive data volume + complex business rules in a highly distributed and service oriented architecture, a world class information collection and delivery challenge. Our challenge is to deliver the software systems which accurately capture, process, and report on the huge volume of financial transactions that are generated each day as millions of customers make purchases, as thousands of Vendors and Partners are paid, as inventory moves in and out of warehouses, as commissions are calculated, and as taxes are collected in hundreds of jurisdictions worldwide. Key job responsibilities • Understand the business and discover actionable insights from large volumes of data through application of machine learning, statistics or causal inference. • Analyse and extract relevant information from large amounts of Amazon’s historical transactions data to help automate and optimize key processes • Research, develop and implement novel machine learning and statistical approaches for anomaly, theft, fraud, abusive and wasteful transactions detection. • Use machine learning and analytical techniques to create scalable solutions for business problems. • Identify new areas where machine learning can be applied for solving business problems. • Partner with developers and business teams to put your models in production. • Mentor other scientists and engineers in the use of ML techniques. A day in the life • Understand the business and discover actionable insights from large volumes of data through application of machine learning, statistics or causal inference. • Analyse and extract relevant information from large amounts of Amazon’s historical transactions data to help automate and optimize key processes • Research, develop and implement novel machine learning and statistical approaches for anomaly, theft, fraud, abusive and wasteful transactions detection. • Use machine learning and analytical techniques to create scalable solutions for business problems. • Identify new areas where machine learning can be applied for solving business problems. • Partner with developers and business teams to put your models in production. • Mentor other scientists and engineers in the use of ML techniques. About the team The FinAuto TFAW(theft, fraud, abuse, waste) team is part of FGBS Org and focuses on building applications utilizing machine learning models to identify and prevent theft, fraud, abusive and wasteful(TFAW) financial transactions across Amazon. Our mission is to prevent every single TFAW transaction. As a Machine Learning Scientist in the team, you will be driving the TFAW Sciences roadmap, conduct research to develop state-of-the-art solutions through a combination of data mining, statistical and machine learning techniques, and coordinate with Engineering team to put these models into production. You will need to collaborate effectively with internal stakeholders, cross-functional teams to solve problems, create operational efficiencies, and deliver successfully against high organizational standards.
IN, KA, Bengaluru
Amazon Health Services (One Medical) About Us: At Health AI, we're revolutionizing healthcare delivery through innovative AI-enabled solutions. As part of Amazon Health Services and One Medical, we're on a mission to make quality healthcare more accessible while improving patient outcomes. Our work directly impacts millions of lives by empowering patients and enabling healthcare providers to deliver more meaningful care. Role Overview: We're seeking an Applied Scientist to join our dynamic team in building state of the art AI/ML solutions for healthcare. This role offers a unique opportunity to work at the intersection of artificial intelligence and healthcare, developing solutions that will shape the future of medical services delivery. Key job responsibilities • Lead end-to-end development of AI/ML solutions for Amazon Health organization, including Amazon Pharmacy and One Medical • Research, design, and implement state-of-the-art machine learning models, with a focus on Large Language Models (LLMs) and Visual Language Models (VLMs) • Optimize and fine-tune models for production deployment, including model distillation for improved latency • Drive scientific innovation while maintaining a strong focus on practical business outcomes • Collaborate with cross-functional teams to translate complex technical solutions into tangible customer benefits • Contribute to the broader Amazon Health scientific community and help shape our technical roadmap
US, MA, Boston
The Artificial General Intelligence (AGI) team is seeking a dedicated, skilled, and innovative Applied Scientist with a robust background in machine learning, statistics, quality assurance, auditing methodologies, and automated evaluation systems to ensure the highest standards of data quality, to build industry-leading technology with Large Language Models (LLMs) and multimodal systems. Key job responsibilities As part of the AGI team, an Applied Scientist will collaborate closely with core scientist team developing Amazon Nova models. They will lead the development of comprehensive quality strategies and auditing frameworks that safeguard the integrity of data collection workflows. This includes designing auditing strategies with detailed SOPs, quality metrics, and sampling methodologies that help Nova improve performances on benchmarks. The Applied Scientist will perform expert-level manual audits, conduct meta-audits to evaluate auditor performance, and provide targeted coaching to uplift overall quality capabilities. A critical aspect of this role involves developing and maintaining LLM-as-a-Judge systems, including designing judge architectures, creating evaluation rubrics, and building machine learning models for automated quality assessment. The Applied Scientist will also set up the configuration of data collection workflows and communicate quality feedback to stakeholders. An Applied Scientist will also have a direct impact on enhancing customer experiences through high-quality training and evaluation data that powers state-of-the-art LLM products and services. A day in the life An Applied Scientist with the AGI team will support quality solution design, conduct root cause analysis on data quality issues, research new auditing methodologies, and find innovative ways of optimizing data quality while setting examples for the team on quality assurance best practices and standards. Besides theoretical analysis and quality framework development, an Applied Scientist will also work closely with talented engineers, domain experts, and vendor teams to put quality strategies and automated judging systems into practice.
US, CA, Santa Clara
Amazon Quick Suite is an enterprise AI platform that transforms how organizations work with their data and knowledge. Combining generative AI-powered search, deep research capabilities, intelligent agents and automations, and comprehensive business intelligence, Quick Suite serves tens of thousands of users. Our platform processes thousands of queries monthly, helping teams make faster, data-driven decisions while maintaining enterprise-grade security and governance. From natural language interactions with complex datasets to automated workflows and custom AI agents, Quick Suite is redefining workplace productivity at unprecedented scale. We are seeking a Data Scientist II to join our Quick Data team, focusing on evaluation and benchmarking data development for Quick Suite features, with particular emphasis on Research and other generative AI capabilities. Our mission is to engineer high-quality datasets that are essential to the success of Amazon Quick Suite. From human evaluations and Responsible AI safeguards to Retrieval-Augmented Generation and beyond, our work ensures that Generative AI is enterprise-ready, safe, and effective for users at scale. As part of our diverse team—including data scientists, engineers, language engineers, linguists, and program managers—you will collaborate closely with science, engineering, and product teams. We are driven by customer obsession and a commitment to excellence. Key job responsibilities In this role, you will leverage data-centric AI principles to assess the impact of data on model performance and the broader machine learning pipeline. You will apply Generative AI techniques to evaluate how well our data represents human language and conduct experiments to measure downstream interactions. Specific responsibilities include: * Design and develop comprehensive evaluation and benchmarking datasets for Quick Suite AI-powered features * Leverage LLMs for synthetic data corpora generation; data evaluation and quality assessment using LLM-as-a-judge settings * Create ground truth datasets with high-quality question-answer pairs across diverse domains and use cases * Lead human annotation initiatives and model evaluation audits to ensure data quality and relevance * Develop and refine annotation guidelines and quality frameworks for evaluation tasks * Conduct statistical analysis to measure model performance, identify failure patterns, and guide improvement strategies * Collaborate with ML scientists and engineers to translate evaluation insights into actionable product improvements * Build scalable data pipelines and tools to support continuous evaluation and benchmarking efforts * Contribute to Responsible AI initiatives by developing safety and fairness evaluation datasets About the team Why AWS? Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform. We pioneered cloud computing and never stopped innovating — that’s why customers from the most successful startups to Global 500 companies trust our robust suite of products and services to power their businesses. Inclusive Team Culture Here at AWS, it’s in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon conferences, inspire us to never stop embracing our uniqueness. Mentorship & Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve in the cloud. Hybrid Work We value innovation and recognize this sometimes requires uninterrupted time to focus on a build. We also value in-person collaboration and time spent face-to-face. Our team affords employees options to work in the office every day or in a flexible, hybrid work model near one of our U.S. Amazon offices.
US, CA, San Francisco
Amazon launched the AGI Lab to develop foundational capabilities for useful AI agents. We built Nova Act - a new AI model trained to perform actions within a web browser. The team builds AI/ML infrastructure that powers our production systems to run performantly at high scale. We’re also enabling practical AI to make our customers more productive, empowered, and fulfilled. In particular, our work combines large language models (LLMs) with reinforcement learning (RL) to solve reasoning, planning, and world modeling in both virtual and physical environments. Our lab is a small, talent-dense team with the resources and scale of Amazon. Each team in the lab has the autonomy to move fast and the long-term commitment to pursue high-risk, high-payoff research. We’re entering an exciting new era where agents can redefine what AI makes possible. We’d love for you to join our lab and build it from the ground up! Key job responsibilities This role will lead a team of SDEs building AI agents infrastructure from launch to scale. The role requires the ability to span across ML/AI system architecture and infrastructure. You will work closely with application developers and scientists to have a impact on the Agentic AI industry. We're looking for a Software Development Manager who is energized by building high performance systems, making an impact and thrives in fast-paced, collaborative environments. About the team Check out the Nova Act tools our team built on on nova.amazon.com/act
US, MA, Boston
**This is an experimental role to support a business pilot and can potentially span up to 12 months** Embark on a transformative journey as our Expert Consultant, where intellectual rigor meets technological innovation. As an Expert Consultant, you will blend your advanced analytical skills and domain expertise to provide strategic oversight to our human-in-the-loop and model-in-the-loop data pipelines. You will also provide mentorship and guidance to junior team members. Your responsibilities will ensure data excellence through strategic oversight of high-quality data output, while delivering expert consultation throughout the pipeline and fostering iterative development. This position directly impacts the effectiveness and reliability of our AI solutions by maintaining the highest standards of data quality throughout the development process while building capability within the broader team. Key job responsibilities • Serve as a trusted domain advisor to cross-functional teams, providing strategic direction and specialized problem-solving support • Champion domain knowledge sharing across multiple channels and teams to maintain data quality excellence and standardization • Drive collaborative efforts with science teams to optimize output of complex data collections in your domain expertise, ensuring data excellence through iterative feedback loops • Foster team excellence through mentorship and motivation of peers and junior team members • Make informed decisions on behalf of our customers, ensuring that selected code meets industry standards, best practices, and specific client needs • Collaborate with AI teams to innovate model-in-the-loop and human-in-the-loop approaches, to ensure the collection of high-quality data, safeguarding data privacy and security for LLM training, and more. • Stay abreast of the latest developments in how LLMs and GenAI can be applied to your area of expertise to ensure our evaluations remain cutting-edge. • Develop and write demonstrations to illustrate "what good data looks like" in terms of meeting benchmarks for quality and efficiency • Provide detailed feedback and explanations for your evaluations, helping to refine and improve the LLM's understanding and output
US, MA, Boston
**This is an experimental role to support a business pilot and can potentially span up to 12 months** Embark on a transformative journey as our Expert Consultant, where intellectual rigor meets technological innovation. As an Expert Consultant, you will blend your advanced analytical skills and domain expertise to provide strategic oversight to our human-in-the-loop and model-in-the-loop data pipelines. You will also provide mentorship and guidance to junior team members. Your responsibilities will ensure data excellence through strategic oversight of high-quality data output, while delivering expert consultation throughout the pipeline and fostering iterative development. This position directly impacts the effectiveness and reliability of our AI solutions by maintaining the highest standards of data quality throughout the development process while building capability within the broader team. Key job responsibilities • Serve as a trusted domain advisor to cross-functional teams, providing strategic direction and specialized problem-solving support • Champion domain knowledge sharing across multiple channels and teams to maintain data quality excellence and standardization • Drive collaborative efforts with science teams to optimize output of complex data collections in your domain expertise, ensuring data excellence through iterative feedback loops • Foster team excellence through mentorship and motivation of peers and junior team members • Make informed decisions on behalf of our customers, ensuring that selected code meets industry standards, best practices, and specific client needs • Collaborate with AI teams to innovate model-in-the-loop and human-in-the-loop approaches, to ensure the collection of high-quality data, safeguarding data privacy and security for LLM training, and more. • Stay abreast of the latest developments in how LLMs and GenAI can be applied to your area of expertise to ensure our evaluations remain cutting-edge. • Develop and write demonstrations to illustrate "what good data looks like" in terms of meeting benchmarks for quality and efficiency • Provide detailed feedback and explanations for your evaluations, helping to refine and improve the LLM's understanding and output
US, WA, Seattle
We are working on improving shopping on Amazon using the conversational capabilities of large language models and through customer behavioral data to make them more personalized for each customer. We are searching for pioneers who are passionate about technology, innovation, and customer experience, and are ready to make a lasting impact on the industry. In this role, you will be managing a team working on Large Language Model (LLM) and/or Vision-Language Model (VLM) post-training and alignment for new shopping experiences. You’ll be working with talented scientists, engineers, and technical program managers (TPM) to innovate on behalf of our customers. If you’re fired up about being part of a dynamic, driven team, then this is your moment to join us on this exciting journey!