ACL Findings2025
How Programming Concepts and Neurons Are Shared in Code Language Models
Amir Hossein Kargaran, Yihong Liu, François Yvon, Hinrich Schütze
摘要
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 Llamabased 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.Java: String message = ""; -Python: message = ""
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- How do Large Language Models Handle Multilingualism? 引用了 Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Space
- Beyond Language Boundaries: Uncovering Programming Language Families for Code Language Models 引用了 Unsupervised Translation of Programming Languages
引用它的顶会 Paper2
它引用的 Paper19
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 次引用
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu 等ICLR 2023 · 234 次引用
- How do Large Language Models Handle Multilingualism?Yiran Zhao, Wenxuan Zhang, Guizhen Chen, Kenji Kawaguchi 等NeurIPS 2024 · 196 次引用
- Share or Not? Learning to Schedule Language-Specific Capacity for Multilingual TranslationBiao Zhang, Ankur Bapna, Rico Sennrich, Orhan FiratICLR 2021 · 97 次引用
- Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary SpaceMor Geva, Avi Caciularu, Kevin Ro Wang, Yoav GoldbergEMNLP 2022 · 92 次引用
相关 Paper
- The Emergence of Abstract Thought in Large Language Models Beyond Any LanguageYuxin Chen, Yiran Zhao, Yang Zhang, An Zhang 等NeurIPS 2025 · 27 次引用
- Cross-Lingual Generalization and Compression: From Language-Specific to Shared NeuronsFrederick Riemenschneider, Anette FrankACL 2025 · 3 次引用
- The Rise and Down of Babel Tower: Investigating the Evolution Process of Multilingual Code Large Language ModelJiawei Chen, Wentao Chen, Jing Su, Jingjing Xu 等ICLR 2025
- Are Structural Concepts Universal in Transformer Language Models? Towards Interpretable Cross-Lingual GeneralizationNingyu Xu, Qi Zhang, Jingting Ye, Menghan Zhang 等EMNLP Findings 2023 · 3 次引用
- Probing the Emergence of Cross-lingual Alignment during LLM TrainingHetong Wang, Pasquale Minervini, Edoardo M. PontiACL Findings 2024 · 13 次引用
