The widespread adoption of proprietary Large Language Models (LLMs) via closed APIs poses an interpretability challenge. While white-box and gray-box (logit-dependent) attribution methods require internal model access, post-hoc attribution under a strictly black-box, text-only generative regime remains largely unexplored. To address this, we propose a model-agnostic, post-hoc attribution interpreter operating at the sentence level. We first train a transformer-based Energy-Based Model (EBM) as a surrogate to score the consistency between prompt and response sentences based on observed LLM generations. To prevent energy collapse and avoid a focus on superficial artifacts, we design contrastive negative samplers that evaluate partial counterfactual dependencies across prompt and response segments. This learned energy landscape then guides the training of a lightweight interpreter network. After model-specific training, the interpreter operates as a standalone tool; it estimates the influence of prompt sentences on a user-specified output sentence without requiring runtime API queries to the target LLM. Comprehensive experiments demonstrate that our EBM surrogate captures nuanced generative dependencies beyond surface-level heuristics, while the interpreter achieves competitive attribution quality with parameter-efficient, $\mathcal{O}(1)$ inference.
翻译:暂无翻译