影响的焦虑:变换器注意力头中的布洛姆过滤器
The Anxiety of Influence: Bloom Filters in Transformer Attention Heads
AI总结:
研究发现变换器注意力头中存在布洛姆过滤器功能,通过成员测试策略实现高效重复标记识别,且误报率随嵌入距离降低而减少。
摘要:
一些变换器注意力头似乎在充当成员测试器,专注于回答“这个标记是否在上下文中出现过?”的问题。我们在这四个语言模型(GPT-2 small、medium和large;Pythia-160M)中识别出这些头,并展示了它们形成了一种成员测试策略的光谱。两个头(GPT-2 small中的L0H1和L0H5)充当高精度成员过滤器,即使在180个独特的上下文标记的情况下,误报率仍为0-4%——远高于经典布洛姆过滤器的$d_\text{head} = 64$位容量。第三个头(L1H11)显示了经典的布洛姆过滤器容量曲线:其误报率遵循理论公式$p \approx (1 - e^{-kn/m})^k$,具有$R^2 = 1.0$和拟合容量$m \approx 5$位,当$n \approx 20$个独特的标记时饱和。第四个头最初被识别为布洛姆过滤器(L3H0),但在消除混杂因素后被重新分类为一般的前缀注意力头。一起,这三个真实的成员测试头形成一个多分辨率系统,集中在早期层(0-1),在分类上与归纳和前一标记头不同,其误报率随着嵌入距离的减少而单调下降——这与距离敏感的布洛姆过滤器一致。这些头具有广泛的一般化能力:它们对任何重复的标记类型做出响应,而不仅仅是重复的名称,其一般化能力比仅对重复标记进行响应的头高出43%。消融揭示这些头对重复和新标记的处理都做出了贡献,表明成员测试与更广泛的计算作用共存。通过消除混杂因素对L3H0的重新分类加强了而非削弱了这一案例:剩下的头经受住了我们自身分析中消除的假阳性测试。
英文摘要:
Some transformer attention heads appear to function as membership testers, dedicating themselves to answering the question "has this token appeared before in the context?" We identify these heads across four language models (GPT-2 small, medium, and large; Pythia-160M) and show that they form a spectrum of membership-testing strategies. Two heads (L0H1 and L0H5 in GPT-2 small) function as high-precision membership filters with false positive rates of 0-4\% even at 180 unique context tokens -- well above the $d_\text{head} = 64$ bit capacity of a classical Bloom filter. A third head (L1H11) shows the classic Bloom filter capacity curve: its false positive rate follows the theoretical formula $p \approx (1 - e^{-kn/m})^k$ with $R^2 = 1.0$ and fitted capacity $m \approx 5$ bits, saturating by $n \approx 20$ unique tokens. A fourth head initially identified as a Bloom filter (L3H0) was reclassified as a general prefix-attention head after confound controls revealed its apparent capacity curve was a sequence-length artifact. Together, the three genuine membership-testing heads form a multi-resolution system concentrated in early layers (0-1), taxonomically distinct from induction and previous-token heads, with false positive rates that decay monotonically with embedding distance -- consistent with distance-sensitive Bloom filters. These heads generalize broadly: they respond to any repeated token type, not just repeated names, with 43\% higher generalization than duplicate-token-only heads. Ablation reveals these heads contribute to both repeated and novel token processing, indicating that membership testing coexists with broader computational roles. The reclassification of L3H0 through confound controls strengthens rather than weakens the case: the surviving heads withstand the scrutiny that eliminated a false positive in our own analysis.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。