mlsanityData to 14 Oct 2026

Analyzing Latent Concepts in Code Language Models

arXiv 2510.00476 ↗First posted 1 Oct 2025cs.SE cs.AI cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

Interpreting the internal behavior of large language models trained on code remains a critical challenge, particularly for applications demanding trust, transparency, and semantic robustness. We propose Code Concept Analysis (CoCoA): a global post-hoc interpretability framework that uncovers emergent lexical, syntactic, and semantic structures in a code language model's representation space by clustering contextualized token embeddings into human-interpretable concept groups. We propose a hybrid annotation pipeline that combines static analysis tool-based syntactic alignment with prompt-engineered large language models (LLMs), enabling scalable labeling of latent concepts across abstraction levels. We analyse the distribution of concepts across layers and across three finetuning tasks. Emergent concept clusters can help identify unexpected latent interactions and be used to identify trends and biases within the model's learned representations. We further integrate LCA with local attribution methods to produce concept-grounded explanations, improving the coherence and interpretability of token-level saliency. Empirical evaluations across multiple models and tasks show that LCA discovers concepts that remain stable under semantic-preserving perturbations (average Cluster Sensitivity Index, CSI = 0.288) and evolve predictably with fine-tuning. In a user study on the programming-language classification task, concept-augmented explanations disambiguated token roles and improved human-centric explainability by 37 percentage points compared with token-level attributions using Integrated Gradients.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 24 of its 32 references that are in the map. First posted on arXiv 1 Oct 2025.

Builds on

24 of 32 references.

References · 24

  1. 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
  2. 2017Axiomatic Attribution for Deep Networkscited by 3,384
  3. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  4. 2019Attention is not Explanationcited by 929
  5. 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
  6. 2019Attention is not not Explanationcited by 636
  7. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  8. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  9. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  10. 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
  11. 2022Discovering Latent Concepts Learned in BERTcited by 56
  12. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
12 more
  1. 2021What do pre-trained code models know about code?cited by 36
  2. 2022Probing Pretrained Models of Source Codecited by 26
  3. 2021Counterfactual Explanations for Models of Codecited by 25
  4. 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
  5. 2022Human-Centered Concept Explanations for Neural Networkscited by 23
  6. 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 22
  7. 2024Latent Concept-based Explanation of NLP Modelscited by 13
  8. 2024Towards More Trustworthy and Interpretable LLMs for Code through Syntax-Grounded Explanationscited by 11
  9. 2023Scaling up Discovery of Latent Concepts in Deep NLP Modelscited by 9
  10. 2022Benchmarking Language Models for Code Syntax Understandingcited by 8
  11. 2022ConceptX: A Framework for Latent Concept Analysiscited by 6
  12. 2025Enabling Global, Human-Centered Explanations for LLMs:From Tokens to Interpretable Code and Test Generationcited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.