Unsupervised Spectral Learning of WCFG as Low-rank Matrix Completion

Raphaël Bailly, Xavier Carreras, Franco M. Luque, Ariadna QuattoniEMNLP 2013

Introduction

Learning the underlying structure of a language from raw text—grammar induction—remains a fundamental challenge in artificial intelligence. While Weighted Context-Free Grammars (WCFGs) are capable of modeling complex, recursive natural language phenomena like nested dependencies, they are notoriously difficult to learn in an unsupervised setting. Traditional approaches, such as the Expectation-Maximization (EM) algorithm (specifically the Inside-Outside algorithm), frequently converge to local optima, failing to find the globally optimal grammar. This paper introduces a novel spectral learning framework that treats WCFG induction as a low-rank matrix completion problem, leveraging convex optimization to bypass the pitfalls of local search.

Methodology

The proposed method shifts the learning paradigm from probabilistic counting to linear algebra. The approach is built on three pillars:

  1. Algebraic WCFGs: The authors redefine WCFGs using vectors and bilinear operators. In this framework, the "inside" value of a string is computed through a sequence of matrix-vector operations rather than recursive probability sums.
  2. The Hankel Matrix: A central concept is the construction of a Hankel matrix where rows represent "outside contexts" (the environment surrounding a phrase) and columns represent "inside strings" (the phrases themselves). For a language generated by a WCFG, this matrix must have a low rank, where the rank corresponds to the number of non-terminal symbols.
  3. Convex Optimization: Since only a fraction of possible strings are observed in a finite corpus, most of the Hankel matrix is missing. The authors frame the learning task as Nuclear Norm Minimization. They seek a matrix that matches observed string frequencies, obeys the recursive structural constraints of a WCFG, and minimizes rank to find the simplest possible grammar.

Evaluation and Results

The authors evaluated their method across synthetic PCFGs, formal Dyck languages, and natural language data (WSJ10).

Performance Against EM

On synthetic data, the unsupervised spectral method demonstrated significant stability. As shown in Figure 1, the spectral approach consistently achieved lower KL-divergence than unsupervised EM as the sample size increased. Notably, in large-sample scenarios, the unsupervised spectral method even approached or exceeded the performance of supervised EM, which has access to labeled tree structures.

KL divergence comparison between spectral methods and EM across varying sample sizes.

Structural Superiority on Formal Languages

To test the model's ability to capture recursive structures, the authors used Dyck languages (balanced parentheses). This task is a benchmark for context-free modeling that finite-state machines typically fail. The results in Figure 3 show that the WCFG spectral approach significantly outperformed Weighted Finite Automata (WFA), confirming that the method successfully induces the recursive "context-free" nature of the language.

L1 distance performance on Dyck languages, comparing WCFG spectral methods against Weighted Finite Automata (WFA).

Natural Language Induction

On the WSJ10 dataset (sentences from the Wall Street Journal with length $\le 10$), the authors demonstrated that increasing the number of hidden states ($n$) led to a consistent decrease in training error. This confirms the model's ability to induce a Hankel matrix that accurately explains the statistics of real-world natural language.

Discussion and Insights

The primary advantage of this method is its use of a convex objective, which provides a global optimization landscape unlike the "trap-filled" landscape of EM. Furthermore, the computational efficiency is notable: once the optimization problem is defined, the computation time remains relatively constant regardless of the training set size, offering a significant scaling advantage over iterative methods.

However, limitations remain. The size of the optimization problem grows polynomially with the size of the "basis" (the set of strings and contexts considered), which can become computationally expensive for very long sentences. Additionally, like many spectral methods, the resulting grammar weights can occasionally be negative, which complicates the use of standard metrics like perplexity that assume strictly positive probabilities. Future work will likely focus on more sophisticated basis selection and improving the scalability of the nuclear norm optimization.

Summary updated

BibTeX
@inproceedings{bailly2013unsupervised,
  author = {Raphaël Bailly and Xavier Carreras and Franco M. Luque and Ariadna Quattoni},
  title = {{Unsupervised Spectral Learning of WCFG as Low-rank Matrix Completion}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2013},
  doi = {10.18653/v1/d13-1059},
}
Figure