Empowering AI to Generate Better AI Code: Guided Generation of Deep Learning Projects with LLMs

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Xie, Chen, Jiao, Mingsheng, Gu, Xiaodong, Shen, Beijun
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915252105379840
author Xie, Chen
Jiao, Mingsheng
Gu, Xiaodong
Shen, Beijun
author_facet Xie, Chen
Jiao, Mingsheng
Gu, Xiaodong
Shen, Beijun
contents While large language models (LLMs) have been widely applied to code generation, they struggle with generating entire deep learning projects, which are characterized by complex structures, longer functions, and stronger reliance on domain knowledge than general-purpose code. An open-domain LLM often lacks coherent contextual guidance and domain expertise for specific projects, making it challenging to produce complete code that fully meets user requirements. In this paper, we propose a novel planning-guided code generation method, DLCodeGen, tailored for generating deep learning projects. DLCodeGen predicts a structured solution plan, offering global guidance for LLMs to generate the project. The generated plan is then leveraged to retrieve semantically analogous code samples and subsequently abstract a code template. To effectively integrate these multiple retrieval-augmented techniques, a comparative learning mechanism is designed to generate the final code. We validate the effectiveness of our approach on a dataset we build for deep learning code generation. Experimental results demonstrate that DLCodeGen outperforms other baselines, achieving improvements of 9.7% in CodeBLEU and 3.6% in human evaluation metrics.
format Preprint
id arxiv_https___arxiv_org_abs_2504_15080
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Empowering AI to Generate Better AI Code: Guided Generation of Deep Learning Projects with LLMs
Xie, Chen
Jiao, Mingsheng
Gu, Xiaodong
Shen, Beijun
Software Engineering
Artificial Intelligence
While large language models (LLMs) have been widely applied to code generation, they struggle with generating entire deep learning projects, which are characterized by complex structures, longer functions, and stronger reliance on domain knowledge than general-purpose code. An open-domain LLM often lacks coherent contextual guidance and domain expertise for specific projects, making it challenging to produce complete code that fully meets user requirements. In this paper, we propose a novel planning-guided code generation method, DLCodeGen, tailored for generating deep learning projects. DLCodeGen predicts a structured solution plan, offering global guidance for LLMs to generate the project. The generated plan is then leveraged to retrieve semantically analogous code samples and subsequently abstract a code template. To effectively integrate these multiple retrieval-augmented techniques, a comparative learning mechanism is designed to generate the final code. We validate the effectiveness of our approach on a dataset we build for deep learning code generation. Experimental results demonstrate that DLCodeGen outperforms other baselines, achieving improvements of 9.7% in CodeBLEU and 3.6% in human evaluation metrics.
title Empowering AI to Generate Better AI Code: Guided Generation of Deep Learning Projects with LLMs
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2504.15080