A Human-on-the-Loop Optimization Autoformalism Approach for Sustainability

Ming Jin, Bilgehan Sel, Fnu Hardeep, Wotao YinarXiv 2023 · DOI

Introduction

Advanced mathematical optimization offers a powerful path toward reducing carbon footprints and energy costs. However, these techniques often remain inaccessible to the general public due to a "high marginal cost of adoption." Implementing effective strategies for electric vehicle (EV) charging, solar installations, or HVAC control requires specialized expertise in mathematical modeling, programming, and data management.

The Cognitive Barrier: System 1 vs. System 2

Human decision-making is often categorized into two modes: "System 1" (fast, intuitive, and habitual) and "System 2" (deliberate, analytical, and effortful). In the context of energy management, most individuals default to System 1 habits—such as plugging in an EV immediately upon returning home—even when such actions are economically or environmentally suboptimal. Transitioning to System 2 thinking for energy tasks is mentally taxing and technically demanding.

Methodology: The Energy Concierge

To bridge this gap, researchers developed the Energy Concierge (EC), a framework utilizing Large Language Models (LLMs) to perform "Optimization Autoformalism." This approach translates natural language queries into formal mathematical problems that can be solved by external engines. The workflow includes:

  1. Iterative Parameter Solicitation: The LLM identifies missing data through conversational Q&A.
  2. Optimization Autoformalism: The model generates executable Python code (using libraries like SCIPY or CVXPY) to represent the optimization task.
  3. External Reasoning Engine: A dedicated mathematical solver executes the code, providing the precise logic that LLMs often lack.
  4. Automated Debugging Loop: If errors occur, the system feeds Python traceback messages back to the LLM for autonomous correction.
  5. Auto-informalism: The solver's output is translated back into actionable, natural language advice.

Key Insights and Results

The framework was evaluated across 20 personalized test cases in six categories, including EV charging and solar panel installation.

  • Solver Fluency: Interestingly, the general-purpose SCIPY library outperformed the specialized CVXPY, achieving success rates between 71% and 100%. This is likely due to the higher prevalence of SCIPY in the LLM's training data.
  • Robustness through Feedback: The automated debugging loop proved critical, enabling the system to reach a 100% compilation rate in several categories by fixing minor syntactic errors.
  • Performance: The EC significantly outperformed standard LLM prompting (the baseline). In many scenarios, the EC achieved near-perfect alignment with user constraints, maintaining an "optimality gap" of less than 10% compared to the true mathematical optimum. In the EV charging case study, the EC improved optimality by up to 60% over simple prompting.

Conclusion

The Energy Concierge demonstrates that LLMs can democratize complex optimization by acting as a bridge between human intent and formal mathematical solvers. By offloading "System 2" reasoning to an external engine, the framework enables non-experts to make data-driven, sustainable choices. Future work will focus on integrating real-time data feeds (e.g., weather and utility pricing) to further reduce the user's manual input requirements.

Summary updated

BibTeX
@misc{jin2023human,
  author = {Ming Jin and Bilgehan Sel and Fnu Hardeep and Wotao Yin},
  title = {{A Human-on-the-Loop Optimization Autoformalism Approach for Sustainability}},
  year = {2023},
  eprint = {2308.10380},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.10380},
}
Figure