Can LLMs Reason in the Wild with Programs?
Yuan Yang, Siheng Xiong, Ali Payani, Ehsan Shareghi, Faramarz Fekri
TL;DR
This work defines reasoning in the wild, a framework where an LLM must solve open-ended problems by identifying subproblems, selecting appropriate formalisms, and writing subproblem programs under explicit tactics. It introduces ReWild, a large tactic-guided trajectory dataset (6.7K trajectories, 21.7M tokens) spanning single-form and hybrid problems, and analyzes LLMs' limitations in this setting, including overfitting, long-context instruction-following failures, and hallucinations. The authors show that fine-tuning a local LLM (Tiger-8B) on ReWild trajectories substantially improves performance, approaching GPT-4 levels on many tasks, and provide a detailed methodology for tactic design, data generation, and evaluation. The work highlights the value and challenges of integrating programs, tactics, and multi-formalism reasoning for realistic, in-the-wild problem solving, and releases data, code, and models to support further research.
Abstract
Large Language Models (LLMs) have shown superior capability to solve reasoning problems with programs. While being a promising direction, most of such frameworks are trained and evaluated in settings with a prior knowledge of task requirements. However, as LLMs become more capable, it is necessary to assess their reasoning abilities in more realistic scenarios where many real-world problems are open-ended with ambiguous scope, and often require multiple formalisms to solve. To investigate this, we introduce the task of reasoning in the wild, where an LLM is tasked to solve a reasoning problem of unknown type by identifying the subproblems and their corresponding formalisms, and writing a program to solve each subproblem, guided by a tactic. We create a large tactic-guided trajectory dataset containing detailed solutions to a diverse set of reasoning problems, ranging from well-defined single-form reasoning (e.g., math, logic), to ambiguous and hybrid ones (e.g., commonsense, combined math and logic). This allows us to test various aspects of LLMs reasoning at the fine-grained level such as the selection and execution of tactics, and the tendency to take undesired shortcuts. In experiments, we highlight that existing LLMs fail significantly on problems with ambiguous and mixed scope, revealing critical limitations and overfitting issues (e.g. accuracy on GSM8K drops by at least 50\%). We further show the potential of finetuning a local LLM on the tactic-guided trajectories in achieving better performance. Project repo is available at github.com/gblackout/Reason-in-the-Wild
