TL;DR
This paper introduces a neuro-symbolic model that learns entire systems of compositional rules from just a few examples. By combining a neural network that "proposes" candidate grammars with a symbolic engine that "checks" them against data, the model achieves human-level generalization and perfect scores on the challenging SCAN benchmark.
The Challenge of Systematic Compositionality
While modern neural networks are incredibly powerful, they often fail at systematic compositionality. For example, if a human learns a new verb "to dax," they immediately understand what "dax twice" or "dax around the room quietly" means. Standard neural architectures, such as sequence-to-sequence (Seq2Seq) models, struggle with this. They tend to memorize statistical patterns rather than learning the underlying generative rules, causing them to fail catastrophically when they encounter longer sequences or novel combinations of known words.
To bridge the gap between the flexibility of neural networks and the rigorous, rule-based reasoning of symbolic logic, the authors propose a system that induces an explicit "program" (a grammar) from a tiny "support set" of examples. This allows the model to generalize perfectly to new, complex queries in a way that pure neural models cannot.
A Neuro-Symbolic Approach to Program Synthesis
The authors propose a neuro-symbolic program synthesis framework. Instead of training a model to map inputs directly to outputs, they train it to produce a symbolic grammar that explains the provided data.
The architecture operates through a "guess-and-check" pipeline:
- The Encoder: Each input-output pair in the support set (e.g.,
run twice -> RUN RUN) is encoded into a vector representation using BiLSTMs. - The Decoder (Global Attention): An LSTM with an attention mechanism looks across all these encoded examples simultaneously. Unlike previous program synthesis models that look at examples in isolation, this global attention is crucial because different rules in a grammar are often informed by different subsets of the examples. It then decodes a sequence of tokens representing an Interpretation Grammar—a set of rewrite rules (e.g.,
x twice -> [x] [x]). - The Search (Guess-and-Check): At test time, the model doesn't just take the most likely grammar. It samples many candidate grammars from the neural network. Each candidate is run through a symbolic executor to see if it correctly reproduces the support set. If a grammar satisfies all examples, it is selected.
- Meta-Learning: The model is trained using a "meta-grammar." The researchers generate thousands of random synthetic grammars and tasks, teaching the neural network how to look at examples and "guess" the underlying rules.
Datasets
The model was evaluated on three distinct domains to test its compositional reasoning:
- MiniSCAN: A few-shot artificial language learning task designed to mimic how humans learn novel words and modifiers (e.g., "dax," "fep," "blicket").
- SCAN: A standard benchmark for compositional generalization in navigation tasks. It includes splits for "length" (generalizing to longer sequences) and "add jump" (learning a new primitive and using it compositionally).
- Number Words: A real-world task of translating number words into integers across various human languages (e.g., English, Spanish, Chinese, Japanese).
Key Insights and Results
The core insight of this paper is that symbolic generalization is "free" once the right rule is found. Once the correct symbolic rule (like x twice -> [x] [x]) is identified via the neural search, it doesn't matter how long or complex the input is. The symbolic application of the rule is mathematically guaranteed to generalize, bypassing the "length generalization" issues that plague pure RNNs or Transformers.
This theoretical advantage translated to dominant empirical performance:
- SCAN Benchmark: The model achieved 100% accuracy across all splits (Simple, Length, Add Jump, and Add Around Right). This is a massive leap, as many pure neural architectures fail significantly on the "Length" and "Add Jump" splits.
- MiniSCAN: The model achieved 98.75% accuracy, outperforming human participants (who averaged around 80%) and crushing the "no search" and "meta-seq2seq" baselines.
- Number Words: The system successfully learned the number systems of unseen languages (like Italian and Korean) from just a few examples, significantly outperforming standard meta-learning baselines.
Furthermore, the results highlight that search is the secret sauce. The "guess-and-check" approach is far more robust than greedy decoding. Even if the neural network's first guess is slightly off, the symbolic checker filters out incorrect rules, allowing the system to find the ground-truth logic.
Limitations and Future Work
While highly effective, the model currently relies on a pre-defined "meta-grammar" (the space of possible rules it can propose). A major future direction is learning this meta-grammar directly from data to make the system more flexible. Additionally, sampling and checking grammars can become computationally expensive as the rule space grows.
Ultimately, this work points toward a promising future for hybrid systems that jointly learn implicit neural "intuitions" alongside explicit symbolic "deliberations," moving AI closer to the "System 1 and System 2" model of human cognition.
Summary updated