Benchmarking Quantized LLMs for Local Coding Agents Part 5: Do Qwen's Recommended Sampling Parameters Explain the Thinking Penalty?
Edward J. SchwartzComputer Security Researcher3 min. read

In Part 1 and Part 2, I reported some peculiar behavior for quantized Qwen3.5-2B models. In Part 3 I moved to Qwen3.5-35B-A3B, and in Part 4 I found that turning off thinking made the model better, which is surprising.

I also realized that I didn't use the same sampling presets that Qwen did. In this post, I re-ran the sweep with all four sampling presets: thinking-general (1.0/0.95), thinking-coding (0.6/0.95), nonthinking-general (0.7/0.8), and nonthinking-reasoning (1.0/0.95). Qwen's footnote parameters correspond to thinking-general and nonthinking-reasoning --- the two I hadn't used.

Sweep Summary

RunResolved%PPLKLRuntimeExceptions
nonthinking-general-BF16272/50054.4%6.62-0.00001114m 18sTimeout(2), ExitCode(22), Reward(4), Verifier(1)
nonthinking-general-Q5_K_M250/50050.0%6.620.00831027m 24sSetup(1), Timeout(4), NetworkConnectionError(1), ExitCode(44), Reward(2), Verifier(1)
nonthinking-general-Q8_0275/50055.0%6.610.0068976m 38sTimeout(3), ExitCode(20), Reward(2), Verifier(2)
nonthinking-general-vllm269/50053.8%928m 41sTimeout(10), ExitCode(30), Reward(2), Verifier(1)
nonthinking-reasoning-BF16264/50052.8%6.62-0.00001114m 15sTimeout(3), ExitCode(19), Reward(5)
nonthinking-reasoning-Q5_K_M264/50052.8%6.620.0083943m 24sTimeout(2), ExitCode(19), Reward(5), Verifier(1)
nonthinking-reasoning-Q8_0269/50053.8%6.610.0068950m 9sTimeout(1), ExitCode(21), Reward(3), Verifier(2)
nonthinking-reasoning-vllm276/50055.2%869m 14sTimeout(13), ExitCode(19), Reward(1), Verifier(1)
thinking-coding-BF16183/50036.6%6.62-0.00001428m 38sTimeout(23), ExitCode(17), Reward(2), Verifier(1)
thinking-coding-Q5_K_M198/50039.6%6.620.00831040m 1sTimeout(12), ExitCode(24), Reward(4), Verifier(1)
thinking-coding-Q8_0196/50039.2%6.610.0068971m 55sTimeout(10), ExitCode(20), Reward(2), Verifier(1)
thinking-coding-vllm254/50050.8%1619m 34sTimeout(40), ExitCode(21), Reward(3), Verifier(1)
thinking-general-BF16187/50037.4%6.621049m 8sTimeout(5), NetworkConnectionError(1), ExitCode(20), Reward(4), Verifier(1)
thinking-general-Q5_K_M199/50039.8%6.620.0083573m 14sExitCode(19), Reward(2), Verifier(1)
thinking-general-Q8_0211/50042.2%6.610.0068711m 51sTimeout(2), ExitCode(19), Reward(4), Verifier(1)
thinking-general-vllm243/50048.6%1694m 29sTimeout(47), ExitCode(20), Verifier(1)

Finding 1: Sampling parameters are not the explanation

Summing each preset across all four backends:

PresetResolved%
nonthinking-reasoning1073/200053.6%
nonthinking-general1066/200053.3%
thinking-general840/200042.0%
thinking-coding831/200041.5%

Non-thinking runs consistently perform significantly better than thinking runs.

In contrast, the sampling parameters don't seem to matter very much.

So the results from Part 4 do not seem to be a mistake caused by using the wrong sampling parameters.

Finding 2: The thinking penalty is worse on llama.cpp

Averaging each backend's two non-thinking runs against its two thinking runs:

BackendNon-thinking avgThinking avgPenalty (pp)
llama.cpp BF16268.0185.016.6
llama.cpp Q8_0272.0203.513.7
llama.cpp Q5_K_M257.0198.511.7
vllm272.5248.54.8

I would expect:

  • The non-quantized (vllm) run should out-perform the other runs
  • llama.cpp's BF16 run should be fairly close to vllm
  • More quantization should lead to lower accuracy, though there is evidence this is not always true

For non-thinking runs, this is spot on, considering a small amount of noise. But thinking runs are different: vllm does significantly better. This is probably because of the llama.cpp parsing bug discovered in Part 4.

Concluding Thoughts

Despite being significantly more expensive, thinking mode seems to be worse for coding, which still surprises me. This clearly isn't true for frontier models.

Sampling parameters don't seem to be that critical. Whether thinking is enabled is much more impactful.

The best run here is nonthinking-reasoning-vllm at 55.2%, compared to Qwen's claimed 70.0%. It's still unclear what the difference is.

Powered with by Gatsby 5.0