In a recent development, since June 2024, we have evaluated more than 3,000 models on the Open LLM Leaderboard, a worldwide ranking of open language models performance. Even though we’re trying to run evaluations without wasting resources (we use the spare cycles of our cluster, in other words the GPUs which are active but waiting between jobs), this still represents quite a major amount of energy spent for model inference!
In the last year, people have become more and more aware that using large language models (LLMs) to generate text has a significant environmental impact, beyond the already crucial impact of training. Recent research (see the Towards Greener LLMs article) highlights the challenges of managing resources efficiently at inference due to dynamic and diverse workloads.
By integrating carbon emission estimates into the Open LLM Leaderboard, we aim to provide transparency to customers about the carbon impact of various model evaluations and hopefully encourage model creators to balance performance with environmental responsibility. (Related: Breaking: Introducing the Open Arabic LLM Leaderboard...)
We were curious to explore the CO₂ emissions associated with model inference and to identify any emerging trends in the data. Along the way, we saw a few predictable patterns but also discovered some surprising insights, like community fine-tunes being more carbon-efficient in general! (Related: Director of Machine Learning Insights...)
Recent findings suggest that 💡 Note: We’ve created a Colab notebook containing all the data and findings discussed here. This notebook allows you to explore the results, run the analyses yourself, and even adapt the code to investigate further questions.
Let's take a closer look at how we calculate the CO₂ emissions generated during model inference.
In our case, we use a straightforward heuristic, because all evaluations are run on the same hardware using the same method (method: loading the model with Transformers and Accelerate using a combination of pipeline parallelism and data parallelism to use our 8 GPUs per node to the fullest). It involves factoring in:.
A detailed explanation and formula can be found in our documentation.
In a recent development, caveat: This does not mean that model X emits Y CO₂ at inference in general! Instead, what this means is that model X emitted Y CO₂ on our very specific inference setup, and you can still learn a lot from that 😀.
Since we wanted to look at general trends, we only considered the most frequent model architectures, and models for which we had the parameter count.
We therefore looked at 2,742 models from some recent families: Gemma/Gemma2, all generations of Llama, Mistral, Mixtral, as well as Phi/Phi3, Qwen2 and above. We also included older model families such as GPT, GPT-NeoX, and T5.
Official models come from high-quality trusted model creators, such as research groups or community consortiums (EleutherAI, NousResearch), FAANG (Google, Meta, Alibaba…), startups (MistralAI, 01.AI), etc, who have taken the time and compute to create new high-quality models. They represent 341 models.
As the community focuses largely on small models, it manages to reach up to 35 in average score (best scores are around 45) for models below 10B parameters, for less than 5kg CO₂!
However, interestingly, the trend of CO₂ emissions to model size, even at higher values, is not the same between community releases and official releases: community fine-tunes or merges tend to be more CO₂ efficient than the official models they start from!
Let’s dive deeper into this finding!
According to recent reports, let’s take a close look at high-parameter and compact (> 7B parameters) base models, focusing on three for each category. We will investigate the emissions for each base model itself, for other official fine-tunes, including the official instruct versions, and community fine-tunes.
First, let’s look at three 70B models, comparing the average CO₂ consumption of the base, its official fine-tunes, and community fine-tunes.
Overall, for Qwen2.5 and Llama3.1, the base models and community fine-tunes tend to exhibit similar CO₂ emissions, but the official fine-tunes consume twice as much energy.
Curiously, for Qwen2, the base model is significantly more energy-intensive than its fine-tunes.
The strong performance of community fine-tunes might be attributed to their benchmark-specific adaptations, leading to shorter outputs and reduced energy consumption.
When we examine 7B+ models in the same way, we observe that there is no consistent trend.
For Llama3.1 and Qwen2.5, the base models consume twice as much as the fine-tunes.
For Qwen2 and Mistral v0.3, the consumption of the community fine-tunes is higher.
Industry observers note that A significant disparity between the base model and community fine-tunes in Qwen2-72B raises intriguing questions about potential differences in verbosity or text quality. The base model exhibits notably higher CO₂ emissions compared to its fine-tunes, while the community fine-tunes demonstrate much lower emissions.
We can compare these three models using our Comparator tool:.
Qwen/Qwen2-72B-Instruct (official fine-tune).
MaziyarPanahi/calme-2.1-qwen2-72b (community fine-tune).
Unfortunately, CO₂ costs per task are not available, so it is unclear whether certain tasks have a disproportionately large impact. However, we know that generative tasks tend to be more costly because they require inferring over more tokens than multiple-choice tasks. With this in mind, we assessed the generative capabilities of these three models and compared their outputs on the IFEval benchmark to identify any notable differences:.
Here's an example showing how the base model can produce responses with repetivie patterns:.
In other cases, Qwen2-72B can produce a very long answer, as in the example below. Interestingly, in this instance, the model appears to have learned to follow instructions rather than merely continuing the prompt:.
According to recent reports, one possible explanation is that, for IFEval, we do not use a stop token. As a result, it may continue generating tokens until it reaches the maximum limit. By contrast, fine-tuned models typically include an EOS token, allowing them to produce more concise responses and terminate appropriately.
Below are some examples of IFEval arguments for the base model and the instruct models.
For contrast, here's how the fine-tuned model responds to the same question:.
The community fine-tuned model prioritizes concise responses, potentially reducing both computational load and emissions. You can observe this for IFEval’s doc_id=12, where the answer from calme-2.1-qwen2-72b (shown first) is shorter than the one from Qwen2-72B-Instruct. Here is the prompt:.
Response from calme-2.1-qwen2-72b (1,209 characters):.
Response from Qwen2-72B-Instruct (1,444 characters):.
Comparing both responses illustrates how the fine-tuned calme-2.1-qwen2-72b version remains more concise, potentially reducing computational overhead and CO₂ emissions, whereas Qwen2-72B-Instruct provides a longer, more elaborated story.
According to recent reports, we can find the same pattern for the Meta-Llama-3.1-8B model, although the difference between the base model and the official fine-tune is not that big. Let’s provide the same analysis.
Here is the list of models to compare:.
meta-llama/Meta-Llama-3.1-8B (base model).
meta-llama/Meta-Llama-3.1-8B-Instruct (official fine-tune).
fluently-lm/Llama-TI-8B (community fine-tune).
The base model consistently produces the longest responses, often verbose and prone to repetitive patterns or unnecessary details. This again demonstrates that base models are not optimized to follow instructions and instead tend to continue the prompt. For instance, see the answer for IFEval doc_id=1, which totals 5,475 characters:.
Additionally, some responses are entirely empty (IFEval doc_id=2 or doc_id=4, for example), indicating potential failures or truncation.
Industry observers note that the instruct model reveals significant improvements in reducing verbosity while maintaining coherence. For example, check the Meta-Llama-3.1-8B-Instruct answer for IFEval doc_id=14 question:.
According to recent reports, the community fine-tune generates responses that can be as long as the base model and occasionally truncates or repeats text. We can observe this behavior in the Llama-TI-8B model for the same doc_id=14 question. Notably, the model not only attempts to accomplish the task but also adds extra commentary above its final output:.
Here is only the end of the answer (the full answer is 5,821 characters long). It demonstrates how the model goes beyond the original prompt and essentially offers a meta-commentary on the task it just performed, rather than simply providing the requested content.
Industry observers note that fine-tuning large language models like Qwen2-72B and Meta-Llama-3.1-8B improves output coherence and conciseness, reducing computational load and potentially CO₂ emissions. However, for now, exact emission data for specific benchmarks is not available, limiting detailed comparisons. Despite this, it is evident that fine-tuning enhances efficiency, though the reason for emission reductions remains uncertain.
Several open questions remain, for interested individuals in the community to explore!
Industry observers note that we invite the community to help us investigate these questions! Your insights and research could unlock a fresh understanding of energy-efficient AI development.
Industry observers note that inspiring piece @alozowski ! I want to ask if what you guys report is the KG-CO2 per model or ration of KG-CO2:#params ?Even if it is easily inferenced info, I believe both infos are equally important to display ... or i might be missing something here ?
Talking about CO2 emissions of AI models (or anything) is a waste of time and unimportant. It's sad we are wasting brain-power over that meaningless statistic. CO2 is not harmful.
Industry observers note that AI models use energy, and the value of the AI model far outweighs its energy input. Far better metric is to just calculate the cost of energy input and the value of AI's output insight.
@alielfilali01 Thanks! Per model, but we could display it per #params too! :)We initially did not want to assume only the number of params would play a role in the analysis.
@patmcguinness Calculating the cost of energy input vs the value of the AI output is literally what we did, using CO2 as our metric for energy consumption (we assume a linear relationship between CO2 and energy). However, we did not include all our graphs (only the most salient ones).
Since all the data is open, you could easily compute a CO2/energy per param to score graph, wdyt?