[Paper Review] An Empirical Comparison of Pre-Trained Models of Source Code
This paper presents the first systematic empirical comparison of 19 pre-trained models of source code across 13 software engineering tasks. It evaluates model performance using a standardized setup, identifies key architectural and pre-training strategy factors influencing performance, and reveals that TF-based models outperform TE-based models on both code understanding and generation tasks, challenging prior assumptions about model superiority by architecture type.
While a large number of pre-trained models of source code have been successfully developed and applied to a variety of software engineering (SE) tasks in recent years, our understanding of these pre-trained models is arguably fairly limited. With the goal of advancing our understanding of these models, we perform the first systematic empirical comparison of 19 recently-developed pre-trained models of source code on 13 SE tasks. To gain additional insights into these models, we adopt a recently-developed 4-dimensional categorization of pre-trained models, and subsequently investigate whether there are correlations between different categories of pre-trained models and their performances on different SE tasks.
Motivation & Objective
- To advance understanding of pre-trained models of source code (CodePTMs) by conducting a systematic empirical evaluation across diverse software engineering tasks.
- To investigate correlations between CodePTM categories and performance on different SE tasks using a 4-dimensional categorization framework.
- To identify effective pre-training strategies, modalities (e.g., natural language, code structure), and architectural choices for maximizing performance across multiple downstream tasks.
Proposed method
- The study evaluates 19 recently developed CodePTMs on 13 standard SE tasks using standardized datasets and metrics.
- A 4-dimensional categorization of CodePTMs is applied to analyze architectural and pre-training strategy differences.
- All models are fine-tuned under identical hyperparameter settings to ensure fair comparison across tasks.
- Statistical significance testing is used to validate performance differences between models.
- The authors re-implement or re-collect datasets and models to ensure reproducibility and minimize deviation from original implementations.
- The analysis includes ablation studies on modalities (e.g., natural language, code structure) and pre-training tasks (e.g., MLM, DAE, MASS) to assess their impact on performance.
Experimental results
Research questions
- RQ1How do different CodePTM architectures (e.g., TF-based vs. TE-based) compare in performance across diverse SE tasks?
- RQ2What is the impact of incorporating natural language (NL), code structure, or both on downstream task performance?
- RQ3Which pre-training tasks (e.g., MLM, DAE, MASS) yield the strongest performance across different SE task types?
- RQ4Are there consistent performance advantages for models pre-trained on multiple programming languages versus single languages?
- RQ5Does the choice of pre-training strategy correlate with performance on code generation versus code understanding tasks?
Key findings
- TF-based models (e.g., CodeBERT, GraphCodeBERT) outperform TE-based models (e.g., BERT, RoBERTa) on both code understanding and code generation tasks, contrary to prior assumptions favoring TE-based models.
- The use of natural language (NL) during pre-training significantly improves performance on most tasks, especially code-to-code retrieval and code summarization.
- Pre-training tasks such as DAE, MASS, and MNG show strong positive effects on downstream performance, particularly for code generation and code translation tasks.
- Incorporating code structure (e.g., ASTs) improves performance on tasks like clone detection and code retrieval, especially when combined with NL.
- No single CodePTM achieves state-of-the-art performance across all tasks; model choice should be task-specific, with different models excelling on different task types.
- MLM and its variants consistently yield strong results across multiple tasks, indicating their effectiveness in capturing syntactic and semantic code features.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.