mlsanityData to 14 Oct 2026

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

arXiv 2504.04351 ↗First posted 6 Apr 2025cs.SE cs.AI cs.CLcited by 2

On the map: Diffusion models → Discrete and text diffusion

Abstract (arXiv)

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.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Discrete and text diffusion, one of 14 directions in Diffusion models. Builds on 32 of its 42 references that are in the map. First posted on arXiv 6 Apr 2025.

Builds on

32 of 42 references.

Closest ancestors · 1

Same direction, newest first

  1. 2022Continuous diffusion for categorical data28 Nov

Other references · 31

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2020Denoising Diffusion Probabilistic Modelscited by 21,076
  3. 2023GPT-4 Technical Reportcited by 18,396
  4. 2020Score-Based Generative Modeling through Stochastic Differential Equationscited by 9,122
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2015Deep Unsupervised Learning using Nonequilibrium Thermodynamicscited by 7,058
  7. 2019Generative Modeling by Estimating Gradients of the Data Distributioncited by 4,101
  8. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
  9. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
  10. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
  11. 2019Language Models as Knowledge Bases?cited by 1,936
  12. 2022Diffusion-LM Improves Controllable Text Generationcited by 1,027
19 more
  1. 2019How Can We Know What Language Models Know?cited by 959
  2. 2020Exploiting Cloze Questions for Few Shot Text Classification and Natural Language Inferencecited by 938
  3. 2021Blended Diffusion for Text-driven Editing of Natural Imagescited by 927
  4. 2021GPT Understands, Toocited by 716
  5. 2020Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuningcited by 671
  6. 2024A Survey on Large Language Models for Code Generationcited by 658
  7. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  8. 2022RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learningcited by 366
  9. 2022A Systematic Evaluation of Large Language Models of Codecited by 363
  10. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
  11. 2022UL2: Unifying Language Learning Paradigmscited by 295
  12. 2021SegDiff: Image Segmentation with Diffusion Probabilistic Modelscited by 280
  13. 2022Black-Box Tuning for Language-Model-as-a-Servicecited by 256
  14. 2020AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Promptscited by 249
  15. 2021PPT: Pre-trained Prompt Tuning for Few-shot Learningcited by 232
  16. 2022Diffusion-based Time Series Imputation and Forecasting with Structured State Space Modelscited by 198
  17. 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
  18. 2021Template-Based Named Entity Recognition Using BARTcited by 153
  19. 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Prompt Optimization Via Diffusion Language Models
  2. 2025PromptBridge: Cross-Model Prompt Transfer for Large Language Models
  3. 2024Exploring the Role of Large Language Models in Prompt Encoding for Diffusion Models
  4. 2026Distilled Continuous Diffusion Language Models Can Write Code in Few Steps---or One
  5. 2025Thinking Inside the Mask: In-Place Prompting in Diffusion LLMs
  6. 2026Unlocking Prompt Infilling Capability for Diffusion Language Models
  7. 2026Diffusion Language Models: An Experimental Analysis
  8. 2026Diffusion Language Models Are Natively Length-Aware