arXiv:2606.15054cs.LG2026-06

用余弦相似度替代内积,让自编码器更关注语义而非输入大小。

Size Doesn't Matter: Cosine-Scored Sparse Autoencoders

论文配图:Size Doesn't Matter: Cosine-Scored Sparse Autoencoders
图 1 · 摘自论文原文
  • 改用余弦相似度加学习权重的混合评分机制
  • 在相同重建精度下,识别出更多人类可理解的概念特征
  • 特别适合对归一化表示进行词典学习的任务

稀疏自编码器(SAEs)通过内积检测特征,导致激活强度同时受方向对齐和输入范数影响。因此,仅因输入长度高而触发的特征会占用词典位置,无论其内容是否相关。这造成问题,因为子层归一化已丢弃了范数信息,模型实际无法读取这一量。本文将评分改为可学习的余弦相似度与输入范数的加权组合,允许每个特征独立决定使用多少范数信息。在两种设置下,训练过程虽能恢复内积但从未选择使用,且无特征依赖超过一半的范数。在匹配重建性能时,余弦评分编码器学习到的特征更常与人类可识别概念对齐,有效避免内积浪费词典槽于范数探测器。梯度重加权使损失均衡后差距仍存在,证实前向传播评分几何结构是关键杠杆。该优势并非在所有任务或深度上都成立,但我们认为在归一化表示上的词典学习应默认采用余弦评分。

原文摘要 · Abstract (English)

Sparse autoencoders (SAEs) detect features via inner product, so a feature's activation scales with both its directional alignment and the input's norm. Features that fire on token norm therefore claim dictionary slots regardless of content alignment. This matters because sublayer normalization has already discarded the magnitude the score measures, so the encoder detects a quantity the model does not read. We replace the score with a learned blend of cosine similarity and input magnitude, letting the optimizer choose how much norm to use; a per-feature extension lets each feature decide independently. In both regimes, training is free to recover inner product but never does, with no feature ever choosing more than half-magnitude dependence. At matched reconstruction, the cosine encoder learns features that align with human-recognizable concepts far more often than standard, filling dictionary slots that inner product wastes on norm detectors. Loss reweighting that equalizes gradients barely closes the gap, confirming forward-pass score geometry as the lever. The advantage is not universal across tasks or depths, but we believe cosine scoring should be the default for dictionary learning on normalized representations.

自编码器特征检测词典学习余弦相似度

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。