INSPECT: Intrinsic and Systematic Probing Evaluation for Code Transformers

Anjan Karmakar, Romain Robbes
12/8/2023
cs.SEcs.LG

No confident code implementation found for this paper.

Abstract

Pre-trained models of source code have recently been successfully applied to a wide variety of Software Engineering tasks; they have also seen some practical adoption in practice, e.g. for code completion. Yet, we still know very little about what these pre-trained models learn about source code. In this article, we use probing--simple diagnostic tasks that do not further train the models--to discover to what extent pre-trained models learn about specific aspects of source code. We use an extensible framework to define 15 probing tasks that exercise surface, syntactic, structural and semantic characteristics of source code. We probe 8 pre-trained source code models, as well as a natural language model (BERT) as our baseline. We find that models that incorporate some structural information (such as GraphCodeBERT) have a better representation of source code characteristics. Surprisingly, we find that for some probing tasks, BERT is competitive with the source code models, indicating that there are ample opportunities to improve source-code specific pre-training on the respective code characteristics. We encourage other researchers to evaluate their models with our probing task suite, so that they may peer into the hidden layers of the models and identify what intrinsic code characteristics are encoded.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{karmakar2023inspect,
  title  = {INSPECT: Intrinsic and Systematic Probing Evaluation for Code Transformers},
  author = {Anjan Karmakar and Romain Robbes},
  year   = {2023},
  eprint = {2312.05092},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.05092v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.05092.svg)](https://codeofpaper.com/paper/2312.05092)

Discussion