Evaluating and Optimizing the Effectiveness of Neural Machine Translation in Supporting Code Retrieval Models: A Study on the CAT Benchmark
Hung Phan, Ali Jannesari

TL;DR
This study evaluates neural machine translation for natural language-to-code tasks on the CAT benchmark, introduces an AST-based representation to improve translation accuracy, and enhances code search performance significantly.
Contribution
It proposes ASTTrans, a novel AST-based representation, and demonstrates its effectiveness in improving NMT accuracy and code retrieval results on real-world datasets.
Findings
NMT shows low accuracy in natural language-to-code translation on the CAT benchmark.
ASTTrans Representation improves Meteor score by up to 36%.
Using ASTTrans boosts code search ranking metrics by up to 3.08%.
Abstract
Neural Machine Translation (NMT) is widely applied in software engineering tasks. The effectiveness of NMT for code retrieval relies on the ability to learn from the sequence of tokens in the source language to the sequence of tokens in the target language. While NMT performs well in pseudocode-to-code translation, it might have challenges in learning to translate from natural language query to source code in newly curated real-world code documentation/ implementation datasets. In this work, we analyze the performance of NMT in natural language-to-code translation in the newly curated CAT benchmark that includes the optimized versions of three Java datasets TLCodeSum, CodeSearchNet, Funcom, and a Python dataset PCSD. Our evaluation shows that NMT has low accuracy, measured by CrystalBLEU and Meteor metrics in this task. To alleviate the duty of NMT in learning complex representation of…
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.
