Toward Explaining Large Language Models in Software Engineering Tasks

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Vitale, Antonio, Nguyen, Khai-Nguyen, Poshyvanyk, Denys, Oliveto, Rocco, Scalabrino, Simone, Mastropaolo, Antonio
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917166298693632
author Vitale, Antonio
Nguyen, Khai-Nguyen
Poshyvanyk, Denys
Oliveto, Rocco
Scalabrino, Simone
Mastropaolo, Antonio
author_facet Vitale, Antonio
Nguyen, Khai-Nguyen
Poshyvanyk, Denys
Oliveto, Rocco
Scalabrino, Simone
Mastropaolo, Antonio
contents Recent progress in Large Language Models (LLMs) has substantially advanced the automation of software engineering (SE) tasks, enabling complex activities such as code generation and code summarization. However, the black-box nature of LLMs remains a major barrier to their adoption in high-stakes and safety-critical domains, where explainability and transparency are vital for trust, accountability, and effective human supervision. Despite increasing interest in explainable AI for software engineering, existing methods lack domain-specific explanations aligned with how practitioners reason about SE artifacts. To address this gap, we introduce FeatureSHAP, the first fully automated, model-agnostic explainability framework tailored to software engineering tasks. Based on Shapley values, FeatureSHAP attributes model outputs to high-level input features through systematic input perturbation and task-specific similarity comparisons, while remaining compatible with both open-source and proprietary LLMs. We evaluate FeatureSHAP on two bi-modal SE tasks: code generation and code summarization. The results show that FeatureSHAP assigns less importance to irrelevant input features and produces explanations with higher fidelity than baseline methods. A practitioner survey involving 37 participants shows that FeatureSHAP helps practitioners better interpret model outputs and make more informed decisions. Collectively, FeatureSHAP represents a meaningful step toward practical explainable AI in software engineering. FeatureSHAP is available at https://github.com/deviserlab/FeatureSHAP.
format Preprint
id arxiv_https___arxiv_org_abs_2512_20328
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Toward Explaining Large Language Models in Software Engineering Tasks
Vitale, Antonio
Nguyen, Khai-Nguyen
Poshyvanyk, Denys
Oliveto, Rocco
Scalabrino, Simone
Mastropaolo, Antonio
Software Engineering
Artificial Intelligence
Machine Learning
Recent progress in Large Language Models (LLMs) has substantially advanced the automation of software engineering (SE) tasks, enabling complex activities such as code generation and code summarization. However, the black-box nature of LLMs remains a major barrier to their adoption in high-stakes and safety-critical domains, where explainability and transparency are vital for trust, accountability, and effective human supervision. Despite increasing interest in explainable AI for software engineering, existing methods lack domain-specific explanations aligned with how practitioners reason about SE artifacts. To address this gap, we introduce FeatureSHAP, the first fully automated, model-agnostic explainability framework tailored to software engineering tasks. Based on Shapley values, FeatureSHAP attributes model outputs to high-level input features through systematic input perturbation and task-specific similarity comparisons, while remaining compatible with both open-source and proprietary LLMs. We evaluate FeatureSHAP on two bi-modal SE tasks: code generation and code summarization. The results show that FeatureSHAP assigns less importance to irrelevant input features and produces explanations with higher fidelity than baseline methods. A practitioner survey involving 37 participants shows that FeatureSHAP helps practitioners better interpret model outputs and make more informed decisions. Collectively, FeatureSHAP represents a meaningful step toward practical explainable AI in software engineering. FeatureSHAP is available at https://github.com/deviserlab/FeatureSHAP.
title Toward Explaining Large Language Models in Software Engineering Tasks
topic Software Engineering
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2512.20328