Michele Donini, left, a senior applied scientist with Amazon Web Services, and Luca Oneto, associate professor of computer engineering at University of Genoa
Michele Donini, left, a senior applied scientist with Amazon Web Services, and Luca Oneto, associate professor of computer engineering at University of Genoa, review different approaches that can make data-driven predictions fairer for underrepresented groups.
Credit: Glynis Condon

Working toward fairer machine learning

Exploring and analyzing possible techniques to make ML algorithms capable of learning fairer models by utilizing empirical risk minimization theory.

Editor’s note: Michele Donini is a senior applied scientist with Amazon Web Services (AWS). He and his co-author, Luca Oneto, associate professor of computer engineering at University of Genoa, have written about how different approaches can make data-driven predictions fairer for underrepresented groups. Oneto also won a 2019 Machine Learning Research award for his work on algorithmic fairness. In this article, Donini and Oneto explore the research they and other collaborators have published related to designing machine learning (ML) models from a human-centered perspective, and building responsible AI.

What is fairness?

Fairness can be defined in many different ways, and many different formal notions exist, such as demographic parity, equal opportunity, and equal odds.

Graphic shows a model of an unfair outcome on the left and a fair outcome on the right
Algorithmic fairness is a topic of great importance, with impact on many applications. The issue requires much further research; even the definition of what “being fair” means for an ML model is still an open research question.

Nevertheless, the basic and common idea behind notions of fairness is that the learned ML model should behave equivalently, or at least similarly, no matter whether it is applied to one subgroup of the population (e.g., males) or to another one (e.g., females).

For example, demographic parity, which arguably is the most common notion of fairness, implies that the probability of a certain output of an ML model (e.g., deciding to make a loan) should not depend on the value of specific demographic attributes (e.g., gender, race, or age).

Moving toward fairer models

Broadly speaking, we can group current literature on algorithmic fairness into three main approaches:

  • The first approach consists of pre-processing the data to remove historical biases and then feeding this data to classical ML models.
  • The second approach consists of post-processing an already learned ML model. This approach is useful when very complex ML models need to be made fairer without touching their inner structure or when re-training them is unfeasible (due to computational cost, or time requirements).
  • The third approach, called in-processing, consists of enforcing fairness notions by imposing specific statistical constraints during the learning phase of the model. This is the most natural approach, but so far, it has required ad hoc solutions tailored to specific tasks and data sets.
Fair Models.png
Broadly speaking, current literature on algorithmic fairness falls into three main approaches: pre-processing data; post-processing an already learned ML model; and in-processing, which consists of enforcing fairness notions by imposing specific statistical constraints during the learning phase of the model.

We decided to explore and analyze possible techniques to make ML algorithms capable of learning fairer models.

We started from the base concepts of statistical learning theory — a mathematical framework for describing machine learning — and, in particular, from empirical risk minimization theory. The core concept of empirical risk minimization is that a model’s performance on test data may not accurately predict its performance on real-world data, as the real-world data may have a different probability distribution.

Empirical-risk-minimization theory provides a way to estimate the “true risk” of a model from its “empirical risk”, which can be computed from the available data. We extended this concept to the true and empirical fairness risk of ML models.

Below is a summary of three papers we’ve published related to these topics.

Empirical risk minimization under fairness constraints

This paper presents a new in-processing method, meaning that we incorporate a fairness constraint into the learning problem. We derive theoretical guarantees on both the accuracy and fairness of the resulting models, and we show how to apply our method to a large family of machine learning algorithms, including linear models and support vector machines for classification (a widely used supervised-learning method).

We observe that, in practice, we can meet our fairness constraint simply by requiring that a scalar product between two vectors remains small (an orthogonality constraint between the vector of the weights describing our model and the vector describing the discrimination between the different subgroups). We further observe that, for linear models, this requirement translates into a simple pre-processing method. Experiments indicate that our approach is empirically effective and performs favorably against state-of-the-art approaches.

Fair regression with Wasserstein barycenters

In this paper, we consider the case in which the ML model learns a regression function (as opposed to a classification task). We propose a post-processing method for transforming a real-valued regression function — the ML model — into one that satisfies the demographic-parity constraint (i.e., the probability of getting a positive outcome should be virtually the same for different subgroups). In particular, the new regression function is as good an approximation of the original as is possible while still satisfying the constraint, making it an optimal fair predictor.

Fair Representation.png
In “Fair regression with Wasserstein barycenters”, we consider the case in which the ML model learns a regression function and propose a post-processing method for transforming a real-valued regression function — the ML model — into one that satisfies the demographic-parity constraint.

We assume that the sensitive attribute — the demographic attribute that should not bias outcome — is available to the ML model at inference time and not only during training. We establish a connection between learning a fair model for regression and optimal transport theory, which describes how to measure distances among probability distributions. On that basis, we derive a closed-form expression for the optimal fair predictor.

Specifically, under the unfair regression function, different populations have different probability distributions; the function skews the probabilities for the population with the sensitive attribute. The difference between subgroups’ distributions can be calculated using the Wasserstein distance. We show that the mean of the distribution of the optimal fair predictor is the mean of the different subgroups’ distributions, as calculated using Wasserstein distance. This mean is known as the Wasserstein barycenter.

This result offers an intuitive interpretation of optimal fair prediction and suggests a simple post-processing algorithm to achieve fairness. We establish fairness-risk guarantees for this procedure. Numerical experiments indicate that our method is very effective in learning fair models, with a relative increase in error rate that is smaller than the relative gain in fairness.

"Exploiting MMD and Sinkhorn divergences for fair and transferable representation learning

Where the first paper described a general learning method, and the second a regression method, this paper concerns deep learning. We show how to improve demographic parity in the multitask-learning setting, in which a deep-learning model learns a single representation of the input data that is useful for multiple tasks. We derive theoretical guarantees on the learned model, establishing that the representation will still reduce bias even when transferred to novel tasks.

We propose a learning algorithm that imposes constraints based on two different ways of measuring distances between probability distributions, maximum mean discrepancy and Sinkhorn divergence. Keeping this distance small ensures that we represent similar inputs in a similar way when they differ only on the sensitive attribute. We present experiments on three real-world datasets, showing that the proposed method outperforms state-of-the-art approaches by a significant margin.

Algorithmic fairness is a topic of great importance, with impact on many applications. In our work, we have attempted to take a small step forward, but the issue requires much further research; even the definition of what “being fair” means for an ML model is still an open research question.

It’s also becoming clearer that we need to keep humans in the loop during the lifecycle of ML models, to evaluate whether the models are acting as we would like them to. In this sense, it is important to note that many other research subjects – such as the explainability, interpretability, and privacy of ML models – are deeply connected to algorithmic fairness. They can work in synergy, with the common goal of increasing the trustworthiness of ML models.

Research areas

Related content

US, CA, Sunnyvale
We are seeking an Applied Scientist II to work on development of an AI-based data intelligence and classification platform that will redefine how security and privacy assessments and enforcement are conducted at scale. This mission-critical platform will leverage AI-driven autonomous agents to conduct proactive, intelligent security operations across the company. The platform will integrate deeply with internal security, privacy, engineering, and cloud-native tools to provide self-serve, automated insights, verifications, and enforcement mechanisms. This role requires strong technical expertise in AI/ML, LLMs, and distributed cloud infrastructure, as well as thought leadership to drive alignment across multiple teams, customers, and business units. This is an opportunity to shape the future of AI-driven security and privacy assurance at an enterprise scale, defining standards, influencing company-wide security posture, and leading technical innovation at the highest level. Key job responsibilities * Architect and define the next-generation data classification and search matching platform, leading the technical strategy for AI-driven security automation across applied science and engineering teams * Build on multi-agent LLM framework, and influence your organizations in adopting the promising approaches * Develop a highly scalable, traditional ML-based as well as LLM-based intelligent security agent framework that enables internal teams to automate processing of structured and unstructured data * Combine depth and breadth of domain expertise and provide technical leadership to the entire team while also doing hands-on work by diving deep into details to diagnose complex system performance problems. About the team The Data Categorization team helps Amazonians understand their data and govern it at scale and ensures experiences delivered by Amazon to our customers uphold our high security and privacy standards. The science team harnesses AI to strengthen Amazon’s privacy and security posture more efficiently and effectively.
GB, London
Applied Scientists in AWS Automated Reasoning are dedicated to making AWS the best computing service in the world for customers who require advanced and rigorous solutions for automated reasoning, privacy, and sovereignty. Key job responsibilities The successful candidate will: - Solve large or significantly complex problems that require deep knowledge and understanding of your domain and scientific innovation. - Own strategic problem solving, and take the lead on the design, implementation, and delivery for solutions that have a long-term quantifiable impact. - Provide cross-organizational technical influence, increasing productivity and effectiveness by sharing your deep knowledge and experience. - Develop strategic plans to identify fundamentally new solutions for business problems. - Assist in the career development of others, actively mentoring individuals and the community on advanced technical issues. A day in the life This is a unique and rare opportunity to get in early on a fast-growing segment of AWS and help shape the technology, product and the business. You will have a chance to utilize your deep technical experience within a fast moving, start-up environment and make a large business and customer impact. About the team Diverse Experiences Amazon Automated Reasoning values diverse experiences. Even if you do not meet all of the 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. Why Amazon Automated Reasoning? At Amazon, automated reasoning is central to maintaining customer trust and delivering delightful customer experiences. Our organization is responsible for creating and maintaining a high bar for automated reasoning across all of Amazon's products and services. We offer talented automated reasoning professionals the chance to accelerate their careers with opportunities to build experience in a wide variety of areas including cloud, devices, retail, entertainment, healthcare, operations, and physical stores. Inclusive Team Culture In Amazon Automated Reasoning, it's in our nature to learn and be curious. Ongoing DEI events and learning experiences inspire us to continue learning and to embrace our uniqueness. Addressing the toughest automated reasoning challenges requires that we seek out and celebrate a diversity of ideas, perspectives, and voices. Training & 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, training, 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 flexible work hours and arrangements are part of our culture. When we feel supported in the workplace and at home, there's nothing we can't achieve.
US, CA, Sunnyvale
Are you excited about developing state-of-the-art Machine Learning, Natural Language Processing, Deep Learning and Computer Vision algorithms and designs using large data sets to solve real world problems? Do you have proven analytical capabilities and can multi-task and thrive in a fast-paced environment? Do you want to build a foundation for your career after your Master's or Ph.D program at an industry-leading company? You enjoy the prospect of solving real-world problems that, quite frankly, have not been solved at scale anywhere before. Along the way, you’ll get opportunities to be a disruptor, prolific innovator, and a reputed problem solver—someone who truly enables machine learning to create significant impacts. As an Applied Scientist, you will bring statistical modeling and machine learning advancements to data analytics for customer-facing solutions in complex industrial settings. You will be working in a fast-paced, cross-disciplinary team of researchers who are leaders in the field. You will take on challenging problems, distill real requirements, and then deliver solutions that either leverage existing academic and industrial research, or utilize your own out-of-the-box pragmatic thinking. In addition to coming up with novel solutions and prototypes, you may even need to deliver these to production in customer facing products
US, WA, Seattle
We are seeking a senior Applied Scientist to join a science team within Amazon Customer Service that is reimagining how customers are connected with the right support experience. This is a senior technical leadership role where you will drive scientific strategy, mentor junior scientists, and deliver foundational models that power real-time personalization at scale. Key job responsibilities - Lead the science for understanding the demand side of customer service interactions - Characterize who is contacting us, what they need, and how complex their situation is - Invent novel representation learning approaches that encode customer interactions - Directly inform intelligent routing decisions across hundreds of millions of annual contacts
US, WA, Seattle
We are seeking an Applied Scientist to join a science team within Amazon Customer Service that is reimagining how customers are connected with the right support experience. This is a role at the intersection of representation learning, behavioral modeling, and large-scale experimentation where you will see your science deployed in production systems serving real-time decisions. Key job responsibilities - Develop machine learning models that capture how service associates perform across different problem types and how their capabilities evolve over time - Power intelligent routing decisions across hundreds of millions of annual customer contacts - Directly improve both customer experience and associate satisfaction through model-driven decisions - Work at the intersection of representation learning, behavioral modeling, and large-scale experimentation - Deploy science into production systems serving real-time decisions
US, CA, Sunnyvale
Amazon's PRISM team is seeking an innovative Applied Scientist to build the intelligence layer powering the Catalog Diagnostic Assistant — a conversational AI agent that unifies Amazon's fragmented catalog diagnostic experience into a single natural-language interface. Rather than switching between legacy tools, internal users ask CDA a question in plain language and CDA coordinates across data sources, reasons through complex diagnostic workflows, and returns a combined answer with source citations. This role sits at the intersection of Generative AI, agentic architectures, and large-scale information retrieval applied to the world's largest product catalog. You will design and build the scientific core of an agent that autonomously investigates catalog anomalies — diagnosing why products aren't live, why attributes aren't publishing, or why matching decisions went wrong — across billions of products, petabytes of multimodal data, and dozens of marketplaces. You will be the founding scientist for the CDA product, defining the research agenda for agentic diagnostics, developing novel approaches to skill-based reasoning and tool orchestration, and owning the full lifecycle from problem formulation through production deployment at Amazon scale. You will pioneer advanced GenAI solutions that power next-generation agentic experiences, working in a collaborative environment where you can experiment with massive data from the world's largest product catalog and tackle problems at the frontier of AI research. Key job responsibilities - Formulate open research problems at the intersection of GenAI, agentic reasoning, and large-scale catalog diagnostics — defining how an autonomous agent should decompose, investigate, and explain complex catalog issues - Design and develop novel agentic architectures (skill planning, tool selection, multi-step reasoning, chain-of-thought verification) that enable CDA to autonomously resolve diagnostic workflows that traditionally required manual expert investigation - Build and optimize retrieval-augmented generation (RAG) systems over Amazon's catalog data, ensuring the agent retrieves the right evidence from the right data sources to ground its diagnostic answers - Advance the science of efficient model deployment — developing distillation, compression, and LLM serving optimization strategies that preserve diagnostic reasoning quality in production-grade architectures while reducing latency and cost - Make frontier models reliable for autonomous decisions — advancing uncertainty calibration, confidence estimation, and interpretability methods so CDA's agentic diagnoses can be trusted at scale - Own the full research lifecycle from problem formulation through production deployment — designing rigorous experiments, iterating rapidly, and seeing your research directly improve diagnostic accuracy and coverage - Partner closely with CDA engineers to translate research prototypes into production systems serving thousands of daily diagnostic sessions - Shape the team's research vision by defining technical roadmaps that balance foundational scientific inquiry with measurable product impact - Mentor engineers on advanced ML/GenAI techniques, experimental design, and scientific rigor About the team We are a GenAI science team within Amazon's Selection and Catalog Systems (ASCS) organization. Our mission is to advance state-of-the-art Generative AI to deeply understand, uniquely identify, and intelligently diagnose every product at Amazon scale. We push the boundaries of multimodal LLMs, agentic systems, and generative AI to solve foundational catalog challenges — from product identity and semantic matching to automated catalog diagnostics and intelligent catalog analytics. Our scientists work across multiple high-impact problem spaces: establishing canonical product identity across billions of items, powering next-generation agentic experiences for catalog operations, and building AI systems that make Amazon's catalog self-diagnosing and self-healing. We operate at the frontier of AI research applied at unprecedented scale — petabytes of multimodal data, millions of sellers, dozens of languages, and infinite product diversity. This is a collaborative, fast-moving environment where you can experiment with massive data from the world's largest product catalog, tackle problems at the frontier of AI research, rapidly implement and deploy your ideas at scale, and publish your findings at top venues.
US, CA, San Francisco
We are seeking a Member of Technical Staff — Mechanical Engineer to lead the structural and electromechanical design of advanced high degree-of-freedom robotic systems within a frontier AI and robotics research lab. You will own the mechanical architecture of our robotics platform end-to-end: actuator selection, joint design, thermal management, cable routing, sensing integration, and structural optimization — all under the demanding constraints of a high-DoF system that must be lightweight, robust, and production-viable. This is a unique opportunity to define the physical design direction of a next-generation robotics platform from first principles. The ideal candidate has deep experience designing complex robotic systems and scaling hardware from concept through prototyping to production. You thrive on analytical problem solving, possess strong intuition for structural and electromechanical tradeoffs, and are equally comfortable in CAD and on the shop floor. You will be the technical lead of a small team of talented mechanical engineers while collaborating closely with electrical, firmware, controls, and AI research teams to set the mechanical and structural direction of the platform. Beyond core platform development, this role offers real latitude to push into novel territory — novel actuation methods, advanced sensor integration, or new approaches to mechatronic packaging. If you have research instincts alongside shipping discipline, you'll find an environment that rewards both. We're looking for someone who wants to be the technical authority on how a high-performance robot is physically built, not just a contributor to the effort. What You Bring: - A systems-thinking mindset with a strong grasp of cross-domain engineering tradeoffs. - A bias toward action: comfortable building, testing, and iterating rapidly. - A collaborative and communicative working style — especially in multi-disciplinary research environments. - A passion for robotics and advancing the state of the art in intelligent, capable machines. Key job responsibilities - Lead mechanical design of robotic subsystems and full platforms, including structures, joints, enclosures, and mechanisms for a research environment. - Own kinematic, dynamic, and structural analyses to guide the design and optimization of full systems and subsystems of high-DoF robots - Specify and integrate actuators and motors for high-torque density applications in high-degree-of-freedom systems. - Drive rapid iteration and prototyping cycles — from concept sketches through functional hardware — to accelerate learning and compress development timelines in a fast-paced R&D environment. - Partner with the AI research team to establish simulation pipelines that enable rapid exploration of mechanical design space, informing actuator choices, structural topology, and system-level tradeoffs before committing to physical builds. - Contribute to thermal management strategies for motors, sensors, and embedded compute hardware. - Integrate sensors such as lidar, stereo cameras, IMUs, tactile sensors, and compute modules into compact, functional assemblies. - Design and route cabling and wire harnesses, ensuring reliability, serviceability, and thermal/electrical integrity. - Prototype and test mechanical systems; support hands-on builds, debug sessions, and field testing. - Conduct root cause analysis on system-level failures or performance issues and implement design improvements. - Apply Design for Manufacturing (DFM) and Design for Assembly (DFA) principles to transition prototypes into scalable builds (10s–100s of units). - Collaborate with cross-functional teams in electrical engineering, controls, perception, and research to meet research and product goals. About the team Frontier AI & Robotics (FAR) is the team at Amazon building the next generation of embodied intelligence. FAR drives the development and implementation of advanced AI models within Amazon’s operations that enable robots to see, reason, and act on the world around them, supporting a number of different warehouse automation tasks.
IN, KA, Bengaluru
Do you want to join an innovative team of scientists who use machine learning and statistical techniques to create state-of-the-art solutions for providing better value to Amazon’s customers? Do you want to build and deploy advanced algorithmic systems that help optimize millions of transactions every day? Are you excited by the prospect of analyzing and modeling terabytes of data to solve real world problems? Do you like to own end-to-end business problems/metrics and directly impact the profitability of the company? Do you like to innovate and simplify? If yes, then you may be a great fit to join the Machine Learning and Data Sciences team for India Consumer Businesses. If you have an entrepreneurial spirit, know how to deliver, love to work with data, are deeply technical, highly innovative and long for the opportunity to build solutions to challenging problems that directly impact the company's bottom-line, we want to talk to you. Major responsibilities - Use machine learning and analytical techniques to create scalable solutions for business problems - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes - Design, development, evaluate and deploy innovative and highly scalable models for predictive learning - Research and implement novel machine learning and statistical approaches - Work closely with software engineering teams to drive real-time model implementations and new feature creations - Work closely with business owners and operations staff to optimize various business operations - Establish scalable, efficient, automated processes for large scale data analyses, model development, model validation and model implementation - Mentor other scientists and engineers in the use of ML techniques Key job responsibilities Use machine learning and analytical techniques to create scalable solutions for business problems Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes Design, develop, evaluate and deploy, innovative and highly scalable ML models Work closely with software engineering teams to drive real-time model implementations Work closely with business partners to identify problems and propose machine learning solutions Establish scalable, efficient, automated processes for large scale data analyses, model development, model validation and model maintenance Work proactively with engineering teams and product managers to evangelize new algorithms and drive the implementation of large-scale complex ML models in production Leading projects and mentoring other scientists, engineers in the use of ML techniques About the team International Machine Learning Team is responsible for building novel ML solutions that attack India first (and other Emerging Markets across MENA and LatAm) problems and impact the bottom-line and top-line of India business. Learn more about our team from https://www.amazon.science/working-at-amazon/how-rajeev-rastogis-machine-learning-team-in-india-develops-innovations-for-customers-worldwide
IN, KA, Bengaluru
RBS (Retail Business Services) Tech team works towards enhancing the customer experience (CX) and their trust in product data by providing technologies to find and fix Amazon CX defects at scale. Our platforms help in improving the CX in all phases of customer journey, including selection, discoverability & fulfilment, buying experience and post-buying experience (product quality and customer returns). As a Sciences team in RBS Tech, we focus on foundational ML research and develop scalable state-of-the-art ML solutions to solve the problems covering customer experience (CX) and Selling partner experience (SPX). We work to solve problems related to multi-modal understanding (text and visual), supervised and unsupervised techniques, multi-task learning, multi-label classification, aspect and topic extraction for Customer Anecdote Mining, product similarity, using GenAI, LLMs, NLP and Computer Vision. Key job responsibilities As an Applied Science Manager, you will be responsible to design and deploy scalable GenAI, NLP and Computer Vision solutions that will impact the content visible to millions of customer and solve key customer experience issues. You will Lead scientists on the team and oversee research and development projects at various stages ranging from initial exploration to deployment into production systems. You will partner with business and engineering teams to identify and solve large and significantly complex problems that require scientific innovation. You will help the team leverage your expertise, by coaching and mentoring. You will contribute to the professional development of colleagues, improving their technical knowledge and the engineering practices. You will create the environment in the team to file for patents and/or publish research work where opportunities arise. You will impact the large product strategy, identifies new business opportunities and provides strategic direction to the team.
US, VA, Arlington
The AWS Certification team is seeking a Psychometrician with experience working with criterion-referenced assessment programs to support a large global AWS Certification and Credentialing program. In this role, you will support all psychometric aspects of exam development and operation, including job analyses, standard setting, automated test assembly, item and test analyses, optimal item bank design, quality assurance, and project planning. You will work closely with a team of psychometricians, subject matter experts, certification exam program managers, publishing, delivery, security, and product management teams to support ongoing analyses of exam and credential data. To be successful in this position, you must be highly motivated, creative, detail oriented, and a self-starter who is able to think big, execute, ensure high quality, yet stay focused on the details. Key job responsibilities • Conduct Job Task Analysis (JTA) workshops and post-JTA survey analyses to define the blueprint and test specifications for new certifications or updates to existing certifications • Conduct standard setting studies to set the passing score for exams and credentials • Run item analysis to evaluate quality and performance of exam items • Use automated test assembly procedures to assemble forms or item pools • Work with content development to track item bank trends and optimize the health of item banks • Support the development of a cloud-based analytics and reporting system • Partake in development and performance analysis of credentials • Interpret and clearly communicate the results of analyses to stakeholders through written and oral reports • Follow the accreditation standards set by ISO/IEC:2012 17024 and the National Council for Certifying Agencies (NCCA) as they relate to valid psychometric practices • Contribute to the development and execution of the strategic goals regarding the AWS certification and credentialing program. • Consult with leadership, internal staff, external consultants, and industry leaders regarding advancement of current offerings