paper-with-me

Papers

On Discrete Prompt Optimization for Diffusion Models

2024-06-27 · Ruochen Wang, Ting Liu, Cho-Jui Hsieh, Boqing Gong

This paper introduces the first gradient-based framework for prompt optimization in text-to-image diffusion models. We formulate prompt engineering as a discrete optimization problem over the language space. Two major challenges arise in efficiently finding a solution to this problem: (1) Enormous Domain Space: Setting the domain to the entire language space poses significant difficulty to the optimization process. (2) Text Gradient: Efficiently computing the text gradient is challenging, as it requires backpropagating through the inference steps of the diffusion model and a non-differentiable embedding lookup table. Beyond the problem formulation, our main technical contributions lie in solving the above challenges. First, we design a family of dynamically generated compact subspaces comprised of only the most relevant words to user input, substantially restricting the domain space. Second, we introduce "Shortcut Text Gradient" -- an effective replacement for the text gradient that can be obtained with constant memory and runtime. Empirical evaluation on prompts collected from diverse sources (DiffusionDB, ChatGPT, COCO) suggests that our method can discover prompts that substantially improve (prompt enhancement) or destroy (adversarial attack) the faithfulness of images generated by the text-to-image diffusion model.

📄 PDF Abstract BibTeX arXiv:2407.01606

Code (1)

ruocwang/dpo-diffusion 공식 구현 pytorch

Tasks

Adversarial AttackPrompt Engineering

Methods 이 논문이 사용한 방법론

Diffusion Diffusion models generate samples by gradually removing noise from a signal, and their training objective can be expressed as a reweighted variational lower-bound…

Similar Papers 제목 키워드 기반

Diffusion LLMs are Natural Adversaries for any LLM

2025-10-31 · David Lüdke, Tom Wollschläger, Paul Ungermann, Stephan Günnemann 외 arxiv

We introduce a novel framework that transforms the resource-intensive (adversarial) prompt optimization problem into an \emph{efficient, amortized inference task}. Our core insight is that pretrained, non-autoregressive …

Red Teaming

STEPS: Sequential Probability Tensor Estimation for Text-to-Image Hard Prompt Search

2025-01-01 · CVPR 2025 1 · Yuning Qiu, Andong Wang, Chao Li, Haonan Huang 외

Recent text-to-image (T2I) diffusion models have demonstrated remarkable capabilities in visual synthesis, yet their performance heavily relies on the quality of input prompts. However, optimizing discrete prompts re…

Computational EfficiencyQuantization

DiffZOO: A Purely Query-Based Black-Box Attack for Red-teaming Text-to-Image Generative Model via Zeroth Order Optimization

2024-08-18 · Pucheng Dang, Xing Hu, Dong Li, Rui Zhang 외

Current text-to-image (T2I) synthesis diffusion models raise misuse concerns, particularly in creating prohibited or not-safe-for-work (NSFW) images. To address this, various safety mechanisms and red teaming attack meth…

Red Teaming

Prompting Hard or Hardly Prompting: Prompt Inversion for Text-to-Image Diffusion Models

2023-12-19 · CVPR 2024 1 · Shweta Mahajan, Tanzila Rahman, Kwang Moo Yi, Leonid Sigal

The quality of the prompts provided to text-to-image diffusion models determines how faithful the generated content is to the user's intent, often requiring `prompt engineering'. To harness visual concepts from target im…

Image GenerationPrompt Engineering

Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery

2023-02-07 · NeurIPS 2023 11 · Yuxin Wen, Neel Jain, John Kirchenbauer, Micah Goldblum 외

The strength of modern generative models lies in their ability to be controlled through text-based prompts. Typical "hard" prompts are made from interpretable words and tokens, and must be hand-crafted by humans. There a…