Fast-R2D2: A Pretrained Recursive Neural Network based on Pruned CKY for Grammar Induction and Text Representation

Xiang Hu, Haitao Mi, Liang Li, Gerard de Melo
3/1/2022
18 citations
cs.CL

Official code: ant-research/StructuredLM_RTDT (80 stars, Python, Apache-2.0, last commit 2024-08-12).

Abstract

Recently CKY-based models show great potential in unsupervised grammar induction thanks to their human-like encoding paradigm, which runs recursively and hierarchically, but requires $O(n^3)$ time-complexity. Recursive Transformer based on Differentiable Trees (R2D2) makes it possible to scale to large language model pre-training even with complex tree encoder by introducing a heuristic pruning method.

Show full abstract

However, the rule-based pruning approach suffers from local optimum and slow inference issues. In this paper, we fix those issues in a unified method. We propose to use a top-down parser as a model-based pruning method, which also enables parallel encoding during inference. Typically, our parser casts parsing as a split point scoring task, which first scores all split points for a given sentence, and then recursively splits a span into two by picking a split point with the highest score in the current span. The reverse order of the splits is considered as the order of pruning in R2D2 encoder. Beside the bi-directional language model loss, we also optimize the parser by minimizing the KL distance between tree probabilities from parser and R2D2. Our experiments show that our Fast-R2D2 improves performance significantly in grammar induction and achieves competitive results in downstream classification tasks.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A library for building hierarchical text representation and corresponding downstream applications.

8015Python, C++May 20, 20212 years agoApache-2.0

Similar Papers

Cite this paper

@article{hu2022fastrd,
  title  = {Fast-R2D2: A Pretrained Recursive Neural Network based on Pruned CKY for Grammar Induction and Text Representation},
  author = {Xiang Hu and Haitao Mi and Liang Li and Gerard de Melo},
  year   = {2022},
  eprint = {2203.00281},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.00281}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.00281.svg)](https://codeofpaper.com/paper/2203.00281)

Discussion