arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.01606cs.LGcs.AIcs.CLcs.CVstat.ML
收藏

关于扩散模型的离散提示优化

On Discrete Prompt Optimization for Diffusion Models

University of California, Los Angeles(加利福尼亚大学洛杉矶分校);Google Research(谷歌研究院);Google Deepmind(谷歌DeepMind)

Ruochen Wang, Ting Liu, Cho-Jui Hsieh, Boqing Gong

AI总结:

提出首个基于梯度的文本到图像扩散模型离散提示优化框架,通过动态紧凑子空间和Shortcut Text Gradient解决搜索空间与梯度计算难题,可用于提示增强和对抗攻击。

摘要:

本文介绍了首个基于梯度的文本到图像扩散模型提示优化框架。我们将提示工程表述为语言空间上的离散优化问题。高效求解该问题面临两大挑战:(1)巨大的领域空间:将领域设为整个语言空间给优化过程带来显著困难。(2)文本梯度:高效计算文本梯度颇具挑战,因为这需要通过扩散模型的推理步骤以及不可微的嵌入查找表进行反向传播。除问题表述外,我们的主要技术贡献在于解决上述挑战。首先,我们设计了一族动态生成的紧凑子空间,这些子空间仅包含与用户输入最相关的词语,从而大幅限制领域空间。其次,我们提出“Shortcut Text Gradient”——一种可在恒定内存和运行时间下获得的、有效替代文本梯度的方法。在从多种来源(DiffusionDB、ChatGPT、COCO)收集的提示上进行的实证评估表明,我们的方法能够发现可显著提升(提示增强)或破坏(对抗攻击)文本到图像扩散模型所生成图像忠实度的提示。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑