Carbon-Aware Reporting Evaluation Tool for AI Models
This repository provides the implementation of AI-CARE, a research framework for measuring predictive performance together with energy use, carbon impact, and billing-oriented efficiency metrics for AI systems.
The repository accompanies the paper:
- 📄 AI-CARE: Carbon-Aware Reporting Evaluation Metric for AI Models
- 🔗 https://arxiv.org/abs/2602.16042
- 📥 https://arxiv.org/pdf/2602.16042
AI-CARE treats energy and carbon as first-class evaluation quantities and now includes an LLM billing pipeline for studying token-based versus energy-based pricing under a reproducible experiment design.
AI-CARE contains two complementary workflows:
The original benchmark pipeline evaluates machine learning models under fixed experimental conditions, measures training and inference energy consumption, converts energy usage to carbon emissions, and reports performance–energy–carbon tradeoffs.
The LLM extension adds a research-ready pipeline for evaluating the mismatch between token-based billing and energy-based billing. The workflow includes:
- A fixed 30-prompt suite with three prompt categories:
- 10 short factual QA prompts
- 10 long summarization prompts
- 10 reasoning / multi-step prompts
- A fixed experiment runner that evaluates four logical model profiles against
a real NRP-hosted OpenAI-compatible LLM backend:
local-qa-llm-smalllocal-qa-llm-mediumlocal-qa-llm-largealt-llm
- Cost and energy analysis modules that compute:
- token usage
- latency
- approximate energy consumption
- token-based cost
- energy-based cost
- efficiency ratios
- Statistical analysis for:
- token–energy correlation
- energy variance across token buckets
- rank shifts between billing regimes
- Publication-quality plotting utilities for paper figures.
All LLM scripts preserve the same experiment matrix, logging, and CSV outputs, while now issuing real inference requests to the configured NRP endpoint.
The broader repository includes representative model families such as:
- Multilayer Perceptron (MLP)
- Convolutional Neural Network (CNN)
- Transformer-based classifier
- MLP-Mixer
- MobileNetV2
- ResNet-18 (ImageNet-100 only)
The LLM billing pipeline now maps each logical experiment profile to a distinct NRP-hosted backend model while preserving the existing billing, evaluation, and reporting structure.
Experiments in the core benchmark are conducted on vision benchmarks of increasing complexity:
- MNIST
- Fashion-MNIST
- CIFAR-10
- CIFAR-100
- ImageNet-100
The LLM billing pipeline uses experiments/llm/prompts.json, which contains a
fixed set of 30 prompts split evenly across:
- Short factual QA
- Long summarization
- Reasoning / multi-step
This design supports controlled comparison of how prompt type affects tokens, latency, energy, and billing outcomes.
The most relevant directories for the LLM billing workflow are:
experiments/llm/ Prompt suite plus reusable execution pipeline modules
billing/ Cost analysis, table generation, statistical analysis, and plotting
results/ Generated CSV outputs, including results/llm/
paper/figures/ Publication-ready figures generated by the billing pipeline
paper/tables/ Automatically generated LaTeX tables for the paper workflow
Additional repository directories support the broader AI-CARE benchmark, paper artifacts, tables, model definitions, scripts, and utilities.
Install dependencies first:
pip install -r requirements.txtRun the full publication pipeline (experiments + tables + plots + export zips):
make paper-assetsThis command executes, in order:
python experiments/llm/run_llm_experiments.pypython billing/llm_cost_analysis.pypython billing/llm_stat_analysis.pypython billing/generate_tables.pypython billing/llm_plots.pypython billing/generate_plots.pypython billing/package_paper_assets.py
Exported zip bundles are written to:
paper/exports/tables.zippaper/exports/figures.zip
Then run the LLM billing pipeline in the following order:
python experiments/llm/run_llm_experiments.pyThis executes the fixed prompt suite across four logical model profiles backed
by multiple NRP-hosted models and writes per-run measurements to
results/llm/llm_results.csv.
python billing/llm_cost_analysis.pyThis reads the experiment results and computes token-based cost, energy-based cost, and efficiency metrics.
python billing/llm_stat_analysis.pyThis generates the correlation, token-bucket variance, and rank-shift outputs.
python billing/generate_tables.pyThis writes LaTeX tables to paper/tables/.
python billing/llm_plots.py
python billing/generate_plots.pyThis saves the final paper figures to paper/figures/.
All plotting scripts now export TikZ/PGFPlots figure sources to plots_tikz/
for direct LaTeX inclusion via \input{plots_tikz/<figure>.tex}.
For LaTeX preamble support, include:
\\usepackage{pgfplots} and \\pgfplotsset{compat=newest}.
make paper-assetsresults/llm/llm_results.csv
This file stores one row per model–prompt run and includes fields such as:
modelprompt_idprompt_typetokens_usedlatency_secondsapproximate_energy_kwhcarbon_emissions_gco2energy_backend(gpu_telemetryorcpu_fallback)accuracyresponse_modelenergy_per_tokenlatency_per_tokenaccuracy_per_energy
results/llm/llm_cost_analysis.csv
This file adds billing-oriented metrics, including:
token_costenergy_costcost_gapcarbon_per_token_gco2accuracy_per_carbonaccuracy_per_token_costaccuracy_per_energy_cost
results/llm/correlation.csvresults/llm/energy_variance_by_token_bucket.csvresults/llm/rank_shift.csvresults/llm/regression_summary.csvresults/llm/model_summary_with_ci.csvresults/llm/prompt_summary_with_ci.csvresults/llm/efficiency_summary.csvresults/llm/scas_ranking.csvresults/llm/key_findings.txt
These outputs provide quantitative evidence for:
- correlation between token usage and energy use
- variance in energy within comparable token ranges
- ranking differences under token-based vs energy-based billing
- ranking differences under token-cost vs energy-cost vs SCAS criteria
Tables are written to paper/tables/, including:
llm_summary_table.texllm_cost_table.texllm_efficiency_table.texllm_carbon_table.tex
TikZ/PGFPlots figure sources are written to plots_tikz/, including:
llm_token_vs_energy_scatter.texllm_pareto_frontier.texllm_cost_mismatch_bar.texllm_efficiency_per_cost.texllm_rank_shift_comparison.texllm_energy_variance_by_token_bucket.texllm_prompt_type_comparison.texenergy_vs_tokens.texcarbon_vs_tokens.texenergy_by_model.texcarbon_by_model.texaccuracy_vs_energy.texaccuracy_vs_carbon.tex
These figures are intended to be suitable for manuscript and presentation use.
The LLM billing workflow emphasizes the following metrics:
token_cost = (tokens_used / 1000) * price_per_1k_tokens
energy_cost = approximate_energy_kwh * ALPHA
accuracy_per_token_costaccuracy_per_energy_cost
These metrics make it possible to compare whether billing methods agree on which models are most efficient and whether token counts accurately reflect underlying energy expenditure.
The LLM billing extension contributes a framework for studying a central systems question in modern generative AI evaluation:
Do token-based prices faithfully reflect the real energy footprint of model inference?
By combining controlled prompts, real API-backed inference, per-run token and energy logging, billing calculations, variance analysis, correlation analysis, and model rank-shift comparisons, this repository enables journal-style investigation of token vs energy mismatch in LLM evaluation.
Experiments now use real NRP-hosted LLMs through the NRP OpenAI-compatible API. The experiment matrix, CSV schema, energy estimation logic, and downstream billing/statistical analysis remain unchanged, which makes it easy to compare historical runs with newer live-inference runs.
Export your API key before running the experiment pipeline:
export OPENAI_API_KEY=your_api_key_hereThe runner connects to the NRP OpenAI-compatible endpoint:
https://ellm.nrp-nautilus.io/v1
The LLM billing workflow now uses multiple real NRP models rather than a single shared backend:
qwen3-small: lightweight backend for thelocal-qa-llm-smallprofilegpt-oss: default medium-profile backend forlocal-qa-llm-mediumqwen3: higher-capacity backend for thelocal-qa-llm-largeprofileminimax-m2: alternate backend used for thealt-llmprofile
The experiment runner also records the provider-reported response.model value
in the raw LLM results CSV so you can confirm which backend actually served each
request.
All logical experiment model names are preserved, but they now map to distinct NRP backend models so the original experiment structure stays intact while real model diversity is introduced:
local-qa-llm-small->qwen3-smalllocal-qa-llm-medium->gpt-osslocal-qa-llm-large->qwen3alt-llm->minimax-m2
from llm_client import NRPClient
client = NRPClient()
response = client.generate("Summarize the benefits of carbon-aware AI reporting.")
print(response["text"])
print(response["usage"])Using a real hosted LLM improves realism for billing and latency measurements, but exact generations can vary across runs because the backend service is now live. The fixed prompt suite, preserved logical model profiles, and unchanged analysis pipeline still provide a consistent experiment structure for controlled comparisons.
The LLM workflow now includes a high-performance execution path tailored for real NRP-hosted models:
- bounded parallel execution via a reusable pipeline module (
1-5workers, default3) for rate-safe throughput - per-model batching that reuses a single NRP client instance across prompt runs
- progress logging that reports model name, prompt type, run index, and overall completion percentage
- optional
FAST_MODE(or--fast-mode) for debugging, which keeps two prompts per prompt type and shortens prompt text to reduce turnaround time - reusable CLI subset selection via
--models,--prompt-types, and--prompt-limitto support future dataset or prompt-suite extensions
Parallel execution improves throughput, but live hosted-model behavior still means generations and latency can vary across runs. The fixed logical model profiles, prompt suite structure, CSV outputs, and downstream billing/statistics scripts remain stable for controlled comparisons.
The LLM pipeline is designed for structured repeatability:
- fixed prompt suite
- preserved logical model profiles
- automatic directory creation for outputs
- repository-local billing/statistics/plotting pipeline
- live inference via the NRP OpenAI-compatible API
The broader AI-CARE benchmark likewise uses fixed reporting assumptions to make energy and carbon comparisons transparent and repeatable.
This project is licensed under the Apache License 2.0. See LICENSE for
details.
This project may be subject to patent protection. Certain components described in the associated publication are pending patent review.
If you use this work, please cite:
@misc{santosh2026aicarecarbonawarereportingevaluation,
title={AI-CARE: Carbon-Aware Reporting Evaluation Metric for AI Models},
author={KC Santosh and Srikanth Baride and Rodrigue Rizk},
year={2026},
eprint={2602.16042},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2602.16042}
}