mlsanityData to 14 Oct 2026

Code Comment Inconsistency Detection with BERT and Longformer

arXiv 2207.14444 ↗First posted 29 Jul 2022cs.CLcited by 6

Not on the map. Why?

Abstract (arXiv)

Comments, or natural language descriptions of source code, are standard practice among software developers. By communicating important aspects of the code such as functionality and usage, comments help with software project maintenance. However, when the code is modified without an accompanying correction to the comment, an inconsistency between the comment and code can arise, which opens up the possibility for developer confusion and bugs. In this paper, we propose two models based on BERT (Devlin et al., 2019) and Longformer (Beltagy et al., 2020) to detect such inconsistencies in a natural language inference (NLI) context. Through an evaluation on a previously established corpus of comment-method pairs both during and after code changes, we demonstrate that our models outperform multiple baselines and yield comparable results to the state-of-the-art models that exclude linguistic and lexical features. We further discuss ideas for future research in using pretrained language models for both inconsistency detection and automatic comment updating.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 14 of its 28 references that are in the map. First posted on arXiv 29 Jul 2022.

Builds on

14 of 28 references.

References · 14

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  5. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,057
  6. 2020Longformer: The Long-Document Transformercited by 3,413
  7. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  9. 2018Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labelscited by 997
  10. 2015Gated Graph Sequence Neural Networkscited by 796
  11. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  12. 2020Learning to Update Natural Language Comments Based on Code Changescited by 31
2 more
  1. 2020Deep Just-In-Time Inconsistency Detection Between Comments and Source Codecited by 20
  2. 2022HatCUP: Hybrid Analysis and Attention based Just-In-Time Comment Updatingcited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 1; 2024: 0; 2025: 2; 2026: 3.

6 papers.