arXiv:2507.20133cs.CLcs.AI2025-07ACL

让提示词优化更忠实原意,避免生成跑偏。

Sem-DPO: Mitigating Semantic Inconsistency in Preference Optimization for Prompt Engineering

  • 用语义相似度加权调整DPO损失,约束生成偏离原意。
  • 在三个图像生成任务上提升8%-12%的CLIP相似度和5%-9%的人类评分。
  • 适合追求生成结果一致性与可控性的提示工程研究者。

生成式AI虽能从文本生成逼真图像,但输出质量高度依赖提示词表述。直接偏好优化(DPO)作为轻量级无监督强化学习替代方法,在自动提示词工程中表现优异,但其逐标记正则化无法控制语义不一致:得分更高的提示词仍可能偏离用户原始意图。本文提出Sem-DPO,一种在保持DPO简洁高效的同时增强语义一致性的变体。该方法通过引入基于胜出提示与原始提示差异的权重,降低语义错位训练样本的影响。我们首次为偏好调优的提示生成器提供了语义漂移的理论边界分析,证明Sem-DPO可将学习到的提示限制在原始文本的可证明邻域内。在三个标准文生图提示优化基准及两个语言模型上,Sem-DPO相较DPO实现8%-12%的CLIP相似度提升和5%-9%的人类偏好评分(HPSv2.1、PickScore)提升,同时超越现有最优基线。结果表明,加入语义加权的强基线应成为提示优化研究的新标准,并为语言模型中更广泛的语义感知偏好优化奠定基础。

原文摘要 · Abstract (English)

Generative AI can now synthesize strikingly realistic images from text, yet output quality remains highly sensitive to how prompts are phrased. Direct Preference Optimization (DPO) offers a lightweight, off-policy alternative to RL for automatic prompt engineering, but its token-level regularization leaves semantic inconsistency unchecked as prompts that win higher preference scores can still drift away from the user's intended meaning. We introduce Sem-DPO, a variant of DPO that preserves semantic consistency yet retains its simplicity and efficiency. Sem-DPO adjusts the DPO loss using a weight based on how different the winning prompt is from the original, reducing the impact of training examples that are semantically misaligned. We provide the first analytical bound on semantic drift for preference-tuned prompt generators, showing that Sem-DPO keeps learned prompts within a provably bounded neighborhood of the original text. On three standard text-to-image prompt-optimization benchmarks and two language models, Sem-DPO achieves 8-12% higher CLIP similarity and 5-9% higher human-preference scores (HPSv2.1, PickScore) than DPO, while also outperforming state-of-the-art baselines. These findings suggest that strong flat baselines augmented with semantic weighting should become the new standard for prompt-optimization studies and lay the groundwork for broader, semantics-aware preference optimization in language models.

提示工程偏好优化语义一致DPO改进

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。