arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.29002cs.CVcs.AIcs.LG
收藏

揭秘用于自回归图像生成的无分类器引导(CFG)

Demystifying Classifier-Free Guidance for Auto-Regressive Image Generation

Yale University(耶鲁大学);National University of Singapore(新加坡国立大学);Cisco Foundation AI(思科基金会人工智能部门)

Zhiling Zhou, Jiachun Pan, Fengzhuo Zhang, Dirk Bergemann, Zhuoran Yang

AI总结:

本文通过实证与理论研究揭秘自回归图像生成中无分类器引导(CFG)的机制,提出注意力权重复用(AttnReuse)方法,可减少约25%注意力计算且性能下降极小。

摘要:

无分类器引导(CFG)已被广泛应用于自回归(AR)模型中以生成高质量图像。尽管其经验性能优异,但它在AR模型中的机制仍不明确。本文通过实证与理论研究揭示了CFG的机制。通过检查CFG不同组件的排名靠前的语义,我们发现纹理信息主要编码在条件与无条件logit的差值中,而两种logit均以“前一标记重复”作为主导语义。这种强烈的重复语义掩盖了所需的纹理信息,导致仅从条件logit进行贪婪解码会产生近乎纯色的图像。通过对浅层Transformer的训练动态分析,我们证明这种共享的重复语义并非源于预训练的局限或失效,而是源自图像的纹理稀疏性。我们进一步表明,CFG通过在推理过程中纠正这种重复偏差来提升生成质量。受条件与无条件logit间共享语义的启发,我们提出注意力权重复用(AttnReuse),该方法复用条件logit前向传播中的中间注意力计算以加速无条件logit的计算。AttnReuse在不同模型上可减少约25%的注意力计算,且性能下降极小。

英文摘要:

Classifier-free guidance (CFG) has been widely adopted in autoregressive (AR) models for high-quality image generation. Despite its strong empirical performance, its mechanism in AR models remains unclear. This paper demystifies the mechanism of CFG through both empirical and theoretical studies. By examining the top-ranked semantics of different components in CFG, we show that texture information is primarily encoded in the difference between the conditional and unconditional logits, whereas both logits share previous-token repetition as their leading semantics. This strong repetition semantics obscures the desired texture information, causing greedy decoding from the conditional logits alone to produce nearly pure-color images. Through a training-dynamics analysis of shallow transformers, we prove that this shared repetition semantics does not arise from limitations or failures of pretraining, but instead originates from the texture sparsity of images. We further show that CFG improves generation quality by rectifying this repetition bias during inference. Motivated by the shared semantics between conditional and unconditional logits, we propose Attention Weight Reuse (AttnReuse), which reuses intermediate attention computations from the conditional-logit forward pass to accelerate the unconditional-logit computation. AttnReuse reduces about $25\%$ of attention computation with little performance degradation across different models.

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

↑