Comparing Retrieval-Augmented Generation Pipelines for Energy-Aware Code Refactoring

Youssef Oubelmouh, Pierre Chhieng, Amir Salah Eddine Daoudi


Abstract

Choosing a Natural Language Generation (NLG) pipeline is difficult when the generated output must be functionally correct, measurably effective, and inexpensive to produce, all at once. We propose an evaluation framework for comparing NLG pipelines under these joint constraints, together with the Inference-Adjusted Gain (IAG), an architecture-agnostic metric combining output quality and inference cost. We instantiate the framework on energy-aware code refactoring: five systems (LLM-only, Retrieval-Augmented Generation (RAG), Knowledge-Augmented Generation (KAG), Agentic RAG, and Token-Efficient Agentic RAG (TeaRAG)) share the same 1,368-entry knowledge base (KB), named GreenKB, backbone LLM, and validation protocol across 11 Python programs, including three real GitHub projects. Only TeaRAG passes the functional gate on all three GitHub projects, with confirmed energy reductions on two; the third remains within measurement noise. Every other system passes at most one project. A rollback ablation traces this robustness mainly to orchestration rather than retrieval alone. On three synthetic scripts, each run over five seeds, TeaRAG again achieves the highest IAG: it cuts energy use by 96 % on average, against 88 % for KAG, at a higher token cost (3.6k vs. 2.2k tokens). One synthetic case is unstable across seeds for every system, leaving the margin over KAG narrow.

Anthology ID:
2026.inlg-long.78
Volume:
Proceedings of the 19th International Natural Language Generation Conference: Long Papers
Month:
October
Year:
2026
Address:
Utrecht, The Netherlands
Editors:
Guanyi Chen, Laura Perez-Beltrachini, Emiel van Miltenburg
Venue:
INLG
SIG:
SIGGEN
Publisher:
Association for Computational Linguistics
Note:
Pages:
1410–1420
Language:
URL:
https://aclanthology.org/2026.inlg-long.78/
DOI:
Bibkey:
Cite (ACL):
Youssef Oubelmouh, Pierre Chhieng, and Amir Salah Eddine Daoudi. 2026. Comparing Retrieval-Augmented Generation Pipelines for Energy-Aware Code Refactoring. In Proceedings of the 19th International Natural Language Generation Conference: Long Papers, pages 1410–1420, Utrecht, The Netherlands. Association for Computational Linguistics.
Cite (Informal):
Comparing Retrieval-Augmented Generation Pipelines for Energy-Aware Code Refactoring (Oubelmouh et al., INLG 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.inlg-long.78.pdf