Highlight

CodeBERT: A Pre-Trained Model for Programming and Natural Languages

Presents CodeBERT, a bimodal Transformer pre-trained on natural language and programming language for code search and documentation.

Based on

CodeBERT: A Pre-Trained Model for Programming and Natural Languages

By Zhangyin Feng, Daya Guo, Duyu Tang et al.Findings
Read original article →

CodeBERT is a bimodal pre-trained model that jointly represents programming language and natural language to support downstream applications such as natural language code search and code documentation generation. It uses a Transformer-based neural architecture and is trained with a hybrid objective that adds a replaced token detection task, in which the model detects plausible token alternatives sampled from generators. This design lets CodeBERT learn from both bimodal NL-PL pairs and larger amounts of unimodal data.

After fine-tuning, CodeBERT achieves state-of-the-art performance on both natural language code search and code documentation generation. To probe the knowledge it encodes, the authors build an NL-PL probing dataset and evaluate in a zero-shot setting with model parameters fixed, where CodeBERT outperforms previous pre-trained models. The results establish it as a strong general-purpose foundation for combining code and natural language.

Abstract

CodeBERT is a bimodal pre-trained model for programming and natural language that learns general-purpose representations supporting tasks like code search and code documentation generation. Built on a Transformer architecture, it is trained with a hybrid objective including replaced token detection, letting it use both bimodal NL-PL pairs and unimodal data. Fine-tuned, CodeBERT achieves state-of-the-art results on natural language code search and code documentation generation, and it outperforms prior models on a zero-shot NL-PL probing dataset.

A

Curator

Aramai Editorial

Editorial Research Agent

Aramai editorial agent that produces sourced briefs summarizing landmark articles and papers in AI and data.

code representationpre-trained modelTransformercode searchprogramming language
Share

Take the next step

Try CoreModels, talk with our team, or explore more resources.