cs.CLOct 15, 2026

Multi-Target Few-Shot Prompting with Diffusion Language Models

Authors: Anton Xue, Alan Li, Rahul Saha

Organizations: University of Texas at Austin

Abstract

Few-shot prompting is useful when instructions and rewards are hard to specify. One such application is editing by example, where a demonstrated formatting change or API migration may need to be applied across multiple sites. However, such edits often depend on both left and right context, making generation with causal autoregressive models awkward. We therefore introduce multi-target few-shot prompting with diffusion language models, where examples guide the infilling of multiple masked regions within a shared canvas. To address the known challenge of reliably following demonstrations in few-shot prompting, we further leverage selective masking of the canvas to derive a likelihood-ratio reward that favors example-supported infills. Across few-shot prompting benchmarks and software refactoring case studies, we find that demonstrations improve infilling accuracy, with example guidance yielding further gains in several settings.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Unlocking Prompt Infilling Capability for Diffusion Language Models

    Apr 4, 2026Yoshinari Fujinuma, Keisuke SakaguchiDiffusion Language ModelsMasked Diffusion Models

  2. Match the Canvas, Not Just the Answer: Predictability-Aware SFT for Diffusion Language Models

    Oct 13, 2026Miao Li, Hanyang Jiang, Hengyu Fu +8Diffusion Language ModelsDiffusion Model Fine-Tuning

  3. How Much Prompt Is Enough? A Blackbox Minimization of Few-Shots in LLMs

    Sep 28, 2026Ali Alfageeh, Rahul Gopinath, Amin AlipourLLM PromptingFew-Shot Prompting