CoChat

An extensive study on pre-trained models for program understanding and generation

Zeng, Zhengran, Tan, Hanzhuo, Zhang, Haotian, Li, Jing, Zhang, Yuqun, Zhang, Lingming · 2022 · Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis

The DOI matches its Crossref record; 69 of the 69 references it cites were found in a registry or an index.

Abstract

Automatic program understanding and generation techniques could significantly advance the productivity of programmers and have been widely studied by academia and industry. Recently, the advent of pre-trained paradigm enlightens researchers to develop general-purpose pre-trained models which can be applied for a broad range of program understanding and generation tasks. Such pre-trained models, derived by self-supervised objectives on large unlabelled corpora, can be fine-tuned in downstream tasks (such as code search and code generation) with minimal adaptations. Although these pre-trained models claim superiority over the prior techniques, they seldom follow equivalent evaluation protocols, e.g., they are hardly evaluated on the identical benchmarks, tasks, or settings. Consequently, there is a pressing need for a comprehensive study of the pre-trained models on their effectiveness, versatility as well as the limitations to provide implications and guidance for the future development in this area. To this end, we first perform an extensive study of eight open-access pre-trained models over a large benchmark on seven representative code tasks to assess their reproducibility. We further compare the pre-trained models and domain-specific state-of-the-art techniques for validating pre-trained effectiveness. At last, we investigate the robustness of the pre-trained models by inspecting their performance variations under adversarial attacks. Through the study, we find that while we can in general replicate the original performance of the pre-trained models on their evaluated tasks and adopted benchmarks, subtle performance fluctuations can refute the findings in their original papers. Moreover, none of the existing pre-trained models can dominate over all other models. We also find that the pre-trained models can significantly outperform non-pre-trained state-of-the-art techniques in program understanding tasks. Furthermore, we perform the first study for natural language-programming language pre-trained model robustness via adversarial attacks and find that a simple random attack approach can easily fool the state-of-the-art pre-trained models and thus incur security issues. At last, we also provide multiple practical guidelines for advancing future research on pre-trained models for program understanding and generation.

Overview

Integrity signals

Registry

Crossref · 10.1145/3533767.3534390

Cites

69 of 69 references verified0 citation errors · 0 not checkable

Statistics

Recomputing p-values needs the paper’s full text.

Verification

Claims the paper makes

This paper’s full text isn’t openly available, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Citations

Cites

Show all 69 references

Research works printed but not linked: 22

  1. 2022. ISSTA’22 CodeStudy. Github. https://github.com/ZZR0/ISSTA22-CodeStudy 2022. ISSTA’22 CodeStudy. Github. https://github.com/ZZR0/ISSTA22-CodeStudy
  2. Miltiadis Allamanis , Hao Peng , and Charles Sutton . 2016 . A Convolutional Attention Network for Extreme Summarization of Source Code . In ICML 2016 (JMLR Workshop and Conference Proceedings , Vol. 48). JMLR.org, 2091– 2100 . http://proceedings.mlr.press/v48/allamanis16.html Miltiadis Allamanis, Hao Peng, and Charles Sutton. 2016. A Convolutional Attention Network for Extreme Summarization of Source Code. In ICML 2016 (JMLR Workshop and Conference Proceedings, Vol. 48). JMLR.org, 2091–2100. http://proceedings.mlr.press/v48/allamanis16.html
  3. Saikat Chakraborty , Miltiadis Allamanis , and Baishakhi Ray . 2018. Tree2Tree Neural Translation Model for Learning Source Code Changes. CoRR, abs/1810.00314 ( 2018 ), arxiv:1810.00314. arxiv:1810.00314 Saikat Chakraborty, Miltiadis Allamanis, and Baishakhi Ray. 2018. Tree2Tree Neural Translation Model for Learning Source Code Changes. CoRR, abs/1810.00314 (2018), arxiv:1810.00314. arxiv:1810.00314 · arXiv
  4. Mark Chen , Jerry Tworek , Heewoo Jun , Qiming Yuan , Henrique Ponde de Oliveira Pinto , Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, and Greg Brockman. 2021 . Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, and Greg Brockman. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. · arXiv
  5. Kevin Clark , Minh-Thang Luong , Quoc V. Le , and Christopher D. Manning . 2020. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators . In ICLR 2020 . OpenReview.net. https://openreview.net/forum?id=r1xMH1BtvB Kevin Clark, Minh-Thang Luong, Quoc V. Le, and Christopher D. Manning. 2020. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators. In ICLR 2020. OpenReview.net. https://openreview.net/forum?id=r1xMH1BtvB
  6. Kevin Clark , Minh-Thang Luong , Quoc V Le , and Christopher D Manning . 2020 . Electra: Pre-training text encoders as discriminators rather than generators. arXiv preprint arXiv:2003.10555. Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. 2020. Electra: Pre-training text encoders as discriminators rather than generators. arXiv preprint arXiv:2003.10555. · arXiv
  7. Siddhant Garg and Goutham Ramakrishnan . 2020 . BAE : BERT-based Adversarial Examples for Text Classification. In EMNLP 2020. 6174 – 6181 . Siddhant Garg and Goutham Ramakrishnan. 2020. BAE: BERT-based Adversarial Examples for Text Classification. In EMNLP 2020. 6174–6181.
  8. Daya Guo , Shuo Ren , Shuai Lu , Zhangyin Feng , Duyu Tang , Shujie Liu , Long Zhou , Nan Duan , Alexey Svyatkovskiy , Shengyu Fu , Michele Tufano , Shao Kun Deng , Colin B. Clement , Dawn Drain , Neel Sundaresan , Jian Yin , Daxin Jiang , and Ming Zhou . 2021 . GraphCodeBERT: Pre-training Code Representations with Data Flow. In ICLR 2021. OpenReview.net. https://openreview.net/forum?id=jLoC4ez43PZ Daya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng, Duyu Tang, Shujie Liu, Long Zhou, Nan Duan, Alexey Svyatkovskiy, Shengyu Fu, Michele Tufano, Shao Kun Deng, Colin B. Clement, Dawn Drain, Neel Sundaresan, Jian Yin, Daxin Jiang, and Ming Zhou. 2021. GraphCodeBERT: Pre-training Code Representations with Data Flow. In ICLR 2021. OpenReview.net. https://openreview.net/forum?id=jLoC4ez43PZ
  9. Nan Jiang , Thibaud Lutellier , and Lin Tan . 2021 . CURE : Code-Aware Neural Machine Translation for Automatic Program Repair. In ICSE 2021. 1161 – 1173 . Nan Jiang, Thibaud Lutellier, and Lin Tan. 2021. CURE: Code-Aware Neural Machine Translation for Automatic Program Repair. In ICSE 2021. 1161–1173.
  10. Di Jin , Zhijing Jin , Joey Tianyi Zhou, and Peter Szolovits . 2020 . Is bert really robust? a strong baseline for natural language attack on text classification and entailment. In AAAI 2020. 34, 8018–8025. Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. Is bert really robust? a strong baseline for natural language attack on text classification and entailment. In AAAI 2020. 34, 8018–8025.
  11. Aditya Kanade , Petros Maniatis , Gogul Balakrishnan , and Kensen Shi . 2020 . Learning and evaluating contextual embedding of source code . In International Conference on Machine Learning. 5110–5121 . Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. 2020. Learning and evaluating contextual embedding of source code. In International Conference on Machine Learning. 5110–5121.
  12. Yinhan Liu , Myle Ott , Naman Goyal , Jingfei Du , Mandar Joshi , Danqi Chen , Omer Levy , Mike Lewis , Luke Zettlemoyer , and Veselin Stoyanov . 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. CoRR, abs/1907.11692 ( 2019 ), arxiv:1907.11692. arxiv:1907.11692 Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. RoBERTa: A Robustly Optimized BERT Pretraining Approach. CoRR, abs/1907.11692 (2019), arxiv:1907.11692. arxiv:1907.11692 · arXiv
  13. 10.5555/3015812.3016002 · doi:10.5555/3015812.3016002
  14. 10.5555/3015812.3016002 · doi:10.5555/3015812.3016002
  15. Alec Radford , Jeffrey Wu , Rewon Child , David Luan , Dario Amodei , and Ilya Sutskever . 2019. Language models are unsupervised multitask learners. OpenAI blog, 1, 8 ( 2019 ), 9. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1, 8 (2019), 9.
  16. Baptiste Roziere Marie-Anne Lachaux Lowik Chanussot and Guillaume Lample. 2020. Unsupervised Translation of Programming Languages.. In NeurIPS. Baptiste Roziere Marie-Anne Lachaux Lowik Chanussot and Guillaume Lample. 2020. Unsupervised Translation of Programming Languages.. In NeurIPS.
  17. Ensheng Shi Yanlin Wang Lun Du Junjie Chen Shi Han Hongyu Zhang Dongmei Zhang and Hongbin Sun. 2021. Neural Code Summarization: How Far Are We? arXiv preprint arXiv:2107.07112. Ensheng Shi Yanlin Wang Lun Du Junjie Chen Shi Han Hongyu Zhang Dongmei Zhang and Hongbin Sun. 2021. Neural Code Summarization: How Far Are We? arXiv preprint arXiv:2107.07112. · arXiv
  18. Shashank Srikant Sijia Liu Tamara Mitrovska Shiyu Chang Quanfu Fan Gaoyuan Zhang and Una-May O’Reilly. 2020. Generating Adversarial Computer Programs using Optimized Obfuscations. In ICLR. Shashank Srikant Sijia Liu Tamara Mitrovska Shiyu Chang Quanfu Fan Gaoyuan Zhang and Una-May O’Reilly. 2020. Generating Adversarial Computer Programs using Optimized Obfuscations. In ICLR.
  19. 10.1145/3340544 · DOI · Paper page
  20. Ashish Vaswani , Noam Shazeer , Niki Parmar , Jakob Uszkoreit , Llion Jones , Aidan N. Gomez , Lukasz Kaiser , and Illia Polosukhin . 2017 . Attention is All you Need . In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017 . 5998–6008. https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is All you Need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017. 5998–6008. https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html
  21. Anjiang Wei Yinlin Deng Chenyuan Yang and Lingming Zhang. 2022. Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source. In ICSE. Anjiang Wei Yinlin Deng Chenyuan Yang and Lingming Zhang. 2022. Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source. In ICSE.
  22. Yaqin Zhou , Shangqing Liu , Jing Kai Siow , Xiaoning Du, and Yang Liu. 2019 . Devign : Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks. In NeurIPS 2019. 10197–10207. Yaqin Zhou, Shangqing Liu, Jing Kai Siow, Xiaoning Du, and Yang Liu. 2019. Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks. In NeurIPS 2019. 10197–10207.

Cited by

See all 157

Metadata

Authors
Zeng, Z., Tan, H., Zhang, H., Li, J., Zhang, Y., & Zhang, L.
Affiliations
  • Southern University of Science and Technology (CN)
  • Hong Kong Polytechnic University (HK)
  • Kwai, China
  • University of Illinois Urbana-Champaign (US)
Venue
Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis
Publisher
ACM
Published
2022-07-18
Pages
39-51
OpenAlex
W4285490465
Cited by
153
References
51
Citations by year
2026: 28 · 2025: 48 · 2024: 48 · 2023: 28 · 2022: 1
FWCI
27.94
Type
conference paper
Language
en
Open access
closed
Locations
ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA) (publishedVersion)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
Keywords
pre-trained language models, program comprehension, code generation, code search, reproducibility, adversarial robustness, adversarial attacks, self-supervised learning, benchmark evaluation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.