用 key 匹配,用 value 反向作用
VSF 在图像生成器的注意力内部引入负向引导,也适用于少步模型。
它拼接正负提示的 key,但只翻转并缩放负提示的 value。
保持负 key 不变,使图像 query 仍能匹配不希望出现的概念。
翻转整个嵌入还会改变匹配,因此不是同一种操作。
Paper Notes
原创笔记逐句中英对照Sentence-aligned original note
合成教学数值,不是论文实验结果。默认静止;所有步骤均可在下方静态说明中阅读。Synthetic teaching values, not paper results. Nothing plays automatically; all steps remain available in the static explanation.
VSF 在图像生成器的注意力内部引入负向引导,也适用于少步模型。VSF introduces negative guidance inside attention for image generators, including few-step models.
Wenqi Guo, Shan Du
Original reading note; cited methods and evidence, not an experimental reproduction. · 2508.10931v6
VSF 在图像生成器的注意力内部引入负向引导,也适用于少步模型。
它拼接正负提示的 key,但只翻转并缩放负提示的 value。
保持负 key 不变,使图像 query 仍能匹配不希望出现的概念。
翻转整个嵌入还会改变匹配,因此不是同一种操作。
令 S⁺、S⁻ 为正负 key 对应指数化注意力分数之和。
共享 softmax 分配的正向总质量为 W = S⁺/(S⁺ + S⁻)。
其中 Z⁺、Z⁻ 在各自提示组内分别归一化注意力。
这一恒等式解释了每个 query 的自适应权重,而无需两个独立注意力前向过程。
它并未证明减去一个表示就能准确删除某一个语义概念。
在 MM-DiT 中,图像与文本词元共享注意力,因此未经保护的负 value 还可能扰动正负文本流。
方法复制负词元,保留未翻转的更新流,并将翻转副本的影响限制在图像 query。
它还使用注意力偏置并去除负提示 padding。
第 3.2 节关于翻转副本是否充当 key/value 的文字存在冲突;式 9 与路由描述要求图像 query 能关注其 key 和翻转后的 value。
因此,演示呈现明确公式与预期路由,而不重复那句矛盾表述。
论文还指出作者仓库 issue 19 中存在实现层面的重复问题。
NegGenBench 包含 200 对提示,常要求删除必需部件,主实验采用两个种子。
表 2 报告 VSF Strong 的正向、负向和质量分数为 0.870、0.545、0.952。
VSF Quality 为 0.980、0.420、0.986,体现了对负向遵循度的主动权衡。
原始 NAG 配置在同一报告评估下为 0.993、0.220、0.968。
主要评判器是 MLLM;人工检查仅覆盖十个选定提示及两个种子。
因此,应分别检查负向遵循度和视觉质量,包括不寻常但符合要求的对象。
复现应固定代码版本、路由掩码、重复约定、α 和注意力偏置。
作者仓库为 weathon/VSF。
本原创笔记覆盖上文讨论的方法和选定实验证据,不是论文全文翻译;本次未运行模型复现实验。来源许可:https://creativecommons.org/licenses/by/4.0/
原文所列作者或相关代码链接:https://github.com/weathon/VSF/tree/main; https://github.com/weathon/VSF/issues/19; https://github.com/hako-mikan/sd-webui-negpip/; https://github.com/huggingface/diffusers
原图与数据来自原论文。解释与比较属于阅读笔记。版本和图表编号随正文标明。
Wenqi Guo, Shan Du
Original reading note; cited methods and evidence, not an experimental reproduction. · 2508.10931v6
VSF introduces negative guidance inside attention for image generators, including few-step models.
It concatenates positive and negative prompt keys but flips and scales only the negative values.
Keeping the negative key unchanged lets image queries still find the unwanted concept.
Flipping the entire embedding would also change matching and is not the same operation.
Let S⁺ and S⁻ be the summed exponentiated attention scores for positive and negative keys.
The shared softmax assigns total positive mass W = S⁺/(S⁺ + S⁻).
Here Z⁺ and Z⁻ use separately normalized attention within their prompt groups.
This identity explains the per-query weight without requiring two separate attention passes.
It does not prove that subtracting a representation removes exactly one semantic concept.
In MM-DiT, image and text tokens share attention, so an unprotected negative value could also perturb positive and negative text streams.
The method duplicates negative tokens, retains an unflipped updating stream, and restricts the flipped copy's influence to image queries.
It also uses attention bias and removes negative-prompt padding.
Section 3.2 contains conflicting wording about whether the flipped copy acts as a key/value; Equation 9 and the routing description require that image queries can attend to its keys and flipped values.
The demonstration therefore visualizes the explicit equation and intended routing rather than reproducing that contradictory sentence.
The paper also flags an implementation duplication issue in the author repository's issue 19.
NegGenBench contains 200 prompt pairs, often requesting removal of an essential part, with two seeds for the main experiment.
Table 2 reports positive, negative, and quality scores of 0.870, 0.545, and 0.952 for VSF Strong.
VSF Quality gives 0.980, 0.420, and 0.986, showing a deliberate tradeoff in negative adherence.
The original NAG configuration gives 0.993, 0.220, and 0.968 under the same reported evaluation.
The main judge is an MLLM; the human check covers only ten selected prompts with two seeds.
Negative adherence and visual quality must therefore be inspected separately, including unusual but correct objects.
A reproduction should pin the code revision, routing mask, duplication convention, α, and attention bias.
The author repository is weathon/VSF.
This original note covers the method and selected experimental evidence discussed above. It is not a full-paper translation. No model experiments were run for this note. Source license: https://creativecommons.org/licenses/by/4.0/
Author-code links in the source: https://github.com/weathon/VSF/tree/main; https://github.com/weathon/VSF/issues/19; https://github.com/hako-mikan/sd-webui-negpip/; https://github.com/huggingface/diffusers
Original figures and data come from the cited paper. Explanations and comparisons are reading notes. Source versions and figure labels appear beside the material.