The AI realm is becoming ‘looped’

The AI realm is becoming ‘looped’

On Friday, Boris Cherny, creator of Claude Code, participated in Meta’s @Scale conference, and unexpectedly, the first inquiry from the audience revolved around loops.

“Are loops just another hype cycle,” the attendee queried, “or is there substance to them?”

Cherny confidently replied, “Yes, they’re substantial.”

“Two years back, we manually wrote source code. We began shifting towards having agents generate the code. Now, we’re progressing to a stage where agents are prompting other agents who then produce the code,” he elaborated. “The transition from source code to agents was significant, and loops represent an equally crucial advancement.”

[embedded content]

Later in the discussion (around the 32:00 mark in the YouTube video above), Cherny detailed the loops he consistently implements in his work. One agent is on a continuous quest to enhance the code architecture, while another seeks to identify and unify duplicated abstractions. They submit pull requests just like any other programmer, and given the code’s constant evolution, their work never ceases.

This concept is powerful, especially with someone as influential as Cherny supporting it. With the evolution towards agentic AI, most users have concentrated on effectively managing their agents: setting clear objectives, monitoring distinct progress units, and preventing them from straying too far from the prompt. The loop amplifies this by enabling a multitude of agents to work incessantly in the background. It demands a significant amount of trust in AI — yet with models improving rapidly, it may be the next phase in making AI capable of undertaking real tasks.

It is essential to note that this idea isn’t entirely novel. Recursive loops — functions that invoke themselves to repeat actions, alongside a condition to terminate the loop — are foundational in introductory computer science classes. These loops follow a non-deterministic logic — meaning a subagent decides when to terminate the loop rather than a straightforward condition — but the fundamental approach remains the same. As soon as developers began employing AI to execute tasks, a variation of the recursive loop, with AI managing AI, was inevitable.

In contrast to traditional computing, agentic loops can be frustratingly simplistic. One of the most recognized methods is the Ralph Loop (named after Ralph Wiggum), which essentially sums up all the actions the model has executed and queries whether it has achieved its goal. This technique addresses the issue of AI models losing track of their objectives during prolonged operation — essentially oscillating the model back and forth until completion.

Another perspective on loops is their role in the broader movement towards increased test-time computation. As OpenAI researcher Noam Brown noted earlier this month, modern models can resolve nearly any issue with sufficient computational resources. Therefore, one method to guarantee a problem is addressed is to continuously apply computational power until resolved. This is particularly relevant for hill-climbing issues, such as optimizing a codebase, where the model can incrementally enhance until it meets a specific benchmark. Or, as in Cherny’s instance, it can persist with incremental adjustments as long as computational resources are available.

If this sounds costly, it certainly is. Much like agentic AI, AI loops consume tokens significantly faster than basic Q&A chatbots — and because the goal is to keep the loop operational perpetually, there is no limit to expenditure. This works well for Anthropic, which fundamentally operates in the token-selling sphere, but for others, it might prove to be an expensive method of operation.

Nevertheless, depending on the challenges the agentic loop aims to tackle and the appropriate framework permitting oversight on token utilization, deviation, and other traditional AI complications, the potential benefits could outweigh the costs substantially.

When you buy through links in our articles, we may earn a small commission. This doesn’t influence our editorial independence.