A Critical Study of What Code-LLMs (Do Not) Learn
Not on the map. Why?
Abstract (arXiv)
Large Language Models trained on code corpora (code-LLMs) have demonstrated impressive performance in various coding assistance tasks. However, despite their increased size and training dataset, code-LLMs still have limitations such as suggesting codes with syntactic errors, variable misuse etc. Some studies argue that code-LLMs perform well on coding tasks because they use self-attention and hidden representations to encode relations among input tokens. However, previous works have not studied what code properties are not encoded by code-LLMs. In this paper, we conduct a fine-grained analysis of attention maps and hidden representations of code-LLMs. Our study indicates that code-LLMs only encode relations among specific subsets of input tokens. Specifically, by categorizing input tokens into syntactic tokens and identifiers, we found that models encode relations among syntactic tokens and among identifiers, but they fail to encode relations between syntactic tokens and identifiers. We also found that fine-tuned models encode these relations poorly compared to their pre-trained counterparts. Additionally, larger models with billions of parameters encode significantly less information about code than models with only a few hundred million parameters.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 34 of its 54 references that are in the map. First posted on arXiv 17 Jun 2024.
Builds on
34 of 54 references.
References · 34
- 2017Attention Is All You Needcited by 59,932
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2019Unified Language Model Pre-training for Natural Language Understanding and Generationcited by 668
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2019Designing and Interpreting Probes with Control Taskscited by 608
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
22 more
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2022Data Contamination: From Memorization to Exploitationcited by 234
- 2019Visualizing and Measuring the Geometry of BERTcited by 215
- 2020BERTology Meets Biology: Interpreting Attention in Protein Language Modelscited by 85
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2020A Tale of a Probe and a Parsercited by 40
- 2021What do pre-trained code models know about code?cited by 36
- 2021A Non-Linear Structural Probecited by 31
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 2022Probing Pretrained Models of Source Codecited by 26
- 2021DirectProbe: Studying Representations without Classifierscited by 25
- 2021Counterfactual Explanations for Models of Codecited by 24
- 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
- 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 20
- 2020Learning Autocompletion from Real-World Datasetscited by 19
- 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
- 2018Studying the Difference Between Natural and Programming Language Corporacited by 13
- 2022What does Transformer learn about source code?cited by 9
- 2022Syntax-Guided Program Reduction for Understanding Neural Code Intelligence Modelscited by 7
- 2022CAT-probing: A Metric-based Approach to Interpret How Pre-trained Models for Programming Language Attend Code Structurecited by 6
- 2023The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classificationcited by 5
- 2023Study of Distractors in Neural Models of Codecited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 2; 2026: 1.
4 papers.
- 2024Problem Solving Through Human-AI Preference-Based Cooperationcited by 11
- 2025Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoderscited by 3
- 2026Towards Understanding What State Space Models Learn About Codecited by 1
- 2025Toward Neurosymbolic Program Comprehensioncited by 0
- 2026Towards Understanding What State Space Models Learn About Code6 Feb 2026
- 2025Mechanistic Interpretability of Code Correctness in LLMs via Sparse Autoencoders3 Oct 2025
- 2025Toward Neurosymbolic Program Comprehension3 Feb 2025
- 2024Problem Solving Through Human-AI Preference-Based Cooperation14 Aug 2024