Papers › Assemble Foundation Models for Automatic Code Summarization

Assemble Foundation Models for Automatic Code Summarization

13 Jan 2022arXiv:2201.05222archive 2025-07-28

Jian Gu, Pasquale Salza, Harald C. Gall

Automatic code summarization is beneficial to daily software development since it could help reduce the requirement of manual writing. Currently, artificial intelligence is undergoing a paradigm shift. The foundation models pretrained on massive data and finetuned to downstream tasks surpass specially customized models. This trend inspired us to consider reusing foundation models instead of learning from scratch. Thereby, we propose a flexible and robust approach for automatic code summarization, based on neural models. We assemble available foundation models, such as CodeBERT and GPT-2, into a single neural model named AdaMo. Moreover, we utilize Gaussian noise as the simulation of contextual information to optimize the latent representation. Furthermore, we introduce two adaptive schemes from the perspective of knowledge transfer, namely continuous pretraining and intermediate finetuning, and design intermediate stage tasks for general sequence-to-sequence learning. Finally, we evaluate AdaMo against a benchmark dataset for code summarization, by comparing it with state-of-the-art models.

PaperPDFCode

Code

jianguda/afm4acs officialmentioned in paperpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Code Documentation GenerationCode SummarizationSequence-to-sequence Language ModelingSource Code SummarizationTransfer Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Source Code Summarization CodeSearchNet - Python AdaMo-basic BLEU-4 16.46 #1 of 1 Archive leaderboard report
Source Code Summarization CodeSearchNet - Python AdaMo-basic METEOR 12.51% #1 of 1 Archive leaderboard report
Source Code Summarization DeepCom-Java AdaMo-noise BLEU-4 45.35 #1 of 2 Archive leaderboard report
Source Code Summarization DeepCom-Java AdaMo-noise METEOR 28.25% #1 of 2 Archive leaderboard report
Source Code Summarization DeepCom-Java AdaMo-basic BLEU-4 45.3 #2 of 2 Archive leaderboard report
Source Code Summarization DeepCom-Java AdaMo-basic METEOR 28.19% #2 of 2 Archive leaderboard report
Source Code Summarization Java scripts AdaMo-basic BLEU-4 37.64 #1 of 1 Archive leaderboard report
Source Code Summarization Java scripts AdaMo-basic METEOR 25.59% #1 of 1 Archive leaderboard report
Source Code Summarization ParallelCorpus-Python AdaMo-noise BLEU-4 34.05 #1 of 2 Archive leaderboard report
Source Code Summarization ParallelCorpus-Python AdaMo-noise METEOR 21.92% #1 of 2 Archive leaderboard report
Source Code Summarization ParallelCorpus-Python AdaMo-basic BLEU-4 33.85 #2 of 2 Archive leaderboard report
Source Code Summarization ParallelCorpus-Python AdaMo-basic METEOR 21.68% #2 of 2 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

AdamAttentionAttention DropoutBPECodeBERTCosine AnnealingDense ConnectionsDiscriminative Fine-TuningDropoutGPT-2Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections