JoPA:Explaining Large Language Model's Generation via Joint Prompt Attribution

Yurui Chang, Bochuan Cao, Yujia Wang, Jinghui Chen, Lu Lin
5/30/2024
cs.CLcs.LG

No official code found. Best implementation: yuruic/JoPA (1 star, last commit 2025-06-30).

Abstract

Large Language Models (LLMs) have demonstrated impressive performances in complex text generation tasks. However, the contribution of the input prompt to the generated content still remains obscure to humans, underscoring the necessity of understanding the causality between input and output pairs. Existing works for providing prompt-specific explanation often confine model output to be classification or next-word prediction. Few initial attempts aiming to explain the entire language generation often treat input prompt texts independently, ignoring their combinatorial effects on the follow-up generation. In this study, we introduce a counterfactual explanation framework based on Joint Prompt Attribution, JoPA, which aims to explain how a few prompt texts collaboratively influences the LLM's complete generation. Particularly, we formulate the task of prompt attribution for generation interpretation as a combinatorial optimization problem, and introduce a probabilistic algorithm to search for the casual input combination in the discrete space. We define and utilize multiple metrics to evaluate the produced explanations, demonstrating both the faithfulness and efficiency of our framework.

View on arXivView PDF

Code Implementations(1)

yuruic/JoPACommunity72%

The official repository for JoPA:Explaining Large Language Model's Generation via Joint Prompt Attribution

10Python, Jupyter NotebookNov 11, 20241 years ago

Similar Papers

Cite this paper

@article{chang2024jopaexplaining,
  title  = {JoPA:Explaining Large Language Model's Generation via Joint Prompt Attribution},
  author = {Yurui Chang and Bochuan Cao and Yujia Wang and Jinghui Chen and Lu Lin},
  year   = {2024},
  eprint = {2405.20404},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.20404v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.20404.svg)](https://codeofpaper.com/paper/2405.20404)

Discussion