Devreal

Scale By The Bay : Clement Delangue, Keynote, Why and how to care about ethics in ML

Scale By The Bay : Clement Delangue, Keynote, Why and how to care about ethics in ML

Recording: Scale By The Bay : Clement Delangue, Keynote, Why and how to care about ethics in ML

thanks thanks alex i'm super happy to to be here uh you you started kind of like introducing a little bit to what we do at the game face the high level we're like the most popular machine learning platform uh today uh that more than ten thousand companies are using including uh microsoft google uh facebook grammarly that you can see on on my slide on our homepage here um we're kind of like a platform for companies to build better uh machine learning and today i didn't want to talk too much about you know uh the intricacies of our platform of what we do but i i wanted to talk about a topic that i i feel really personally that we need to talk more about uh which is uh uh machine learning ethics right in a way why and how to care about machine learning ethics and the reason why i think now is the right time to talk and focus more on machine learning ethics is because usually when you want to kind of like think about when is a good time to talk about ethics in technology you want to look at two things first you want to look at how much harm the technology can can do and and secondly you want to look at how many people it can impact right i think for both of these things we're very much at the turning point today for machine learning and natural language processing so first if you look at how much harm it can do i think it's important to remind everyone that uh current models uh are extremely biased here i i took the bert model which is arguably the most popular machine learning model today and i tried it to feel the missing words with a task that is called fit mask with like this man works as and this woman works as uh and of course uh when you say this man works out you're gonna get the prediction of lawyer conference or doctor weather mechanic whereas for a woman you're gonna get nurse waiters teacher made and and prostitutes so models today are extremely biased right and that can be a big problem if you start to think about you know how i use for example this model for resume filtering for for hiring for for things like that then when it comes to how many people it impacts uh i wanted like i wanted to take four different products that are amongst like the most popular today the first one is google they said now that most of the queries are powered by transformer models so it's heavily used for for ranking heavily used for new features also here i put an example of something called question answering when you're gonna ask a question you're gonna it's going to show you the relevant answer right away in the page another example of massive use of machine learning is autocomplete that you can find now in gmail but you find it on on linkedin you can bring it on most social networks or the most messaging apps even on your phone that is powered by modern machine learning models another example of how popular and mainstream the technology is getting is automatic translation that you can see everywhere from facebook twitter um on hundreds of different languages super useful for me as a french speaker as you can hear from my accent but you can find them really like uh everywhere and the last thing is even even more like technical products you you might have seen that github few few weeks ago announced the release of co-pilot which is auto complete transformers uh to complete your code all of these are powered by transformers and are extremely mainstream right if you think of these products billions of people are using them every day so it's important now to think about ethics because these models are so also mainstream right so this is one of the reasons why at the king face we decided to get really serious about topic and why we have been lucky to bring on board dr margaret mitchell who created and collect the mlai etix group at google uh who's going to help us cap like think about all these topics and integrate all these topics into our platform um most of the concepts and the slides that i'm gonna show you in this talk uh actually directly from uh dr margaret's uh mitchell so how can you think about ethics in in ai right uh so first it's important to keep in mind that uh it's not supposed to provide the answer to every problem to every context uh in an abstract way uh it's it's more kind of like a methodology or way to analyze problems in light of human values right and these values human values everyone has their own values every company has their own values they can be things like honor kindness equity inclusion commitment and cooperation connect honesty integrity right now that you've kind of like integrated that you know building machine learning ethically is integrating values into processes let's look at what a typical machine learning process is it's usually like four phases you you start with the kind of like the training data and then you train your model then you do some post-processing and then finally your model is used and interact with users now let's kind of like look a little bit at how each of these steps can be can be biased depending depending on on your values first in the training data one of the main challenges is that before even getting the data usually the data is a social construct it's especially true for text right we all know that text is a social construct and so you have a lot of human biases that have been embedded into into this text right when you think about a big transformer models like bert gpt t5 roberta all these models have been trained on the slice of the web right even the web form from reddit uh from twitter from places like that and so you're going to find some like reporting biases selection devices stereotyping racism under representation and more then when you go into the training of the model there are a lot of problems there for example picking the default uh model that's what we call default effects uh if you pick bert without really thinking too much about it because that's what everyone is using but also challenges like overfitting uh and the feeding and coring biases and more then when you go after you've trained your models and you're going to kind of like the software that is surrounding the model and the post-processing again you have more human biases right here you have kept like the classic story of the team that was trying to remove the ability and the potential of a model to talk about sex right so they kind of like filtered after the fact everything when it comes to um that that was kind of like containing the word sex but then it creates like uh big problems in terms of like uh under representation for example because when you start to talk about transsexuality then it's filtered out right and finally when it comes to how users are are using these these models what's interesting is that when users are using your models to create more content then this there can be some sort of kind of like a a network effect or some sort of catholic laundry effect i think dr margaret mitchell is calling it the bias laundering where for example for autocomplete when you have your users create content thanks to autocomplete if the autocomplete is biased then it's going to go back into publishing on the web and most likely is going to be used by the next generation of models that are training on the web right so what we're seeing here is that ml development is is not value neutral right uh it creates a lot of like uh creates and integrates a lot of human human biases but what's interesting i think is because you have kept like this sort of like a network effect that can be negative if you increase the biases if you manage to mitigate these biases hopefully you managed to create like a positive circle and impact society and and mitigate at large scale the basis right now when you know about these biases you know about this concept of bias laundering uh you can think for each step what you can do to uh kind of like mitigate these biases right and so for for training it's things like copyright of data instances uh it's it's looking at consent of data providers uh fair pay for for emulators diversity in what the data represents then when you think about the training you want to focus on appropriateness of loss function appropriateness of of models looking at which model is the best for which use case evaluation of your models then you look at for the post processing you look at fairness of outcome diversity of choices inclusion of the user stereotype removal removal and more and then finally when you look at the usage and users interacting with your machine learning systems look at things like minimizing social harm uh reducing dual use of your of your models or boosting positive use cases right um and and all of that kind of like uh helps you really kind of like break this cycle of of uh of biases right um and i i wanted to kind of like uh not stay only kind of like theoretical but give you two examples of what we've put in place at the face to integrate more of our values into the way we build our platform uh and how we how we shape the ecosystem so the first one is we have a huge amount of models that have been shared on the huge face platform i think now it's over 30 000 models that that have been shared and so what we put in place is something called the model cards that have been invented by margaret mitchell and the team at google which creates transparent documentation for things like benefits arms risks uses users intentional or not metrics why metrics were chosen evaluation tests and and results what it allows is to kind of like uh reduce a little bit the bias for example in selection of the of the models right we've been lucky to see more than 5 000 model cards that have been created uh so far uh and and which are kind of like really impacted impacting kind of like uh this stage uh both of gap like the training but also selection of of data sets and and models for everyone in the community the other thing that we've we've done uh when it comes to usage usage and the ability to access models and data and research whatever your language is that we organize the sprint where we've had more than 500 researchers and data scientists all over the world which expanded the capabilities of speech to text and speech models in general to over 100 of what we call low resource languages which are languages that are not as much studied or or worked on um and what he creates is kept like some some more democratization some more broadened uh broader access to to to the technology to remove some of the representation biases that we have sometimes for example with people focusing too much on english and then on on english stereotypes right so these are two two examples um and we believe this is uh just the beginning for what we call what margaret mitchell calls value informs machine learning there's so much potential to include processes like that into into machine learning and nlp to improve the outcome of these models to be a positive force in in the world if you think about a lot of our societies problems from like climate change vaccines toxicity of big platforms machine learning can and and should help for example obviously uh a lot of you were probably listening to the not the facebook the meta keynote uh earlier this this afternoon obviously on social networks you can't have a human to check for racist violent comments for all of them um so we need machine learning nrp models and transformers to to help with uh with value informed uh processes and we we believe that taking phase this is this is a way for transformers for machine learning for this new generation of machine learning not only to to be useful uh but really to be helpful and and positive for for the world so um this is it for for me if you're interested in continuing the conversation about ethics in machine learning but also happy to talk about transformers transfer learning or hugging face in general feel free to join the q a session that is happening after in a different platform or to reach out to me uh on on twitter uh or or by email thanks thanks everyone thank you uh clement um that's a really great overview of the um ethics uh of ai uh so um you know it's kind of presents a blueprint right uh so uh but you know one question i i'd like to ask you uh is about community right so i think the big science is a really really strong community effort and it has i think an ethics uh group working group which is i think one of the largest actually right because it's a multi-disciplinary group and not just coders can be there but also ethicists and philosophers uh and so i think it's a really diverse group so uh what do you think of the role of community uh in uh kind of building this ethics of ai directions where do you see is the most important focus for that for the community to help uh and how do you see that kind of community working with industry in the space yeah so what's really exciting about the big science project is that it's trying to put like ethical consideration and value informed consideration uh at the starting point of the process rather than an afterthought right and that's what's been done a lot i think in the past researchers would work on on a project and the machine learning model and then you know one week before releasing they would be like oh we have to think about like ethical considerations what we we've been doing what the community has been doing with big science is starting actually with uh ethical considerations from from the get-go so this is this is really exciting too exciting to see and when it comes to kind of like the most important and interesting topics for me i'm really excited about transparency and explainability right because i think they will allow us to understand better what are like the challenges what are the biases of this uh these new transformers i'm super excited about about that and then i'm super excited about uh some of the uh bias mitigation uh that that we start to be able to to explore for example in the data sets um so for example we we're gonna release soon um thanks to the team of of uh dr margaret mitchell uh a tool that allows you to uh explore your large data sets in a better way and kind of like notice some of the biases in these data sets so i'm really excited also about that about how you can help with tools detecting biases in in their sets and obviously remove them to start really acting into the mitigation of biases thank you thank you for that that that that's really good um and one more question for me i see some folks already kind of sending their questions so before they type it i'll ask another one um so you know i was thinking really right so we have all this hard ethics questions right for instance you know should you allow certain comments in in a facebook post right and so and uh so i was thinking this is something that obviously we want to use as much machine learning as possible to do but if you ever typed on facebook sometimes you would use the word which you will think is innocent and it will flag you like i was doing in russian and i was using some idiomatic words apparently they use machine translation and they flag used to think the word is bad although for russian speakers it is not bad right so somebody decided maybe on their global safety team right and maybe they asked some folks or maybe they use machine translation so so we need humans right uh so kind of one kind of statement i wanted to see if you agree or not ultimately ethics of ai is judged by humans because finally right like no computer can give the final judgment right you should always have reports to humans do you agree with that i think you can really integrate your values into uh into the technology that you're that you're building right what's important is not to think that you know the product that you're building is value neutral and then you need humans in addition to the product that you're building to bring these values um i think a product a technology a machine model can integrate some of the values that you hold as an individual as a company as a society and we we should we should aim at that right so we should aim at stuff like the moderation model that is used on facebook to integrate the values that that we wanted to to integrate right and it's going to be circumstantial because you know facebook values are probably not the same as hugging face values which are probably different than other companies values but that's what we should aim at and in addition to that also have have humans maybe help in the loop uh one way one way or another um but you know there are already humans creating the technology the models the algorithms right so they transmit their values into into the product right and we just need to be cognizant of that not not ignore it uh and and make sure that the ends result is uh consistent with the with the the humans and the organization's values okay no this is this is absolutely i agree with that but you know one thing i was thinking about right so let's say you know something is really hard for the ai as of today right to judge and so maybe if we can do it algorithmically and we have very high confidence right we do that but eventually it might come up before uh humans for instance if you do this with facebook automatically flags you can say no i disagree uh i want it to be riveted by humans so they have this oversight board and eventually if you object to something like i objected to this classification because i thought this is a mistranslation or misunderstanding and so because they say you know why do you do this feedback and because i said because i want to improve facebook quality right because it's not necessarily about you know uh disagreement on principle it may be a technical disagreement or it may be disagreement on principle so i was thinking right uh that we probably need something like high-level validation of ai results right so and currently what we have we have this human in the loop where we treat humans like is very low cost disposable robots who will distinguish cats from dogs or so you know if we see how the humans are used right now in the eye i actually think that this is very uh kind of diminished and in insufficient function because you know there are these huge farms as facebook supposedly has where you know low paid workers are sifting through horrible images to flag them right so we kind of use humans as really low level image recognition devices right and so but i think a lot of these ethics judgments will come at a high level where you will have to see is this statement actually harmful for instance can it incite an uprising in india somewhere right can it actually lead to loss of human life and you may not be kind of uh satisfied you may not have enough uh you know support if you employ you know low paid workers in some part of the world who are not actually familiar with the culture of another part of the world so i'm wondering i was thinking how can we do that right and so one way to do that is to have what i call community validation hierarchy similar to wikipedia hierarchy we need to have very reliable structure of human experts who can very quickly or reasonably quickly judge if this statement is ethical or not because until we really build you know very high level ai we'll need this judgment at least and for training purposes so what do you think of this kind of you know effort do we need you maybe it's a part of the big science work maybe it's a part of the stanford crfm center but you know do you think that as a community we need some high level hierarchical structure of experts performances medical decision making right can we say the model tells me cut this person and extract this this thing like is it right or wrong i need to consult the doctor do we need something like a hierarchy of high level experts for validation of ai so first i think something that sounds simple but that is a lot of times actually forgotten today is to make sure that the people who are building technology or value in form the people who are building the models today the researchers in in all the research labs actually start from the value standpoint which doesn't seem to be the case most of the time today right they think about how do i increase accuracy how do i build a bigger model and they don't really think about values and and impact of what they're working on i think just adding that and i think that's that's the point of dr margaret mitchell which is the fact that the machine learning building process today is not value neutral is that we need to make sure that everyone that is building machine learning today thinks about values think about what is their values what is their company's values um and and integrate that when when they create create technology and i think that we are solved a lot of our challenges and then after um as you're talking more about you know how they used with with users and how you can add humans in the loop they are definitely kind of like uh new ways to invent there i don't have all the answers um to be honest it's very industry use case specific right um so it depends on each company's use case for example you're talking about moderation for facebook i can't i can't only search for for facebook they are the experts there but i think there are definitely new things and new tools to invent to be able to bring humans in the loop um in kind of like a less like degrading way uh and in a less kind of like industrial way and take advantage of actually the unique qualities of humans compared to algorithms and and create ways to mesh together humans and technology for for better value-informed technology you