arXiv:2411.07107cs.CLcs.LG2024-11ICLR被引 26

用直接分类字符串的方法测试神经网络对形式语言的识别能力。

Training Neural Networks as Recognizers of Formal Languages

  • 将神经网络训练为字符串二分类器,贴合形式语言理论定义。
  • RNN和LSTM在多数语言上优于因果掩码Transformer。
  • 提出FLaRe基准数据集,支持未来理论驱动的实证研究。

从形式语言理论角度刻画神经网络架构的计算能力,是理解现代人工智能推理能力边界的关键。然而,现有实证研究常因实验与理论主张不一致而受限:形式语言理论关注的是接收字符串并判断其是否属于某语言的识别器,而当前普遍采用语言建模或序列到序列转换等代理任务进行评估,仅在非正式意义上相关。本文通过直接训练和评估神经网络作为字符串的二分类器,纠正了这一偏差。我们扩展了Snæbjarnarson等人(2025)提出的高效长度可控正则语言字符串采样算法,并在涵盖乔姆斯基层级多种语言的任务上,对简单RNN、LSTM和因果掩码Transformer三种架构进行了测试。结果表明,RNN和LSTM通常优于Transformer;辅助训练目标如语言建模有助于提升性能,但无单一目标能在所有语言和架构上统一改进。本文贡献包括可复现的实验框架与名为FLaRe(Formal Language Recognition)的公开基准数据集及代码。

原文摘要 · Abstract (English)

Characterizing the computational power of neural network architectures in terms of formal language theory remains a crucial line of research, as it describes lower and upper bounds on the reasoning capabilities of modern AI. However, when empirically testing these bounds, existing work often leaves a discrepancy between experiments and the formal claims they are meant to support. The problem is that formal language theory pertains specifically to recognizers: machines that receive a string as input and classify whether it belongs to a language. On the other hand, it is common instead to evaluate language models on proxy tasks, e.g., language modeling or sequence-to-sequence transduction, that are similar in only an informal sense to the underlying theory. We correct this mismatch by training and evaluating neural networks directly as binary classifiers of strings, using a general method that can be applied to a wide variety of languages. As part of this, we extend an algorithm recently proposed by Snæbjarnarson et al. (2025) for efficient length-controlled sampling of strings from regular languages. We provide results on a variety of languages across the Chomsky hierarchy for three neural architectures: a simple RNN, an LSTM, and a causally-masked transformer. We find that the RNN and LSTM often outperform the transformer, and that auxiliary training objectives such as language modeling can help, although no single objective uniformly improves performance across languages and architectures. Our contributions will facilitate theoretically sound empirical testing of language recognition claims in future work. We have released our datasets as a benchmark called FLaRe (Formal Language Recognition), along with our code.

形式语言神经网络理论验证基准测试

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