{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/rnns-can-generate-bounded-hierarchical","title":"RNNs can generate bounded hierarchical languages with optimal memory","arxiv_id":"2010.07515","date":"2020-10-15","proceeding":"EMNLP 2020 11","authors":["John Hewitt","Michael Hahn","Surya Ganguli","Percy Liang","Christopher D. Manning"],"abstract":"Recurrent neural networks empirically generate natural language with high syntactic fidelity. However, their success is not well-understood theoretically. We provide theoretical insight into this success, proving in a finite-precision setting that RNNs can efficiently generate bounded hierarchical languages that reflect the scaffolding of natural language syntax. We introduce Dyck-($k$,$m$), the language of well-nested brackets (of $k$ types) and $m$-bounded nesting depth, reflecting the bounded memory needs and long-distance dependencies of natural language syntax. The best known results use $O(k^{\\frac{m}{2}})$ memory (hidden units) to generate these languages. We prove that an RNN with $O(m \\log k)$ hidden units suffices, an exponential reduction in memory, by an explicit construction. Finally, we show that no algorithm, even with unbounded computation, can suffice with $o(m \\log k)$ hidden units.","url_abs":"https://arxiv.org/abs/2010.07515v1","url_pdf":"https://arxiv.org/pdf/2010.07515v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"rnns-can-generate-bounded-hierarchical","repo_url":"https://github.com/john-hewitt/dyckkm-learning","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"rnns-can-generate-bounded-hierarchical","repo_url":"https://worksheets.codalab.org/worksheets/0xd668cf62e9e0499089626e45affee864","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":null},{"paper_slug":"rnns-can-generate-bounded-hierarchical","repo_url":"https://github.com/MindSpore-scientific-2/code-4/tree/main/Last-Query-Transformer-RNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"rnns-can-generate-bounded-hierarchical","repo_url":"https://github.com/MindSpore-scientific/code-11/tree/main/Last-Query-Transformer-RNN","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2010.07515","mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}