Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates

Ashish Hooda, Mihai Christodorescu, Miltos Allamanis, Aaron Wilson, Kassem Fawaz +1 more
2/1/2024

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large Language Models' success on text generation has also made them better at code generation and coding tasks. While a lot of work has demonstrated their remarkable performance on tasks such as code completion and editing, it is still unclear as to why. We help bridge this gap by exploring to what degree auto-regressive models understand the logical constructs of the underlying programs. We propose Counterfactual Analysis for Programming Concept Predicates (CACP) as a counterfactual testing framework to evaluate whether Large Code Models understand programming concepts. With only black-box access to the model, we use CACP to evaluate ten popular Large Code Models for four different programming concepts. Our findings suggest that current models lack understanding of concepts such as data flow and control flow.

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. 1 weaker match is hidden by default — 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{hooda2024large,
  title  = {Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates},
  author = {Ashish Hooda and Mihai Christodorescu and Miltos Allamanis and Aaron Wilson and Kassem Fawaz and Somesh Jha},
  year   = {2024},
  eprint = {2402.05980},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2402.05980},
  journal = {ICML 2024 2024}
}

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

Discussion