Skip to main content
QUICK REVIEW

[Paper Review] Variational Self-attention Model for Sentence Representation

Qiang Zhang, Shangsong Liang|arXiv (Cornell University)|Dec 30, 2018
Topic ModelingComputer Science9 references4 citations
TL;DR

This paper proposes a Variational Self-attention Model (VSAM) that treats self-attention weights as random variables using variational inference, enabling stochastic, multi-modal attention distributions. By marginalizing over latent variables, VSAM improves robustness to overfitting and achieves state-of-the-art performance on stance detection, with 83.54% micro-F1 on the FNC-1 dataset, outperforming deterministic self-attention and other baselines.

ABSTRACT

This paper proposes a variational self-attention model (VSAM) that employs variational inference to derive self-attention. We model the self-attention vector as random variables by imposing a probabilistic distribution. The self-attention mechanism summarizes source information as an attention vector by weighted sum, where the weights are a learned probabilistic distribution. Compared with conventional deterministic counterpart, the stochastic units incorporated by VSAM allow multi-modal attention distributions. Furthermore, by marginalizing over the latent variables, VSAM is more robust against overfitting. Experiments on the stance detection task demonstrate the superiority of our method.

Motivation & Objective

  • To address the limitations of deterministic self-attention in capturing complex, multi-modal attention patterns in sentence representation.
  • To improve generalization and robustness against overfitting, especially on small NLP datasets.
  • To integrate probabilistic modeling into self-attention via variational inference, enabling richer, distributional attention representations.
  • To enhance sentence representation learning for stance detection by modeling uncertainty in attention weights.

Proposed method

  • VSAM models the self-attention vector as a latent random variable with a variational posterior distribution, enabling stochastic attention computation.
  • It employs a variational lower bound (ELBO) to optimize both the generative model and inference network jointly via stochastic backpropagation.
  • The attention weights are sampled from a parameterized Gaussian distribution, with mean and variance predicted by a neural network conditioned on input sentence representations.
  • The model uses reparameterization trick to enable differentiable sampling, allowing end-to-end training via backpropagation.
  • The generative model defines a prior over latent attention variables, while the inference network approximates the true posterior using observed input and target labels.
  • The final sentence representation is obtained by marginalizing over the latent attention variables, integrating uncertainty into the final output.

Experimental results

Research questions

  • RQ1Can modeling self-attention weights as random variables improve sentence representation learning in NLP tasks?
  • RQ2Does introducing stochasticity via variational inference lead to more robust attention distributions that capture multi-modal dependencies?
  • RQ3Can marginalization over latent attention variables reduce overfitting, especially on small datasets?
  • RQ4How does the proposed variational self-attention mechanism compare to deterministic self-attention in stance detection tasks?

Key findings

  • VSAM achieves 83.54% micro-F1 on the FNC-1 stance detection test set, outperforming all baselines including CNN, RNN, and deterministic self-attention models.
  • The model improves accuracy to 28.53% on the agree class, significantly outperforming the next best baseline (24.54% with CNN).
  • On the unrelated class, VSAM achieves 82.43% accuracy, surpassing the deterministic self-attention model (80.34%) and the CNN baseline (79.53%).
  • The performance gain is attributed to the model's ability to learn multi-modal attention distributions through stochastic inference, enhancing representation quality.
  • Experiments confirm that marginalizing over latent variables improves robustness, particularly beneficial for small-scale datasets with limited training examples.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.