TL;DR
Modern AI models care deeply about where or when data appears—whether it’s a prompt buried in the middle of a document or a spike in body temperature hours after hospital admission. Yet, standard interpretability tools mash a feature's content ("what") and its location ("where/when") into a single, muddled importance score. Position-aware eXplanation (PaX) acts as a universal wrapper around existing explanation methods to cleanly separate feature content from positional bias, without changing a single weight in the underlying model.
What Problem Does This Paper Address?
If you reorder patches in an image or sentences in a prompt, a Transformer’s prediction can swing wildly. Models suffer from quirks like primacy bias (over-relying on the very first token) or "lost in the middle" syndrome. Sometimes positional sensitivity is a bug; sometimes it’s the whole point—in electronic health records, a high fever at admission means something very different than the exact same fever developing twelve hours later.
When we use standard attribution tools (like LIME, SHAP, or Integrated Gradients) to ask a black-box model why it made a decision, they assign a single importance score to each input element. They can’t tell you if a word mattered because of its semantic meaning, or simply because it sat at the start of the prompt. Previous attempts to untangle this were custom-built for specific domains (like medical time-series) or locked into a single attribution algorithm. A general, plug-and-play solution across vision, text, and time-series was missing.
Methods
The core philosophy of PaX is delightfully simple: treat position as a first-class input feature.
Instead of cracking open the model to fiddle with internal positional embeddings, PaX leaves the model untouched and wraps the input representation. Every sequential input $x$ is augmented into a pair $(x, p)$, where $p$ explicitly tracks the position indices $(1, \dots, n)$.
Standard attribution tools work by masking or perturbing features (e.g., blacking out image patches) and watching how the prediction changes. How do you perturb a position? If you zero out positional embeddings or replace them with averages, you feed the model alien positional states it never saw during training. Instead, PaX introduces POS-SWAP: it selects a random pool of elements and shuffles their positions. Every valid position index is still used exactly once, keeping the model safely inside its training distribution.
Because PaX operates purely by permuting inputs and observing outputs, it upgrades almost any existing explainer:
- Perturbation-based methods (like LIME and SHAP) run unchanged on the expanded feature-and-position mask.
- Gradient-based methods (like Integrated Gradients) can't take continuous derivatives of discrete shuffles, so PaX derives an exact mathematical substitute using conditional contrasts—comparing forward passes where an element is shuffled versus kept in place.
Finally, PaX goes one step further by recording where shuffled elements land, yielding counterfactual position attributions: actionable scores predicting how the output would shift if you moved content from position $i$ specifically to position $j$.
Datasets
To prove modality-agnosticism, the authors evaluate PaX across six existing benchmarks spanning three domains (no new datasets are introduced, though new position-faithfulness evaluation protocols are):
- Vision: ImageNet-S (919-class classification) and PASCAL VOC (20-class classification).
- Language: GSM8K (math reasoning) and MedMCQA (medical question-answering).
- Clinical Time-Series: PhysioNet 2019 and MC-MED (both focused on forecasting sepsis).
Key Insights and Ideas
- Untangling position makes feature explanations sharper: Even if you don't care about positional bias, accounting for it stops positional noise from diluting or inflating content scores. Separating the two makes standard feature attributions measurably more faithful across the board.
- Exposing clinical "primacy bias": In a sepsis forecasting case study with MedGemma, standard LIME flagged both
AgeandGenderas massive drivers of sepsis risk ($\approx 0.76$ and $0.73$). Clinically,Gendershouldn't matter here. PaX revealed what was actually happening: PhysioNet logs demographics at timestep $t=0$.Ageretained a high content score ($0.77$), proving genuine biological relevance, whileGender's content score plummeted to $0.33$—exposing that the model was just latching onto its $t=0$ position! - Shuffling beats masking for positions: Ablation tests confirm that permuting positions (POS-SWAP) dramatically outperforms zeroing, averaging, or randomly duplicating positional embeddings because it avoids out-of-distribution artifacts.
Key Results
The authors measure "faithfulness" using insertion and deletion curves—progressively adding or removing top-ranked features (or relocating top-ranked positions) and measuring the Area Under the Curve (AUC). Higher insertion ($\uparrow$) and lower deletion ($\downarrow$) mean the explanation truly reflects what drives the model.
- Better Position Explanations: Across ViT, CLIP, and Llama on PASCAL VOC, PaX variants match or beat bespoke temporal/positional baselines like TimeSHAP, TIMING, and OrdShap (e.g., on Llama, PaX-IntGrad hits 0.445 insertion AUC vs. TimeSHAP’s 0.372, while PaX-LIME drops deletion AUC to 0.006 vs. TimeSHAP's 0.021).
- Better Feature Explanations: Wrapping seven classic explainers (LIME, SHAP, RISE, SHAP-IQ, IntGrad, FullGrad, MFABA) in PaX improved feature faithfulness across every single method. On ImageNet-S with ViT, LIME’s insertion AUC jumped from 0.354 to 0.419, while deletion error was cut more than in half (0.020 down to 0.008).
- Actionable Counterfactuals & Clinical Alignment: Counterfactual relocation scores showed solid positive correlation with actual output drops when swapping elements ($r = 0.282$ to $0.431$). Furthermore, in the sepsis case study, 83% (24 of 29) of biomarkers deemed relevant by a physician saw their importance scores increase under PaX after stripping away positional dilution.
Limitations and Future Work
PaX evaluates positions as isolated, individual slots. However, in many real-world sequences, the true signal lives in a trajectory—like a steadily rising fever slope, a sudden peak, or a plateau—rather than at a single timestamp. Right now, PaX will highlight the latest temperature reading rather than the upward trend itself. Extending the framework to score multi-step, trajectory-level patterns is the natural next frontier. The authors also caution against over-reliance: a clean-looking feature/position split explains how the model behaves, which should help humans spot shortcuts and data leakage, not blind them to underlying model errors.
Summary updated