In this paper, we propose CodeSCM, a Structural Causal Model (SCM) for analyzing multi-modal code generation using large language models (LLMs). By applying interventions to CodeSCM, we measure the causal effects of different prompt modalities, such as natural language, code, and input-output examples, on the model. CodeSCM introduces latent mediator variables to separate the code and natural language semantics of a multi-modal code generation prompt. Using the principles of Causal Mediation Analysis on these mediators we quantify direct effects representing the model's spurious leanings. We find that, in addition to natural language instructions, input-output examples significantly influence code generation.
Finding and Editing Multi-Modal Neurons in Pre-Trained Transformers
University of Science and Technology of China(中国科学技术大学);School of Computer Science, Fudan University(复旦大学计算机学院);Tsinghua University(清华大学);Hefei University of Technology(合肥工业大学)
Mitigating Modality Bias in Multi-modal Entity Alignment from a Causal Perspective
Institute of Information Engineering, Chinese Academy of Sciences(信息工程研究所,中国科学院);School of Cyber Security, University of Chinese Academy of Sciences(网络安全学院,中国科学院大学)
Towards Minimal Causal Representations for Human Multimodal Language Understanding
School of Computer Science, South China Normal University(华南师范大学计算机学院);School of Electronics and Information Technology, Sun Yat-sen University(中山大学电子与信息学院)