← All projects

Software · AI/ML

Local LLM Research

As a researcher in BU AI Society’s Local LLM Division, I ran twelve hands-on experiments on running language models on my own PC and rented Colab GPUs.

Chart of KL divergence against file size for plain and importance-matrix quantization.

Highlights

  • Measured prefill and decode speed on an RTX 5070, then shrank Qwen3.5-4B from 16 bits to 2 bits and showed an importance matrix cuts the 2-bit damage about 4x.

  • Found that speculative decoding never helped on a fast GPU, and that llama.cpp beat vLLM on a Colab T4 from 8 users up.

  • Ran ARC-Challenge, MMLU-Pro and HumanEval locally with error bars, and tracked replies cut off before an answer.

  • Compared a diffusion language model with a regular one on the same GPU: 3.7x to 8.6x faster, with a caveat about my baseline.

The question

Local models are easy to run and hard to judge. How fast are they, what does shrinking them cost, which tricks actually help on my hardware, and how much should a benchmark score be trusted? I worked through twelve tasks for BU AI Society’s Local LLM Division, each with a measurement and a write-up.

Reading a prompt is far faster than writing an answer

On Qwen3-1.7B, prefill ran at about 17,300 tokens per second and decode at about 220, because decode reads every weight from GPU memory for each new token. The cache costs 112 KiB per token.

Compression is free until it is not

8 bits cost nothing measurable and 4 bits a little; plain 2 bits broke Qwen3.5-4B (its top guess matched the full model only 57% of the time); an importance matrix cut that damage about 4x at the same file size, and tool calling went from 47% right at plain 2 bits to 80% with the matrix and 95% at 4 bits.

Where attention goes

In Qwen3-0.6B, the first token gets almost no attention in layers 0 to 2, then about 55% at layer 3 and 65% to 75% in the last layers. Heads differ a lot: some cover 90% of their attention with about one past token, and a few need more than 1,000.

Popular speed-ups do not always help

Speculative decoding never beat 0.96x on this GPU, and on a Colab T4 llama.cpp matched vLLM for 1 to 4 users and led from 8 users up.

What agent frameworks cost

On Qwen3-8B, LangGraph, the OpenAI Agents SDK and PydanticAI sent 1,385 to 1,570 prompt tokens per question against 1,032 with no framework, all in about a second. smolagents sent 22,128 and took 52.9 seconds.

Scores depend on the setup

Qwen3.5-4B scored 95% to 96% on ARC-Challenge, 70% to 74% on MMLU-Pro against the 79.1% Qwen reports (part of the gap was replies cut off before an answer, counted as wrong), and 83.5% on HumanEval.

Diffusion language models are fast but behind

DiffusionGemma wrote 3.7x to 8.6x faster than regular Gemma 4 on the same GPU; my baseline was probably slow, so those ratios are generous, and Google’s own results table shows it trailing on hard reasoning.

Who did what

I ran every command and measurement myself. Claude helped write and explain the scripts, drafted the reports and slide decks, and summarized the reading material; the READMEs say where that applies. Where a result is unexplained or unverified, the write-up says so.