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

Source: [JoPA:Explaining Large Language Model's Generation via Joint Prompt Attribution](<https://www.sota2.com/research/paper/68fa7b651e209131cea882f8>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-02T10:59:48.093Z

Authors: Yurui Chang, Bochuan Cao, Yujia Wang, Jinghui Chen, Lu Lin

Published: 2024-05-30T18:16:41.000Z

## 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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Explanation Generation on Alpaca avg prompt instance](<https://www.sota2.com/research/sota/explanation-generation-on-alpaca-avg-prompt-instance.md>): Explanation Generation; Alpaca avg prompt instance; Inference Time (s): 15.225.

- [Explanation Generation on tldr\_news avg prompt instance](<https://www.sota2.com/research/sota/explanation-generation-on-tldr_news-avg-prompt-instance.md>): Explanation Generation; tldr\_news avg prompt instance; Latency (s): 15.397.

- [Explanation Generation on MHC avg prompt instance](<https://www.sota2.com/research/sota/explanation-generation-on-mhc-avg-prompt-instance.md>): Explanation Generation; MHC avg prompt instance; Time (s): 14.473.

- [Malicious Prompt Detection on Llama-2 7B-Chat (GCG Attacks)](<https://www.sota2.com/research/sota/malicious-prompt-detection-on-llama-2-7b-chat-gcg-attacks.md>): Malicious Prompt Detection; GCG attacks on Llama-2 7B-Chat; Detection Accuracy: 100.

- [Malicious Prompt Detection on Llama-2 Prompt with Random Search 7B-Chat](<https://www.sota2.com/research/sota/malicious-prompt-detection-on-llama-2-prompt-with-random-search-7b-chat.md>): Malicious Prompt Detection; Llama-2 Prompt with Random Search 7B-Chat; Detection Accuracy: 91.

- [Faithfulness Evaluation on Alpaca 800 samples](<https://www.sota2.com/research/sota/faithfulness-evaluation-on-alpaca-800-samples.md>): Faithfulness Evaluation; Alpaca 800 samples; BLEU: 47.9.

- [Faithfulness Evaluation on tldr\_news (800 samples)](<https://www.sota2.com/research/sota/faithfulness-evaluation-on-tldr_news-800-samples.md>): Faithfulness Evaluation; tldr\_news 800 samples; BLEU: 68.7.

- [Faithfulness Measurement on Alpaca](<https://www.sota2.com/research/sota/faithfulness-measurement-on-alpaca.md>): Faithfulness Measurement; Alpaca; BLEU: 0.484.

- [Faithfulness Measurement on tldr\_news](<https://www.sota2.com/research/sota/faithfulness-measurement-on-tldr_news.md>): Faithfulness Measurement; tldr\_news; BLEU: 69.2.

- [Faithfulness Measurement on MHC](<https://www.sota2.com/research/sota/faithfulness-measurement-on-mhc.md>): Faithfulness Measurement; MHC; BLEU: 57.9.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2405.20404>)

[PDF](<https://arxiv.org/pdf/2405.20404.pdf>)

[Implementation](<https://github.com/yuruic/JoPA>)
