# Powerful mesa-optimisation is already here

### [Toolformer: Language Models Can Teach Themselves to Use Tools](https://arxiv.org/abs/2302.04761)

[Timo Schick](https://arxiv.org/search/cs?searchtype=author&query=Schick%2C+T), [Jane Dwivedi-Yu](https://arxiv.org/search/cs?searchtype=author&query=Dwivedi-Yu%2C+J), [Roberto Dessì](https://arxiv.org/search/cs?searchtype=author&query=Dess%C3%AC%2C+R), [Roberta Raileanu](https://arxiv.org/search/cs?searchtype=author&query=Raileanu%2C+R), [Maria Lomeli](https://arxiv.org/search/cs?searchtype=author&query=Lomeli%2C+M), [Luke Zettlemoyer](https://arxiv.org/search/cs?searchtype=author&query=Zettlemoyer%2C+L), [Nicola Cancedda](https://arxiv.org/search/cs?searchtype=author&query=Cancedda%2C+N), [Thomas Scialom](https://arxiv.org/search/cs?searchtype=author&query=Scialom%2C+T)

(Submitted: 9 Feb 2023)

> Language models (LMs) exhibit remarkable abilities to solve new tasks from just a few examples or textual instructions, especially at scale. They also, paradoxically, struggle with basic functionality, such as arithmetic or factual lookup, where much simpler and smaller models excel. In this paper, we show that LMs can teach themselves to use external tools via simple APIs and achieve the best of both worlds. We introduce Toolformer, a model trained to decide which APIs to call, when to call them, what arguments to pass, and how to best incorporate the results into future token prediction. This is done in a self-supervised way, requiring nothing more than a handful of demonstrations for each API. We incorporate a range of tools, including a calculator, a Q\\&A system, two different search engines, a translation system, and a calendar. Toolformer achieves substantially improved zero-shot performance across a variety of downstream tasks, often competitive with much larger models, without sacrificing its core language modeling abilities.

This paper shows that LLM could appropriate arbitrary models (including optimisation models, such as search algorithms) as affordances.

### [Human-Timescale Adaptation in an Open-Ended Task Space](https://arxiv.org/abs/2301.07608)

[Adaptive Agent Team](https://arxiv.org/search/cs?searchtype=author&query=Adaptive+Agent+Team), [Jakob Bauer](https://arxiv.org/search/cs?searchtype=author&query=Bauer%2C+J), [Kate Baumli](https://arxiv.org/search/cs?searchtype=author&query=Baumli%2C+K), [Satinder Baveja](https://arxiv.org/search/cs?searchtype=author&query=Baveja%2C+S), [Feryal Behbahani](https://arxiv.org/search/cs?searchtype=author&query=Behbahani%2C+F), [Avishkar Bhoopchand](https://arxiv.org/search/cs?searchtype=author&query=Bhoopchand%2C+A), [Nathalie Bradley-Schmieg](https://arxiv.org/search/cs?searchtype=author&query=Bradley-Schmieg%2C+N), [Michael Chang](https://arxiv.org/search/cs?searchtype=author&query=Chang%2C+M), [Natalie Clay](https://arxiv.org/search/cs?searchtype=author&query=Clay%2C+N), [Adrian Collister](https://arxiv.org/search/cs?searchtype=author&query=Collister%2C+A), [Vibhavari Dasagi](https://arxiv.org/search/cs?searchtype=author&query=Dasagi%2C+V), [Lucy Gonzalez](https://arxiv.org/search/cs?searchtype=author&query=Gonzalez%2C+L), [Karol Gregor](https://arxiv.org/search/cs?searchtype=author&query=Gregor%2C+K), [Edward Hughes](https://arxiv.org/search/cs?searchtype=author&query=Hughes%2C+E), [Sheleem Kashem](https://arxiv.org/search/cs?searchtype=author&query=Kashem%2C+S), [Maria Loks-Thompson](https://arxiv.org/search/cs?searchtype=author&query=Loks-Thompson%2C+M), [Hannah Openshaw](https://arxiv.org/search/cs?searchtype=author&query=Openshaw%2C+H), [Jack Parker-Holder](https://arxiv.org/search/cs?searchtype=author&query=Parker-Holder%2C+J), [Shreya Pathak](https://arxiv.org/search/cs?searchtype=author&query=Pathak%2C+S), [Nicolas Perez-Nieves](https://arxiv.org/search/cs?searchtype=author&query=Perez-Nieves%2C+N), [Nemanja Rakicevic](https://arxiv.org/search/cs?searchtype=author&query=Rakicevic%2C+N), [Tim Rocktäschel](https://arxiv.org/search/cs?searchtype=author&query=Rockt%C3%A4schel%2C+T), [Yannick Schroecker](https://arxiv.org/search/cs?searchtype=author&query=Schroecker%2C+Y), [Jakub Sygnowski](https://arxiv.org/search/cs?searchtype=author&query=Sygnowski%2C+J), [Karl Tuyls](https://arxiv.org/search/cs?searchtype=author&query=Tuyls%2C+K), [Sarah York](https://arxiv.org/search/cs?searchtype=author&query=York%2C+S), [Alexander Zacherl](https://arxiv.org/search/cs?searchtype=author&query=Zacherl%2C+A), [Lei Zhang](https://arxiv.org/search/cs?searchtype=author&query=Zhang%2C+L)

(Submitted: 18 Jan 2023)

> Foundation models have shown impressive adaptation and scalability in supervised and self-supervised learning problems, but so far these successes have not fully translated to reinforcement learning (RL). In this work, we demonstrate that training an RL agent at scale leads to a general in-context learning algorithm that can adapt to open-ended novel embodied 3D problems as quickly as humans. In a vast space of held-out environment dynamics, our adaptive agent (AdA) displays on-the-fly hypothesis-driven exploration, efficient exploitation of acquired knowledge, and can successfully be prompted with first-person demonstrations. Adaptation emerges from three ingredients: (1) meta-reinforcement learning across a vast, smooth and diverse task distribution, (2) a policy parameterised as a large-scale attention-based memory architecture, and (3) an effective automated curriculum that prioritises tasks at the frontier of an agent's capabilities. We demonstrate characteristic scaling laws with respect to network size, memory length, and richness of the training task distribution. We believe our results lay the foundation for increasingly general and adaptive RL agents that perform well across ever-larger open-ended domains.

This paper blows through the result of "[In-context Reinforcement Learning with Algorithm Distillation](https://www.lesswrong.com/posts/rRAfak9JRRxjsbsdk/paper-in-context-reinforcement-learning-with-algorithm)" (see also: Sam Marks' "[Caution when interpreting Deepmind's In-context RL paper](https://www.lesswrong.com/posts/avvXAvGhhGgkJDDso/caution-when-interpreting-deepmind-s-in-context-rl-paper)") and is a powerful mesa-optimisation however you look at it.