arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.00951cs.LGcs.CV
收藏

当边际钳制影响训练方差时?对比学习中的数据依赖性效应

When Does Margin Clamping Affect Training Variance? Dataset-Dependent Effects in Contrastive Forward-Forward Learning

Independent Researcher(独立研究者)

Joshua Steier

AI总结:

本文研究了对比学习中边际钳制对训练方差的影响,发现其依赖数据集特性,通过调整方法可减少方差膨胀。

摘要:

对比前向-前向学习(CFF)学习通过逐层训练来对抗监督对比目标。CFF训练对随机种子敏感,但其不稳定性的来源尚不明确。我们专注于一个实现细节:在对比损失中,正对边际通过饱和相似性钳制应用,即min(s + m, 1)。我们证明了一种替代方法,在对数概率后减去边际,在均值过正样本的缩减下是梯度中性。在CIFAR-10(2×2因子,每个单元7个种子)上,钳制产生5.90倍更高的测试准确率方差(p=0.003),但平均准确率无差异。对钳制激活率、逐层梯度范数和一个减少边际探测点的分析表明,在早期层中存在饱和驱动的梯度截断。这种影响并不能清晰地转移到其他数据集:在CIFAR-100、SVHN和Fashion-MNIST上,钳制产生相等或更低的方差。两个因素导致了差异。首先,每个批次的正对密度控制饱和发生的频率。其次,任务难度在高准确率时压缩种子间的扩展。一个SVHN难度扫描在单个数据集上确认了这种交互作用,当准确率高时,方差比为0.25倍,当使用激进增强时,方差比为16.73倍。在中等准确率范围内,当每个批次中有许多同类对时,切换到梯度中性的减法参考可以消除这种方差膨胀,而不会影响平均准确率。测量层0的钳制激活率可以作为判断问题是否适用的简单检查。

英文摘要:

Contrastive Forward-Forward (CFF) learning trains Vision Transformers layer by layer against supervised contrastive objectives. CFF training can be sensitive to random seed, but the sources of this instability are poorly understood. We focus on one implementation detail: the positive-pair margin in the contrastive loss is applied through saturating similarity clamping, $\min(s + m,\, 1)$. We prove that an alternative formulation, subtracting the margin after the log-probability, is gradient-neutral under the mean-over-positives reduction. On CIFAR-10 ($2 \times 2$ factorial, $n{=}7$ seeds per cell), clamping produces $5.90\times$ higher pooled test-accuracy variance ($p{=}0.003$) with no difference in mean accuracy. Analyses of clamp activation rates, layerwise gradient norms, and a reduced-margin probe point to saturation-driven gradient truncation at early layers. The effect does not transfer cleanly to other datasets: on CIFAR-100, SVHN, and Fashion-MNIST, clamping produces equal or lower variance. Two factors account for the discrepancy. First, positive-pair density per batch controls how often saturation occurs. Second, task difficulty compresses seed-to-seed spread when accuracy is high. An SVHN difficulty sweep confirms the interaction on a single dataset, with the variance ratio moving from $0.25\times$ at high accuracy to $16.73\times$ under aggressive augmentation. In moderate-accuracy regimes with many same-class pairs per batch, switching to the gradient-neutral subtraction reference removes this variance inflation at no cost to mean accuracy. Measuring the layer-0 clamp activation rate serves as a simple check for whether the problem applies.

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

↑