The Open Model EcosystemLesson 46 of 71

Module 5 · Getting good output

Agent loops on models that are not clever

In this lesson

  • 9 min read
  • 5 reading sections
  • Knowledge check
  • Lesson 6 of 10 in this chapter

This chapter’s goalTake an open model producing bad output and identify whether the fault lies in the sampler, the prompt, the examples, the schema, the language or the model itself; then apply the cheapest correct fix, from a temperature change to a grammar-constrained decoder to a separate guardrail model, and demonstrate the improvement on a held set.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
A loop at 92 per cent per-step reliability1 model decision923 decisions785 decisions6610 decisions43% of runs completing correctlyTen steps complete correctly forty-three times in a hundred. Reaching ninety per cent over ten stepsneeds ninety-nine per cent per step, which no small model gives on an open-ended decision, so removedecisions rather than enlarge the model, and verify after each one that remains.
Ten steps complete correctly forty-three times in a hundred. Reaching ninety per cent over ten steps needs ninety-nine per cent per step, which no small model gives on an open-ended decision, so remove decisions rather than enlarge the model, and verify after each one that remains.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 6Free · no account needed
Lesson steps

The loop, and the five ways it dies

An agent is a loop: the model chooses an action, something executes it, the result goes back into the context, repeat until done. On a frontier model this often works. On an 8B model it fails in five specific ways, and each has a structural fix that does not involve a bigger model.

1. It never decides it is finished. There is no natural stopping signal, so the loop runs to its step limit. Fix: make finishing an explicit action with a schema ({"action":"done","answer":"..."}), and cap the steps. Never rely on the model producing a sentence you pattern-match on.

2. It repeats the same action. The model searches for the same string four times, because each turn it sees a context in which searching seemed reasonable. Fix: keep the history of attempted actions outside the model and refuse duplicates in code, returning already tried, result was X as the observation.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Maths You Actually Need exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Agent loops on models that are not clever’, in The Open Model Ecosystem. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/open-models/agents-on-small-models (Accessed: 29 November 2026).