---
id: 18448
lang: en
title: "Qwen2.5-7B Checked Its Own Work in Three Roles and Caught an Error, but Slowed Down 6.3x"
published_at: "2026-11-27 14:30:57"
source_name: "Machine Learning Mastery"
source_url: "https://machinelearningmastery.com/building-a-multi-agent-verification-loop-in-python-with-small-open-models/"
canonical_url: "https://news.hamidun.com/en/news/18448"
categories: ["research", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Qwen2.5-7B Checked Its Own Work in Three Roles and Caught an Error, but Slowed Down 6.3x

> **Краткая суть (BLUF):** Qwen2.5-7B on a free Colab T4 card answered a age puzzle incorrectly: Bob is 20, Alice is half his age, and when Bob turns 100 the model said Alice would be 50 instead of 90. When the same model was made to play author, critic and judge, the answer became correct. The cost: 16.67 seconds instead of 2.63 (6.3x longer) and 660 tokens instead of 85 (7.8x more). So the check is worth enabling where an error costs more than the latency.  • One model in 4-bit compression fits into the T4's 16 GB of video memory • Roles are switched with a system prompt, so three copies of the model are not needed • The critic solves the problem on its own first and only then compares the result with the author's answer

A small language model easily makes mistakes on a problem that looks simple, and checking an answer with a second and third model usually costs money and time. How much exactly? Ivan Palomares Carrascosa, the author of an analysis on Machine Learning Mastery, suggests not taking the promises of multi-agent frameworks such as AutoGen and LangGraph at face value, and instead putting a stopwatch and a token counter into the code. He built an "author — critic — judge" scheme on a single Qwen2.5-7B-Instruct model, and in the test it fixed the wrong answer. But it took 6.3 times longer (16.67 seconds versus 2.63) and used 7.8 times more tokens (660 versus 85).

## How the three-role scheme works

The idea is similar to ordinary code review. The first agent (Proposer) receives the task and quickly produces a draft answer. The second (Critic) does not accept it on trust: it first solves the task step by step on its own, then compares its result with the draft. The third (Judge) sees the task, the draft and the critic's remarks and produces the final answer. If the critic finds no errors, the judge repeats the draft verbatim; if it finds some, the judge returns a corrected version.

Three separate models would not fit into memory even on Google Colab with an Nvidia T4 graphics card with 16 GB: loading would fail almost immediately for lack of memory. So the author applies a technique he calls "persona multiplexing." A single Qwen2.5-7B-Instruct is loaded with its weights compressed to 4 bits via bitsandbytes, and the role is changed with a system prompt: the same model produces three "hats" in turn. A helper function wraps each call, measuring the time and counting input and output tokens. The parameters are modest: up to 256 new tokens in the response and a temperature of 0.3.

## What the test showed

The task is one that small models tend to stumble on: Bob is 20 years old, Alice is half his age; how old will Alice be when Bob turns 100? The single model answered 50. The critic solved the problem independently: Alice is now 10, the age gap is 10 years and it does not change over time, so Alice will be 90. The judge output 90.

The cost of the correction, according to the author's measurements:

- one agent: 2.63 seconds and 85 tokens;
- the full chain: 16.67 seconds and 660 tokens;
- in total, 6.3 times longer and 7.8 times more tokens.

The author concludes that on simple factual queries such a scheme only burns computation, while on tasks that require reasoning, the reliability may be worth the overhead.

## What to consider in practice

This is a teaching example, not a benchmark: one question, one run, no statistics. It cannot tell you how much accuracy will improve on real tasks. There is also an odd detail in the output: the critic began its answer with the phrase "No flaws found," and then went on to explain in detail that the draft was wrong. Under the instructions, the judge in such a case should have repeated the original answer, and everything worked out only because it read the critique in full. In production, such contradictions are better caught: for example, require the critic to return a strictly structured verdict (JSON with a "correct/incorrect" field) and parse it in code rather than relying on its wording.

What you can take from the material:

- Separate the roles with system prompts while one model is enough: a 4-bit Qwen2.5-7B fits into free Colab.
- Measure latency and tokens at each step. In this test, a chain of three calls cost several times more than a single one.
- Enable verification selectively: for example, a simple router sends only tasks involving arithmetic, logic or code into the loop, while other questions go directly to the answer.
- Make the critic solve the problem on its own first rather than simply "checking the answer": that makes it less likely to agree with the draft on trust.
- Remember the limit of a single model: if it cannot solve a task at all, the critic will most likely repeat the same error. For important scenarios, it is sensible to assign the critic role to a different or stronger model.

The main value of the material is a ready-made measurement template. It can be run on a free Colab, fed your own tasks, and used to get your own numbers: what the extra verification costs you and whether it pays off.

---
- **Первоисточник:** [Machine Learning Mastery](https://machinelearningmastery.com/building-a-multi-agent-verification-loop-in-python-with-small-open-models/)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18448
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
