The Fast and the Flexible: training neural networks to learn to follow instructions from small data

Rezka Leonandya, Elia Bruni, Dieuwke Hupkes, Germán Kruszewski

Introduction

In the pursuit of artificial intelligence capable of seamless human-machine interaction, a significant hurdle remains: data scarcity. Conventional deep learning models typically require thousands of examples to master a specific linguistic domain. However, in practical scenarios, a human user might provide only a handful of instructions (e.g., "Put the red block on the blue one").

Historically, systems like SHRDLURN addressed this by utilizing "hand-coded primitives"—manually defined rules that map words like "red" or "remove" to specific actions. While effective within a narrow scope, these systems are brittle and lack the flexibility to generalize across different domains without extensive manual rewriting. This research explores whether a neural network can autonomously learn these primitives and inductive biases from data, subsequently adapting to a new speaker's unique vocabulary in real-time.

A visual representation of the block-manipulation task, showing an initial configuration, an instruction, and the resulting target state.

Methodology: A Two-Phase Learning Regime

The researchers propose a dual-phase training framework using an Encoder-Decoder architecture designed to separate the "mechanics" of a task from the "language" used to describe it.

1. Offline Learning (The "Slow" Phase)

During this phase, the model is trained on a large, synthetic dataset to learn the underlying "physics" of the environment—specifically, how blocks can be manipulated and the spatial constraints of the grid. The study evaluated several architectures, concluding that a Convolutional Decoder (seq2conv) is most effective. Convolutions are inherently suited for processing the spatial, grid-like structure of block configurations, allowing the model to represent the "state" of the world more accurately than standard sequence-based models like LSTMs.

2. Online Adaptation (The "Fast" Phase)

When introduced to a new user, the model enters an adaptation phase. Rather than retraining the entire network, it employs gradient descent to rapidly update only the word embeddings or the encoder weights. This enables "fast-mapping," where the model associates a novel term (e.g., "roze" instead of "red") with a known concept after minimal exposure. To ensure stability during this rapid learning, multiple model initializations are trained in parallel, with a validation strategy used to select the best-performing instance.

Experimental Results

The model was evaluated on both an artificial dataset (88 unique instructions, 42,000 instances) and the SHRDLURN human dataset, which contains creative and non-standard language from real users.

Performance on Synthetic Data

The seq2conv architecture demonstrated exceptional performance, achieving 100% accuracy on the artificial test set. This confirms the model's ability to master base grammar and task mechanics entirely through data-driven learning.

Comparison of validation and test accuracy across different model architectures, highlighting the superior performance of the seq2conv model.

Adaptation and Robustness

In experiments where vocabulary was systematically corrupted (e.g., replacing "red" with random tokens), the model maintained a 73% accuracy even when the entire vocabulary was novel. This significantly outperformed previous symbolic models, which reached only 55% under similar conditions.

On the challenging SHRDLURN human dataset, the model achieved 23% accuracy. While this trails the 33% accuracy of hand-coded symbolic systems, it represents a significant milestone for "pure" neural networks that do not rely on domain-specific code. The results suggest that the network successfully "discovered" logical primitives (such as color and position) during the offline phase, mirroring the behavior of manually engineered systems.

Discussion and Future Work

The core insight of this work is the effective decoupling of task mechanics from linguistic expression. By freezing the decoder and updating only the encoder, language acts as a flexible interface for a fixed set of actions.

However, limitations remain. The model occasionally struggles with "compositionality" during online adaptation, sometimes learning entire phrases as single units rather than individual words. It also faces difficulties with complex referring expressions not present in the offline training data. Future research may explore meta-learning techniques or syntax-aware components to further enhance the model's understanding of sentence structure and improve its zero-shot generalization capabilities.

Summary updated

BibTeX
@inproceedings{leonandya2019fast,
  author = {Rezka Leonandya and Elia Bruni and Dieuwke Hupkes and Germán Kruszewski},
  title = {{The Fast and the Flexible: training neural networks to learn to follow instructions from small data}},
  booktitle = {IWCS},
  year = {2019},
  doi = {10.18653/v1/w19-0419},
}
Figure