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, San Francisco
PXT Central Science is seeking an exceptional Data Scientist to join our team. The ideal candidate will thrive in a dynamic, multifaceted role where you'll translate complex business challenges into rigorous quantitative frameworks, extract actionable insights from structured and unstructured datasets, and architect science-backed, scalable solutions that elevate the experience of our 1 million+ employees worldwide. If you're energized by the opportunity to apply data science to our mission of making Amazon Earth's Best Employer, we want to hear from you. Key job responsibilities • Own the design, development, and maintenance of scalable models and prototypes leveraging statistical, machine learning, or GenAI methodologies to enhance employee experience. • Partner with scientists, engineers, and product leaders to solve for employee experience defects using scientific approaches, building new services and tools that deliverable measurable impact. • Author and maintain detailed technical documentation related to the projects you drive. • Communicate results to diverse audiences of varying technical background with effective writing, visualizations, and presentations • Stay current with emerging methods and technologies, and implement them strategically to amplify the team’s impact. About the team The Central Science Team within Amazon’s People Experience and Technology org (PXTCS) uses economics, behavioral science, statistics, machine learning, and Generative AI to proactively identify mechanisms and process improvements which simultaneously improve Amazon and the lives, well-being, and the value of work to Amazonians. We are an interdisciplinary team, which combines the talents of science, engineering, and UX to develop and deliver solutions that measurably achieve this goal.
US, MA, N.reading
Amazon is seeking exceptional talent to help develop the next generation of advanced robotics systems that will transform automation at Amazon's scale. We're building revolutionary robotic systems that combine cutting-edge AI, sophisticated control systems, and advanced mechanical design to create adaptable automation solutions capable of working safely alongside humans in dynamic environments. This is a unique opportunity to shape the future of robotics and automation at an unprecedented scale, working with world-class teams pushing the boundaries of what's possible in robotic dexterous manipulation, locomotion, and human-robot interaction. This role presents an opportunity to shape the future of robotics through innovative applications of deep learning and large language models. At Amazon we leverage advanced robotics, machine learning, and artificial intelligence to solve complex operational challenges at an unprecedented scale. Our fleet of robots operates across hundreds of facilities worldwide, working in sophisticated coordination to fulfill our mission of customer excellence. The ideal candidate will contribute to research that bridges the gap between theoretical advancement and practical implementation in robotics. You will be part of a team that's revolutionizing how robots learn, adapt, and interact with their environment. Join us in building the next generation of intelligent robotics systems that will transform the future of automation and human-robot collaboration. Key job responsibilities - Design and implement whole body control methods for balance, locomotion, and dexterous manipulation - Utilize state-of-the-art in methods in learned and model-based control - Create robust and safe behaviors for different terrains and tasks - Implement real-time controllers with stability guarantees - Collaborate effectively with multi-disciplinary teams to co-design hardware and algorithms for loco-manipulation - Mentor junior engineer and scientists
US, WA, Seattle
Do you want to work on Reinforcement Learning (RL) post-training of frontier Large Language Models (LLMs) to revolutionize customer service? Come join the world class researchers and academics in the AWS AI endeavor, and develop the science that powers countless new businesses in cloud computing! AWS, the world-leading provider of cloud services. Our customers bring problems that will give Applied Scientists like you endless opportunities to see your research have a positive and immediate impact in the world. You will have the opportunity to partner with technology and business teams to solve real-world problems, have access to virtually endless data and computational resources, and to world-class engineers and developers that can help bring your ideas into the world. As part of the team, we expect that you will develop innovative solutions to hard problems, and publish your findings at peer reviewed conferences and journals. The scientific topics you are going to work on include, but are not limited to: LLM post-training to improve capabilities particularly for instruction following, reasoning over long context, and tool use, etc. 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 (gender diversity) conferences, inspire us to never stop embracing our uniqueness. 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. 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. 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.
US, MA, North Reading
Are you inspired by invention? Is problem solving through teamwork in your DNA? Do you like the idea of seeing how your work impacts the bigger picture? Answer yes to any of these and you’ll fit right in here at Amazon Robotics. We are a smart team of doers that work passionately to apply advances in robotics and software to solve real-world challenges that will transform our customers’ experiences in ways we can’t even imagine yet. We invent new improvements every day. We are Amazon Robotics and we will give you the tools and support you need to invent with us in ways that are rewarding, fulfilling and fun. Amazon Robotics is seeking experienced and Senior Applied Scientist with a passion for robotic research. Our team works on challenging and high-impact projects within robotics. Examples of projects include allocating resources to complete a million orders a day, coordinating the motion of thousands of robots and identifying objects and damage. Key job responsibilities - Lead research initiatives advancing AI-driven structured field robotics (path planning, fleet coordination, control systems) and translate breakthroughs into production solutions at global scale - Own end-to-end delivery of complex algorithmic solutions from design through production deployment and operational maintenance - Drive technical decisions for Control, Coordination, and Path Planning systems meeting performance, scalability, and reliability requirements - Partner with cross-functional teams to translate business requirements into research problems and assess technical risks - Influence technical direction across the broader robotics organization through design reviews and technical discussions with senior engineers and scientists - Demonstrate measurable impact through AI-driven algorithmic improvements: fleet efficiency gains, operational cost reduction, system reliability improvements, and enhanced customer experience - Publish findings at top-tier AI and robotics conferences representing organizational technical leadership - Mentor junior Applied Scientists on research methodology and balancing innovation with production constraints - Operate independently on ambiguous, multi-quarter problems requiring novel AI approaches while navigating tradeoffs between research innovation and production constraints A day in the life Amazon offers a full range of benefits that support you and eligible family members, including domestic partners and their children. Benefits can vary by location, the number of regularly scheduled hours you work, length of employment, and job status such as seasonal or temporary employment. The benefits that generally apply to regular, full-time employees include: - Medical, Dental, and Vision Coverage - Maternity and Parental Leave Options - Paid Time Off (PTO) - 401(k) Plan If you are not sure that every qualification on the list above describes you exactly, we'd still love to hear from you! At Amazon, we value people with unique backgrounds, experiences, and skillsets. If you’re passionate about this role and want to make an impact on a global scale, please apply! About the team We're the structured field robotics organization powering large-scale mobile robotics operations globally. Our mission is to enable safe, efficient, and reliable robotic operations through intelligent Control, Coordination, and Path Planning systems. We operate at the intersection of planning, algorithmic, and ML research with production systems, owning the full stack from innovation to deployment. Our culture balances research excellence with operational ownership. Applied Scientists partner closely with engineers: reviewing code, contributing to research discussions, and solving problems together. We value deep technical expertise alongside pragmatic engineering judgment. We invest in our people through mentorship and encourage conference participation and knowledge sharing.
US, WA, Seattle
Prime Video is a first-stop entertainment destination offering customers a vast collection of premium programming in one app available across thousands of devices. Prime members can customize their viewing experience and find their favorite movies, series, documentaries, and live sports – including Amazon MGM Studios-produced series and movies; licensed fan favorites; and programming from Prime Video subscriptions such as Apple TV+, HBO Max, Peacock, Crunchyroll and MGM+. All customers, regardless of whether they have a Prime membership or not, can rent or buy titles via the Prime Video Store, and can enjoy even more content for free with ads. Are you interested in shaping the future of entertainment? Prime Video's technology teams are creating best-in-class digital video experience. As a Prime Video team member, you’ll have end-to-end ownership of the product, user experience, design, and technology required to deliver state-of-the-art experiences for our customers. You’ll get to work on projects that are fast-paced, challenging, and varied. You’ll also be able to experiment with new possibilities, take risks, and collaborate with remarkable people. We’ll look for you to bring your diverse perspectives, ideas, and skill-sets to make Prime Video even better for our customers. With global opportunities for talented technologists, you can decide where a career Prime Video Tech takes you! Key job responsibilities As a highly experienced and seasoned science leader, you will apply state of the art natural language processing and computer vision research to video centric digital media, while also responsible for creating and maintaining the best environment for applied science in order to recruit, retain and develop top talent. You will lead the research direction for a team of deeply talented applied scientists, creating the roadmaps for forward-looking research and communicate them effectively to senior leadership. You will also hire and develop applied scientists - growing the team to meet the evolving needs of our customers. About the team This team's mission is to deeply understand all content and empower all customers with relevant language options, innovative accessibility assists, and rich title-information across all their content-experiences on Prime Video. We create and publish content on-time that's meaningful, accurate, and accessible to every customer globally. We delight our customers by pushing the boundaries of content understanding and enrichment. Through inclusion and innovation, we do the most fulfilling work of our career.
US, CA, San Francisco
The Amazon General Intelligence “AGI” organization is looking for an Executive Assistant to support leaders of our Autonomy Team in our growing AI Lab space located in San Francisco. This role is ideal for exceptionally talented, dependable, customer-obsessed, and self-motivated individuals eager to work in a fast paced, exciting and growing team. This role serves as a strategic business partner, managing complex executive operations across the AGI organization. The position requires superior attention to detail, ability to meet tight deadlines, excellent organizational skills, and juggling multiple critical requests while proactively anticipating needs and driving improvements. High integrity, discretion with confidential information, and professionalism are essential. The successful candidate will complete complex tasks and projects quickly with minimal guidance, react with appropriate urgency, and take effective action while navigating ambiguity. Flexibility to change direction at a moment's notice is critical for success in this role. Key job responsibilities Key job responsibilities Serve as strategic partner to senior leadership, identifying opportunities to improve organizational effectiveness and drive operational excellence Manage complex calendars and scheduling for multiple executives Drive continuous improvement through process optimization and new mechanisms Coordinate team activities including staff meetings, offsites, and events Schedule and manage cost-effective travel Attend key meetings, track deliverables, and ensure timely follow-up Create expense reports and manage budget tracking Serve as liaison between executives and internal/external stakeholders Build collaborative relationships with Executive Assistants across the company and with critical external partners Help us build a great team culture in the Lab!
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). The team also develops GenAI platforms for automation of Amazon Stores Operations. 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 images), task automation through multi-modal LLM Agents, supervised and unsupervised techniques, multi-task learning, multi-label classification, aspect and topic extraction for Customer Anecdote Mining, image and text similarity and retrieval using NLP and Computer Vision for product groupings and identifying duplicate listings in product search results. Key job responsibilities As a Data Scientist, 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 develop novel LLM, deep learning and statistical techniques for task automation, text processing, image processing, pattern recognition, and anomaly detection problems. You will define the research and experiments strategy with an iterative execution approach to develop AI/ML models and progressively improve the results over time. 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 independently as well as guide team to file for patents and/or publish research work where opportunities arise. The RBS org deals with problems that are directly related to the selling partners and end customers and the ML team drives resolution to organization level problems. Therefore, the Data Scientist role will impact the large product strategy, identifies new business opportunities and provides strategic direction which is very exciting.
IN, KA, Bengaluru
We are looking for a Senior Applied Scientist to help establish and lead the technical direction of our newly formed team in Bangalore. In this role, you will drive the research and development of next-generation machine learning models spanning computer vision, audio processing, and multimodal semantic understanding. You will help define the science roadmap, tackle high-ambiguity problems across modalities, and deliver solutions that operate at scale. This is a rare opportunity to shape the technical vision, culture, and long-term research agenda of a greenfield site. Key job responsibilities Model Development & Technical Leadership: Architect and drive development of advanced deep learning models for CV, audio understanding, and multimodal semantic fusion — setting the technical bar and defining best practices for the team. End-to-End Ownership: Own complex ML programs end-to-end — from identifying high-impact problems, designing data strategies and evaluation frameworks, through experimentation, optimization, and deployment at production scale. Research & Innovation: Define the science roadmap for your area; drive novel research directions in multimodal learning and deliver results that advance both the product and the broader field. Publications & Thought Leadership: Maintain an active publication record at top-tier venues (e.g. CVPR, NeurIPS, ICASSP, ICCV, ACL) and represent the team externally in the research community. Mentorship & Culture Building: Mentor scientists and engineers, raise the technical bar through hiring, and play a foundational role in establishing the Bangalore site's culture, processes, and scientific identity. A day in the life An Applied Scientist with the Alexa Edge AI team will lead science solution design, run experiments, research new algorithms, and find new ways of optimizing the customer experience; while setting examples for the team on good science practice and standards. Besides theoretical analysis and innovation, a Sr. Applied Scientist will also drive cross functional collaboration with talented engineers and scientists to put algorithms and models into production. About the team The Alexa Edge AI team has a mission to deliver best in class, resource efficient multimodal AI models in support of various perception (vision, audio and speech) and semantic understanding based applications for devices like Echo Show series within Amazon.
IN, KA, Bengaluru
The Alexa Edge AI team is seeking a talented and motivated Applied Scientist to join our newly established team in Bangalore. In this role, you will design, develop, and deploy state-of-the-art machine learning models spanning computer vision (CV), audio (including speech) processing, and multimodal semantic understanding for both edge and cloud deployment. You will work at the intersection of multiple modalities to build systems that can perceive, interpret, and reason about the world — pushing the boundaries of what's possible in unified multimodal intelligence. This is a unique opportunity to be a founding member of a brand-new site, shaping the team culture, technical direction, and research agenda from the ground up. Key job responsibilities Model Development: Design and build deep learning models for computer vision, audio understanding, and multimodal semantic fusion — including architectures that enable joint reasoning across visual, auditory, and textual modalities. End-to-End Ownership: Own the full ML lifecycle — from problem formulation, data strategy, and annotation design through experimentation, evaluation frameworks, model optimization, and deployment at scale. Research & Innovation: Stay at the frontier of CV, audio ML, and multimodal learning; identify and apply cutting-edge techniques and contribute to the scientific community through papers at top-tier venues (CVPR, NeurIPS, ICASSP, ICCV, ACL). Mentorship & Culture Building: As a founding member of the Bangalore site, help hire, onboard, and establish the technical practices that define the team's culture. A day in the life An Applied Scientist with the Alexa Edge AI team will support science solution design, run experiments, research new algorithms, and find new ways of optimizing the customer experience; while setting examples for the team on good science practice and standards. Besides theoretical analysis and innovation, an Applied Scientist will also work closely with talented engineers and scientists to put algorithms and models into production. About the team The Alexa Edge AI team has a mission to deliver best in class, resource efficient multimodal AI models in support of various perception (vision, audio and speech) and semantic understanding based applications for devices like Echo Show series within Amazon.
IN, KA, Bengaluru
The Alexa Edge AI team is seeking a talented and motivated Applied Scientist to join our newly established team in Bangalore. In this role, you will design, develop, and deploy state-of-the-art machine learning models spanning computer vision (CV), audio (including speech) processing, and multimodal semantic understanding for both edge and cloud deployment. You will work at the intersection of multiple modalities to build systems that can perceive, interpret, and reason about the world — pushing the boundaries of what's possible in unified multimodal intelligence. This is a unique opportunity to be a founding member of a brand-new site, shaping the team culture, technical direction, and research agenda from the ground up. Key job responsibilities Model Development: Design and build deep learning models for computer vision, audio understanding, and multimodal semantic fusion — including architectures that enable joint reasoning across visual, auditory, and textual modalities. End-to-End Ownership: Own the full ML lifecycle — from problem formulation, data strategy, and annotation design through experimentation, evaluation frameworks, model optimization, and deployment at scale. Research & Innovation: Stay at the frontier of CV, audio ML, and multimodal learning; identify and apply SOTA techniques and contribute to the scientific community through papers at top-tier venues (CVPR, NeurIPS, ICASSP, ICCV, ACL). Mentorship & Culture Building: As a founding member of the Bangalore site, help hire, onboard, and establish the technical practices that define the team's culture. A day in the life An Applied Scientist with the Alexa Edge AI team will support science solution design, run experiments, research new algorithms, and find new ways of optimizing the customer experience; while setting examples for the team on good science practice and standards. Besides theoretical analysis and innovation, an Applied Scientist will also work closely with talented engineers and scientists to put algorithms and models into production. About the team The Alexa Edge AI team has a mission to deliver best in class, resource efficient multimodal AI models in support of various perception (vision, audio and speech) and semantic understanding based applications for devices like Echo Show series within Amazon.