DeepCodeProbe: Towards Understanding What Models Trained on Code Learn

Vahid Majdinasab, Amin Nikanjam, Foutse Khomh
7/11/2024
cs.SEcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Machine learning models trained on code and related artifacts offer valuable support for software maintenance but suffer from interpretability issues due to their complex internal variables. These concerns are particularly significant in safety-critical applications where the models' decision-making processes must be reliable. The specific features and representations learned by these models remain unclear, adding to the hesitancy in adopting them widely. To address these challenges, we introduce DeepCodeProbe, a probing approach that examines the syntax and representation learning abilities of ML models designed for software maintenance tasks. Our study applies DeepCodeProbe to state-of-the-art models for code clone detection, code summarization, and comment generation. Findings reveal that while small models capture abstract syntactic representations, their ability to fully grasp programming language syntax is limited. Increasing model capacity improves syntax learning but introduces trade-offs such as increased training time and overfitting. DeepCodeProbe also identifies specific code patterns the models learn from their training data. Additionally, we provide best practices for training models on code to enhance performance and interpretability, supported by an open-source replication package for broader application of DeepCodeProbe in interpreting other code-related models.

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{majdinasab2024deepcodeprobe,
  title  = {DeepCodeProbe: Towards Understanding What Models Trained on Code Learn},
  author = {Vahid Majdinasab and Amin Nikanjam and Foutse Khomh},
  year   = {2024},
  eprint = {2407.08890},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.08890v1}
}

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/2407.08890.svg)](https://codeofpaper.com/paper/2407.08890)

Discussion