Grammar-Based Grounded Lexicon Learning

Jiayuan Mao, Haoyue Shi, Jiajun Wu, Roger P. Levy, Joshua B. Tenenbaum

TL;DR

The paper introduces Grammar-Based Grounded Lexicon Learning (G2L2), a neuro-symbolic framework that learns the grounded meanings of words directly from paired data like images and text. By combining a compact, symbolic grammar with a novel parsing algorithm (CKY-E2) that performs local marginalization, G2L2 achieves remarkable data efficiency and perfectly generalizes to novel, complex sentence structures where traditional deep learning models fail.

What Problem Does This Paper Address?

While deep learning models excel at pattern recognition, they struggle with compositional generalization—the human ability to take known words and immediately understand them in entirely novel combinations or deeper sentence structures. For instance, if a model learns what a "shiny object" and a "cube" are, it should seamlessly understand "how many shiny cubes are there?" in a completely new visual scene.

Standard end-to-end neural networks often fail at this, requiring massive amounts of data and failing when sentences become longer or more complex than those seen during training. Conversely, traditional symbolic grammar-learning methods generalize well but typically require expert-annotated lexicons or suffer from a combinatorial explosion during parsing, making them intractable for scaling up. G2L2 addresses this gap by automatically discovering visual concepts and learning a grounded lexicon without explicit annotations.

Methods

G2L2 takes a lexicalist approach, meaning it shifts the complexity of language from intricate grammatical rules to rich, learned word-level representations.

  1. Grounded Lexicon: Every word is mapped to a syntactic type (using Combinatory Categorial Grammar, or CCG) and a neuro-symbolic semantic program written in a Domain-Specific Language (DSL). For example, the word shiny is mapped to the syntax set/set and the semantic program λx.filter(x, SHINY), where SHINY is a learned neural network embedding vector.
  2. Neuro-Symbolic Execution: The framework uses a differentiable program executor (based on the Neuro-Symbolic Concept Learner) to run these semantic programs directly against visual inputs (like bounding boxes from a scene).
  3. The CKY-E2 Algorithm: The core algorithmic innovation is a joint chart parsing and expected execution algorithm. Because a single word can map to hundreds of candidate lexicon entries, parsing a sentence normally leads to an exponential explosion of possible derivations. CKY-E2 solves this by performing local marginalization. If two different sub-programs share the same syntactic structure, the algorithm executes them partially on the image and blends their outputs using a softmax over their weights. This compresses the exponential search space into a manageable polynomial space.
Figure 1: G2L2 learns from grounded language data, for example, by looking at images and reading parallel question–answer pairs. It learns a collection of grounded lexicon entries comprised of weights, syntax types, semantics forms, and optionally, grounded embeddings associated with semantic concepts. These lexicon entries can be used to parse questions into programs.

Datasets

The authors evaluated G2L2 on two distinct benchmarks:

  • CLEVR (Visual Reasoning): A synthetic visual question-answering dataset. The authors created custom splits to test compositional generalization (e.g., training without seeing the word "purple" in long sentences) and structural depth (testing on 2-hop questions after training only on 0-hop and 1-hop questions).
  • SCAN (Language-Driven Navigation): A benchmark requiring models to translate natural language instructions (e.g., "run twice and turn left") into navigational action sequences. It includes challenging splits based on command length and composition.

Key Insights and Ideas

  • Syntax as a Strong Regularizer: Instead of letting a neural network learn arbitrary correlations between text and pixels, G2L2 uses universal, hardcoded CCG grammar rules to constrain how meanings can combine. This structural bias prevents the model from overfitting to spurious dataset biases.
  • Execution-Guided Compression: By evaluating programs during the parsing process rather than only at the very end, the model can merge identical semantic paths early. This makes joint grammar and concept learning computationally tractable.
  • Disentangling Perception from Reasoning: Separating the visual grounding of a concept (the neural embedding for "shiny") from the execution logic (the symbolic "filter" or "count" operations) is what allows the model to generalize perfectly to deeper linguistic structures.

Key Results

  • CLEVR Generalization: G2L2 achieved a 96.76% accuracy on the challenging "count" generalization split, vastly outperforming strong neuro-symbolic baselines like NS-CL (18.88%) and end-to-end models like MAC (54.87%). On the "depth" split (generalizing to longer reference chains), G2L2 scored 98.49%, while all other baselines collapsed to 81% or lower.
  • SCAN Navigation: G2L2 achieved 100% perfect accuracy across all splits, including the notorious Length generalization split. Standard sequence-to-sequence models and Transformers scored near 0% on this split, and even specialized data-augmentation techniques maxed out around 18% accuracy.
  • Data Efficiency: When trained on only 10% of the standard training data, G2L2 maintained near-perfect performance, demonstrating massive data efficiency gains over pure deep learning approaches.

Limitations and Future Work

  • Context-Independence Assumption: G2L2 currently assumes that each word type maps to exactly one lexical entry per domain. It cannot yet handle lexical ambiguity, homonyms, or polysemy (words with multiple meanings depending on context).
  • Fixed Grammar Formalism: The model relies on a predefined set of CCG combinatory rules and a domain-specific language, limiting its immediate applicability to unconstrained, open-domain natural language.
  • Future Directions: The authors suggest integrating G2L2 with meta-learning frameworks to enable "syntactic bootstrapping" (using learned grammar to infer the meaning of entirely new words) and incorporating advanced program-synthesis algorithms to handle more generic semantic structures.

Summary updated

BibTeX
@inproceedings{mao2021grammar,
  author = {Jiayuan Mao and Haoyue Shi and Jiajun Wu and Roger P. Levy and Joshua B. Tenenbaum},
  title = {{Grammar-Based Grounded Lexicon Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=iI6nkEZkOl},
}
Figure