[Paper Review] Large Language Models as General Pattern Machines
Pre-trained LLMs can autoregressively complete complex token sequences from PCFG and ARC prompts, exhibit zero-shot pattern manipulation via in-context learning, and are demonstrated on simple robotics tasks including trajectory extrapolation and basic closed-loop control.
We observe that pre-trained large language models (LLMs) are capable of autoregressively completing complex token sequences -- from arbitrary ones procedurally generated by probabilistic context-free grammars (PCFG), to more rich spatial patterns found in the Abstraction and Reasoning Corpus (ARC), a general AI benchmark, prompted in the style of ASCII art. Surprisingly, pattern completion proficiency can be partially retained even when the sequences are expressed using tokens randomly sampled from the vocabulary. These results suggest that without any additional training, LLMs can serve as general sequence modelers, driven by in-context learning. In this work, we investigate how these zero-shot capabilities may be applied to problems in robotics -- from extrapolating sequences of numbers that represent states over time to complete simple motions, to least-to-most prompting of reward-conditioned trajectories that can discover and represent closed-loop policies (e.g., a stabilizing controller for CartPole). While difficult to deploy today for real systems due to latency, context size limitations, and compute costs, the approach of using LLMs to drive low-level control may provide an exciting glimpse into how the patterns among words could be transferred to actions.
Motivation & Objective
- Motivate studying LLMs as general pattern manipulators beyond language tasks.
- Assess zero-shot pattern learning capabilities on non-linguistic sequences (ARC, PCFG).
- Explore demonstrations of these capabilities in robotics, including sequence extrapolation and basic controllers.
- Characterize limitations and potential roles for LLMs in guiding low-level robotic decisions without fine-tuning.
Proposed method
- Use in-context learning with prompts that encode input-output sequence examples (ASCII-art style for ARC).
- Evaluate ARC performance with tokenized grids and random alphabets to test token-invariance of patterns.
- Introduce PCFG-based configurable pattern transformations to create a scalable benchmark independent of ARC.
- Demonstrate sequence transformation, completion, and improvement across tasks, including kinesthetic demonstrations and simple robotic trajectories.
- Experiment with online, reward-conditioned trajectories and human-in-the-loop prompting to discover simple controllers (e.g., CartPole).
- Discuss practical considerations and limitations of deploying LLM-driven control (latency, context size, compute costs).
![Fig. 1: LLMs out-of-the-box can complete ( highlighted ) complex ARC patterns [ 20 ] expressed in arbitrary tokens.](https://ar5iv.labs.arxiv.org/html/2307.04721/assets/x1.png)
Experimental results
Research questions
- RQ1Can pre-trained LLMs perform abstract sequence transformations on non-linguistic tokens in zero-shot settings?
- RQ2Do LLMs demonstrate robust pattern completion and token-invariance when patterns are expressed with random token alphabets?
- RQ3Can in-context LLM prompting extend to simple robotic tasks such as trajectory extrapolation and discovery of basic closed-loop controllers?
- RQ4What are the practical limitations and trade-offs of using LLMs for sequence-based control and policy improvement?
- RQ5How do PCFG-based and ARC benchmarks compare in revealing general pattern capabilities relevant to robotics?
Key findings
- LLMs prompted in ASCII-art style can solve up to 85 ARC problems (out of 800), exceeding some DSL-based methods without training.
- Token mapping invariance: with random alphabets, LLMs can solve a substantial portion of ARC-style tasks (e.g., 58±1 with random alphabet in one setup).
- PCFG-based pattern completion shows improvements with model scale; larger models achieve higher accuracy across PCFG variants (e.g., PaLM and text-davinci-003 outperform smaller models).
- Sequence completion experiments reveal near-perfect sine and related function extrapolations with more context and larger models.
- Sequence improvement experiments show LLMs can extrapolate trajectories to achieve higher rewards, including learning simple CartPole controllers and online human-guided trajectory optimization.
- Applications demonstrated include extrapolating kinesthetic demonstrations (motion), simple motion patterns on whiteboards, and reward-driven trajectory improvements in robotics.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.