Skip to content

Attention mechanisms in NLP

Learned weighting schemes for emphasizing relevant parts of input sequences

Learned mechanisms that compute context-dependent importance weights over input sequences, allowing models to focus on task-relevant elements. In NLP, attention is typically applied to word sequences or sentence sequences to learn differential relevance without manual feature engineering.

Foundational papers

Key mechanisms

  • Self-attention / Scaled dot-product attention: Computes importance via similarity between query and key vectors; scaled to stabilize gradients. Foundation of Transformer models.
  • Additive attention (Bahdanau): Uses a learned MLP to compute relevance scores between query and each input element.
  • Multi-head attention: Applies multiple independent attention mechanisms in parallel, capturing different aspects of relevance (syntactic, semantic, pragmatic).

Key papers in fake news detection

Papers on this topic