Concept

Attention with Prior

A prior is an attention distribution that comes from a source other than the immediate pairwise input interactions (such as the standard softmax(QKT)\text{softmax}(\mathbf{Q}\mathbf{K}^T) in a vanilla Transformer). Attention with prior is the fusion of two attention distributions, which can be done by computing a weighted sum of the scores corresponding to the prior and the generated attention before applying the softmax function.

Image 0

0

1

Updated 2026-06-19

Tags

Data Science