How Programming Concepts and Neurons Are Shared in Code Language Models
Not on the map. Why?
Abstract (arXiv)
Several studies have explored the mechanisms of large language models (LLMs) in coding tasks, but most have focused on programming languages (PLs) in a monolingual setting. In this paper, we investigate the relationship between multiple PLs and English in the concept space of LLMs. We perform a few-shot translation task on 21 PL pairs using two Llama-based models. By decoding the embeddings of intermediate layers during this task, we observe that the concept space is closer to English (including PL keywords) and assigns high probabilities to English tokens in the second half of the intermediate layers. We analyze neuron activations for 11 PLs and English, finding that while language-specific neurons are primarily concentrated in the bottom layers, those exclusive to each PL tend to appear in the top layers. For PLs that are highly aligned with multiple other PLs, identifying language-specific neurons is not feasible. These PLs also tend to have a larger keyword set than other PLs and are closer to the model's concept space regardless of the input/output PL in the translation task. Our findings provide insights into how LLMs internally represent PLs, revealing structural patterns in the model's concept space. Code is available at https://github.com/cisnlp/code-specific-neurons.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 34 of its 51 references that are in the map. First posted on arXiv 1 Jun 2025.
Builds on
34 of 51 references.
References · 34
- 2017Attention Is All You Needcited by 60,361
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
- 2020GLU Variants Improve Transformercited by 1,804
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 623
- 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
22 more
- 2024Do Llamas Work in English? On the Latent Language of Multilingual Transformerscited by 281
- 2020Unsupervised Translation of Programming Languagescited by 263
- 2022SGPT: GPT Sentence Embeddings for Semantic Searchcited by 204
- 2024How do Large Language Models Handle Multilingualism?cited by 150
- 2025CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratingscited by 115
- 2024On the Multilingual Ability of Decoder-based Pre-trained Language Models: Finding and Controlling Language-Specific Neuronscited by 83
- 2024The Semantic Hub Hypothesis: Language Models Share Semantic Representations Across Languages and Modalitiescited by 69
- 2022XLCoST: A Benchmark Dataset for Cross-lingual Code Intelligencecited by 56
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2021A Primer on Pretrained Multilingual Language Modelscited by 49
- 2021Learning Language Specific Sub-network for Multilingual Machine Translationcited by 48
- 2024To Code, or Not To Code? Exploring Impact of Code in Pre-trainingcited by 47
- 2023Explaining How Transformers Use Context to Build Predictionscited by 43
- 2024Automatic Programming: Large Language Models and Beyondcited by 36
- 2024Sharing Matters: Analysing Neurons Across Languages and Tasks in LLMscited by 33
- 2024MEXA: Multilingual Evaluation of English-Centric LLMs via Cross-Lingual Alignmentcited by 25
- 2021Importance-based Neuron Allocation for Multilingual Neural Machine Translationcited by 23
- 2023On the Reliability and Explainability of Language Models for Program Generationcited by 17
- 2023Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networkscited by 13
- 2022Explainable AI for Pre-Trained Code Models: What Do They Learn? When They Do Not Work?cited by 8
- 2024Looking into Black Box Code Language Modelscited by 5
- 2024Understanding the role of FFNs in driving multilingual behaviour in LLMscited by 3
Built on by
Citing papers per year: 2025: 1; 2026: 4.
5 papers.
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Modelscited by 27
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?cited by 5
- 2026Neuron-Level Interventions for Gendered and Gender-Neutral Generation in Language Modelscited by 2
- 2026CoDA: Towards Effective Cross-domain Knowledge Transfer via CoT-guided Domain Adaptationcited by 0
- 2026Mind the Gaps: From Failure Attribution to Closed-Form Repair of Code Language Modelscited by 0
- 2026Mind the Gaps: From Failure Attribution to Closed-Form Repair of Code Language Models4 Oct 2026
- 2026Neuron-Level Interventions for Gendered and Gender-Neutral Generation in Language Models29 May 2026
- 2026CoDA: Towards Effective Cross-domain Knowledge Transfer via CoT-guided Domain Adaptation21 Apr 2026
- 2026Locate, Steer, and Improve: A Practical Survey of Actionable Mechanistic Interpretability in Large Language Models20 Jan 2026
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?23 Dec 2025