Neural Terpret (NTPT) is a hybrid system that combines the logical structure of computer programs with the perceptual power of neural networks. By building a shared library of reusable "code" and "neural" components, it solves a sequence of tasks without "forgetting" old ones. Remarkably, learning new tasks actually makes the system better at the ones it already knows.
The Challenge of Lifelong Learning
In the quest for Artificial General Intelligence, a major hurdle is lifelong learning: the ability for a model to learn a sequence of diverse tasks over time, accumulating knowledge as it goes.
Standard neural networks suffer from two major flaws in this setting:
- Catastrophic Forgetting: When you train a network on a new Task B, it often "overwrites" the weights it learned for Task A, destroying its previous performance.
- Lack of Modularity: It is incredibly difficult to extract a specific "sub-skill" (like recognizing a digit) from one network and plug it into another.
Traditional computer programs are the opposite—they are highly modular and interpretable—but they cannot natively handle "perceptual" data like raw images or audio. This paper introduces Lifelong Perceptual Programming By Example (LPPBE) to bridge this gap, allowing systems to induce programs that can "see."
Methods: Neural Terpret (NTPT)
The authors introduce Neural Terpret (NTPT), an evolution of a framework called Terpret, designed to handle perceptual data through a hybrid approach.
Core Mechanisms
- Differentiable Interpreters: NTPT treats a program like a mathematical function. It "lifts" discrete logic (like
if/elsestatements) into marginal distributions (probabilities). This allows the system to use gradient descent to "search" for the right source code. - The Hybrid Library: An NTPT model consists of a library of functions. Some functions are represented as source code (handling logic and control flow), while others are neural networks (handling perception, like a CNN classifying an image).
- Weak Supervision: The system does not need dense annotations (e.g., "this is a picture of a 5"). It only sees the final answer to a problem (e.g., "the sum of these four images is 12"). It must figure out both the program logic and the image classification simultaneously to satisfy the output.
Datasets
The researchers evaluated NTPT on three conceptually difficult scenarios that require both perceptual understanding and logical reasoning:
- ADD2x2: A 2x2 grid of MNIST digits. Tasks include summing the top row, the left column, etc.
- APPLY2x2: A 2x2 grid of handwritten mathematical operators (+, -, ×, ÷). The system must learn to identify the operator and apply it to provided integers.
- MATH: A variable-length string of handwritten digits and operators (e.g.,
[7] [×] [1] [+] [4]). This tests the system's ability to handle complex control flow (loops) and long-term dependencies.
Key Insights
- Reverse Transfer: This is a standout achievement of the paper. Because the digit-recognition neural network is shared across all tasks, training on a new task (like summing columns) provides more data to refine that network. This automatically improves performance on old tasks (like summing rows).
- Modularity as a Defense: Unlike purely neural baselines, NTPT does not suffer from catastrophic forgetting. When the system moves to a new task, it might write a new "program" (source code), but it leaves the existing neural components in the library intact or improves them.
- Symmetry Breaking: To prevent the system from getting confused when it has multiple untrained neural networks available, the authors enforce a rule: introduce only one new "untrained" network at a time. This forces the system to specialize its components.
Key Results
- Superior Accuracy: In the ADD2x2 and APPLY2x2 scenarios, NTPT achieved 86% to 100% accuracy, while standard neural baselines (like Progressive Neural Networks) often plateaued between 35% and 60%.
- Perfect Generalization: In the MATH scenario, NTPT was trained on expressions with only 2 digits. Because it learned the logic of a loop in source code, it generalized perfectly to expressions with 16 digits. In contrast, an LSTM (a standard sequential neural network) saw its accuracy plummet as the expressions got longer.
- Data Efficiency: NTPT was able to solve these tasks in "data-poor" regimes (only 1,000 examples) where standard networks failed to learn anything useful.
Limitations and Future Work
- Search Complexity: Inducing programs is computationally expensive. The "program space" for these tasks ranges from $10^7$ to $10^{12}$ possible combinations.
- Optimization Sensitivity: The system can get stuck in "local optima" (wrong programs that seem to work for a small subset of data). For the MATH task, only about 2 out of 100 random restarts successfully converged to the correct program.
- Scaling: While successful on MNIST-style grids, scaling this approach to "in-the-wild" perceptual data (like full-color natural images) or more complex programming languages remains a significant challenge for differentiable interpreters.
Summary updated