{"id":345,"date":"2020-10-26T01:51:58","date_gmt":"2020-10-26T01:51:58","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/sustainable-software\/?p=345"},"modified":"2020-11-06T16:18:13","modified_gmt":"2020-11-06T16:18:13","slug":"the-carbon-footprint-of-ai","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/sustainable-software\/the-carbon-footprint-of-ai\/","title":{"rendered":"The Carbon Footprint Of AI"},"content":{"rendered":"<p>Artificial Intelligence (AI) has the potential to transform how we fight climate change. However, it also increasingly contributes to it: the carbon footprint of AI will grow exponentially over the next decade, and is projected to grow at a <a href=\"https:\/\/www.grandviewresearch.com\/industry-analysis\/machine-learning-market\">CAGR of nearly 44% globally<\/a> through 2025.<\/p>\n<p>The industry is trending towards bigger models (e.g. GPT-3): these require ever-growing datasets, compute budgets, and incur massive energy bills over the model lifecycle. Computational costs of AI models have been doubling every few months, resulting in an estimated <a href=\"https:\/\/schwartz-lab-huji.github.io\/publication\/greenai\/\">300,000x increase from 2012-2018<\/a>. In the past two years, the number of parameters have grown 170X. Currently, training a single 213M parameter NLP deep-learning model through an architecture search can generate the same carbon footprint as the lifetime of five American cars, including gas.<\/p>\n<p><figure id=\"attachment_356\" aria-labelledby=\"figcaption_attachment_356\" class=\"wp-caption aligncenter\" ><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-1024x414.png\" alt=\"Carbon Footprint Of AI\" width=\"640\" height=\"259\" class=\"size-large wp-image-356\" srcset=\"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-1024x414.png 1024w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-300x121.png 300w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-768x310.png 768w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-1536x621.png 1536w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/Screen-Shot-2020-10-20-at-5.58.27-PM-2048x828.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><figcaption id=\"figcaption_attachment_356\" class=\"wp-caption-text\">One NLP model has the same carbon footprint of five cars, including gas.<\/figcaption><\/figure><\/p>\n<p>Source: <a href=\"https:\/\/www.technologyreview.com\/2019\/06\/06\/239031\/training-a-single-ai-model-can-emit-as-much-carbon-as-five-cars-in-their-lifetimes\/\">Emma Strubell, Carnegie Mellon University<\/a><\/p>\n<p>Environmental sustainability should be considered as one of the principles towards responsible development and application of AI. The benefits of using such technology should outweigh its drawbacks, and it\u2019s time to bring the conversation about the hidden costs of AI to the forefront.<\/p>\n<h2>\u2018Data Is The New Oil\u2019<\/h2>\n<p>According to Gerry McGovern\u2019s book <em>\u2018<a href=\"https:\/\/gerrymcgovern.com\/books\/world-wide-waste\/\">World Wide Waste<\/a>\u2019<\/em>, 90% of data is not used \u2013 merely stored (which is cheap). He argues that because of this, the IT landscape is ~90% waste: 91% of pages analyzed got zero traffic from google, and more people have been to the top of Everest than the 10th page of search results. It\u2019s no surprise that companies are seeking capitalize on this unprecedented amount of data collection. AI provides a way to make sense of massive amounts of data, but the current state-of-the-art requires a massive amount of data for training &amp; validation. The more weights a model has, the more data it needs.<\/p>\n<p><em>\u201cThe AI industry is often compared to the oil industry: once mined &amp; refined, data, like oil, can be a highly lucrative commodity. Now it seems the metaphor may extend even further\u201d<\/em> <a href=\"https:\/\/www.technologyreview.com\/2019\/06\/06\/239031\/training-a-single-ai-model-can-emit-as-much-carbon-as-five-cars-in-their-lifetimes\/\">&#8211; MIT Technology Review<\/a><\/p>\n<p>There are promising, but emergent methods such as \u2018<a href=\"https:\/\/www.forbes.com\/sites\/robtoews\/2019\/11\/04\/questioning-the-long-term-importance-of-big-data-in-ai\/#4ea52dbf2177\">few-shot learning<\/a>\u2019 and \u2018<a href=\"https:\/\/arxiv.org\/abs\/2009.08449?mc_cid=11c01e2a8c&amp;mc_eid=d652cce602\">less than zero-shot learning<\/a>\u2019 which will allow ML systems to learn &amp; reason from a handful of examples. However, in the interim, the industry is currently trending towards increasingly large datasets, which require massive computational training budgets.<\/p>\n<h2>Bigger Is Not Always Better<\/h2>\n<p>The human brain is remarkably efficient; it can learn from a single example and apply this knowledge in a wide variety of contexts for the rest of its life. It requires relatively little energetic input: the brain only requires <a href=\"https:\/\/hypertextbook.com\/facts\/2001\/JacquelineLing.shtml#:~:text=The%20brain%20consumes%20energy%20at,of%20the%20brain%2020%20W.\">20W<\/a> to operate, and the global average of a human life requires around <a href=\"https:\/\/www.nature.org\/en-us\/get-involved\/how-to-help\/carbon-footprint-calculator\/#:~:text=The%20average%20carbon%20footprint%20for,under%202%20tons%20by%202050.\">8,000 lbs Co2\/year<\/a>.<\/p>\n<p>Nature has done a significantly better job of engineering a brain than we have with AI. This represents significant potential for improvement: <a href=\"https:\/\/www.technologyreview.com\/2020\/02\/25\/906083\/artificial-intelligence-destroy-civilization-canaries-robot-overlords-take-over-world-ai\/\">according to some of the brightest minds in the industry<\/a>, \u2018Artificial Intelligence\u2019 isn&#8217;t yet close to being intelligent in any meaningful sense of the word. ML systems learn to perform a specific task by observing lots of examples, and pattern matching data by what can be viewed as a brute-force computational approach.<\/p>\n<p>This requires staggering amounts of energy (data &amp; compute resources) to perform pattern matching &amp; superhuman statistical analysis. As a result, state-of-the-art approaches to AI are engaged in a computational arms race to achieve the next benchmark performance. A 2018 analysis led by Dario Amodei and Danny Hernandez of the California-based OpenAI research lab, an organization that describes its mission as ensuring that artificial general intelligence benefits all of humanity, revealed that the compute used in various large AI training models had been doubling every 3.4 months since 2012 \u2014 a wild deviation from Moore\u2019s Law, which puts this at 18 months \u2014 accounting for a <a href=\"https:\/\/schwartz-lab-huji.github.io\/publication\/greenai\/\">300,000\u00d7 increase<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-1024x747.png\" alt=\"AI &#038; Compute\" width=\"640\" height=\"467\" class=\"size-large wp-image-357\" srcset=\"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-1024x747.png 1024w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-300x219.png 300w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-768x560.png 768w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-1536x1120.png 1536w, https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-content\/uploads\/sites\/60\/2020\/10\/ai-and-compute-all-2048x1493.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Source: <a href=\"https:\/\/openai.com\/blog\/ai-and-compute\/\">https:\/\/openai.com\/blog\/ai-and-compute\/<\/a><\/p>\n<p>It is noteworthy that there have been major efficiency gains in recent years: <a href=\"https:\/\/openai.com\/blog\/ai-and-efficiency\/\">According to OpenAI<\/a>, compute cost has been halving every 16 months for equivalent model performance. Since 2012, the same model requires 44X less compute. However, we\u2019re rapidly approaching outrageous computational, economic, and environmental costs to gain incrementally smaller improvements in model performance. For the moment, computational cost has a linear relationship with the amount of data, epochs, and hyperparameters involved in training. The state-of-the-art advances are primarily achieved through scale: bigger datasets, larger models, and more compute.<\/p>\n<p><em>\u201cI think the best analogy is with some oil-rich country being able to build a very tall skyscraper. Sure, a lot of money and engineering effort goes into building these things. And you do get the \u2018state of the art\u2019 in building tall buildings. But\u2026there is no scientific advancement per se.\u201d<\/em> \u2013 <a href=\"https:\/\/www.forbes.com\/sites\/robtoews\/2020\/06\/17\/deep-learnings-climate-change-problem\/#247d4b0f6b43\">Guy Van den Broeck, UCLA<\/a><\/p>\n<p>The AI industry is currently what researcher <a href=\"https:\/\/schwartz-lab-huji.github.io\/\">Roy Schwartz<\/a> (Allen Institute For AI &amp; Hebrew University of Jerusalem) has deemed \u2018RedAI\u2019: performance &amp; accuracy at the expense of efficiency (speed, energy cost).<\/p>\n<p>A <a href=\"https:\/\/www.mckinsey.com\/~\/media\/McKinsey\/Industries\/Advanced%20Electronics\/Our%20Insights\/How%20artificial%20intelligence%20can%20deliver%20real%20value%20to%20companies\/MGI-Artificial-Intelligence-Discussion-paper.ashx\">McKinsey report from 2017 indicated that 88% of ML projects never reach production<\/a>, suggesting that many experimentation paths are dead-ends with a corresponding carbon footprint. Even if a ML project does mature to production\/publication, it will have required many different tunings\/trials to achieve the max performance, likely exceeding 10-20 training runs to produce a single model with the highest accuracy.<\/p>\n<p>Model training represents only a portion of the total carbon footprint: it is important to holistically analyze the footprint across all phases of an ML project.<\/p>\n<h2>Deployment &amp; Lifecycle<\/h2>\n<p>While deployed, model inference has an outsized footprint: NVIDIA has estimated that inferencing constitutes <a href=\"https:\/\/www.forbes.com\/sites\/moorinsights\/2019\/05\/09\/google-cloud-doubles-down-on-nvidia-gpus-for-inference\/#270aace16792\">80-90% of total carbon cost of a ML model<\/a>. This warrants a cross-industry framework for a full Life Cycle Analysis (LCA) to evaluate embodied carbon across the ML lifecycle.<\/p>\n<h2>GreenAI<\/h2>\n<p>There are ways to make machine learning greener, a movement that has been dubbed \u2018GreenAI\u2019, initiated by Natural Language Processing researchers. This community is pushing for efficiency as a core metric. Some conferences (below) now require submissions to fill out forms that include information about the computational budget used to generate the reported results.<\/p>\n<p>GreenAI is in its infancy, and presents both numerous research opportunities and industry partnership potential. By bringing visibility &amp; accountability into our ML efforts, we can begin to prioritize reporting and efficiency measures to incentivize sustainable AI practices. In future posts, I will dive into particularly promising approaches (such as reporting &amp; efficiency methods). In the interim, here are some resources that can get you started in the community:<\/p>\n<h2>Get Involved<\/h2>\n<p><strong>OSS packages to start tracking the carbon footprint of your experiments:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/Breakend\/experiment-impact-tracker\">https:\/\/github.com\/Breakend\/experiment-impact-tracker<\/a> <\/li>\n<li><a href=\"https:\/\/mlco2.github.io\/impact\/\">https:\/\/mlco2.github.io\/impact\/<\/a><\/li>\n<\/ul>\n<p><strong>Conferences:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/medium.com\/@NeurIPSConf\/behind-the-program-for-reproducibility-at-neurips-2019-8a020e57bfd9\">NeurIPS 2019<\/a> <\/li>\n<li><a href=\"https:\/\/2020.emnlp.org\/call-for-papers\">EMNLP 2020<\/a> <\/li>\n<li><a href=\"https:\/\/sites.google.com\/view\/sustainlp2020\/shared-task\">SustaiNLP2020<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Artificial Intelligence (AI) has the potential to transform how we fight climate change. However, it also increasingly contributes to it: the carbon footprint of AI is growing exponentially. Bigger models, more data, and deployments contribute towards &#8216;RedAI&#8217;. A nascent field called &#8216;GreenAI&#8217; is focused on measuring &#038; mitigating this.<\/p>\n","protected":false},"author":42948,"featured_media":368,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[71,64,22],"tags":[83,85,89,86,90,84,88,62,87],"class_list":["post-345","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-measurement","category-renewables","category-sustainable-software-engineering","tag-ai","tag-decarbonization","tag-efficiency","tag-greenai","tag-intelligence","tag-ml","tag-reporting","tag-sustainability","tag-tracking"],"acf":[],"blog_post_summary":"<p>Artificial Intelligence (AI) has the potential to transform how we fight climate change. However, it also increasingly contributes to it: the carbon footprint of AI is growing exponentially. Bigger models, more data, and deployments contribute towards &#8216;RedAI&#8217;. A nascent field called &#8216;GreenAI&#8217; is focused on measuring &#038; mitigating this.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/users\/42948"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/comments?post=345"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/posts\/345\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/media\/368"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/media?parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/categories?post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/sustainable-software\/wp-json\/wp\/v2\/tags?post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}