Knowledge boundary probing and demand-guided intervention for LLM-based power system code generation
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) can turn grid-analysis requests into executable programs for power-system simulation, but utilities and research laboratories often require on-premise deployment. In this setting, first-pass failures frequently arise at an API-knowledge boundary, through hallucinated functions, misused parameters, and mishandled result tables. We present PowerCodeBench, a parameterised benchmark generator released as a frozen 2,000-task suite for pandapower, and a deployment-time workflow that requires no weight updates. Documentation-driven L0-L3 probes produce per-model API profiles for diagnosis, model comparison, documentation allocation, and backend calibration. A query-side demand estimator selects layered API evidence before generation, while execution feedback routes targeted repair. Across ten open-weight LLMs (1.5B-480B) and four mid-tier APIs, the validation-enabled workflow raises scalar-match accuracy by 32-56 percentage points after up to three repair rounds relative to an unassisted first pass, for every model of at least 7B and every API. Open-weight models in the 70B-120B range reach the four-vendor mid-tier accuracy range under matched no-tool conditions. Selective injection approaches the full-layer reference using 41% of its prompt tokens. Among model-item pairs passing numerical checks under both workflows, engineering review confirms the requested analysis in 88% of full-workflow outputs versus 66% under plain repair. Round-0 pilots on OpenDSS and PyPSA motivate staged onboarding from broad retrieval at cold start to calibrated selective injection. Measured throughput, latency, energy, and allocated GPU memory establish a practical on-premise serving envelope.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 34 of its 70 references that are in the map. First posted on arXiv 29 May 2026.
Builds on
34 of 70 references.
References · 34
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
22 more
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2023API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMscited by 574
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 527
- 2023Active Retrieval Augmented Generationcited by 506
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
- 2024Adaptive-RAG: Learning to Adapt Retrieval-Augmented Large Language Models through Question Complexitycited by 437
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2024ToolACE: Winning the Points of LLM Function Callingcited by 204
- 2024SciCode: A Research Coding Benchmark Curated by Scientistscited by 172
- 2017pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systemscited by 79
- 2024Exploring the Capabilities and Limitations of Large Language Models in the Electric Energy Sectorcited by 29
- 2024CodeUpdateArena: Benchmarking Knowledge Editing on API Updatescited by 18
- 2023Large Foundation Models for Power Systemscited by 16
- 2024Enhancing LLMs for Power System Simulations: A Feedback-driven Multi-agent Frameworkcited by 16
- 2025GridMind: LLMs-Powered Agents for Power System Analysis and Operationscited by 15
- 2024ElecBench: a Power Dispatch Evaluation Benchmark for Large Language Modelscited by 12
- 2024LibEvolutionEval: A Benchmark and Study for Version-Specific Code Generationcited by 11
- 2024Enabling Large Language Models to Perform Power System Simulations with Previously Unseen Tools: A Case of Dalinecited by 6
- 2025MoE2: Optimizing Collaborative Inference for Edge Large Language Modelscited by 6
- 2025Towards Mitigating API Hallucination in Code Generated by LLMs with Hierarchical Dependency Awarecited by 6
- 2025Identifying and Mitigating API Misuse in Large Language Modelscited by 3
Built on by
Citing papers per year: 2026: 1.
1 paper.