Abstract:To enhance the ability of large language models to generate legal documents for the power grid sector under few-shot conditions, this paper proposed a few-shot legal document generation method based on large language models, integrating data augmentation and rule guidance techniques. The proposed method addressed key challenges in power grid legal document generation, such as data scarcity, high domain specificity, and the complexity of legal practice. Experimental results show that the method achieves excellent performance in generating power grid legal defense documents, significantly improving the quality and professionalism of the generated texts.