Kaijing Ma

VSF: Simple, Efficient, and Effective Negative Guidance in Few-Step Image Generation Models By Value Sign Flip

Original note, sentence-aligned / 原创笔记逐句对照。Not a full-paper translation / 不是论文全文翻译。

English / 中文 · Source / 原文

Match with the key, oppose with the value

用 key 匹配,用 value 反向作用

VSF introduces negative guidance inside attention for image generators, including few-step models.

VSF 在图像生成器的注意力内部引入负向引导,也适用于少步模型。

It concatenates positive and negative prompt keys but flips and scales only the negative values.

它拼接正负提示的 key,但只翻转并缩放负提示的 value。

Keeping the negative key unchanged lets image queries still find the unwanted concept.

保持负 key 不变,使图像 query 仍能匹配不希望出现的概念。

Z_VSF = softmax(Q[K⁺;K⁻]ᵀ/√d)[V⁺;−αV⁻]

Flipping the entire embedding would also change matching and is not the same operation.

翻转整个嵌入还会改变匹配,因此不是同一种操作。

Why one attention pass gives adaptive weights

为什么一次注意力计算会产生自适应权重

Let S⁺ and S⁻ be the summed exponentiated attention scores for positive and negative keys.

令 S⁺、S⁻ 为正负 key 对应指数化注意力分数之和。

The shared softmax assigns total positive mass W = S⁺/(S⁺ + S⁻).

共享 softmax 分配的正向总质量为 W = S⁺/(S⁺ + S⁻)。

Z_VSF = W Z⁺ − α(1 − W)Z⁻

Here Z⁺ and Z⁻ use separately normalized attention within their prompt groups.

其中 Z⁺、Z⁻ 在各自提示组内分别归一化注意力。

This identity explains the per-query weight without requiring two separate attention passes.

这一恒等式解释了每个 query 的自适应权重,而无需两个独立注意力前向过程。

It does not prove that subtracting a representation removes exactly one semantic concept.

它并未证明减去一个表示就能准确删除某一个语义概念。

Joint attention needs routing controls

联合注意力需要路由控制

In MM-DiT, image and text tokens share attention, so an unprotected negative value could also perturb positive and negative text streams.

在 MM-DiT 中,图像与文本词元共享注意力,因此未经保护的负 value 还可能扰动正负文本流。

The method duplicates negative tokens, retains an unflipped updating stream, and restricts the flipped copy's influence to image queries.

方法复制负词元,保留未翻转的更新流,并将翻转副本的影响限制在图像 query。

It also uses attention bias and removes negative-prompt padding.

它还使用注意力偏置并去除负提示 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.

第 3.2 节关于翻转副本是否充当 key/value 的文字存在冲突;式 9 与路由描述要求图像 query 能关注其 key 和翻转后的 value。

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.

论文还指出作者仓库 issue 19 中存在实现层面的重复问题。

Experiments and limitations

实验与局限

NegGenBench contains 200 prompt pairs, often requesting removal of an essential part, with two seeds for the main experiment.

NegGenBench 包含 200 对提示,常要求删除必需部件,主实验采用两个种子。

Table 2 reports positive, negative, and quality scores of 0.870, 0.545, and 0.952 for VSF Strong.

表 2 报告 VSF Strong 的正向、负向和质量分数为 0.870、0.545、0.952。

VSF Quality gives 0.980, 0.420, and 0.986, showing a deliberate tradeoff in negative adherence.

VSF Quality 为 0.980、0.420、0.986,体现了对负向遵循度的主动权衡。

The original NAG configuration gives 0.993, 0.220, and 0.968 under the same reported evaluation.

原始 NAG 配置在同一报告评估下为 0.993、0.220、0.968。

The main judge is an MLLM; the human check covers only ten selected prompts with two seeds.

主要评判器是 MLLM;人工检查仅覆盖十个选定提示及两个种子。

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.

作者仓库为 weathon/VSF。