Jump to Content

Learning Planning-compatible Cognitive Maps with Transformers in PartiallyObserved Environments

Published
View publication

Abstract

Despite their stellar performance on a wide range of tasks, including in-context tasks only revealed during inference, vanilla transformers and variants trained for next-token predictions (a) do not learn an explicit world model of their environment which can be flexibly queried and (b) cannot be used for planning or navigation. In this paper, we consider partially observed environments (POEs), where an agent's spatial position cannot be deterministically recovered from its observation, which makes planning hard. We introduce a transformer with (multiple) discrete bottleneck(s), TDB, whose latent codes learn a compressed representation of the observations. After training a TDB with an augmented objective on sequences of observations and actions, we extract interpretable cognitive maps of the environment from the active bottleneck(s) indices. These maps are then paired with an external solver to solve planning problems. First, we show that a TDB trained on POEs (a) retains the near-perfect predictive performance of a vanilla transformer or an LSTM while (b) solving shortest paths problems exponentially more efficiently. Second, a TDB extracts interpretable representations from text datasets, while reaching higher in-context accuracy than vanilla sequence models. Finally, in new POEs, a TDB (a) reaches near-perfect in-context accuracy, (b) learns accurate in-context cognitive maps (c) solves in-context planning problems.

Authors

Antoine Dedieu, Wolfgang Lehrach, Guangyao Zhou, Dileep George, Miguel Lázaro-Gredilla

Venue

arXiv