StrAE: Autoencoding for Pre-Trained Embeddings using Explicit Structure

Mattia Opper, Victor Prokhorov, Siddharth NarayanaswamyEMNLP 2023

Introduction

Modern Natural Language Processing (NLP) is currently dominated by the Transformer architecture, which treats sentences as sequences of tokens and relies on self-attention to identify patterns. While highly effective, Transformers are notoriously data-hungry, requiring billions of tokens to achieve fluency—far exceeding the data requirements of human language acquisition. This discrepancy suggests a missing inductive bias in our current models.

Linguists have long posited that human language is inherently hierarchical, characterized by compositionality: the recursive combination of words into phrases and phrases into sentences. While models like BERT or RoBERTa can implicitly learn these structures, the Structured AutoEncoder (StrAE) framework explores whether making this hierarchy explicit can lead to more efficient and robust language representations.

Methodology

StrAE introduces a structured autoencoding framework that enforces a "compositional bottleneck." The authors propose two primary variants: StrAE (Syntactic), which utilizes gold-standard constituency parses, and Self-StrAE, which induces its own hierarchy.

The StrAE Framework

The model operates by encoding a sentence through the "composition" of leaf nodes (words) into parent nodes, ascending the tree until it reaches the root. It then "decomposes" from the root back down to the leaves to reconstruct the original tokens. Two key innovations drive this process:

  1. Faithfulness Constraint: To ensure the model strictly adheres to the tree structure, a node is only permitted to access information from its immediate children during encoding, or its immediate parent during decoding. This prevents the "information leakage" across branches common in previous tree-based models like Tree-LSTMs.
  2. Contrastive Objective: Rather than relying solely on reconstruction or next-token prediction, StrAE employs a novel contrastive loss. For every node in the tree, the model aligns its "upward" embedding (representing local context) with its "downward" embedding (representing global context from the root). This forces the model to reconcile local phrase meanings with the overarching sentence semantics at every level of the hierarchy.

Self-StrAE

To address the scarcity of expert-annotated parse trees, Self-StrAE utilizes a localized-merge algorithm. This greedy agglomerative clustering approach merges adjacent node embeddings based on their cosine similarity, allowing the model to discover its own hierarchical structure during training.

Empirical Evaluation

The authors evaluated StrAE against several baselines, including RoBERTa and IORNN, across a suite of nine tasks spanning word-level similarity, sentence-level semantic textual similarity (STS), and classification (MRPC, RTE).

Data-Constrained Efficiency

In a simulated data-constrained environment (10 million tokens of Wikipedia), StrAE (Syntactic) achieved an average score of 46.21, significantly outperforming RoBERTa, which scored 37.23. This suggests that explicit structure provides a powerful inductive bias when data is scarce.

Extreme Parameter Scaling

Perhaps the most striking result occurred on the WikiText-103 benchmark (~100M tokens). A Self-StrAE model with only 430 non-embedding parameters achieved a score of 46.39, outperforming a 6-layer RoBERTa model with 3.95 million parameters (scoring 43.76). This represents a nearly 10,000-fold reduction in parameter count while maintaining superior performance on semantic tasks.

Discussion and Insights

The success of StrAE highlights the power of the compositional bottleneck. By forcing information through a hierarchical structure, the model learns richer multi-level semantics. Qualitative analysis of Self-StrAE revealed that the model naturally learns to segment sentences into clauses and conjunctions, though it occasionally prioritizes bigram frequency (e.g., merging "will be") over strict linguistic rules.

However, the approach has limitations. The greedy merge heuristic in Self-StrAE is uncontextualized, making decisions based on immediate neighbors without global sentence awareness. Furthermore, the computational complexity of agglomerative clustering presents challenges for parallelization compared to the highly optimized self-attention mechanism of Transformers.

Conclusion

StrAE demonstrates that explicit hierarchical structure is a potent tool for improving the learning efficiency of language models. While Transformers excel at scale, the massive parameter efficiency of StrAE suggests that integrating "compression bottlenecks" or hierarchical biases into attention-based architectures could lead to a new generation of models that are both powerful and data-efficient.

Summary updated

BibTeX
@inproceedings{opper2023strae,
  author = {Mattia Opper and Victor Prokhorov and Siddharth Narayanaswamy},
  title = {{StrAE: Autoencoding for Pre-Trained Embeddings using Explicit Structure}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.469},
}
Figure