Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or Worse
While comments are non-functional elements of source code, Large Language Models (LLM) frequently rely on them to perform Software Engineering (SE) tasks. Yet, where in the model this reliance resides, and how it affects performance, remains poorly understood. We present the first concept-level interpretability study of LLMs in SE, analyzing three tasks - code completion, translation, and refinement - through the lens of internal comment representation. Using Concept Activation Vectors (CAV), we show that LLMs not only internalize comments as distinct latent concepts but also differentiate between subtypes such as Javadocs, inline, and multiline comments. By systematically activating and deactivating these concepts in the LLMs’ embedding space, we observed significant, model-specific, and task-dependent shifts in performance ranging from -90% to +67%. Finally, we conducted a controlled experiment using the same set of code inputs, prompting LLMs to perform 10 distinct SE tasks while measuring the activation of the comment concept within their latent representations. We found that code summarization consistently triggered the strongest activation of comment concepts, whereas code completion elicited the weakest sensitivity. These results open a new direction for building SE tools and models that reason about and manipulate internal concept representations rather than relying solely on surface-level input.
Thu 16 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
16:00 - 17:30 | AI for Software Engineering 19Research Track at Oceania IX Chair(s): Fabio Palomba University of Salerno | ||
16:00 15mTalk | An Eye for AI: Eye-Tracking the Micro-Interruptions of GenAI Code SuggestionsArtifact Award Winner Research Track Pre-print Media Attached | ||
16:15 15mTalk | Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or Worse Research Track Aaron Imani University of California, Irvine, Mohammad Moshirpour University of California, Irvine, Iftekhar Ahmed University of California at Irvine Pre-print Media Attached | ||
16:30 15mTalk | Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning Research Track Zhaoyang Chu Huazhong University of Science and Technology, Yao Wan Huazhong University of Science and Technology, Zhikun Zhang Zhejiang University, Di Wang King Abdullah University of Science and Technology, Zhou Yang University of Alberta, Alberta Machine Intelligence Institute , Hongyu Zhang Chongqing University, Pan Zhou Huazhong University of Science and Technology, Xuanhua Shi Huazhong University of Science and Technology, Hai Jin Huazhong University of Science and Technology, David Lo Singapore Management University Pre-print | ||
16:45 15mTalk | What Makes Code Generation Ethically Sourced?Distinguished Paper Award Research Track Zhuolin Xu Concordia University, Chenglin Li Concordia University, Qiushi Li Concordia University, Shin Hwei Tan Concordia University | ||
17:00 15mTalk | Filtering before Tuning: Robust Fine-Tuning of Large Code Models under Noisy Labels Research Track Zhong Li Nanjing University, Yang Chen China Automobile Data of Tianjin Co., Ltd. China Automotive Technology&Research Center Co.,Ltd., Heng Yong Nanjing University, Yuanyi Lin Huawei Technologies, Jiali Zhao Huawei, Tongtong Xu Huawei, Minxue Pan Nanjing University, Tian Zhang Nanjing University, Xuandong Li Nanjing University | ||
17:15 15mTalk | Automating Requirements Formalization: Using LLMs and Low-Complexity Distinguishing Traces for Semantic Validation Research Track Daniel Mendoza Stanford University, Anastasia Mavridou KBR / NASA Ames Research Center, Andreas Katis KBR / NASA Ames Research Center, Caroline Trippel Stanford University | ||