Disentangling Semantics and Syntax in Sentence Embeddings with Pre-trained Language Models

James Y. Huang, Kuan-Hao Huang, Kai-Wei Chang
4/11/2021
cs.CL

Official code: uclanlp/ParaBART (23 stars, Python, last commit 2021-11-08).

Abstract

Pre-trained language models have achieved huge success on a wide range of NLP tasks. However, contextual representations from pre-trained models contain entangled semantic and syntactic information, and therefore cannot be directly used to derive useful semantic sentence embeddings for some tasks.

Show full abstract

Paraphrase pairs offer an effective way of learning the distinction between semantics and syntax, as they naturally share semantics and often vary in syntax. In this work, we present ParaBART, a semantic sentence embedding model that learns to disentangle semantics and syntax in sentence embeddings obtained by pre-trained language models. ParaBART is trained to perform syntax-guided paraphrasing, based on a source sentence that shares semantics with the target paraphrase, and a parse tree that specifies the target syntax. In this way, ParaBART learns disentangled semantic and syntactic representations from their respective inputs with separate encoders. Experiments in English show that ParaBART outperforms state-of-the-art sentence embedding models on unsupervised semantic similarity tasks. Additionally, we show that our approach can effectively remove syntactic information from semantic sentence embeddings, leading to better robustness against syntactic variation on downstream semantic tasks.

View on arXivView PDF

Code Implementations(1)

uclanlp/ParaBARTOfficial100%

Code for our NAACL-2021 paper "Disentangling Semantics and Syntax in Sentence Embeddings with Pre-trained Language Models".

231PythonMar 30, 20215 years ago

Similar Papers

Cite this paper

@article{huang2021disentangling,
  title  = {Disentangling Semantics and Syntax in Sentence Embeddings with Pre-trained Language Models},
  author = {James Y. Huang and Kuan-Hao Huang and Kai-Wei Chang},
  year   = {2021},
  eprint = {2104.05115},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.05115}
}

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/2104.05115.svg)](https://codeofpaper.com/paper/2104.05115)

Discussion