Automata Extraction from Transformers

Yihao Zhang, Zeming Wei, Meng Sun
{"title":"Automata Extraction from Transformers","authors":"Yihao Zhang, Zeming Wei, Meng Sun","doi":"arxiv-2406.05564","DOIUrl":null,"url":null,"abstract":"In modern machine (ML) learning systems, Transformer-based architectures have\nachieved milestone success across a broad spectrum of tasks, yet understanding\ntheir operational mechanisms remains an open problem. To improve the\ntransparency of ML systems, automata extraction methods, which interpret\nstateful ML models as automata typically through formal languages, have proven\neffective for explaining the mechanism of recurrent neural networks (RNNs).\nHowever, few works have been applied to this paradigm to Transformer models. In\nparticular, understanding their processing of formal languages and identifying\ntheir limitations in this area remains unexplored. In this paper, we propose an\nautomata extraction algorithm specifically designed for Transformer models.\nTreating the Transformer model as a black-box system, we track the model\nthrough the transformation process of their internal latent representations\nduring their operations, and then use classical pedagogical approaches like L*\nalgorithm to interpret them as deterministic finite-state automata (DFA).\nOverall, our study reveals how the Transformer model comprehends the structure\nof formal languages, which not only enhances the interpretability of the\nTransformer-based ML systems but also marks a crucial step toward a deeper\nunderstanding of how ML systems process formal languages. Code and data are\navailable at https://github.com/Zhang-Yihao/Transfomer2DFA.","PeriodicalId":501124,"journal":{"name":"arXiv - CS - Formal Languages and Automata Theory","volume":"13 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-06-08","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-2406.05564","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

In modern machine (ML) learning systems, Transformer-based architectures have achieved milestone success across a broad spectrum of tasks, yet understanding their operational mechanisms remains an open problem. To improve the transparency of ML systems, automata extraction methods, which interpret stateful ML models as automata typically through formal languages, have proven effective for explaining the mechanism of recurrent neural networks (RNNs). However, few works have been applied to this paradigm to Transformer models. In particular, understanding their processing of formal languages and identifying their limitations in this area remains unexplored. In this paper, we propose an automata extraction algorithm specifically designed for Transformer models. Treating the Transformer model as a black-box system, we track the model through the transformation process of their internal latent representations during their operations, and then use classical pedagogical approaches like L* algorithm to interpret them as deterministic finite-state automata (DFA). Overall, our study reveals how the Transformer model comprehends the structure of formal languages, which not only enhances the interpretability of the Transformer-based ML systems but also marks a crucial step toward a deeper understanding of how ML systems process formal languages. Code and data are available at https://github.com/Zhang-Yihao/Transfomer2DFA.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
从变形金刚中提取自动机
在现代机器(ML)学习系统中,基于变形器的架构在广泛的任务中取得了里程碑式的成功,然而,理解其运行机制仍然是一个未决问题。为了提高 ML 系统的透明度,自动机提取方法(通常通过形式语言将有状态的 ML 模型解释为自动机)被证明对解释循环神经网络(RNN)的机制非常有效。特别是在理解它们对形式语言的处理以及识别它们在这方面的局限性方面,仍有待探索。本文提出了一种专为变换器模型设计的自动机提取算法。我们将变换器模型视为一个黑盒系统,在其运行过程中跟踪其内部潜在表征的变换过程,然后使用经典的教学方法(如 L* 算法)将其解释为确定性有限状态自动机(DFA)。总之,我们的研究揭示了变换器模型是如何理解形式语言结构的,这不仅增强了基于变换器的 ML 系统的可解释性,而且标志着我们朝着更深入地理解 ML 系统如何处理形式语言的方向迈出了关键的一步。代码和数据请访问 https://github.com/Zhang-Yihao/Transfomer2DFA。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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