Can Recurrent Neural Networks Learn Nested Recursion?

Jean-Phillipe Bernardy


Abstract
Context-free grammars (CFG) were one of the first formal tools used to model natural languages, and they remain relevant today as the basis of several frameworks. A key ingredient of CFG is the presence of nested recursion. In this paper, we investigate experimentally the capability of several recurrent neural networks (RNNs) to learn nested recursion. More precisely, we measure an upper bound of their capability to do so, by simplifying the task to learning a generalized Dyck language, namely one composed of matching parentheses of various kinds. To do so, we present the RNNs with a set of random strings having a given maximum nesting depth and test its ability to predict the kind of closing parenthesis when facing deeper nested strings. We report mixed results: when generalizing to deeper nesting levels, the accuracy of standard RNNs is significantly higher than random, but still far from perfect. Additionally, we propose some non-standard stack-based models which can approach perfect accuracy, at the cost of robustness.
Anthology ID:
2018.lilt-16.1
Volume:
Linguistic Issues in Language Technology, Volume 16, 2018
Month:
July
Year:
2018
Address:
Venue:
LILT
SIG:
Publisher:
CSLI Publications
Note:
Pages:
Language:
URL:
https://www.aclweb.org/anthology/2018.lilt-16.1
DOI:
Bib Export formats:
BibTeX MODS XML EndNote
PDF:
http://aclanthology.lst.uni-saarland.de/2018.lilt-16.1.pdf