Influence Score and Transformers interpretability: Measure of the Effective Impact of Attention Heads at inference time
Abstract
We propose an influence score to quantify the contribution of attention heads to classification decisions in Transformer-based models designed for prompt injection detection. The score combines directional influence on the logits with structural contribution within the residual stream, enabling a multi-scale analysis at the head, layer, and network levels. Applied to a DeBERTa model specialized for prompt injection detection, our framework reveals distinct decision behaviours between correct and erroneous predictions. Our method provides an effective compromise between fine-grained circuit analysis and global output-based methods, and offers a systematic way to study decision mechanisms in Transformer classifiers.
Create a lesson
Related papers
Learn the Effects, Not the Examples: Implicit ICL via Attention Patching
Shared title terminologycs.CLSeungwon Woo, Hyunseo Shin, Wonseok Hwang
FramingQA: Does the Question Shape the Answer? Measuring the Compositional Framing Effect
Shared title terminologycs.CLHazel H. Kim, Andrew M. Bean, Guilherme Affonso Ferreira de Camargo et al.
Self-Cleaning and Captured Anyway: One Measured Primitive for Error in a Store an Agent Writes to Itself, and What a Falling Score Actually Measures
Shared title terminologycs.CLWenhui Chen, Jianlin Chen, Ziyao Lin et al.
Choosing the Right Language Mode at Inference Time for Multilingual Reliability
Shared title terminologycs.CLEkata Mitra, Ameeta Agrawal
Residual Cross-Model Narrative Convergence under Shared Prompts: Auditing Prompt Controls and Narrative Measurement
Shared title terminologycs.CLMehdy Sedaghat Payam
DiCALM: Converting Autoregressive Convolution-Attention Language Models into Discrete Diffusion Language Models
Shared title terminologycs.CLPhong Le, Ngoc-Quan Pham, Dat Quoc Nguyen