Learning Structural Information for Syntax-Controlled Paraphrase Generation

Erguang Yang, Chenglin Bai, Deyi Xiong, Yujie Zhang, Yao Meng, Jinan Xu, Yufeng ChenNAACL 2022

Introduction

Paraphrase generation is a fundamental task in natural language processing, requiring models to produce semantically equivalent sentences with varied surface forms. Syntax-controlled paraphrase generation adds a layer of complexity: the model must rewrite a sentence to match a specific "syntactic skeleton," such as converting an active sentence into a passive one with a specific clause structure. This level of control is vital for data augmentation, style transfer, and improving the robustness of NLP systems.

However, current research identifies two major gaps: structural loss and the retrieval gap. Most models either flatten syntax trees into simple text strings, losing the 2D hierarchy, or ignore "sibling" relationships between adjacent phrases that are crucial for grammatical flow. Furthermore, in real-world scenarios, a target syntax tree is not always available, leading to nonsensical outputs when using fixed templates.

Methodology: The SI-SCP Framework

To address these challenges, the researchers introduced SI-SCP (Structural Information-augmented Syntax-Controlled Paraphrasing), a model designed to capture the full geometry of syntax trees.

Tree-Transformer Encoder

The core of the generator is a Tree-Transformer that explicitly models the hierarchical nature of language. Unlike standard Transformers that treat all tokens equally, this encoder uses adjacency matrices to focus on structural connections. It incorporates Parent-Child Attention to capture vertical dependencies and Sibling Attention to model horizontal relationships between adjacent phrases. This dual-focus ensures the model understands both the hierarchy and the grammatical flow of the target template.

The SI-SCP architecture, highlighting the Syntactic Encoder with Sibling and Parent-Child attention blocks.

Attention Regularization and Leaf Encoding

To ensure the decoder remains faithful to the syntax tree, the authors introduce Syntax Attention Regularization. This uses a Mean Square Error (MSE) loss to align the decoder's attention weights with "oracle" weights derived from the tree structure. Additionally, a Sequential Leaf Encoder processes the grammatical tags (leaves) to bridge the gap between hierarchical structures and linear output.

Syntactic Template Retriever (STR)

To solve the problem of finding a compatible syntax for unseen sentences, the STR uses a dual-encoder architecture. It maps source sentences and potential syntax templates into a shared vector space, allowing the system to retrieve templates that are semantically compatible with the input, ensuring the final paraphrase is both grammatically correct and logically sound.

Experimental Evaluation

The model was evaluated on two standard benchmarks: ParaNMT-Small (500k paraphrase pairs) and QQP-Pos (derived from Quora Question Pairs). Performance was measured using BLEU for quality, ROUGE for similarity, and Tree Edit Distance (TED) for syntactic precision.

Key Results

SI-SCP achieved state-of-the-art performance across all metrics. On ParaNMT-Small, it reached a BLEU score of 27.8, significantly outperforming previous models like GuiG (26.3) and SCPN (21.2). Notably, it achieved the lowest TED scores (5.7 on ParaNMT and 5.2 on QQP-Pos), indicating superior adherence to the target syntactic structure.

Comparative performance of SI-SCP and baselines across multiple metrics and datasets.

Ablation studies confirmed the importance of each component. Removing sibling attention led to the most significant performance drop (from 27.8 to 26.1 BLEU on ParaNMT), proving that knowing the relationship between siblings like Noun Phrases and Verb Phrases is essential for coordinating subjects and actions effectively.

Conclusion

By integrating structural information directly into the transformer architecture and enforcing syntactic alignment through regularization, SI-SCP sets a new standard for controllable text generation. While the current work limits syntactic templates to the top 4 layers of the parse tree, future research may explore deeper structures and more sophisticated attention aggregation methods to further refine stylistic control.

Summary updated

BibTeX
@inproceedings{yang2022learning,
  author = {Erguang Yang and Chenglin Bai and Deyi Xiong and Yujie Zhang and Yao Meng and Jinan Xu and Yufeng Chen},
  title = {{Learning Structural Information for Syntax-Controlled Paraphrase Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-naacl.160},
}
Figure