Lune

ACL Findings2021

Analysis of Tree-Structured Architectures for Code Generation

Samip Dahal, Adyasha Maharana, Mohit Bansal

摘要

Code generation is the task of generating code snippets from input user specifications in natural language. Leveraging the linguisticallymotivated hierarchical structure of the input can benefit code generation, especially since the specifications are complex sentences containing multiple variables and operations over various data structures. Moreover, recent advances in Transformer architectures have led to improved performance with tree-to-tree style generation for other seq2seq tasks e.g., machine translation. Hence, we present an empirical analysis of the significance of input parse trees for code generation. We run textto-tree, linearized tree-to-tree, and structured tree-to-tree models, using constituency-based parse trees as input, where the target is Abstract Syntax Tree (AST) of the code. We evaluate our models on the Python-based code generation dataset CoNaLa and a semantic parsing dataset ATIS. We find that constituency trees encoded using a structure-aware model improve performance for both datasets. We also provide an analysis of those aspects of the input parse trees which are most impactful. For instance, we find that structure-aware encodings are better at modelling inputs with multiple variables and capturing long-range dependencies for code generation. 1

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper2

  1. TreeGen: A Tree-Based Transformer Architecture for Code GenerationZeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun 等AAAI 2020 · 196 次引用
  2. Tree-Structured Attention with Hierarchical AccumulationXuan-Phi Nguyen, Shafiq R. Joty, Steven C. H. Hoi, Richard SocherICLR 2020 · 79 次引用

相关 Paper

  1. Learning Sequential and Structural Information for Source Code SummarizationYunSeok Choi, JinYeong Bak, CheolWon Na, Jee-Hyong LeeACL Findings 2021 · 34 次引用
  2. AST-Trans: Code Summarization with Efficient Tree-Structured AttentionZe Tang, Xiaoyu Shen, Chuanyi Li, Jidong Ge 等ICSE 2022 · 57 次引用
  3. AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 次引用
  4. Code Summarization with Structure-induced TransformerHongqiu Wu, Hai Zhao, Min ZhangACL Findings 2021 · 70 次引用
  5. CODEP: Grammatical Seq2Seq Model for General-Purpose Code GenerationYihong Dong, Ge Li, Zhi JinISSTA 2023 · 18 次引用
黄昏的海面,两侧是细线勾勒的悬崖