Hello.
In this module, I'm going to first show you
how minimizing the average error on your training examples
can actually lead to disparities between--
in performance between groups.
And then I'm going to show you a simple approach called
group distribution and robust optimization that can mitigate
some of these disparities.
So let me begin with a very famous example of disparities
or inequalities in machine learning,
it's called the Gender Shades project.
In this project, the authors collected a data set
of images of faces of different genders and different skin
tones.
And then, they evaluated a gender classifier from
Microsoft, Face++, and IBM.
What they found was rather striking.
So for a group of lighter skinned males,
the classifier was almost perfect.
But if you look at the performance of this classifiers
on darker skinned females, you'll
see that the accuracies are much, much worse.
So this is a general problem in machine learning, which
is that inequalities between different groups
arise because machine learning is generally where
you minimize the average loss.
So, these inequalities can have real world consequences.
So in this vivid case, a Black man
was wrongly arrested due to an incorrect match
with another Black man captured from a surveillance video.
And this mistake was due to a mistake made
by a facial recognition system.
So given what we just saw on the Gender Shades project,
we can see that lower accuracies for some groups
might lead to more false arrests, which
adds to already problematic inequalities that
exist in our society today.
So in this module, I'm going to focus
on this issue of performance disparities between groups
and how we might be able to mitigate them.
But I also want to highlight that even if we didn't have
any disparities between groups, there's
a question of whether facial recognition technology should
be used in law enforcement or in surveillance or anything
at all.
And these are big thorny ethical questions,
which we're not going to unfortunately
be able to spend much time with in this module.
But I just want to highlight that it's
important to remember that sometimes the issue is
not with the solution but in the framing of the problem itself.
So Gender Shades was an example of classification.
But to make things simpler, let us consider our friend
linear regression.
So recall in linear regression, we
start with a training set, which consists of examples.
Each example has an input x and output y.
But in our case, we're going to assume each example is also
annotated with a group g.
So we're going to have a set of-- let's plot this over here.
So here's 1, 4.
And here's a second example, 2, 8, which is up here.
And then these examples down here
are going to come from group B. So we're
going to have two groups, A and B,
and here they are over here, OK?
So the goal of machine learning or linear regression,
in particular, is to produce a predictor such as this one.
And the predictor is going to take new inputs such as 3
and produce an output, such as 3.27.
So in linear regression, we assume
that the predictor has the form a weight vector, dot, a feature
vector, phi of x.
In this simple example, we're going to restrict ourselves
to the case where the feature vector is simply the identity
map-- just x--
which gives us a hypothesis class,
which is the set of all lines that go through the origin.
So you can think about sweeping lines through the origin here.
And the weight vector is just going to be a single number, w.
So already you can see some tension here.
So which weight vector would you choose?
Would you choose one that's closer
to these points in group B or in group A?
And this tension means that we have to compromise somehow.
And exactly how we compromise is going
to have some implications.
So notice also that the predictor doesn't
use group information, it just takes an input x as before.
What's going to use group information
is the learning algorithm, and we'll get to that a little bit
later.
So just as a review, for linear regression,
we define the loss function of an input x y and a particular
weight vector to be simply the difference between
the predicted value of that classifier-- or sorry--
progressor f of w and the target value of y squared.
And remember that we defined the training
loss of a particular weight vector as follows.
It's going to be the average.
So 1 over a number of training examples over sum
of the training examples of the per example loss.
So visually, we can see this on this plot where
for each value of w--
in our case here, remember w is a scalar
for this particular example--
we get a loss value.
So this is the training loss, which is this curve here.
And what we can do is let's practice
evaluating this training loss at a particular value of w,
let's say 1.
So this is going to take the average over this data set
and it's going to return some value, 7.5, OK?
So the loss of--
the average loss at w equals 1 is 7.5.
Which seems OK.
But now let's remember-- let's peer a little bit closer at how
the loss is spread across groups.
So we're going to define a notion of a per-group loss.
So here's our training set.
So for group A, what is this loss?
In group B, group B what is this loss?
So formally, we're going to define
the per-group loss, writting train loss sub g for group g.
g can be either A or B. To be the average now over only
those examples in that group.
So this notation D train of g is the set of examples in Group g
and of the example loss again, OK?
So we're going to plot these two losses on this curve here.
And we see that we have these two plots.
So train loss A it looks like this and train loss B
looks like that.
And we can practice evaluating these different loss functions
at our example weight vector 1 here.
So train loss A is going to be an average-- remember,
only over the examples in group A--
and that's going to give us 22.5.
You can see it looks like about 22.5 here.
And then what about B?
So B actually gets a loss of 0, which
you can see at this point.
So you can see that we have a single weight vector 1.
Gets very different losses on the two data
sets, on the two groups.
A is doing a lot worse, it has 22.5,
and B is doing much better, it has
a 0, which is the minimum loss you can hope for.
So this is an example of a disparity between--
if we were to choose weight vector 1,
there would be a huge disparity between the performance
on these two groups.
So we can look at the losses of different groups,
but it will be helpful to kind of summarize
that as a single number.
Now we're going to capture it by a quantity called
the maximum group loss.
And you might guess from the name
that the maximum group loss, written TrainLossMax
is simply just going to be the maximum over all groups
of the per-group loss.
And so visually what this looks like is as follows.
So let me-- so remember we had in yellow here
or orange the loss of group A and in blue, we
have the loss of group B, and the maximum group
loss is this function of w, as the other functions, which
is going to be the point wise maximum.
So at every point, we choose either the value
of loss of A or B that's going to be larger.
So as you can see, it traces out this kind of upper envelope
here.
Over here, the loss of A is higher,
so it's going to track that.
And over here the loss of B is higher so
it kind of hugs B from there on.
OK.
So let's evaluate at a point w equals 1.
We see that-- remember from the previous slide
that the two losses are 22.5 and 0 for the two groups.
And then to compute the maximum, we
just take the max of these two values and you get 22.5.
So 22.5 is a single number that summarizes
how bad is the worst group off.
The max was the maximum group loss.
And if you compare the maximum group loss, 22.5,
with the average loss, which is 7.5,
you see that the maximum group loss is larger--
and it's always larger.
So now let's compare these two loss functions.
We have the average loss and the maximum group loss.
So we can plot both of these here.
And what-- pictorially, we can see what's going on.
So here, let me just plot our data points
just so we have them available.
So these functions are definitely very different.
OK.
So what happens now when we try to minimize the average loss
versus the maximum group loss?
So let's start with minimizing the average loss.
So this is standard learning.
This is a status quo.
You find the minimum of the average loss,
which is going to be this point, w equals 1.09,
it gets a loss of 7.29.
So it looks like we were doing pretty well.
But if you remember, look at the worst group loss of that weight
vector, then we'll see that it's above 20, which is not great.
So what you can do instead is to do
what we call group Distributionally Robust
Optimization or group DRO, which is simply going to minimize
the maximum group loss.
So it's going to minimize this purple plot here.
And what happens when you do that,
you get w equals 1.58, which gets a loss of 15.69,
which is better than the 20 plus that you
would have gotten there.
Now of course, the average loss is
worsened, because at this point the average loss
on the red curve is a little bit higher.
So there's a tradeoff here.
And we can see this tension kind of play
out over on this plot over here.
So here we see that if you were to minimize
the average loss, what you would do
is find a regressor or a model that's
very close to the points over here, B,
because there's four of them.
Kind of the majority class dominates.
Whereas, if you minimize the maximum group loss,
then you're going to get this purple line, which
is going to be able to balance out the two groups no matter
how many points are over here versus over here.
So you can think about this purple line
is more fair because it treats groups more equally.
So how do we minimize the maximum group loss?
So as before, we're going to use gradient descent
and follow our nose.
So what this looks like-- let me just try to plot this.
So here's the objective function.
The maximum group loss is train loss max,
is remember, the maximum over all the groups
of the per-group training loss.
And so how do you take the gradient of a max?
Well, the gradient of a max, remember,
is equal to the gradient of the function
where we're evaluating at the particular value of g star.
And what is g star?
g star is the arg max over the training loss.
So let's look at this picture.
So basically what are you doing?
So we want to diff--
take the gradient of this purple curve, right?
And so if you're over here, the gradient of the purple curve
is exactly the gradient of the loss on group A.
And if you're over here, the gradient of the maximum group
loss is exactly the gradient of group B.
And it exactly corresponds to g star is A over here
because group A is worse, and g star is B over here
because group B is worse.
So to compute the gradient, it's actually kind of very simple.
You first just evaluate at your current weight vector
what are the losses of the different groups.
And you look at the group that is hurting the most, has
the highest loss, and then you just update on those examples.
So it's a very intuitive process.
You find which group needs the most amount of help
and then you only update your parameters based on that group.
So one note is that it's important
that we're talking about gradient descent not
stochastic gradient descent.
Because stochastic gradient descent relies on the objective
function being a sum over terms, but this
is a maximum over a sum.
So it exactly won't work.
How it exactly gets the casting methods to work properly
is beyond the scope of this module,
but you can read the notes for pointers
OK.
So let me summarize here.
So we've introduced the setting where examples
are associated with groups.
We've done it for group regression,
but this generalizes for classification
and other more general machine learning problems.
We saw that we have the average loss and the maximum group
loss.
And these are different.
What is good on average is not going
to be good for all groups.
And we see that there's always a tension between the groups
if the groups are pulling you in kind of different directions.
And we saw that group Distributionally Robust
Optimization or group DRO is a very simple algorithm that
minimizes the maximum group loss, the purple curve
over here.
And finally, I want to remark that this module has
kept things simple but there's many, many more nuances.
So intersectionality is this principle or property where
you--
a group such as white women is actually
made out of multiple attributes, and these groups
might behave differently than their more coarse groups,
the women or the set of white people.
And so we have to kind of take into account finer gradient
groups.
There are also cases where we might not
know what the groups are.
Maybe we don't collect demographic information
and we have to infer them.
There's also an issue with overfitting.
We're talking only about the training loss here
just for simplicity, but of course
what we care about in machine learning is doing well on out
of a test set, but we're not talking
about this test set here.
So there's many more references in the notes.
And I hope this has piqued your interest
and realizing that inequalities should be considered
a first class citizen when we think about machine learning
methods.
So that's it.
Thank you.