In this paper, we show the possibility of a direct injection of algorithms into neural network architecture. We focus on a complex algorithm, that is, Cocke-Youger-Kasami (CYK) for parsing context-free grammars in Chomsky Normal Form and we propose CYKNN, a simple recurrent neural network architecture for encoding the CYK algorithm in trainable matrix-vector multiplications.We experimented with a very simple grammar with 4 variations showing that our approach outperforms existing LLMs with more than 20B parameters with an in-context learning setting and smaller LLMs of the Qwen family fine-tuned with LoRA. Our attempt paves the way to a different approach to neuro-symbolic methodologies.
翻译:在本文中,我们展示了将算法直接注入神经网络架构的可能性。我们聚焦于一个复杂算法,即用于解析乔姆斯基范式下上下文无关文法的Cocke-Younger-Kasami(CYK)算法,并提出CYKNN——一种通过可训练矩阵-向量乘法对CYK算法进行编码的简单循环神经网络架构。我们通过一个包含4种变体的极简单文法进行实验,结果表明,我们的方法在上下文学习设置下优于参数超过200亿的现有大型语言模型(LLM),也优于通过LoRA微调的Qwen系列小型LLM。我们的尝试为神经符号方法论开辟了一条新路径。