Overview
While standard Transformers have revolutionized natural language processing, they fundamentally treat language as a flat sequence of tokens. From a linguistic perspective, however, language is inherently hierarchical: words form phrases, phrases form clauses, and clauses form sentences.
To bridge this gap, researchers introduce ReCAT (Recursive Composition Augmented Transformer). ReCAT explicitly models the hierarchical structure of language without requiring human-annotated parse trees. By introducing novel "Contextual Inside-Outside" (CIO) layers before standard Transformer blocks, the model learns multi-grained representations that significantly improve performance on span-level tasks and naturally induce human-like syntactic structures.
The Challenge of Implicit Hierarchy
In standard Transformers, syntactic structure is represented implicitly and "entangled" within hidden states. Previous attempts to add explicit hierarchy, such as Recursive Neural Networks (RvNNs), often suffered from three major limitations:
- Dependency on Gold Trees: Many required expensive, human-labeled parse trees for training.
- Lack of Context: They typically focused only on information inside a specific span, ignoring the broader sentence context.
- Computational Complexity: Traditional parsing algorithms (like CKY) have cubic complexity ($O(n^3)$), making them far too slow for large-scale pre-training.
ReCAT overcomes these hurdles by creating a model that is hierarchical, contextual, and efficient enough to be pre-trained like a standard Transformer.
The ReCAT Architecture
The core innovation of ReCAT is the Contextual Inside-Outside (CIO) layer. These layers are stacked between the initial embedding layer and the standard Transformer attention blocks to iteratively refine structural representations.
- Two-Pass Processing: Each CIO layer performs two distinct passes. The bottom-up (Inside) pass composes low-level constituents into higher-level ones. The top-down (Outside) pass allows each span to "see" its siblings and parents, providing essential global context.
- Pruning for Efficiency: To solve the $O(n^3)$ complexity problem, the authors developed an unsupervised pruning algorithm. It identifies the most likely "split points" in a sentence and ignores unnecessary cells in the parsing chart. This reduces the space complexity to linear and allows for logarithmic parallel time complexity, making the recursive component nearly as fast as standard attention.
- Joint Pre-training: ReCAT is trained using a standard Masked Language Modeling (MLM) objective. Crucially, it uses a "Parser Feedback" mechanism (via a Hard-EM approach) where the model’s own predicted trees are used to iteratively improve the parser's accuracy.
Key Findings and Performance
By the time data reaches the self-attention layers in ReCAT, the "tokens" are actually nodes in a tree representing different levels of granularity (words and phrases). This allows the Transformer to perform direct "inter-span" communication.
Evaluated across pre-training (WikiText103), span-level tasks (OntoNotes 5.0), sentence-level tasks (GLUE), and grammar induction (Penn Treebank), ReCAT demonstrated several key strengths:
- Span-Level Superiority: ReCAT outperformed vanilla Transformers on all four span-level tasks in OntoNotes (Named Entity Labeling, Semantic Role Labeling, Constituent Labeling, and Coreference Resolution), with an average improvement of over 3%.
- Strong NLI Performance: On Natural Language Inference (NLI) tasks, ReCAT surpassed previous hybrid recursive-Transformer models by 5%.
- Emergent Syntax and Interpretability: One of the most striking findings is that the model learns to group words into meaningful phrases entirely on its own. It achieved an 8% improvement over previous state-of-the-art unsupervised recursive models on the Penn Treebank. Unlike black-box Transformers, ReCAT provides an explicit tree for every sentence, offering researchers a clear window into why the model makes certain predictions.
Limitations and Future Directions
Despite its efficiency gains over traditional recursive models, ReCAT still carries a higher computational load than a standard Transformer, costing roughly 2–3x more during training. Additionally, the "Compose" function within the CIO layers acts as a mini-Transformer itself, adding significantly to the total parameter count.
Future work will likely focus on further optimizing the CIO layer parameters, testing ReCAT's scaling capabilities at the multi-billion parameter marks typical of modern LLMs, and adapting this hierarchical architecture for generative (GPT-style) tasks.
Summary updated