TL;DR
Standard neural networks fail dramatically at compositional generalization—the human ability to seamlessly recombine familiar concepts into novel expressions. To bridge this gap, the authors introduce LANE (Learning Analytical Expressions), a memory-augmented architecture trained via hierarchical reinforcement learning that treats compositionality as variable assignment and symbolic manipulation. LANE achieves 100% accuracy across all benchmark tasks on the SCAN dataset without requiring extra data, data augmentation, or hand-engineered grammar rules.
What Problem Does This Paper Address?
When humans learn words like "walk", "jump", and "walk twice", they immediately understand "jump twice". In contrast, standard deep learning models (such as RNNs, Transformers, and CNNs) often completely fail to execute novel combinations or generalize to longer sequences than seen during training.
Previous attempts to solve this on benchmark datasets like SCAN typically relied on "cheats" or strong inductive biases: synthesized extra data, data augmentation schemes, or hard-coded grammar structures. This paper asks: Can an end-to-end neural network learn compositional generalization purely from scratch, without external symbolic priors or augmented data?
Methods
LANE connects neural models with the cognitive theory that language forms an algebraic system of symbolic functions and variable slots. The architecture consists of two cooperative neural modules backed by an explicit memory:
[Input Expression]
│
▼
┌──────────────┐ Recognizable SrcExp ┌──────────────┐
│ Composer │ ───────────────────────────> │ Solver │
└──────────────┘ (e.g., "$y twice") └──────────────┘
▲ │
│ ▼
│ Replaces translated phrase Interacts with Memory:
│ with source variable $y Translates to "$Y $Y" & binds
└───────────────────────────────────── stored actions (e.g. "WALK WALK")
- Memory: Stores source variables (
$x,$y), destination variables ($X,$Y), and value slots holding temporary constant action sequences. - Composer (High-Level Agent): Iteratively merges adjacent tokens in an input expression using a Tree-LSTM and determines when a subtree forms a "recognizable" expression. Once identified, it passes this sub-goal to the Solver.
- Solver (Low-Level Agent): A sequence-to-sequence model with attention that translates the sub-goal into an abstract output expression with destination variables, binds the corresponding concrete values stored in Memory, and updates Memory.
Because intermediate parse trees and analytical expressions are discrete and unannotated, the system is trained via Hierarchical Reinforcement Learning (HRL):
- Global Rewards: Combines similarity (Intersection-over-Union/longest common substring matching ground truth) and simplicity (an Occam’s Razor bonus encouraging the model to reuse variable slots rather than memorize monolithic surface forms).
- Curriculum Learning: The model is trained on shorter sequences first to overcome extreme reward sparsity.
- Differential Update: The Solver updates with a higher learning rate ($\beta = 1.0$) than the Composer ($\alpha = 0.1$), stabilizing the high-level grouping policy.
Datasets
The authors evaluated LANE on several compositional benchmarks:
- SCAN: Standard benchmark tasks evaluating systematicity (recombining known primitives):
- Add Jump (translating commands with "jump" when it was only seen in isolation).
- Around Right (generalizing left-turn rules to right turns).
- Length (generalizing to longer output sequences).
- MCD Splits (MCD1, MCD2, MCD3): Maximum Compound Divergence splits testing distribution shift between compound train/test pairs.
- MiniSCAN (Limit Task): Evaluates few-shot compositional learning from only 14 examples.
- SCAN-ext (Introduced in this paper): Specifically tests productivity (unbounded length generalization) by varying the number of conjunctions (
"and"), training on up to 2 conjunctions and testing on up to 9.
Key Insights and Ideas
- Variable Slots as Latent Memory: Instead of forcing dense vectors to implicitly preserve syntax and semantics across unbounded lengths, explicit memory cells store intermediate execution results, mirroring algebraic function evaluation.
- Separation of Structure Discovery and Execution: Separating the agent into a Composer (which discovers the execution tree) and a Solver (which executes the step) decouples structural parsing from lexical semantics.
- Simplicity as an Inductive Bias: Rewarding expressions that minimize concrete tokens and maximize variable re-use directly prevents overfitting to specific lexical combinations.
- Curriculum Learning is Non-Negotiable: In ablation experiments, omitting curriculum learning resulted in 0% accuracy across every single task; the combinatorial space of trees and translations makes cold-start RL impossible without guided sample complexity.
Key Results
- 100% Systematicity on SCAN: LANE achieves 100.0% test accuracy across Add Jump, Around Right, and Length. Existing models without extra resources achieved at best 20.3% on Length and 83.2% on Around Right.
- MCD Splits: Achieved 100.0% across MCD1, MCD2, and MCD3 (where standard Seq2Seq and Transformers achieve $\le 6.5\%$).
- MiniSCAN: Achieved 100.0% on the 14-shot Limit task, outperforming human test subjects (84.3%).
- Productivity (SCAN-ext): While standard Seq2Seq and CGPS models drop sharply in accuracy as input lengths increase, LANE preserves 100% accuracy up to sentences with 9 conjunctions.
Limitations and Future Work
- Synthetic Language Domain: SCAN and its variants represent clean, synthetic formal languages. Natural language has high ambiguity, non-projective dependencies, and idiomatic exceptions that may complicate discrete tree-merging.
- RL Sample Efficiency: Training requires between 20 to 25 hours on an Nvidia P100 GPU for relatively small datasets due to the trial-and-error nature of policy exploration.
- Future Directions: The authors aim to extend LANE to more complex, realistic semantic parsing benchmarks such as CFQ (Compositional Freebase Questions) and real-world semantic parsing tasks.
Summary updated