LoRA-diag: enhancing low-rank adaptation via diagonal modulation for power system modeling code generation
Abstract
Code generation for power system modeling encounters challenges due to complex engineering constraints and multi-level topological structures. While low-rank adaptation techniques perform well in code generation tasks, their fixed low-rank constraints inherently limit expressive power in handling complex power systems. This paper introduces LoRA-Diag, which improves model adaptability for PandaPower modeling by incorporating learnable diagonal modulation parameters into the low-rank decomposition's intermediate representation. Experimental results demonstrate that LoRA-Diag outperforms standard LoRA in code correctness, functional completeness, and execution success rate while maintaining high parameter efficiency.
Fields of Study & Subjects
Software Engineering Research
Topic Modeling
Domain Adaptation and Few-Shot Learning
Publication details
- Pages
- 34–34
- Publication date
- 27 January 2026