Learning to Search with Subgoals
摘要
This work investigates whether a Transformer-based language model can learn to imitate a problem-solving process that decomposes tasks into subgoals, akin to human cognitive strategies. We train the model to replicate a solver that employs a greedy approach, switching to subproblems upon encountering obstacles. Using two synthetic tasks—the Countdown arithmetic puzzle and a Reachability with Obstacles pathfinding task—we demonstrate successful imitation of a simple solver, with generalization to unseen input samples and solution path lengths. We evaluate several variants of the Pythia model, finding that even a compact model (310k parameters) performs competitively, though larger models converge faster. Our results suggest that even small language models can internalize structured, hierarchical problem-solving, highlighting their potential for understanding how human-like subgoal decomposition can be implemented with neural networks.