cs.CLJun 24, 2025

RCStat: A Statistical Framework for using Relative Contextualization in Transformers

Authors: Debabrata Mahapatra, Shubham Agarwal, Apoorv Saxena, Subrata Mitra

Organizations: Adobe Research, India

Abstract

Identifying which tokens and activations truly influence model predictions is critical for both the efficiency and interpretability of large auto-regressive language models. Yet in practice, token importance is typically inferred from attention distributions that entangle contextual relevance with softmax-normalization effects, obscuring relative influence across tokens and heads. We propose RCStat\textbf{RCStat}, a statistical framework for quantifying contextual influence in attention mechanisms. At its core Relative Contextualization (RC)\textbf{Relative Contextualization (RC)} is a random variable that measures how strongly one subset of tokens contributes to another under the model's internal scoring scheme. RCStat admits computationally efficient bounds on expected influence that can be estimated at inference time. No retraining is required. We apply RCStat to two tasks. For attribution\textbf{attribution}, attention heads with high expected RC accurately identify the prompt spans that drive generation, enabling reliable span-level explanations. For key-value cache eviction\textbf{key-value cache eviction}, RC-based adaptive thresholding selectively evicts low-impact KV entries, substantially reducing cache size while preserving generation quality. Across question answering, summarization, and attribution benchmarks, RCStat achieves consistent gains, improving generation quality by 15-40% with upto 36% error reduction for KV eviction, and attribution accuracy by 2-16%. These results demonstrate that explicitly modeling contextual influence provides a principled and practical alternative to attention-based heuristics.

Figures & tables

Appendix figures & tables21 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. RIFT: Token Influence Follows the Path of Least Resistance

    Oct 12, 2026Tingan Jin, Shuhang Dong, Haosong LiTransformer InterpretabilityLLM Interpretability

  2. Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction

    May 10, 2026Ngoc Bui, Hieu Trung Nguyen, Arman Cohan +1Self-AttentionKV Caching

  3. DeltaTrace: Efficient Signed Attribution for Reasoning Language Models

    Oct 19, 2026Chen Liang, Daoping Wu, Donghua Yang +4Feature AttributionLLM Interpretability