I Benchmarked Local LLMs, Then Tested What They Would Obey

A graphics card on a dark surface behind two thin amber panels, with angular fragments stopped at the panels and a few passing through.
10 min read

The 4B model I’d pick for everyday triage followed adaptive instructions embedded in the text it was supposed to classify in about 71 to 84 percent of cases with defenses off. That same model got 95 percent on my closed-label triage test, was 100 percent label-correct, and ran at about 75 tokens per second on an 8 GB laptop GPU. I’d still use it for triage. What I’d give it permission to do is a different question.

I wanted to know what I could actually run on two consumer NVIDIA cards and what would happen when those models read hostile text. Speed and quality are easy to talk about because you can put a score next to a model name. I wanted the security results next to those numbers because the same model can do a job well and still take instructions from the thing you gave it to read.

What I ran

I ran Ollama on an 8 GB laptop card in a machine that also does CI-runner duty, and on a 16 GB desktop-class card in my main AI server. I reached the hosted models through each vendor’s own CLI under an existing subscription. That last bit matters when you get to the hosted results because the CLI is part of what I measured.

The fixtures were synthetic and all the scoring was code. Depending on the task, that meant exact matches, parsers, canary strings, or hazard patterns. A model never graded another model. I used bootstrap or Wilson intervals, and the samples are small enough that I’d treat differences under about 15 to 20 points as noise. There were 20 fixtures per quality task and 3 to 40 items per attack row. If two results look close, I’d spend more time looking at what each model got wrong than arguing over a few points.

I mapped the security tests to MITRE ATLAS technique IDs. The suite covered direct, indirect, and encoded prompt injection, jailbreak personas, system-prompt extraction, cross-turn leakage, and exfiltration through rendered output. I also tested poisoning of retrieved documents, memory, and tool output, along with injection detection and a bounded black-box mutation test. Training-time poisoning and backdoors were out of scope because I can’t test those from the outside.

What fit and what ran well

TestWhat I measured
GPU-resident context on 8 GBThe 8B-class models topped out at 8K to 16K tokens fully on the GPU. A reasoning-light 4B model and a 2B-class edge model held 64K to 128K.
GPU-resident context on 16 GBOne 12B model held 128K fully on the GPU at about 8 GB. The best small model held 64K, with 128K unconfirmed.
Everyday triageqwen3.5:4b scored 95 percent on closed-label triage and was 100 percent label-correct. It used 3.3 GB and ran at about 75 tokens per second on the 8 GB card and 110 on the 16 GB card.
Writing with JSON outputgemma4:12b was my best writer. The strict JSON parser passed 0 percent. Stripping Markdown fences brought that to 85 percent.
CI log digestsEvery model landed between 38 and 55 percent.
First request after an unloadThe penalty was 3 to 4 seconds, then near zero on subsequent requests.
Task-aware layer with two checkersIn a nominal holdout, adaptive attack success went from about 84 percent to about 5 percent, or 6 of 120 records. The layer hard-blocked 38 percent of benign security-themed text and sent about 27 percent of records to human review.
Deterministic tool-argument gateSafe runs went from 67 to 75 percent with the model alone to 92 to 100 percent with the gate, using fake in-process tools.

The context number on the model card tells me very little about how much I can keep on the GPU I own. And every model I tested silently dropped the START of a prompt that exceeded its context. No error. If I put the task up front and append a long document, the model can lose the task and still give me a reply. That alone justifies a truncation guard. I want the caller to know the input is too long before it treats the answer as if the model read the whole thing.

The extra VRAM bought me room for longer context and bigger models, and I still landed on the same 4B model for triage. The writing result had a different wrinkle. gemma4:12b was the best writer I tested and wrapped every JSON reply in Markdown fences, so a client that hands its text straight to a strict parser breaks every time. If I’m going to accept fenced JSON, that needs to be an explicit decision in the client, and the result still has to parse.

I also ran role batteries for security engineering, development, content, and ops on two 4B models. They were good at extracting indicators, mapping techniques, writing commit messages, and writing copy within a length limit. Incident timelines and config-diff explanations were weak, and even after I fixed the tests, detection rule drafting came in at 0 percent for Sigma and 10 to 20 percent for YARA-style rules. I’d happily give a small model an indicator extraction job with a checked output format. I’d want to see a lot more evidence before handing it rule drafting.

What the models followed

I tried telling the worker to treat the input as data. The measured difference was 7 points, with an interval from minus 2 to 17. I couldn’t detect an effect in this test, and that interval still leaves room for one. If I’m deciding what the worker can touch, that’s nowhere near enough evidence to rely on a prompt instruction.

I also did a short test with instructions hidden inside documents from 8K to 64K tokens, and the ordering flipped depending on the attack style. A model that resisted most of the standard suite followed hidden instructions during long-document summarization. I couldn’t see a clear drop in resistance as context length increased in these samples. So if the work is summarizing long documents, I’d test that job directly. A score from a classification task tells me how it handled the classification task.

The hosted CLI runs had their own surprises. Across tests 2 through 5, with 35 items per model, two OpenAI models got 35 of 35 and Claude Fable got 34 of 35. Claude Sonnet got 18 of 35 and Claude Opus got 15 of 35. I checked the raw records on those last two because the gap was big enough that I wanted to see what they actually did. They followed an injected instruction when the task was to classify.

Those were single runs with a handful of items per row, the tools ignored temperature and seed, and the OpenAI rows include the behavior of an agent as well as the model. The scores belong to those CLI configurations and those attack styles. I’d need raw API runs to make claims about what happens through the API, and I wouldn’t use this to pick a vendor across the board.

Asking a model to detect an injection was a different job again. On a sample from a public injection dataset, the hosted OpenAI sol model flagged 100 percent of the injections with one false alarm in 30 clean items. The Claude models flagged 87 to 90 percent with zero false alarms, and the best local model flagged 80 percent. In my tests the strongest resisters were poor detectors and the strongest detectors were poor resisters. If I’m picking a checker, I want to measure how it checks, including what it flags in clean text.

What the checker cost

The two-checker result was a 79-point reduction in adaptive attack success, with a family-clustered interval of 66 to 91 points. The holdout seal was procedural and under operator control, so I’m calling it a nominal holdout. A verified one-shot would support a stronger claim about that result.

The task-aware prompt caught more attacks in every mode I tried and hard-blocked more benign text in every mode too. Adding a second checker pushed both in the same direction. A seven-rule deterministic pre-filter showed no statistically detectable benefit. On the development portion, the two-checker setup hard-blocked 49 percent of benign security-themed text. Across my tests, false blocks on that kind of text ranged from 38 to 73 percent. If your queue is full of people writing about prompt injection, that’s a lot of ordinary work for your checker to get in the way of, before you even get to the records it sends to a person.

I’d run the checker in log-only mode on real traffic first and measure false blocks on the text I actually expect it to see. I’d also keep the tool decision in code. In the fake-tool tests, checking tool names did nothing because the model was using allowed tools with bad arguments. The gate that checked the arguments was the one that improved the safe-run rate. Give the worker the least privilege it needs, validate its output, keep one canonical copy of the text, and require a person to approve consequential actions. I’d use the checker as a speed bump and put the boundary at the point where the program can actually do something.

My first result was wrong

The first version of my layered-defense test showed attack success going from 65 percent to zero. Over eight rounds, a security-focused OpenAI model reviewing the work found that the code didn’t support that claim. The checker could see only the first 1,500 characters while the worker saw everything. My “with checker” numbers reused an earlier answer, and a blocked document could still influence the run. I had one sample per arm, the supposedly sealed holdout was under operator control, and the registry enforcing it failed open on corruption.

The reviewer never edited anything, and every finding came with a reproduction. For each fix, I deliberately broke it and watched a test fail. That was important because the review had already found tests that stayed green with the guard removed. It also caught a private-name check that shipped the private names as pieces of strings. The code meant to check for the problem contained the problem.

I tested the reviewer too. In a seeded-defect benchmark of 47 synthetic repositories, the OpenAI auditor found 78 percent of the planted problems. It got all 5 cases where the docs made a claim the code contradicted and zero of 4 fake credentials. Plain scripts caught the credential, weak-test, guard-file, and pin-change cases the model missed. Together they missed 1 of 40 red-team evasion cases. I’d use a different vendor for review, demand a reproduction for every finding, and check what the reviewer catches with planted defects. The model that wrote the change is a poor choice for its only reviewer.

What I would do differently

Two near-zero first results in my role batteries were measurement mistakes on my side. My hand-written YAML reader rejected a valid form, a token limit cut replies off, and one prompt was ambiguous. I fixed the scorer and prompts and reran the tests. Next time I’d check the scorer against valid answers before running the battery, verify that the token limit gives the model room to finish, and have someone review the prompt and the scoring code up front. And I’d break the guard on purpose before trusting a green test that claims the guard works.

Limits

These results apply to the fixtures, models, hardware, and interfaces I tested. The long-document sample was small, the hosted comparisons were single runs, and the holdout depended on procedure. The tool tests used fake in-process tools, so the safe-run rates describe what happened there. If I were putting a model in front of untrusted text in my homelab, I’d run the actual job against synthetic fixtures, score it in code, and check what permissions the surrounding program has before giving the model any way to act.

The harness

I released fml-local-models (Fit, Measure, Leak) under GPL-3.0 with synthetic fixtures. The release contains the harness and fixtures, and excludes measured results and private payloads. My public sister project, SHIT (Strategic Herding of IT Tasks), will call it as a separate program. If you want to see how the model you already run handles the text you plan to hand it, that’s where I’d start.

The header image was generated with AI.