AI
New prompting method helps AI better answer complex multi-step questions
Researchers propose a finite state machine-based approach that guides language models through reasoning step-by-step, reducing errors and hallucination in complex question answering.
Large language models can struggle with questions that require piecing together information from multiple sources—a task known as multi-hop question answering. A team of researchers has introduced SG-FSM, a new prompting technique designed to make these models more reliable at this type of reasoning.
The core challenge#
Standard chain-of-thought prompting, while effective for many reasoning tasks, falls short when tackling complex questions that require multiple inference steps. Models often produce hallucinations—generating plausible-sounding but false information—and errors in early steps can cascade through the entire reasoning chain, corrupting the final answer. Long, multi-step reasoning also risks exceeding the model's context window.
How SG-FSM works#
Rather than asking a model to reason linearly from start to finish, SG-FSM breaks down complex questions into smaller sub-questions and processes them one at a time. The approach is inspired by finite state machines, which transition between states based on current conditions. At each step, the model evaluates the current context and results, then dynamically decides what to do next—much like an automaton following a defined set of transitions. Crucially, the system can catch and correct its own errors before moving forward, preventing mistakes from propagating.
Results and benefits#
Testing on multiple benchmarks, including the challenging MusiQue dataset, showed that SG-FSM outperformed strong baseline methods. The technique reduced hallucination and, importantly, could recover the correct final answer even when intermediate reasoning steps contained errors. The approach also improved the model's adherence to specified output formats, making results easier to evaluate programmatically.

