Data centers & energy · Research feature

Comparing energy consumption and accuracy in text classification inference

A study compares energy use and accuracy in text classification models, showing small models can outperform large ones in both efficiency and performance.

Adapted from research by Johannes Zschache, Tilman Hartwig.

arXiv preprint revision · 2026-04-21 · Attribution & reuse
In this article
Editorial illustration of server racks.

Editor’s introduction

The study evaluates energy consumption and classification accuracy across various models, including traditional linear models and large language models (LLMs), during inference. It finds that a simple linear model using pre-trained embeddings achieves the highest accuracy while using significantly less energy than many LLMs. Among LLMs, the Qwen 2.5 7B model consumes seven times less energy than the Qwen 2.5 72B model with only a minor drop in accuracy. Deepseek models, which use extensive reasoning, show lower accuracy and higher energy use compared to non-reasoning LLMs. The research highlights that energy efficiency and accuracy are distinct metrics that do not consistently align. A key limitation is that the study does not account for training energy costs of traditional models, as those are not directly comparable to LLM training costs due to shared external training energy. Additionally, energy impacts from hosting and network traffic are not included in the analysis.

Introduction

Artificial intelligence (AI) systems, particularly large language models (LLMs), have driven remarkable progress in Natural Language Processing (NLP) applications. This development has been enabled by the transformer architecture and exemplified by the emergence of large-scale models such as GPT-3, which have significantly advanced task performance. However, this progress has come at a cost: the escalating energy demands of AI systems pose significant environmental and computational challenges. Data centers that support AI computations are major electricity consumers, often dependent on fossil fuels, thereby contributing to greenhouse gas emissions. This increasing energy demand challenges global climate objectives such as the Paris Agreement and the United Nations’ Sustainable Development Goals (SDGs), specifically Goal 13 on climate action. Consequently, designing energy-efficient AI systems is imperative for aligning technological advancements with sustainability goals. Moreover, beyond sustainability, energy-efficient models offer additional advantages, including reduced hardware requirements, lower financial costs, and faster inference times.

When evaluating machine learning models, most studies concentrate on the quality of the model responses by tracking e.g. the accuracy, the RMSE, or other measures. And even if the energy consumption is taken into account, prior research has mainly focused on the training phase. The inference phase, which is repeatedly executed in real-world deployments, has received comparatively less attention. However, energy efficiency during the operational phase is an increasingly relevant topic as LLM applications become ubiquitous and LLMs are trained to use additional test-time compute to improve performance. Addressing this gap, we present a systematic study on the energy consumption of language models during inference, providing actionable insights for balancing accuracy with efficiency.

A particularly popular machine learning task is text categorization, a task that lightweight models have been shown to handle effectively. For instance, show that a simple classifier built on word embeddings is often as accurate as deep learning classifiers. Despite this, some authors argue for the use of pre-trained LLMs for text classification because it reduces the need for model training and simplifies data preprocessing. Additionally, popular software tutorials promote LLMs for classification tasks, further encouraging their use even when more efficient alternatives exist. In order to justify the usage of LLM in relatively simple tasks such as text categorization, we advocate a consequent comparison of a model’s response quality to its energy efficiency.

Previous research

Research on the environmental impact of machine learning (ML) has primarily focused on the energy consumption and carbon emissions produced during the training phase of large-scale models. Most famously, quantify the carbon footprint of NLP models, revealing that the training of a single large-scale transformer model can emit as much carbon as five cars over their entire lifetimes (their measurements include thousands of hyperparameter tuning jobs, which makes it difficult to disentangle model-inherent efficiency from experimental setup). This seminal work spurred further investigations into the environmental costs of training neural networks, including large language models.

While training remains a significant contributor to energy consumption, recent studies have begun to focus on the inference phase. highlighted the substantial energy demands of LLM inference but did not explore the relationship between energy consumption and task-specific performance. underscore the importance of evaluating NLP models not just on efficiency metrics but also on accuracy by introducing the Efficient Language Understanding Evaluation (ELUE) benchmark. ELUE aims to establish a Pareto frontier that balances performance and efficiency. It includes various language understanding tasks, facilitating fair and comprehensive comparisons among models. However, the framework adopts number of parameters and FLOPs as the metrics for model efficiency, disregarding hardware specific factors. Similarly, estimate the energy consumption associated with the inference phase of generative AI applications based on the output word count and several assumptions about the application such as the number of FLOPS per inference and the sampling rate. More recently, develops a bottom-up, production-oriented token-throughput methodology to estimate per-query energy and shows that production optimizations can substantially lower Wh-per-query consumption.

In contrast, we promote energy-efficient NLP models by the direct measurement of the power consumed during inference. Hence, our work follows the approach of the SustaiNLP 2020 shared task. SustaiNLP demonstrated that substantial energy savings are achievable with minimal performance loss. While this study was limited to the performance of a couple of small language models on a single benchmark, we extend these efforts to a greater number of partially very large models deployed to a practical inference scenario.

Data and methods

Our experiments are inspired by an occasionally occurring use case in public administration: the management of objections that are submitted by the population. Due to a potentially very large amount of submissions, an automatic preprocessing of the objections is of high value. One of the possible steps of an automated workflow is to categorize each submission for optimal forwarding to the responsible department.

The dataset was split into half: 189 entries for training and 189 entries for testing. This unconventional 50:50 split, rather than the standard 70:30 or 80:20 split, was deliberately chosen for several reasons. First, with only 378 total entries across 14 categories (averaging 27 instances per category), a larger test set ensures statistical reliability of our performance metrics, particularly for minority classes. Second, since our primary focus is on inference energy consumption rather than achieving maximum accuracy through extensive training, we prioritize having a representative test set that can yield robust energy measurements across all categories. Third, this split creates a more challenging scenario for traditional models, allowing us to assess whether their potential accuracy disadvantage compared to zero-shot LLMs is offset by their energy efficiency benefits - a key trade-off in our analysis. To mitigate concerns about reduced training data, each experiment was repeated 10 times with different random train-test-splits, ensuring that our results reflect average performance rather than artifacts of a particular split. To increase comparability, every experiment was run with the same 10 train-test-splits.

An experiment run consists of a training phase and a testing phase. Since large language models have been argued to be applicable to text categorization without training (zero-shot), we omit the training phase for these models and apply LLMs without fine-tuning. We report the energy consumption and accuracy only for the test phase as averages over all 10 runs.

Traditional models

Besides LLMs, we initially run the experiments with lightweight NLP models that we call traditional because they have been used for categorization tasks long before LLMs existed. Specifically, we use a linear model (logistic regression) and a gradient boosting algorithm (xgboost). Logistic regression is a simple, interpretable model that estimates the probability of a class based on a linear combination of input features. XGBoost (Extreme Gradient Boosting) is an efficient, scalable machine-learning algorithm that combines predictions from multiple decision trees to improve accuracy.

We consider three different types of features: bag-of-words (BoW), term frequency-inverse document frequency (TF-IDF), and a pretrained multilingual sentence embedding. For text preprocessing and feature extraction, we rely on the default implementations provided by scikit-learn and sentence-transformers libraries to ensure reproducibility and represent common practice in applied NLP scenarios. For BoW features, we use ‘sklearn.feature_extraction.text.CountVectorizer’ with default parameters, which automatically handles the following preprocessing steps: (1) conversion to lowercase, (2) tokenization using word boundaries while preserving tokens of at least 2 characters, and (3) removal of punctuation at word boundaries. No stop word removal or stemming is applied by default, allowing the model to learn from the full vocabulary including function words that may be informative in our domain-specific context. The resulting BoW representation creates sparse vectors counting word occurrences without considering word order.

For TF-IDF features, we employ ‘sklearn.feature_extraction.text.TfidfVectorizer’ with character-level n-grams rather than word-level features. Specifically, we configure the vectorizer to extract 2-gram and 3-gram character sequences (analyzer=’char’, ngram_range=(2,3)), which effectively captures morphological patterns and handles German compound words common in technical administrative texts. The TF-IDF weighting scheme automatically adjusts feature importance based on document frequency, down-weighting common character sequences while emphasizing distinctive patterns. The default parameters include: minimum document frequency of 1, no maximum document frequency limit, and L2 normalization of the resulting feature vectors. This character-level approach is particularly suitable for German text, where compound words and domain-specific terminology might not be well-represented in standard tokenization approaches.

Large language models

Large language models (LLMs) were applied without training (zero-shot) using the test set only. This zero-shot approach was chosen for several reasons: (1) it reflects real-world deployment scenarios where fine-tuning may be impractical due to computational costs or data scarcity, (2) it allows us to measure the true inference energy cost without conflating it with fine-tuning overhead, and (3) it provides a fair comparison point for understanding the energy-accuracy trade-off when models are used out-of-the-box. However, we acknowledge several limitations of this methodological choice. Zero-shot prompting may not fully exploit the LLMs’ capabilities, as these models could potentially achieve higher accuracy through few-shot learning (providing examples in the prompt) or parameter-efficient fine-tuning methods like LoRA.

Recent empirical work has shown that the choice between zero‑shot and few‑shot prompting yields a non-trivial trade-off between predictive performance and inference cost. For instance, in a systematic evaluation across sentiment analysis, NLI, and other classification tasks using multiple LLMs, reports that few‑shot prompting generally outperforms zero‑shot, especially for classification and structured-output tasks, while incurring substantially increased inference overhead in terms of token cost, latency, and compute usage, however “marginal accuracy improvements may not justify doubling inference time”. A recent survey of NLP zero‑ and few‑shot approaches finds that zero‑shot methods remain a viable, computationally efficient choice for text classification, particularly under resource constraints or when labeled data is scarce.

While few-shot prompting or fine-tuning could potentially improve accuracy, we opted for zero-shot prompting to prioritize computational efficiency and reproducibility. A rigorous comparison would require extensive experimentation across multiple configurations (e.g., varying numbers of examples, selection strategies, and training regimes), each affecting both performance and cost in task-dependent ways. Moreover, full fine-tuning was deemed incompatible with our focus on inference energy, as it would require reporting training energy costs that vary dramatically based on hardware and optimization strategies. Instruction tuning and retrieval-augmented generation (RAG) approaches, while promising, would introduce additional system components that would obscure the fundamental energy characteristics of the base models themselves.

Computing Resources

We used different computing systems for a comparative analysis of energy efficiency across diverse hardware architectures. This enables the assessment of how architectural differences - especially GPU tensor core capabilities - affect the inference speed and power usage. A diversity in computational infrastructure is crucial for generalizing findings across different environments and ensuring the validity and replicability of experimental results in machine learning research. Furthermore, insights gained from using multiple platforms contribute to optimizing resource allocation strategies and improving cost-effectiveness in large-scale machine learning projects.

To ensure consistent and realistic energy measurements, we employed a warm-start inference scenario for all experiments. Specifically, for LLMs, we initialized the vLLM server once before beginning measurements, allowing model weights to be loaded into memory and any necessary compilation or optimization steps to complete. All 189 test samples within each experimental run were then processed using the same server instance without restart, reflecting typical production deployments where models remain loaded for batch processing. For traditional models, the trained model was similarly loaded once into memory before processing the entire test set. This warm-start approach excludes one-time initialization costs (such as model loading from disk, memory allocation, and initial GPU kernel compilation) from our measurements, focusing instead on the steady-state inference energy that would dominate in real-world applications where models serve multiple requests. We acknowledge that cold-start scenarios—where models are loaded fresh for each prediction—would incur additional energy costs, particularly for large LLMs that require substantial memory transfers. However, such deployment patterns are uncommon in practice due to their inefficiency, and including cold-start overhead would obscure the fundamental differences in inference efficiency between model architectures, which is the primary focus of our analysis.

Results

The highest accuracy was achieved by a traditional linear model using pre-trained sentence embeddings. Notably, even the most energy-efficient model - a linear model with TF-IDF features - outperformed several large language models. Among LLMs with relatively high accuracy, the best small model (Qwen 2.5 7B) consumes seven times less energy than the most accurate model (Qwen 2.5 72B), with only a minor accuracy reduction of 0.07 points. Deepseek models, despite their extensive reasoning processes during inference, exhibit lower accuracy than non-reasoning LLMs while consuming significantly more energy and taking longer to complete inference.

We acknowledge that our comparison evaluates LLMs in a zero-shot setting while traditional models are fine-tuned on task data, creating an asymmetry in experimental conditions. Our methodological choice represents a conscious trade-off, prioritizing computational efficiency, scalability, and reproducibility, while accepting that fine-tuned LLMs might narrow the performance gap observed in our zero-shot evaluation.

Further Requirements of Planet-Centered LLMs

While energy consumption and the associated carbon footprint remain crucial considerations for sustainable AI, truly planet-centered LLMs must meet a broader set of requirements that go beyond mere efficiency. These include other limited resources (water, rare-earth metals, landuse,…), transparency, accessibility, ethical considerations, and technical adaptability to ensure responsible and sustainable AI deployment.

Transparency in AI models is essential for trust and reproducibility. The predictions of traditional models are generally more transparent than those of LLMs. Open-source LLMs, where both model architectures and training data are publicly available, contribute to scientific progress, allow for direct model comparisons such as this present study, and reduce dependency on proprietary technologies. Furthermore, the ability to inspect training data is crucial to assess potential biases and copyright compliance. Many proprietary models, such as GPT-4, lack such transparency, making it difficult to evaluate their fairness and ethical considerations. The EU AI Act will require providers of general-purpose AI models to publish a sufficiently detailed summary of their training data starting in August 2025, which further highlights the call for transparency.

LLMs vary significantly in size, ranging from lightweight models such as fastText to massive architectures like BLOOM-176B, which require substantial GPU memory and network bandwidth. These computational demands translate into high operational costs and environmental impacts. Moreover, some models require proprietary hardware, limiting their accessibility and long-term sustainability. Future AI systems should prioritize modularity and adaptability, enabling efficient integration into diverse infrastructures without excessive resource demands.

Policy Implications

The findings of this study have practical relevance for public administration IT departments that deploy high-volume, repetitive text-classification systems, such as continuous batch processing or internal document tagging. For these scenarios, small, task-specific models often achieve comparable accuracy to large LLMs while consuming orders of magnitude less energy. Consequently, energy efficiency should be considered alongside accuracy and other standard performance metrics when selecting models for deployment. This aligns with the proportionality and sustainability principles highlighted in the EU AI Act.

To support informed decision-making, agencies are encouraged to adopt a structured, internal model evaluation workflow that incorporates both accuracy and energy consumption. In line with general ML best practice, this begins with simple, traditional models as benchmarks, followed by evaluation of more complex LLMs only if they deliver a meaningful improvement in performance. During this process, energy usage should be measured and considered alongside accuracy and explainability to ensure that any gains justify the additional computational cost.

In practice, this approach supports four strategic objectives: (i) prioritize explainable models that meet operational requirements, (ii) select models that balance accuracy with energy efficiency, (iii) adopt more complex LLMs only when justified by measurable benefits, and (iv) maintain adaptability to evolving AI tools through periodic review and benchmarking. Collectively, these measures enable cost-effective, climate-responsible digitalization without imposing additional bureaucratic or regulatory burden.