{"title":"Pseudocode to Code Based on Adaptive Global and Local Information","authors":"Qianqian Yu, Zhangjin Huang, Naijie Gu","doi":"10.1109/SANER56733.2023.00016","DOIUrl":null,"url":null,"abstract":"The pseudocode-to-code task has two main stages: code translation and search synthesis. It faces two main challenges: First, the generated candidate code pieces need to be more accurate. Second, there are problems with search efficiency and accuracy. To address the above challenges, this work proposes a novel approach: For the encoder of code translation, a new multi-scale pyramid feature extractor is proposed to obtain multi-scale local information, which is combined with the global information to improve the accuracy of code translation. For the search synthesis stage, this paper designs the intra-line attention, the inter-line attention, and the code-errMsg attention, which are adaptively integrated with the graph attention to effectively fuse global and local information. Under a budget of 100 program compilations, our final model, AGL-Code, outperforms the previous state-of-the-art models, achieving 46.1%/63.5% synthesis success rate on the TestP/TestW of the SPoC dataset, respectively.","PeriodicalId":281850,"journal":{"name":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","volume":"46 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2023-03-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2023 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SANER56733.2023.00016","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
The pseudocode-to-code task has two main stages: code translation and search synthesis. It faces two main challenges: First, the generated candidate code pieces need to be more accurate. Second, there are problems with search efficiency and accuracy. To address the above challenges, this work proposes a novel approach: For the encoder of code translation, a new multi-scale pyramid feature extractor is proposed to obtain multi-scale local information, which is combined with the global information to improve the accuracy of code translation. For the search synthesis stage, this paper designs the intra-line attention, the inter-line attention, and the code-errMsg attention, which are adaptively integrated with the graph attention to effectively fuse global and local information. Under a budget of 100 program compilations, our final model, AGL-Code, outperforms the previous state-of-the-art models, achieving 46.1%/63.5% synthesis success rate on the TestP/TestW of the SPoC dataset, respectively.