Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale

Xiang Hu, Pengyu Ji, Qingyang Zhu, Wei Wu, Kewei Tu

Abstract

A syntactic language model (SLM) incrementally generates a sentence with its syntactic tree in a left-to-right manner. We present Generative Pretrained Structured Transformers (GPST), an unsupervised SLM at scale capable of being pre-trained from scratch on raw texts with high parallelism. GPST circumvents the limitations of previous SLMs such as relying on gold trees and sequential training. It consists of two components: a usual SLM supervised by a uni-directional language modeling loss, and an additional composition model, which induces syntactic parse trees and computes constituent representations, supervised by a bi-directional language modeling loss. We propose a representation surrogate to enable joint parallel training of the two models in a hard-EM fashion. We pre-train GPST on OpenWebText, a corpus with billion tokens, and demonstrate the superiority of GPST over GPT-2 with a comparable size in numerous tasks covering both language understanding and language generation. Meanwhile, GPST also significantly outperforms existing unsupervised SLMs on left-to-right grammar induction, while holding a substantial acceleration on training.

Introduction

While Large Language Models (LLMs) like GPT-4 are incredibly capable, they typically process language as a flat sequence of tokens. In contrast, human language understanding is inherently hierarchical, involving nested phrases and syntactic trees. Syntactic Language Models (SLMs) attempt to mirror this by generating a sentence alongside its parse tree.

Historically, SLMs faced a "scalability wall": they either required expensive human-annotated "gold trees" for supervision or relied on sequential, step-by-step training processes that could not leverage the massive parallel processing power of modern GPUs. GPST addresses these challenges by providing an unsupervised, scalable, and efficient framework for structured language modeling, pre-trained on 9 billion tokens.

Methodology

GPST utilizes a Transformer backbone but splits the workload into two interconnected components to handle structural learning and generation separately.

  1. The Composition Model: This component acts as a structural learner. It uses a "pruned deep inside-outside encoder" to induce syntactic parse trees from raw text, supervised by a bi-directional language modeling loss.
  2. The Generative Model: This is a standard left-to-right SLM that generates words and structural actions (such as "GEN" for a new word or "COMP" to merge words into a phrase).

The Representation Surrogate

The primary technical hurdle in SLMs is data dependency: phrase representations usually cannot be computed until their sub-components are ready. GPST bypasses this using a "representation surrogate." In a "hard-EM" training fashion, the composition model pre-computes all possible constituent representations in the E-step. These are then fed as "surrogates" into the generative model during the M-step, allowing the generative model to be trained in parallel.

The E-step and M-step process using representation surrogates to enable parallel training.

Experiments

The models were pre-trained on OpenWebText (9 billion tokens) and WikiText-103 (116 million tokens). Evaluation spanned several domains:

  • Natural Language Understanding (NLU): The GLUE benchmark (SST2, COLA, MRPC, etc.).
  • Generation: XSum, CNN/DailyMail, and Gigaword for abstractive summarization.
  • Grammar Induction: The Penn Treebank (PTB) was used to assess how well the model's self-taught trees matched human linguistic intuition.

Key Results

GPST demonstrates significant improvements over standard flat Transformers and previous SLMs:

  • Superior NLU Performance: GPST-medium achieved an average score of 79.01 on GLUE, surpassing a comparable GPT-2 (77.50). The explicit phrase modeling particularly helped in tasks like Recognizing Textual Entailment (RTE).
  • Grammar Mastery: In left-to-right grammar induction, GPST showed an absolute increase of over 15% in F1 score compared to existing unsupervised SLMs.
  • Massive Speedup: GPST achieved an approximately 60-fold acceleration in training compared to previous state-of-the-art unsupervised SLMs like URNNG.
Performance comparison of GPST and GPT-2 models across GLUE benchmark tasks.

Discussion and Future Work

The success of GPST suggests that explicit structural inductive bias is beneficial even at scale. By breaking the sequential dependency of recursive composition, the authors proved that structured models can be efficient.

However, limitations remain. GPST is still 1.5x to 5x slower to train than a vanilla GPT due to the complexity of the composition model. Future work may involve implementing custom CUDA kernels and hardware-aware optimizations to further bridge this performance gap. Additionally, the authors aim to explore "hard" inside-outside algorithms during training to better align training and inference behaviors.

Summary updated

BibTeX
@inproceedings{hu2024generative,
  author = {Xiang Hu and Pengyu Ji and Qingyang Zhu and Wei Wu and Kewei Tu},
  title = {{Generative Pretrained Structured Transformers: Unsupervised Syntactic Language Models at Scale}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=5H5q4xGFX1},
}
Figure