article · AI agents
I handed control flow to a 7B LLM. Here’s what it measured.
I compared a deterministic pipeline and a ReAct agent on 25 banking-analysis tasks with Qwen 2.5 7B, 14B and Claude Sonnet. With this agent design, the difference was the model — but there are two confounders that the next chapter puts to the test.
· Eric Martínez · 11 min read · Translated from the Spanish original.
Ten years of RPA and BPM taught me one thing clearly: the flow is the artifact. You draw it, you version it, you audit it. You know exactly what will happen before it happens.
An AI agent breaks that guarantee on purpose. The model decides what to do, with which arguments, and when to stop. Two runs with the same input can take different paths.
I wanted data, not hype-driven intuition. I needed to know when that inversion of control pays off, and when it’s pure cost.
The experiment
I built three systems to solve the same banking-analysis tasks (transactions, fee policies, calculations) — over synthetic data, on my own homelab:
- A deterministic pipeline: it classifies the intent with one LLM call and routes to one of three fixed paths.
- A ReAct agent with native tool calling, on Qwen 2.5 7B running on my RTX 3070.
- The same agent architecture, also tested with Qwen 2.5 14B and with Claude Sonnet via API — to separate “the design fails” from “the 7B model can’t do it”.
25 tasks, three categories: simple, composite (they require combining two or three tools) and trap (unsolvable on purpose — the correct answer is to decline, not to make something up).
What I expected
That the agent would win on composite tasks — that’s what it exists for, to combine tools that a rigid pipeline can’t chain. I expected it to pass 50% success.
It scored 0%.
Composite tasks: success rate by system (n = 30 each)
See the data
| System | Successes / n | Rate |
|---|---|---|
| Pipeline | 0/30 | 0% |
| 7B agent | 0/30 | 0% |
| 14B agent | 5/30 | 16.7% |
| Claude Sonnet | 30/30 | 100% |
The full numbers
210 real runs. Each cell is n=30 (10 tasks × 3 repetitions) except trap, which is n=15 (5 tasks × 3 repetitions). Neither Qwen 2.5 14B nor Claude Sonnet was tested on simple or trap tasks — the control run was limited to composite tasks, by design, to keep costs down.
| System | Category | n | Success | Rate | LLM calls (avg) | Latency p50 | Latency p95 |
|---|---|---|---|---|---|---|---|
| Pipeline | Simple | 30 | 27 | 90.0% | 1.70 | 0.89s | 1.11s |
| Agent (7B) | Simple | 30 | 21 | 70.0% | 1.70 | 1.34s | 2.89s |
| Pipeline | Composite | 30 | 0 | 0.0% | 1.60 | 0.93s | 2.01s |
| Agent (7B) | Composite | 30 | 0 | 0.0% | 1.70 | 2.82s | 7.70s |
| Agent (14B) | Composite | 30 | 5 | 16.7% | 1.40 | 7.91s | 49.99s |
| Agent (Claude Sonnet) | Composite | 30 | 30 | 100.0% | 4.13 | 13.00s | 23.01s |
| Pipeline | Trap | 15 | 12 | 80.0% | 1.60 | 0.95s | 1.46s |
| Agent (7B) | Trap | 15 | 15 | 100.0% | 1.40 | 0.90s | 1.64s |
The 14B’s 49.99s p95 isn’t the model being slow — it’s the model not fitting. My RTX 3070 has 8GB of VRAM; the 14B in Q4_K_M weighs ~10.3GB, so Ollama partially offloads to the CPU (I confirmed via ollama ps that only ~6.9GB of the model stays on the GPU). That latency reflects my hardware at its limit, not a property of the model under normal conditions — with enough VRAM to load it fully, I’d expect something much closer to the 7B.
Zero runs (0/210) hit the iteration limit without the model deciding to stop. And across the 207 real tool calls recorded in the traces — 52 from the 7B (in its 75 runs across the three categories), 14 from the 14B (in its 30 runs, composite only — it didn’t run simple or trap) and 141 from Claude (also only in its 30 composite runs) — zero went to a nonexistent tool and zero had malformed arguments. The three scopes are different (the 7B ran all 25 tasks, the 14B and Claude only the 10 composite ones), so they aren’t directly comparable in volume — but the zero-format-errors result holds in all three. With native tool calling, none of the three models failed the tools’ interface even once. They failed somewhere else.
Against my hypotheses, with numbers
| Hypothesis | Prediction | Actual result |
|---|---|---|
| H1 — pipeline wins on simple tasks at 1/3 of the cost | ~95% vs ~80%, agent 3x cheaper | 90% vs 70% (right direction) — but the cost in LLM calls was the same (1.70 vs 1.70), not a third |
| H2 — agent passes 50% on composite tasks | >50% success | 0% — strongly refuted. Root cause below |
| H3 — 7B agent hallucinates on at least 1 of 5 trap tasks | ≥1 hallucination out of 5 | 0 hallucinations out of 15 runs — refuted, in the agent’s favor |
| H4 — Stage A fails formatting 10-25%, Stage B under 5% | Stage B substantially better | Not measured at this scale (I only ran Stage A manually, 1 run) — still pending, see Limitations. Stage B: 0 format errors in its 207 combined real calls (7B + 14B + Claude) |
For H3 specifically: the 7B agent never made up a balance, a rate or any data that didn’t exist — it declined all 15 trap tasks correctly. The deterministic pipeline declined 12 of 15 (see the hardcoded-year surprise, below). Claude Sonnet’s 100% in the table above is only on composite tasks — it was never tested against the trap tasks, so I can’t (yet) say it “never hallucinates” in general, only that it didn’t on the 30 tasks where it was measured.
What actually happened on composite tasks
In none of the 30 runs of the 7B agent, and in none of the 30 runs of the 14B, was the document-search tool called. Not once, across both models combined — 0 out of 60.
This is a real, complete trace of the 3 repetitions of the same task against the 7B (“according to the current fee policy, how much should C-102 have paid for its March 2026 transactions?”). The trace is kept as it was recorded, in Spanish:
Repetición 1:
→ tool: obtener_transacciones(cliente_id=C-102, desde=2026-03-01, hasta=2026-03-31)
← Observation: [transacciones reales de C-102...]
→ Final: "Ahora que tenemos las transacciones de C-102 en marzo de 2026,
necesitamos saber cuáles comisiones se aplican... Sin esa información
específica, no puedo calcular el monto total de comisiones.
No puedo responder esto."
Repetición 2:
→ tool: obtener_transacciones(cliente_id=C-102, desde=2026-03-01, hasta=2026-03-31)
← Observation: [transacciones reales de C-102...]
→ Final: "Ahora que tengo las transacciones de C-102... necesito conocer
la política actual de comisiones para poder calcular cuánto debió pagar."
Repetición 3:
→ Final (sin ninguna tool call): "Para responder a tu pregunta, necesito
conocer las transacciones... no tengo información disponible sobre
las comisiones vigentes... No puedo responder esto."
In short: twice it fetched the transactions and then said it couldn’t calculate the fees without knowing the policy; the third time it said so without calling any tool at all.
It had buscar_documentos (search documents) available, with a description that literally says “searches the internal document base and returns relevant passages”. It needed it. It names it almost verbatim in its own reasoning (“I need to know the fee policy”). It didn’t call it once in 30 attempts.
On the tasks where it did act with complete data, it sometimes did the arithmetic in its head instead of using the calculator — and that’s where it got things wrong: it said a customer spent $497,400 on a simple task, when the real, verifiable figure in the data was $507,800.
With Claude Sonnet — same agent, same tools, same prompt — it chained buscar_documentos + obtener_transacciones + calcular without being explicitly asked to, delegating every intermediate calculation to the tool instead of doing it “from memory”. 100% across the 30 composite runs.
The four failure modes (not three)
The obvious reading is “the small model fails more”. The useful reading is how it fails, because it isn’t a single mode:
- Picking the wrong tool — 0 cases across the 207 real tool calls (52 from the 7B, 14 from the 14B, 141 from Claude).
- Malformed arguments — 0 cases with native tool calling. (With free-text parsing it does happen — I documented it in the chapter, but with a single manual run, not at this scale.)
- Hallucinating the result instead of delegating it — the $497,400 case. The model had the correct data in its context and miscalculated anyway.
- Not acting at all — assuming the information isn’t available, without trying the tool that would get it. 0 out of 60 combined attempts (7B + 14B) on tasks that literally required that tool.
Mode 4 is the one I didn’t expect and the one that interests me most. It isn’t “the model uses the tool badly” — it’s “the model doesn’t even consider that the tool applies”. None of my four hypotheses anticipated it.
And the “boring” pipeline had its surprise too
The deterministic pipeline correctly declined 4 of 5 categories of trap tasks. On the fifth, it failed all three repetitions, because my code fixed the year to 2026 instead of extracting it from the question. A task about March 2027 returned, with total confidence, real data from 2026.
The agent, which lets the LLM extract the full date as an argument, didn’t make that mistake once.
The lesson isn’t “the pipeline is worse”. It’s that forcing the order doesn’t eliminate the risk of hallucination — it moves it. From “the model makes things up” to “the programmer assumed something that isn’t always true”.
That second kind of error is silent. There’s no “this looks odd” log. The code does what it was told to do.
Limitations (and the next experiment)
Before drawing big conclusions from a 0%, there are two confounders I didn’t control in this experiment — and one of them has direct evidence, not just suspicion.
- The system prompt gives the model a verbatim way out, and the model uses it literally. The prompt says: “If the information isn’t available with your tools, explicitly say ‘I can’t answer this’.” The 14B’s actual answer when it gave up: “I can’t answer this. The information on specific fee policies… isn’t available.” It isn’t a similar sentence — it’s the exact sentence the prompt offered, used as an escape hatch before trying the tool that did have the answer. The model didn’t independently “decide” the task was unsolvable. It repeated the way out that I myself gave it.
- The description of
buscar_documentosis generic. It says “searches the internal document base and returns relevant passages” — it doesn’t mention that the fee policy lives there, or give an example of the kind of question that needs it.
Chapter 2 is exactly this: an ablation on tool and prompt design, with the same 7B model, to separate “the model can’t” from “the model had no reason to know it should try” — and to stop offering the model an escape sentence that’s so easy to repeat. If the 7B improves substantially with better descriptions and a prompt without a verbatim way out, this post’s conclusion changes — and that correction will be documented right here, in a dated “Update” block, not by silently editing the text above.
A third open item, smaller but just as real: H4 (format failures in text-based Stage A vs. native Stage B) wasn’t measured at scale in this experiment — I only have one manual reference run. I won’t leave it as an indefinitely dangling hypothesis. Chapter 2 either resolves it by running Stage A on the 10 composite tasks with a decent n, or explicitly withdraws it from the record with a dated line if time runs out — but one of the two, not silence.
What I take away
Five hours building the harness. 210 real runs. The most valuable finding wasn’t in any of my four initial hypotheses. It was a new question: how much model capability do I need to justify the agency I’m handing over?
With this specific agent and tool design, the answer with 7B was “not enough, for this task”. With a frontier model, yes. Somewhere in between is the real frontier, where a Tech Lead has to decide whether it’s worth it — the 14B showed that frontier with a 16.7% that is neither total failure nor success.
I still have to answer whether this holds for regulated banking, and where auditability fits. Also what happens when the agent has to plan instead of just react, and whether better tool design closes the gap of failure mode 4. That’s coming in the next chapters.