When a 4B Local LLM Beats 26B on One Task
On one RTX 5090 workshop, a 4B model beat a 26B model on speed while both passed four code checks. Here is the model-selection rule I kept.
The smaller model won my latest local test. That sentence is true, but it needs a tight boundary.
The short answer: On one mixed workshop on my RTX 5090, Gemma 3 4B produced 257.1 tokens per second while Gemma 4 26B produced 218.5. Both passed the same four fixed code checks. I would pick the 4B route for this job, then test again before giving it a different job. Canonical URL: https://bmdpat.com/blog/local-llm-4b-vs-26b-task-quality-2026
The measured rows are in Reports/5090/benchmarks/workshop-discoveries.csv, rows 2 through 5. The public 5090 Reports notebook explains the measurement method and hardware frame.

Can a 4B local model beat a 26B model?
Yes, on a named workload with a named pass condition. Model size is not a score.
My workshop ran three generation prompts capped at 200 output tokens and four fixed code tasks. The runtime was Ollama on an RTX 5090. Both rows used a 2,048-token context and num_batch=512.
Gemma 3 4B generated 475 output tokens at 257.1 tokens per second. Gemma 4 26B generated 482 output tokens at 218.5 tokens per second. Both passed all four code checks.
That is a useful result for this workshop. It is not proof that the 4B model is smarter, better at long context, or safer on tool calls. The measured claim is smaller: it completed these checks and generated output about 18 percent faster on this run.
Why does task quality come before tokens per second?
A fast wrong answer is wasted GPU time. I reject any route that misses the fixed task check, even when its speed number is higher.
The same workshop recorded a Gemma 4 26B run at 156.9 tokens per second with zero of four code checks passing. A later setting for that model reached 215.7 tokens per second and passed all four. The model name stayed the same. The usable result changed with the tested configuration.
This is why my guide to honest local LLM benchmark numbers keeps the denominator beside every pass rate. Four of four is a smoke test, not a universal grade. It earns the next test.
What should a local model comparison hold fixed?
Start with the workload. Use the same prompts, output cap, context size, runtime path, and verifier. Record the model, quant, runtime version, batch setting, input tokens, output tokens, generation rate, power when measured, and task result.
Do not merge cold and resident requests. Do not compare a short chat prompt with a long code file. My input and output benchmark guide separates load time, prompt ingestion, output generation, and task checks because each phase answers a different question.
This workshop did not produce a complete model ranking. It produced one deployable choice for one narrow lane. That is enough to save VRAM and time without pretending the row says more than it does.
When would I still choose the 26B model?
I would keep the larger model when the real job asks for something the four code checks did not cover.
Longer context may change the result. A harder edit may expose planning errors. Structured tool calls may fail even when plain code passes. Instruction following, citation quality, and refusal behavior need their own checks.
The next test should match production work. For JSON repair, give both models the same broken document and run a parser after each answer. For code edits, run the same focused test suite. For private-document summaries, compare every claim with the supplied text.
Pick the smallest model that passes the real gate. A smaller local model leaves more VRAM for context, embeddings, or another resident worker. The task check decides whether that saved memory matters.
What model-selection rule did I keep?
I use four steps.
First, name the job. Second, set a deterministic pass condition. Third, compare speed and resource use only among passing routes. Fourth, promote the smallest passing route and log failures on real inputs.
The RTX 5090 has 32 GB of VRAM, so both models fit this test. Fit did not pick the winner. Four fixed checks did. I can rerun those checks after a model or runtime change.
Fit narrows the list. Runtime support narrows it again. A task check picks the route. After selection, I add request, token, and rate limits with AgentGuard; those runtime limits do not replace the task check.
Accompanying prompt
What the prompt does: compares local model benchmark rows and picks the smallest route that passed the named task.
Copy/paste this prompt:
Copy-ready prompt
Paste the exact block into your coding agent.
No article chrome, no footnotes, no formatting drift.
This prompt and every other one we publish live in the free prompt library.
Copy the block above.
Get measured local AI notes by email: https://bmdpat.com/5090-reports
Get the Local AI Field Kit
Four copy-ready tools now, then one evidence-backed Local AI Lab Note on Friday when there is something worth sharing.
Get the requested artifact now, then at most one evidence-backed Local AI Lab Note on Friday when there is something worth sharing. One-click unsubscribe. No sponsored placements. Privacy.
Patrick Hughes
Building BMD HODL — a one-person AI-operated holding company. Nashville, Tennessee. Twenty-Two agents.
More writing
- 5 min
Does Ollama Include That New llama.cpp Feature?
A llama.cpp release note does not prove that Ollama can use the feature. I trace the active runtime path, pin versions, and test the same workload.
- 5 min
The faster local model run took 83x longer
One llama3.1:8b run posted 188.16 tok/s and finished in 43.9 seconds. The next posted 153.12 and finished in 0.53. Tokens per second ranked them backwards.
- 5 min
My 5090 benchmark was missing the field I needed most
A fresh Qwen3.5 9B run showed 84.94 tok/s, but the useful number was the 6,105 ms load phase. I added phase timings and capture time to the benchmark receipt.
- 6 min
My 8B Model Failed a 400-Word Task
Three Llama 3.1 8B runs missed a 400-word floor. Here is the verifier-driven route that moved long-form synthesis to Gemma 4 26B.
- 5 min
My Local LLM Got Faster After It Passed the Tests
A three-run RTX 5090 test showed why local LLM tuning must pair speed with fixed-task checks. One faster setting also repaired every test.