Position-aware eXplanation: A Model-Agnostic Framework for Positional Attributions
Abstract
Transformer predictions depend on positional embeddings, which are known to produce biases such as first- and last-token dominance. However, feature attribution methods implicitly entangle influence from positions with features into a single importance score per feature. To uncover these positional effects, we propose Position-aware eXplanation (PaX), a model-agnostic framework that transforms standard attribution methods to jointly produce feature and position attributions. PaX additionally produces counterfactual position explanations: actionable scores that quantify how the prediction would change if a feature were relocated. PaX generalizes perturbation-, gradient-, and boundary-based attribution methods without architectural changes, which we evaluate across vision, language, and clinical time-series benchmarks. We demonstrate that separating positional effects consistently improves both feature and position attribution faithfulness across insertion and deletion evaluations. In a case study on sepsis forecasting, we find that PaX recovers clinically validated bedside signals that standard attributions miss.