Probabilistic Transformer: A Probabilistic Dependency Model for Contextual Word Representation

Haoyi Wu, Kewei Tu
11/26/2023
cs.CL

No official code found. Best implementation: whyNLP/Probabilistic-Transformer (25 stars, MIT, last commit 2023-10-22).

Abstract

Syntactic structures used to play a vital role in natural language processing (NLP), but since the deep learning revolution, NLP has been gradually dominated by neural models that do not consider syntactic structures in their design. One vastly successful class of neural models is transformers. When used as an encoder, a transformer produces contextual representation of words in the input sentence. In this work, we propose a new model of contextual word representation, not from a neural perspective, but from a purely syntactic and probabilistic perspective. Specifically, we design a conditional random field that models discrete latent representations of all words in a sentence as well as dependency arcs between them; and we use mean field variational inference for approximate inference. Strikingly, we find that the computation graph of our model resembles transformers, with correspondences between dependencies and self-attention and between distributions over latent representations and contextual embeddings of words. Experiments show that our model performs competitively to transformers on small to medium sized datasets. We hope that our work could help bridge the gap between traditional syntactic and probabilistic approaches and cutting-edge neural approaches to NLP, and inspire more linguistically-principled neural approaches in the future.

View on arXivView PDF

Code Implementations(1)

MIT

A probabilitic model for contextual word representation. Accepted to ACL2023 Findings.

252PythonDec 11, 20223 years agoMIT

Similar Papers

Cite this paper

@article{wu2023probabilistic,
  title  = {Probabilistic Transformer: A Probabilistic Dependency Model for Contextual Word Representation},
  author = {Haoyi Wu and Kewei Tu},
  year   = {2023},
  eprint = {2311.15211},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.15211v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.15211.svg)](https://codeofpaper.com/paper/2311.15211)

Discussion