Reliable generalization lies at the heart of safe ML and AI. However, understanding when and how neural networks generalize remains one of the most important unsolved problems in the field. In this work, we conduct an extensive empirical study (20'910 models, 15 tasks) to investigate whether insights from the theory of computation can predict the limits of neural network generalization in practice. We demonstrate that grouping tasks according to the Chomsky hierarchy allows us to forecast whether certain architectures will be able to generalize to out-of-distribution inputs. This includes negative results where even extensive amounts of data and training time never lead to any non-trivial generalization, despite models having sufficient capacity to fit the training data perfectly. Our results show that, for our subset of tasks, RNNs and Transformers fail to generalize on non-regular tasks, LSTMs can solve regular and counter-language tasks, and only networks augmented with structured memory (such as a stack or memory tape) can successfully generalize on context-free and context-sensitive tasks.
翻译:可靠泛化是安全机器学习和人工智能的核心。然而,理解神经网络何时以及如何泛化仍是该领域最重要且悬而未决的问题之一。在本工作中,我们开展了大规模实证研究(20,910个模型,15个任务),探究计算理论中的洞见能否预测神经网络在实际中的泛化极限。我们证明,根据乔姆斯基层级对任务进行分组,可以预测特定架构能否对分布外输入实现泛化。这包括负面结果:即使投入大量数据和训练时间,模型具备完全拟合训练数据的充分容量,也永远无法实现任何非平凡泛化。我们的结果表明,针对实验任务子集,RNN和Transformer无法在非正则任务上泛化;LSTM能解决正则任务和反语言任务;仅当网络配备结构记忆(如栈或记忆带)时,才能成功泛化上下文无关和上下文相关任务。