Sentence-Level Attribution for Black-Box Large Language Model Outputs via Energy-Based Surrogates
Overview
The widespread adoption of proprietary Large Language Models (LLMs) via closed APIs presents a fundamental interpretability challenge. While white-box techniques rely on hidden activations or gradients, and gray-box methods require output logit distributions, commercial deployments conceal these internal signals. Existing model-agnostic alternatives frequently rely on token-level perturbations. In generative settings, deleting individual subwords disrupts grammatical structure, induces out-of-distribution behavior, and incurs exponential query costs over high-latency network endpoints.
To address these limitations, we introduce ESCI (Energy-based Surrogate Concept Interpreter), a post-hoc, model-agnostic attribution framework operating under a strictly black-box regime. We elevate the basic unit of attribution from isolated tokens to syntactically complete sentences. By treating sentences as operational concepts, the framework captures the propositional structure necessary for coherent human interpretation while preserving grammatical stability during attribution.
The ESCI Architecture
ESCI decouples feature attribution into two amortized phases: surrogate energy modeling and standalone feed-forward interpretation.
Surrogate Energy-Based Modeling
Evaluating generative dependencies requires assessing the holistic compatibility between prompts and responses without normalizing over an intractable vocabulary space. We pre-train a transformer-based Energy-Based Model (EBM) as a surrogate for the target LLM. The surrogate projects static sentence embeddings into a contextualized concept space through learned self-attention modules, followed by a joint cross-attention layer that verifies response-conditioned dependencies.
To prevent energy collapse and eliminate superficial heuristics like conversational filler matching, we optimize a composite InfoNCE objective. A global fidelity loss contrasts the target LLM’s outputs against human and external model text. Concurrently, local dependency losses evaluate structured partial counterfactuals, perturbing prompt and response segments independently. This forces the energy landscape to encode genuine semantic antecedents rather than global topic alignment.
Standalone Amortized Interpreter
Direct combinatorial search over prompt subsets is computationally prohibitive at test time. We therefore train a lightweight feed-forward interpreter network that amortizes attribution into a single forward pass. Given a prompt, an observed response, and a specified target output sentence, the interpreter retains the target concept and predicts a sparse continuous importance mask over prompt sentences.
The interpreter is trained using the frozen EBM as an evaluative critic. The optimization minimizes the surrogate energy of the selected prompt antecedents while penalizing unselected sentences and enforcing an $L_1$ sparsity constraint. To prevent distribution shifts between the frozen surrogate and masked generations, the EBM is periodically fine-tuned on refreshed LLM outputs. Once trained, the interpreter operates independently in $\mathcal{O}(1)$ time, producing sentence-level attributions without requiring runtime API queries or logit access.
Empirical Evaluation
We evaluated ESCI on three distinct instruction-tuned architectures treated strictly as closed black boxes: Llama-3.1-8B-Instruct, Gemma-2-9B-It, and GPT-4o-Mini. Evaluations spanned open-ended conversational dialogues in the Human ChatGPT Comparison Corpus (HC3) and constrained factual synthesis in WikiBio.
Attribution quality was validated across both plausibility and semantic faithfulness metrics. Across diverse task regimes, the amortized interpreter matched or outperformed computationally intensive perturbation baselines and white-box approximations. By shifting the computational overhead to offline surrogate training, ESCI provides a faithful, scalable attribution mechanism for production-grade language models.
Lab Dispatch Uplink Reserved
Technical writeups, experiment traces, and theoretical musings for this work will synchronize here as the lab.maryamrezaee.me ecosystem comes online.
@misc{rezaee2026sentence,
title = {Sentence-Level Attribution for Black-Box Large Language Model Outputs via Energy-Based Surrogates},
author = {Rezaee, Maryam and Safaei, Pooriya and Asgarinezhad, Maryam and Seyyedsalehi, Fatemeh},
year = {2026},
eprint = {2608.02879},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2608.02879},
}