🤖 AI Summary
This work proposes CYKNN, a novel neural architecture that directly embeds the Cocke–Younger–Kasami (CYK) context-free grammar parsing algorithm into a recurrent neural network. By formulating the CYK algorithm through differentiable matrix-vector operations, CYKNN enables end-to-end trainable encoding of symbolic parsing within a neural framework, thereby achieving a deep integration of symbolic reasoning and neural computation. Empirical results demonstrate that CYKNN substantially outperforms both large language models with over 20 billion parameters and LoRA-finetuned variants of the Qwen model family on simple grammatical tasks. This approach establishes a promising new direction for neuro-symbolic systems by combining the expressivity of formal grammars with the learning capabilities of neural networks.
📝 Abstract
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.