无需重写器的重写:将提示增强蒸馏到文本编码器中
Rewriting Without a Rewriter: Distilling Prompt Enhancement into the Text Encoder
AI总结:
本文提出Subtext方法,将提示重写器蒸馏到T2I模型的文本编码器,添加集合匹配损失弥补仅速度蒸馏的不足,在多基准上提升提示效果,可迁移到更大模型及带LLM文本编码器的生成器。
摘要:
用大语言模型(LLM)重写图像提示可提升文本到图像(T2I)模型的语义对齐度,尤其在需推断图像内容时效果显著,但额外的LLM调用会增加部署成本。本文提出Subtext方法,将重写器蒸馏到T2I模型的文本编码器中:在图像生成器冻结的情况下,微调文本编码器,使原始提示能诱导出重写提示的去噪轨迹。速度匹配是该场景下的标准蒸馏目标,它能在仅需更多细节的提示(细化提示)上恢复重写器的增益,但在需推理的提示上难以弥合差距。因此,本文添加了集合匹配损失,将编码器的填充输出拉向重写器添加的词汇。在SD3.5-Medium模型上,微调后的编码器在8个细化基准上与重写器表现相当,在5个推理基准上恢复的增益是仅速度蒸馏的两倍,且无需额外部署计算。该编码器还可与重写器互补:当部署计算允许LLM重写时,将重写结果输入本文编码器的表现优于输入基础模型。由于仅修改编码器,该方法无需重新训练即可迁移到共享相同基础编码器的更大模型(SD3.5-Large、FLUX.1-schnell),并保留了重写器推理增益的类似比例。在相同参数数量下,本文方法优于仅速度蒸馏和生成器侧蒸馏,且与可训练参数翻倍、训练计算量1.5倍的变体表现相当。该方法还可迁移到带有LLM文本编码器的生成器:在FLUX.2-klein和Qwen-Image-2.1上,它显著改善了两类提示的表现,且在推理任务上再次优于仅速度蒸馏。增益在14个基准的域内和域外均通过强大的验证评估器测量,并报告了显著性水平。
英文摘要:
Rewriting image prompts with LLMs improves the semantic alignment of text-to-image (T2I) models, especially when the image's content needs to be inferred. However, the extra LLM call is expensive at deployment. We introduce Subtext, which distills the rewriter into the T2I model's text encoder: with the image generator frozen, the encoder is finetuned so that the plain prompt induces the denoising trajectory of the rewritten prompt. Velocity matching, the standard distillation objective in this setting, recovers the rewriter's gain on prompts that only need more detail (elaboration prompts), but struggles to bridge the gap on prompts that require reasoning. We therefore add a set-matching loss that pulls the encoder's padding outputs toward the words the rewriter adds. On SD3.5-Medium, the finetuned encoder matches the rewriter on eight elaboration benchmarks, and on five reasoning benchmarks it recovers twice the share that velocity-only distillation recovers, without additional deployment-time compute. Our encoder is also complementary to rewriting: when deployment-time compute permits an LLM rewrite, feeding it to our encoder outperforms feeding it to the base model. Because only the encoder changes, it transfers without retraining to larger models that share the same base encoder (SD3.5-Large, FLUX.1-schnell), keeping a similar share of the rewriter's reasoning gain. Our recipe outperforms velocity-only and generator-side distillation at the same parameter count, and matches variants with twice the trainable parameters and 1.5x the training compute. The recipe also ports to generators with LLM text encoders: on FLUX.2-klein and Qwen-Image-2.1, it significantly improves both prompt types and again beats velocity-only distillation on reasoning. Gains are measured in-domain and out-of-domain on 14 benchmarks, using a strong validated judge, with significance levels reported.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。