Syntax-guided Controlled Generation of Paraphrases

Ashutosh Kumar, Kabir Ahuja, Raghuram Vadapalli, Partha Talukdar

TL;DR

Researchers have developed SGCP (Syntax Guided Controlled Paraphraser), an end-to-end model that uses full constituency parse trees to control the structure of generated paraphrases. By allowing users to tune the "granularity" of syntactic control through tree pruning, SGCP achieves a superior balance between preserving the original meaning and adhering to a target syntactic template compared to previous state-of-the-art models.

What Problem Does This Paper Address?

Paraphrasing is more than just swapping synonyms; it often requires changing the entire structure of a sentence while keeping the meaning intact. While standard sequence-to-sequence models are good at capturing semantics, they struggle with controlled generation—producing text that follows specific stylistic or structural constraints.

Previous attempts at syntactic control typically relied on "linearized" parse trees (turning a 2D tree into a 1D string of tags) or latent variables. These methods often lose the rich hierarchical dependencies inherent in language. Furthermore, they frequently suffer from "abrupt endings" or poor semantic retention because they force the output to match the exact length or rigid structure of a template, even when it doesn't make sense for the source sentence.

Methods

The authors propose the Syntax Guided Controlled Paraphraser (SGCP), which consists of three main components:

  1. Sentence Encoder: A multi-layered Gated Recurrent Unit (GRU) that creates a semantic representation ($c_t$) of the input sentence.
  2. Syntactic Encoder: Instead of linearizing the tree, this encoder operates directly on the constituency parse tree of an exemplar sentence. It removes the actual words (leaves) and encodes the internal syntactic tags (like NP, VP, SBARQ) using a tree-based recursive neural network.
  3. Syntactic Paraphrase Decoder: A pointer-generator network that combines semantic signals, syntactic signals, and a copying mechanism.
The SGCP Architecture

A key innovation is the signalling vector ($a$). During training, this vector tells the decoder when to "pop" the next syntactic tag from a queue. For example, a single syntactic tag like "NP" (Noun Phrase) might cover a span of multiple words. During inference, the model learns to predict a transition probability ($p_t$) to decide when to move to the next syntactic constraint.

Additionally, the model introduces Syntactical Granularity. By pruning the exemplar's parse tree at a specific height ($H$), the model can choose how strictly to follow the template. A lower $H$ provides a broad structural hint, while a higher $H$ forces a more fine-grained adherence to the exemplar's syntax.

Figure 2: The constituency parse tree serves as an input to the syntactic encoder (Section 3.3). The first step is to remove the leaf nodes which contain meaning representative tokens (Here: What is the best language ...). H denotes the height to which the tree can be pruned and is an input to the model. Figure (a) shows the full constituency parse tree annotated with vector a for different heights. Figure (b) shows the same tree pruned at height H = 3 with its corresponding a vector. The vector a serves as an signalling vector (Section 3.4.2) which helps in deciding the syntactic signal to be passed on to the decoder. Please refer Section 3 for details.

Datasets

The models were trained and evaluated on two primary datasets:

  • ParaNMT-small: A subset of 500k pairs from the ParaNMT-50M dataset (generated via back-translation).
  • QQP-Pos: A newly curated dataset derived from the Quora Question Pairs. The authors argue this is a higher-quality benchmark because it involves more human intervention and better-formed English sentences compared to the noisy, machine-translated ParaNMT.

Key Insights and Ideas

  • The Trade-off Knob: The ability to prune the tree ($H$) is a powerful tool. The authors found that using the full tree (SGCP-F) sometimes forces the model into ungrammatical territory if the source and exemplar are incompatible. Their variant SGCP-R automatically selects the best height based on ROUGE scores, effectively finding the "sweet spot" between meaning and structure.
  • Tree Structure Matters: By encoding the tree directly rather than linearizing it, the model preserves the hierarchical relationships (e.g., which clause belongs to which verb), leading to more coherent paraphrases.
  • Span-based Control: The signalling mechanism allows the model to handle syntactic tags that cover multiple tokens, avoiding the "one tag per word" limitation that often plagues simpler controlled generation models.

Key Results

SGCP significantly outperformed baselines like SCPN and CGEN across both automated metrics and human evaluation.

  • Semantic Preservation: On the QQP-Pos dataset, SGCP-R achieved a PDS (Paraphrase Detection Score) of 87.7%, compared to CGEN's 65.4% and SCPN's 27.0%.
  • Syntactic Transfer: SGCP-F showed the lowest Tree-Edit Distance (TED-E) to the exemplar, meaning it followed the requested structure more accurately than previous models.
  • Human Evaluation: Judges consistently rated SGCP's outputs higher for semantic similarity, noting that it avoided the "abrupt endings" common in CGEN.
Qualitative comparison of generations

Limitations and Future Work

The authors acknowledge that compatibility remains a challenge. Not every source sentence can be naturally mapped to every syntactic template. If you try to force a simple statement into a complex nested question structure, the result might be nonsensical.

Future work includes:

  • Developing methods to automatically identify "compatible" exemplars for a given source sentence.
  • Improving domain independence, as current models are still somewhat biased toward the specific distributions of their training data (like Quora questions).
  • Exploring applications in data augmentation and text simplification.

Summary updated

BibTeX
@article{kumar2020syntax,
  author = {Ashutosh Kumar and Kabir Ahuja and Raghuram Vadapalli and Partha Talukdar},
  title = {{Syntax-guided Controlled Generation of Paraphrases}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2020},
  url = {https://openreview.net/forum?id=HL4j49AnNx},
}

Loading related content...

Figure