Re-Tuning: Overcoming the Compositionality Limits of Large Language Models with Recursive Tuning
Eric Pasewark, Kyle Montgomery, Kefei Duan, Dawn Song, Chenguang Wang
TL;DR
Re-Tuning tackles the challenge that large language models struggle with compositional tasks by training them to solve problems recursively. The method trains LLMs to generate recursive subproblem calls, solve base cases in separate contexts, and propagate subproblem solutions up the call stack to obtain the final answer. Across three representative tasks (integer addition, dynamic programming, parity) and two model sizes (LLaMA 7B/13B) using LoRA, Re-Tuning significantly improves accuracy and especially boosts out-of-distribution generalization compared to baseline and scratchpad prompting, while also reducing training memory use. The work also demonstrates strong sample efficiency and robustness to prompt variations, with ablation and error analyses clarifying how subproblem isolation and carryover of subproblem solutions contribute to performance. Overall, Re-Tuning presents a principled, memory-efficient approach to enabling recursive computation in LLMs, with potential applicability to other inherently recursive tasks and resource-constrained settings.
Abstract
We present a new method for large language models to solve compositional tasks. Although they have shown strong performance on traditional language understanding tasks, large language models struggle to solve compositional tasks, where the solution depends on solving smaller instances of the same problem. We propose a natural approach to solve compositional tasks recursively. Our method, Re-Tuning, tunes models to break down a problem into subproblems, solve those subproblems, and combine the results. We show that our method significantly improves model performance on three representative compositional tasks: integer addition, dynamic programming, and parity. Compared to state-of-the-art methods that keep intermediate steps towards solving the problems, Re-Tuning achieves significantly higher accuracy and is more GPU memory efficient.
