hardLLMs & TransformersReviewed Nov 20, 2026

How does the layer-wise relevance propagation work in transformers?

Layer-wise relevance propagation (LRP) is a technique for interpreting predictions made by deep learning models, including transformers. It works by analyzing how each input feature contributes to the final prediction through a backpropagation-like approach. In transformers, LRP assigns relevance scores to the output, starting from the final layer and tracing back through each transformer block. This involves spreading the relevance from higher layers to lower layers, maintaining the integer properties of relevance while sticking to the constraints of the model's architecture. By examining the aggregated relevances at the input level, LRP provides insights into which tokens or features were most influential in the model's decision-making process, enabling better understanding and debugging of the model.

interpretability

More LLMs & Transformers questions

See all LLMs & Transformers questions →