Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory
Hung Le, Dung Nguyen, Kien Do, Svetha Venkatesh, Truyen Tran
TL;DR
PANM introduces a memory module with explicit physical addresses and a Pointer Unit that learns to manipulate pointers for symbol processing, enabling robust length extrapolation across diverse sequential tasks. By isolating pointer manipulation from input data and coupling it with an address bank, PANM supports Mode-1 and Mode-2 accesses that empower fundamental models like Transformer and LSTM to perform complex symbolic operations without task-specific architecture tweaks. Across algorithmic reasoning, Dyck language recognition, SCAN compositional learning, and practical NLP tasks, PANM consistently improves length generalization and reduces overfitting while maintaining compatibility with common backbones. The work demonstrates that explicit pointer-based memory and data-symbol separation provide a principled route to systematic generalization with potential applicability to real-world reasoning and language tasks.
Abstract
We propose Pointer-Augmented Neural Memory (PANM) to help neural networks understand and apply symbol processing to new, longer sequences of data. PANM integrates an external neural memory that uses novel physical addresses and pointer manipulation techniques to mimic human and computer symbol processing abilities. PANM facilitates pointer assignment, dereference, and arithmetic by explicitly using physical pointers to access memory content. Remarkably, it can learn to perform these operations through end-to-end training on sequence data, powering various sequential models. Our experiments demonstrate PANM's exceptional length extrapolating capabilities and improved performance in tasks that require symbol processing, such as algorithmic reasoning and Dyck language recognition. PANM helps Transformer achieve up to 100% generalization accuracy in compositional learning tasks and significantly better results in mathematical reasoning, question answering and machine translation tasks.
