DDPT: Diffusion-Driven Prompt Tuning for Large Language Model Code Generation

Jinyang Li, Sangwon Hyun, M. Ali Babar
4/6/2025
cs.SEcs.AIcs.CL

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in code generation. However, the quality of the generated code is heavily dependent on the structure and composition of the prompts used. Crafting high-quality prompts is a challenging task that requires significant knowledge and skills of prompt engineering. To advance the automation support for the prompt engineering for LLM-based code generation, we propose a novel solution Diffusion-Driven Prompt Tuning (DDPT) that learns how to generate optimal prompt embedding from Gaussian Noise to automate the prompt engineering for code generation. We evaluate the feasibility of diffusion-based optimization and abstract the optimal prompt embedding as a directional vector toward the optimal embedding. We use the code generation loss given by the LLMs to help the diffusion model capture the distribution of optimal prompt embedding during training. The trained diffusion model can build a path from the noise distribution to the optimal distribution at the sampling phrase, the evaluation result demonstrates that DDPT helps improve the prompt optimization for code generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2025ddpt,
  title  = {DDPT: Diffusion-Driven Prompt Tuning for Large Language Model Code Generation},
  author = {Jinyang Li and Sangwon Hyun and M. Ali Babar},
  year   = {2025},
  eprint = {2504.04351},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.04351v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.04351.svg)](https://codeofpaper.com/paper/2504.04351)

Discussion