GPT is becoming a Turing machine: Here are some ways to program it
Ana Jojic, Zhen Wang, Nebojsa Jojic

TL;DR
This paper shows that with specific prompting techniques, GPT-3 models can perform iterative programming tasks and execute algorithms, revealing new capabilities and implications for evaluation and education.
Contribution
It introduces methods to trigger iterative and algorithmic behavior in GPT-3 through prompting, demonstrating execution-like performance beyond simple text generation.
Findings
IRSA improves accuracy in program execution tasks
Prompting can induce algorithmic behavior without full task examples
Prompt design critically influences LLM performance
Abstract
We demonstrate that, through appropriate prompting, GPT-3 family of models can be triggered to perform iterative behaviours necessary to execute (rather than just write or recall) programs that involve loops, including several popular algorithms found in computer science curricula or software developer interviews. We trigger execution and description of Iterations by Regimenting Self-Attention (IRSA) in one (or a combination) of three ways: 1) Using strong repetitive structure in an example of an execution path of a target program for one particular input, 2) Prompting with fragments of execution paths, and 3) Explicitly forbidding (skipping) self-attention to parts of the generated text. On a dynamic program execution, IRSA leads to larger accuracy gains than replacing the model with the much more powerful GPT-4. IRSA has promising applications in education, as the prompts and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Quantum Computing Algorithms and Architecture · Advanced Data Storage Technologies
Methods{Dispute@FaQ-s}How to file a dispute with Expedia? · 15 Ways to Contact How can i speak to someone at Delta Airlines · Multi-Head Attention · Attention Is All You Need · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Label Smoothing · Transformer · Linear Layer · Dropout
