TreeGen: A Tree-Based Transformer Architecture for Code Generation. Sun, Z., Zhu, Q., Xiong, Y., Sun, Y., Mou, L., & Zhang, L. arXiv, November, 2019. arXiv: 1911.09983
Paper abstract bibtex A code generation system generates programming language code based on an input natural language description. State-of-the-art approaches rely on neural networks for code generation. However, these code generators suffer from two problems. One is the long dependency problem, where a code element often depends on another far-away code element. A variable reference, for example, depends on its definition, which may appear quite a few lines before. The other problem is structure modeling, as programs contain rich structural information. In this paper, we propose a novel tree-based neural architecture, TreeGen, for code generation. TreeGen uses the attention mechanism of Transformers to alleviate the long-dependency problem, and introduces a novel AST reader (encoder) to incorporate grammar rules and AST structures into the network. We evaluated TreeGen on a Python benchmark, HearthStone, and two semantic parsing benchmarks, ATIS and GEO. TreeGen outperformed the previous state-of-the-art approach by 4.5 percentage points on HearthStone, and achieved the best accuracy among neural network-based approaches on ATIS (89.1%) and GEO (89.6%). We also conducted an ablation test to better understand each component of our model.
@article{sun_treegen_2019,
title = {{TreeGen}: {A} {Tree}-{Based} {Transformer} {Architecture} for {Code} {Generation}},
volume = {1911.09983 [cs]},
shorttitle = {{TreeGen}},
url = {http://arxiv.org/abs/1911.09983},
abstract = {A code generation system generates programming language code based on an input natural language description. State-of-the-art approaches rely on neural networks for code generation. However, these code generators suffer from two problems. One is the long dependency problem, where a code element often depends on another far-away code element. A variable reference, for example, depends on its definition, which may appear quite a few lines before. The other problem is structure modeling, as programs contain rich structural information. In this paper, we propose a novel tree-based neural architecture, TreeGen, for code generation. TreeGen uses the attention mechanism of Transformers to alleviate the long-dependency problem, and introduces a novel AST reader (encoder) to incorporate grammar rules and AST structures into the network. We evaluated TreeGen on a Python benchmark, HearthStone, and two semantic parsing benchmarks, ATIS and GEO. TreeGen outperformed the previous state-of-the-art approach by 4.5 percentage points on HearthStone, and achieved the best accuracy among neural network-based approaches on ATIS (89.1\%) and GEO (89.6\%). We also conducted an ablation test to better understand each component of our model.},
urldate = {2020-04-04},
journal = {arXiv},
author = {Sun, Zeyu and Zhu, Qihao and Xiong, Yingfei and Sun, Yican and Mou, Lili and Zhang, Lu},
month = nov,
year = {2019},
note = {arXiv: 1911.09983},
keywords = {Computer Science - Machine Learning, Computer Science - Software Engineering},
}
Downloads: 0
{"_id":"ZHz6odsQa7oNnyqPr","bibbaseid":"sun-zhu-xiong-sun-mou-zhang-treegenatreebasedtransformerarchitectureforcodegeneration-2019","author_short":["Sun, Z.","Zhu, Q.","Xiong, Y.","Sun, Y.","Mou, L.","Zhang, L."],"bibdata":{"bibtype":"article","type":"article","title":"TreeGen: A Tree-Based Transformer Architecture for Code Generation","volume":"1911.09983 [cs]","shorttitle":"TreeGen","url":"http://arxiv.org/abs/1911.09983","abstract":"A code generation system generates programming language code based on an input natural language description. State-of-the-art approaches rely on neural networks for code generation. However, these code generators suffer from two problems. One is the long dependency problem, where a code element often depends on another far-away code element. A variable reference, for example, depends on its definition, which may appear quite a few lines before. The other problem is structure modeling, as programs contain rich structural information. In this paper, we propose a novel tree-based neural architecture, TreeGen, for code generation. TreeGen uses the attention mechanism of Transformers to alleviate the long-dependency problem, and introduces a novel AST reader (encoder) to incorporate grammar rules and AST structures into the network. We evaluated TreeGen on a Python benchmark, HearthStone, and two semantic parsing benchmarks, ATIS and GEO. TreeGen outperformed the previous state-of-the-art approach by 4.5 percentage points on HearthStone, and achieved the best accuracy among neural network-based approaches on ATIS (89.1%) and GEO (89.6%). We also conducted an ablation test to better understand each component of our model.","urldate":"2020-04-04","journal":"arXiv","author":[{"propositions":[],"lastnames":["Sun"],"firstnames":["Zeyu"],"suffixes":[]},{"propositions":[],"lastnames":["Zhu"],"firstnames":["Qihao"],"suffixes":[]},{"propositions":[],"lastnames":["Xiong"],"firstnames":["Yingfei"],"suffixes":[]},{"propositions":[],"lastnames":["Sun"],"firstnames":["Yican"],"suffixes":[]},{"propositions":[],"lastnames":["Mou"],"firstnames":["Lili"],"suffixes":[]},{"propositions":[],"lastnames":["Zhang"],"firstnames":["Lu"],"suffixes":[]}],"month":"November","year":"2019","note":"arXiv: 1911.09983","keywords":"Computer Science - Machine Learning, Computer Science - Software Engineering","bibtex":"@article{sun_treegen_2019,\n\ttitle = {{TreeGen}: {A} {Tree}-{Based} {Transformer} {Architecture} for {Code} {Generation}},\n\tvolume = {1911.09983 [cs]},\n\tshorttitle = {{TreeGen}},\n\turl = {http://arxiv.org/abs/1911.09983},\n\tabstract = {A code generation system generates programming language code based on an input natural language description. State-of-the-art approaches rely on neural networks for code generation. However, these code generators suffer from two problems. One is the long dependency problem, where a code element often depends on another far-away code element. A variable reference, for example, depends on its definition, which may appear quite a few lines before. The other problem is structure modeling, as programs contain rich structural information. In this paper, we propose a novel tree-based neural architecture, TreeGen, for code generation. TreeGen uses the attention mechanism of Transformers to alleviate the long-dependency problem, and introduces a novel AST reader (encoder) to incorporate grammar rules and AST structures into the network. We evaluated TreeGen on a Python benchmark, HearthStone, and two semantic parsing benchmarks, ATIS and GEO. TreeGen outperformed the previous state-of-the-art approach by 4.5 percentage points on HearthStone, and achieved the best accuracy among neural network-based approaches on ATIS (89.1\\%) and GEO (89.6\\%). We also conducted an ablation test to better understand each component of our model.},\n\turldate = {2020-04-04},\n\tjournal = {arXiv},\n\tauthor = {Sun, Zeyu and Zhu, Qihao and Xiong, Yingfei and Sun, Yican and Mou, Lili and Zhang, Lu},\n\tmonth = nov,\n\tyear = {2019},\n\tnote = {arXiv: 1911.09983},\n\tkeywords = {Computer Science - Machine Learning, Computer Science - Software Engineering},\n}\n\n\n\n\n\n\n\n\n\n\n\n","author_short":["Sun, Z.","Zhu, Q.","Xiong, Y.","Sun, Y.","Mou, L.","Zhang, L."],"key":"sun_treegen_2019","id":"sun_treegen_2019","bibbaseid":"sun-zhu-xiong-sun-mou-zhang-treegenatreebasedtransformerarchitectureforcodegeneration-2019","role":"author","urls":{"Paper":"http://arxiv.org/abs/1911.09983"},"keyword":["Computer Science - Machine Learning","Computer Science - Software Engineering"],"metadata":{"authorlinks":{}},"html":""},"bibtype":"article","biburl":"https://bibbase.org/zotero/sarveshsoni","dataSources":["taWdMrienBzqHC2tC"],"keywords":["computer science - machine learning","computer science - software engineering"],"search_terms":["treegen","tree","based","transformer","architecture","code","generation","sun","zhu","xiong","sun","mou","zhang"],"title":"TreeGen: A Tree-Based Transformer Architecture for Code Generation","year":2019}