Towards a Methodology and Framework for AI Sustainability Metrics
This transcript was made by AI. The open source speech recognition model Whisper (large-v3-turbo) transcribed the recording with faster-whisper. Names and technical terms were checked against the paper, but it can still contain mistakes. The recording is the reference.
0:00 So I'm going to talk about a methodology and framework for AI sustainability. Obviously, everyone are very concerned. There are these two papers that were published in 2019 that attracted a lot of attention to the problem. One paper compared very provocatively, compared a transformer training job with five cars carbon throughout their lifetime. Another one coined the term green AI. So we're all aware of the problem. Now, what happened in the last couple of years is the emergence of foundation models. What are foundation models? They are a very broad model that is trained on a very, very, very large data set. And interestingly enough, it's adapted to perform multiple different tasks. So such as questions, answers, sentiment analysis, information extraction, and so on. And that's that property, which is known as homogenization.
0:56 Now, foundation models today are being used mostly for language processing. So it's large language models. But in the future, we're expecting them to be used much more broadly. The same idea of a broad model adapted for multiple different tasks. And so what we're witnessing is this evolution where we start getting a supply chain of models or an ecosystem of models, where models are created or manufactured, distilled, fine-tuned, and continuously retrained to create new models. And basically, what we're seeing is that deployment is just the beginning of the journey. And it's really interesting because I'm coming from the DevOps world. I did a lot of research on DevOps. And we used to say when we started having software as a service that deployment is just the beginning of the journey.
1:51 Well, we're seeing it today with models. As you know, you produce a model, and then it takes life of its own, it's being adapted, and then once it's deployed, it's continuously retrained. If you look at sustainable AI paper from Meta, they're reporting that for two different use cases, they are retraining in a frequency of a single day or a single week. This is a lot of retraining that is happening all the time, and we shouldn't forget about it when we do these sort of evaluations. And when you look a little bit closer at the lifecycle of models, if you look at it as a state machine, this is an illustration. So what you're seeing here is that we're starting with acquisition of the data through crawling.
2:34 Then you have deduplication, then you have tokenization, then you do the removal of hate, abuse, and profanity, HAP, bias, and so on. Then you have the training, which includes neural architecture search, hyperparameter optimization, and so on. And then the distillation, which is another stage. Then you get to the downstream evaluation, you deploy it, and then you start retraining very frequently. Okay, so it's a very, very complicated life cycle that we're seeing here. All right, so the question is, are foundation models good or bad for sustainability in general? And what we know is that they keep growing. They really, really keep growing at a very fast pace. And some, like David Patterson, is saying that the big scheme of things, it's okay. Why? Because they are reused for multiple different tasks, right?
3:37 But the truth is that this claim is yet to be substantiated based on sound analysis. So really, in the big scheme of things, are we actually using less energy for AI because we have foundation models? You know, I don't know about that. So we need to do the analysis. And this is something that we're attempting to do here, or at least starting to attack that problem. So when you look at the data scientist, now the data scientist has a dilemma. There are lots of different questions that data scientists need to address. So if I have a task and I want to develop a model for this task, what do I do? Do I adapt from a broad model? Do I adapt? Do I distill it and then use it?
4:21 Or do I start from scratch using much smaller model and more specific data? This is what I call a lifecycle strategy question. How much data to use? Can I actually synthesize a few smaller models? People are doing that. Should I use a neural architecture search? So should I do hyperparameter optimization? Well, maybe it depends. Maybe it depends on the amount of usage that you're expecting to get from your model. Because as we know, and as we've seen, neural architecture search is a huge amount of energy. All right. And what is the optimal frequency of retraining? Daily, weekly, monthly? What data should I use? Should I only retrain on new data incrementally? Or should I retrain from scratch? So all of these questions are lifecycle strategy questions that the data scientist is facing.
5:12 And what we're saying here is to reason about these questions, we must take a lifecycle view of the efficiency of AI models. Lifecycle view. And so what we're doing here is we're trying to attempt to address this problem. First of all, we want to apply product lifecycle assessment principles to that issue. So to do that, we're basically looking at two products. We're treating a data set as a product for which we can provide a lifecycle assessment. And we're treating a model as a product. So later, we're going to go deep into the lifecycle of these products. The second thing is that we're focused on the unit of work that is performed on behalf of the end user. So the end user is submitting inference jobs.
6:00 That's the work that is actually produced. The question is, what is the energy and carbon associated with each one of these jobs, including the entire lifecycle? Because what we really want to reduce is the amount of energy and carbon that is associated with a job, okay? Or care, job, energy, and carbon footprint. And this follows the same reasoning as a paper that was presented here in this workshop last year. I'm going to take questions at the end, okay? Ah, five more minutes, okay. Oh, my God. Five more minutes? I should talk faster. This follows the same reasoning. So as metric for sustainability in data center by Gandhi. And what they did here, they defined one metric, which is the job sustainability cost that takes into account all of the energy of all of the devices that are participated in serving a job, plus the overhead for cooling, times the carbon efficiency factor, okay?
6:59 And then the other one is the amortized sustainability cost, which is the job sustainability cost, plus taking into account the embodied carbon, all right? So, so far, so good. We're claiming that something is missing, and this is really a point. We're claiming that the execution, the runtime execution context for the job is missing. So, so if we look at, for example, serverless requests in Amazon, they are served on Lambda. Lambda is a platform service. That platform service has an associated overhead, which is caused by the management service that are running, which is caused by the entire DevOps thing around that platform service, which is always running. That needs to be factored in. In addition, there is also embodied cost with that platform service, which is the amount of energy and carbon that went into producing that platform service.
7:55 Two years development with developers and testers and so on. That's the embodied carbon of that platform service. It needs to be factored in. So we're basically correcting these two terms, two metrics, and we're adding it in. So, and adding the energy of that platform that is serving the requests, platform service, and adding the embodied carbon of that platform service, which is the carbon and energy that went into producing that platform, the development and testing that went into producing that platform. Then we applied to models and data sets. A data set is created via extraction of materials, that is data, crawling, right? Dedup, HPO, tokenization, and so on. A model is created by using a data set via process of experimentation, pre-training, and is used in order to serve inference jobs.
8:48 What we're doing is applying these expanded terms where now the energy, the platform, what I call the platform, is actually the model. And what we're adding here is the energy cost of maintaining that model, meaning the retraining that has to happen all the time in order to keep the model up to date. And what we're adding to the amortized sustainability cost is also the embodied cost of a model. So the entire energy and carbon that went into the manufacturing of that model. So this is a very neat way of doing it because instead of really inventing new metric, we're reusing metric from a different domain here, so we achieve consistency. And if we put that to practice, and this is my last two charts, if we put that to practice, we see here a data set D and model M.
9:43 They're both associated with embodied cost. The embodied cost of a data set factors in all of these actions, the crawling, the dedupe, the hate, profanity, and abuse, the tokenization, all of that goes into the creation of the embodied carbon of data set. Then we have the embodied carbon of a model, which takes into account additionally the neural architecture search, the hyperparameter optimization, experimentations, and pre-training. All of that goes into model, and then that model is used to serve inference jobs, right? And we have the retraining. So the first term, job sustainability cost, really looks at the energy per each inference, so all the devices which are participating to serve an inference job, including the amortized cost of the retraining. So that will factor it in.
10:32 And then it allows us to reason about questions such as what should be the frequency of my retraining? And the amortized sustainability cost takes into account the entire picture, so it adds in the embodied cost of models, right? Embodied cost of models is factored in, and then it allows us to reason about questions such as what data set shall I use, shall I invest in neural architecture search, and so on. So to summarize, if you have reused, this can also be factored in when the same model is used and adapted to create other models via supply chain, basically, principles. And this is the summary, so we're, how much time do I have? All right, I made it, I made it. So we're proposing a unified lifecycle metric that is consistent with data center efficiency metric that you have seen in other papers, and with product lifecycle assessment standards, and can be used to methodologically reason about lifecycle strategies to improve the lifecycle efficiency of AI models.
11:43 Future work is obvious here. We will demonstrate how we use the metric to compare different strategies in real-life use cases, and the call-to-action that we have seen also in other contexts for software is similar here. AI platforms must track lineage. We need to understand that model was created from that other model. It was created from that data set. We must track the entire lifecycle, and we must add to the data sheets or the border, whatever they're called, score borders, or whatever they're called. They must include energy and carbon data. So with that, I'm done. And since I'm also the session chair, I'm going to ask for questions. You factor in the carbon for a data set, right? What happens when multiple models are trained from the same data set?
12:37 Do they divide it? Great question. And I just didn't have time to go to these details, but it's the same principle exactly as we see in supply chain. So if I produce a product, and in order to produce it, I use the transportation service. That transportation service is a truck, and the truck is actually bringing materials to a lot of different consumers that are creating a lot of different products. I'm going to slice it. I'm going to get a share. So the same thing here. If the data set is used to create multiple different models, you are getting a slice based on the amount of reuse. And how do I ever close on what the amount of carbon is for a model? Because it depends on the future, right?
13:14 Right. So you need to make certain assumptions, and you need... So there are different ways to do it. Either you are going to know what is the expected use, and you're going to factor in, or you're just going to look at the history or something in between, but it's going to be an approximation.
13:32 Other question? How would you track something like this? So let's say your model gets loaded onto Hugging Face, and then how do you track from there? Does a download of a model count as a usage? How do you go even from there in terms of number of inferences which might happen in a customer's environment? Great question. And I think that it really, again, I'm going to go back to the supply chain issue, how to track that, you know, when you cross organizational boundaries, then it becomes a problem. And I have several ideas. Like, there are several ideas. I'm not sure that any of this is implemented yet. But, for example, we can, like GitHub, when you download something, you can track it. So it will, I think that it will necessitate some collaboration and some standards.
14:30 I don't think that they have a really, really good answer for this. So is supply chain comparison really fair? Because supply chain, for example, truck example, trucks have a lifetime. You can divide it by time or something like that. A data set does not have a lifetime. So any estimate that you do could be highly inaccurate. And optimizing based on an inaccurate signal would lead to optimization that may not be valid. Yeah, I think that's a fair question. And we thought about it. And there is, it's really a tricky question. Because there are some things that are perishable and some things that are less perishable. Like, data set is less perishable. But data set also has an expiration date. Because data set gets old and gets replaced.
15:26 So these are all open questions that I think needs to be addressed. Don't have a good answer to that. All right. With that, we're going to continue to the next session.