Antecedent Predictions Are More Important Than You Think: An Effective Method for Tree-Based Code Generation
Yihong Dong, Ge Li, Xue Jiang, and Zhi Jin

TL;DR
This paper introduces a novel Antecedent Prioritized Loss for tree-based code generation, emphasizing the importance of accurate antecedent predictions to improve overall code generation accuracy.
Contribution
The paper proposes a new loss function and a position-aware AST modeling method to enhance antecedent prediction accuracy in tree-based code generation models.
Findings
Significant performance improvements on four benchmark datasets.
The proposed method outperforms existing Seq2Tree approaches.
Enhanced antecedent prediction leads to more accurate code generation.
Abstract
Code generation focuses on the automatic conversion of natural language (NL) utterances into code snippets. The sequence-to-tree (Seq2Tree) approaches are proposed for code generation, with the guarantee of the grammatical correctness of the generated code, which generate the subsequent Abstract Syntax Tree (AST) node relying on antecedent predictions of AST nodes. Existing Seq2Tree methods tend to treat both antecedent predictions and subsequent predictions equally. However, under the AST constraints, it is difficult for Seq2Tree models to produce the correct subsequent prediction based on incorrect antecedent predictions. Thus, antecedent predictions ought to receive more attention than subsequent predictions. To this end, in this paper, we propose an effective method, named Antecedent Prioritized (AP) Loss, that helps the model attach importance to antecedent predictions by…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Parallel Computing and Optimization Techniques
