The Power of Hard Attention Transformers on Data Sequences: A Formal Language Theoretic Perspective

Pascal Bergsträßer, Chris Köcher, Anthony Widjaja Lin, Georg Zetzsche
{"title":"The Power of Hard Attention Transformers on Data Sequences: A Formal Language Theoretic Perspective","authors":"Pascal Bergsträßer, Chris Köcher, Anthony Widjaja Lin, Georg Zetzsche","doi":"arxiv-2405.16166","DOIUrl":null,"url":null,"abstract":"Formal language theory has recently been successfully employed to unravel the\npower of transformer encoders. This setting is primarily applicable in Natural\nLanguange Processing (NLP), as a token embedding function (where a bounded\nnumber of tokens is admitted) is first applied before feeding the input to the\ntransformer. On certain kinds of data (e.g. time series), we want our\ntransformers to be able to handle \\emph{arbitrary} input sequences of numbers\n(or tuples thereof) without \\emph{a priori} limiting the values of these\nnumbers. In this paper, we initiate the study of the expressive power of\ntransformer encoders on sequences of data (i.e. tuples of numbers). Our results\nindicate an increase in expressive power of hard attention transformers over\ndata sequences, in stark contrast to the case of strings. In particular, we\nprove that Unique Hard Attention Transformers (UHAT) over inputs as data\nsequences no longer lie within the circuit complexity class $AC^0$ (even\nwithout positional encodings), unlike the case of string inputs, but are still\nwithin the complexity class $TC^0$ (even with positional encodings). Over\nstrings, UHAT without positional encodings capture only regular languages. In\ncontrast, we show that over data sequences UHAT can capture non-regular\nproperties. Finally, we show that UHAT capture languages definable in an\nextension of linear temporal logic with unary numeric predicates and\narithmetics.","PeriodicalId":501124,"journal":{"name":"arXiv - CS - Formal Languages and Automata Theory","volume":"46 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-05-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Formal Languages and Automata Theory","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2405.16166","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Formal language theory has recently been successfully employed to unravel the power of transformer encoders. This setting is primarily applicable in Natural Languange Processing (NLP), as a token embedding function (where a bounded number of tokens is admitted) is first applied before feeding the input to the transformer. On certain kinds of data (e.g. time series), we want our transformers to be able to handle \emph{arbitrary} input sequences of numbers (or tuples thereof) without \emph{a priori} limiting the values of these numbers. In this paper, we initiate the study of the expressive power of transformer encoders on sequences of data (i.e. tuples of numbers). Our results indicate an increase in expressive power of hard attention transformers over data sequences, in stark contrast to the case of strings. In particular, we prove that Unique Hard Attention Transformers (UHAT) over inputs as data sequences no longer lie within the circuit complexity class $AC^0$ (even without positional encodings), unlike the case of string inputs, but are still within the complexity class $TC^0$ (even with positional encodings). Over strings, UHAT without positional encodings capture only regular languages. In contrast, we show that over data sequences UHAT can capture non-regular properties. Finally, we show that UHAT capture languages definable in an extension of linear temporal logic with unary numeric predicates and arithmetics.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
数据序列上的硬注意变换器的力量:形式语言理论的视角
形式语言理论最近被成功地用于揭示变换编码器的能力。这种设置主要适用于自然语言处理(NLP),因为在将输入输入到变换器之前,首先要应用一个标记嵌入函数(其中允许一定数量的标记)。对于某些类型的数据(例如时间序列),我们希望转换器能够处理输入的数字序列(或数字元组),而不对数字的值进行限制。在本文中,我们开始研究变换器编码器对数据序列(即数字元组)的表达能力。我们的研究结果表明,在数据序列上,硬注意变换器的表达能力有所提高,这与字符串的情况形成了鲜明对比。特别是,我们证明了数据序列输入的唯一硬注意力变换器(UHAT)不再位于电路复杂度类别 $AC^0$(即使没有位置编码)之内,这与字符串输入的情况不同,但仍然位于复杂度类别 $TC^0$(即使有位置编码)之内。不使用位置编码的 UHAT 只能捕捉正则表达式语言。相反,我们证明在数据序列上,UHAT 可以捕捉非规则属性。最后,我们证明了 UHAT 可以捕捉在线性时态逻辑的扩展中用一元数值谓词和算术定义的语言。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Query Learning of Advice and Nominal Automata Well-Behaved (Co)algebraic Semantics of Regular Expressions in Dafny Run supports and initial algebra supports of weighted automata Alternating hierarchy of sushifts defined by nondeterministic plane-walking automata $\mathbb{N}$-polyregular functions arise from well-quasi-orderings
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1