From Execution to Embedding: Enriching Code Representations with Data Difference Signals for Comment Generation
Modern software engineering increasingly involves data-centric workflows, where the purpose of a code cell lies not in its syntax but in how it transforms data. Existing automatic comment generation tools often fail to capture this intent, producing generic documentation. We propose a paradigm shift: capturing post-execution data transformations—semantic differences in the data that reveal what the code actually does—as the foundation for generating explanatory comments for data-wrangling code. To this end, we introduce a dual-encoder architecture that enriches code embeddings with execution-aware signals, pairing code with a new formal grammar of its effects on data. We evaluate the approach building a dataset of executed Python notebooks pairing code, its effect sequence, and human comments. The results show that, in instances without detected transformations, the full pipeline outperforms the baseline across metrics and human evaluation. When transformations are present, the baseline remains competitive, while the simplified data-diff variants model surpass the baseline on several metrics. We make available all software and data to encourage replication and further studies in this area. While our experiments focus on comment generation, our core contribution is broader: we introduce execution-aware embeddings — a novel modality to captures what code does to data — and argue for their applicability to a variety of downstream tasks.
Thu 16 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
14:00 - 15:30 | AI for Software Engineering 15New Ideas and Emerging Results (NIER) / Research Track at Europa II Chair(s): Christian Bird Microsoft Research | ||
14:00 15mTalk | SCLA: Automated Smart Contract Summarization via LLMs and Control Flow Prompt New Ideas and Emerging Results (NIER) Xiaoqi Li Hainan University, Yingjie Mao Hainan University, Zexin Lu Hong Kong Polytechnic University, Wenkai Li Hainan University, Zongwei Li Hainan University | ||
14:15 15mTalk | Leveraging Design-Aware Context in Large Language Models for Code Comment Generation New Ideas and Emerging Results (NIER) Aritra Mitra Indian Institute of Technology Kharagpur, Srijoni Majumdar University of Leeds, Anamitra Mukhopadhyay Indian Institute of Technology Kharagpur, Partha Pratim Das Ashoka University, Paul Clough University of Sheffield, Partha Pratim Chakrabarti Indian Institute of Technology, Kharagpur | ||
14:30 15mTalk | From Execution to Embedding: Enriching Code Representations with Data Difference Signals for Comment Generation New Ideas and Emerging Results (NIER) Giacomo Fantino Politecnico di Torino, Italy, Antonio Vetrò Politecnico di Torino, Marco Torchiano Politecnico di Torino, Federica Cappelluti Politecnico di Torino, Italy | ||
14:45 15mTalk | Towards Bridging Language Gaps in OSS with LLM-Driven Documentation Translation New Ideas and Emerging Results (NIER) Elijah Kayode Adejumo George Mason University, Mariam Guizani Queen's University, Canada, Fatemeh Vares George Mason University, Brittany Johnson George Mason University Pre-print Media Attached | ||
15:00 15mTalk | Automating API Documentation from Crowdsourced Knowledge Research Track Bonan Kou Purdue University, Zijie Zhou University of Illinois Urbana-Champaign, Muhao Chen University of Southern California, Tianyi Zhang Purdue University | ||
15:15 15mTalk | UniCoR: Modality Collaboration for Robust Cross-Language Hybrid Code RetrievalDistinguished Paper Award Research Track Yang Yang Central South University, China, Li Kuang Centrel South University, Jiakun Liu Harbin Institute of Technology, Zhongxin Liu Zhejiang University, Yingjie Xia Hangzhou Dianzi University, David Lo Singapore Management University | ||