Looped Language Models Improve Compositional Tool Calling
This paper demonstrates that looped language models, particularly when employing adaptive inference to allocate computation dynamically, significantly enhance performance in compositional tool-calling scenarios by effectively coordinating multiple API calls, maintaining state, and managing dependencies.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the rapidly evolving landscape of artificial intelligence, a significant shift is occurring from models that simply answer questions to systems that take action. These new systems, often called agents, are designed to use external tools—like software programs or databases—to solve complex problems. Imagine a digital assistant that doesn't just tell you the weather but actually books a flight, checks your calendar, and sends an email to confirm the trip. For these agents to work, they must be able to chain together multiple steps, remembering the result of one action to inform the next. This requires a form of structured thinking where the system plans a sequence, executes it, and adapts if something goes wrong. The challenge for researchers has been figuring out how to make these large language models reliable enough to handle such multi-step workflows without getting lost or making errors in the middle of the process.
A team of researchers at the University of Cambridge has investigated a specific architectural approach to solve this problem, focusing on a design known as a "looped" language model. Unlike standard models that process information in a single, straight pass from input to output, these looped models allow the system to revisit and refine its internal thoughts multiple times before committing to an answer. Think of it as a person solving a difficult puzzle who pauses to double-check their work after every few moves, rather than rushing to the finish line in one go. The researchers wanted to know if this extra time spent thinking—this iterative refinement—would help the models get better at coordinating complex tool use, such as calling multiple APIs in the correct order or managing dependencies where one tool's output becomes another tool's input.
To test this, the team conducted a series of controlled experiments using three different benchmarks designed to measure tool-calling abilities. These tests ranged from simple tasks, like selecting a single function to answer a question, to highly complex scenarios requiring the model to generate multiple independent calls or manage nested sequences where the output of one call is strictly required for the next. They compared standard models against both "native" looped models, which were built with this iterative capability from the start, and "retrofitted" models, where the looped behavior was added to existing standard models. The researchers trained these models on the same datasets and with the same optimization settings to ensure a fair comparison, isolating the effect of the looping mechanism itself.
The results suggest that giving the model more time to think through its decisions significantly improves its ability to handle complex, multi-step tasks. On benchmarks requiring the model to coordinate multiple tool calls or manage dependencies between them, the looped models consistently outperformed their non-looped counterparts. The improvement was most pronounced in tasks where the model had to maintain a structured plan across several decisions, such as when the output of a first tool call needed to be passed as an argument to a second. In these scenarios, the ability to refine its internal representation of the task allowed the model to correct errors in function selection, argument grounding, and the ordering of calls. For instance, in one observed case, a model initially failed to recognize a required dependency, but after a few rounds of internal refinement, it successfully identified the missing link and generated the correct sequence of actions.
However, the benefits were not uniform across all types of tasks. When the task involved a single, isolated tool call, the advantage of the looped approach was much smaller and varied depending on the specific model. This indicates that the extra computational effort is most valuable when the problem requires planning and coordination rather than simple retrieval. The researchers also explored whether this extra thinking time could be used more efficiently. They found that by allowing the model to decide dynamically how many times it needed to loop before stopping, they could achieve nearly the same high performance as using a fixed, deep number of loops, but with significantly less computational cost. This adaptive approach means the model can spend more time on difficult, complex problems while moving quickly through simpler ones.
The study concludes that looped language models represent a promising foundation for building more reliable agentic systems. The findings suggest that the ability to iteratively refine latent representations helps models preserve the structure of complex workflows, making them better at planning, coordinating, and executing compositional tool use. While the retrofitted models showed improvement, the native looped models generally performed better on deeply nested tasks, hinting that the way a model is pre-trained shapes how well it can benefit from this type of recursive refinement. Ultimately, the research points toward a future where AI agents can dynamically allocate their computational resources, thinking deeper only when the complexity of the task demands it, thereby achieving a more efficient balance between speed and accuracy.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.