arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.07705cs.LOcs.AI
收藏

交叉注意力与编码器-解码器变换器:一种逻辑刻画

Encoder-Decoder Transformers: Logical Characterizations and Periodicity

Mathematics Research Centre, Tampere University(塔尔皮奥大学数学研究中心)

Veeti Ahvonen, Damian Heiman, Antti Kuusisto, Miguel Moreno, Matias Selin

AI总结:

本文通过一种新的时序逻辑对编码器-解码器变换器进行逻辑刻画,扩展了命题逻辑并引入计数全局模态和过去模态,同时探讨了变换器在自回归设置中的应用。

摘要:

我们为编码器-解码器变换器提供了一种新颖的逻辑刻画,这是大语言模型的基础架构,也广泛应用于各种受益于交叉注意力的场景。我们研究此类变换器在文本上的实际设置,包括浮点数和软注意力,通过一种新的时序逻辑进行刻画。这种逻辑在命题逻辑中引入了针对编码器输入的计数全局模态和针对解码器输入的过去模态。我们还通过一种分布式自动机对这类变换器进行了额外的刻画,并展示了我们的结果不仅限于架构中的特定选择,还能应对如掩码变化等变化。最后,我们讨论了编码器-解码器变换器在自回归设置中的应用。

英文摘要:

We give logical characterizations of encoder-decoder transformers, the foundational architecture for LLMs that also sees use in various settings that benefit from cross-attention, in the practical setting of floating-point numbers and soft attention. First, we characterize such transformers via a new temporal logic that extends propositional logic with a counting global modality over the encoder input and a past modality over the decoder input, as well as via a type of distributed automata. We consider three frameworks: with and without a final softmax step in the transformer, and in the setting where each model generates tokens via autoregression. Second, we show that both autoregressive transformers and sentences of counting propositional logic - the fragment of the previous logic obtained by omitting the past modality - recognize exactly the commutative star-free languages. Finally, we find that the sequences of tokens the transformers generate are ultimately periodic (and each token appears in the period at most once). This allows us to characterize autoregressive transformers via sentences of counting propositional logic that generate tokens without autoregression, i.e., we can effectively eliminate recursion from the transformers.

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

↑