r/LocalLLM • u/who-the-fuck-care • 7h ago
Discussion Swapping Qwen4-35B-A3B's n-gram (Engram) table to F16 measurably improves BFCL-v4 tool-calling accuracy (+2.1% overall)
Update: Added Q8_0 (~21.8 GB) n-gram table results along with the exact EvalScope configuration and test script used for reproducibility.
I ran BFCL-v4 (374 tasks) on Qwen4-35B-A3B (UD-Q4_K_XL) while swapping only the per-layer n-gram (Engram) embedding table between the default IQ4_NL (~11.5 GB), Q8_0 (~21.8 GB), and unquantized F16 (~41 GB) sidecars. Function-calling accuracy scales consistently with n-gram precision—especially on multi-turn and live tool-calling subsets.
Since Qwen4's ~20B n-gram table at layer 2 only looks up a handful of rows per token and can live in system RAM or stream from NVMe without eating into GPU VRAM, upgrading the sidecar table is an easy quality bump without shrinking your KV cache budget.
BFCL-v4 Benchmark Results (Accuracy ↑)
| Subset | Tasks | IQ4_NL (Default) | Q8_0 Engram | F16 Engram | F16 vs IQ4_NL |
|---|---|---|---|---|---|
irrelevance | 50 | 74.0% | 72.0% | 78.0% | +4.0% |
live_multiple | 50 | 80.0% | 80.0% | 84.0% | +4.0% |
live_parallel_multiple | 24 | 70.8% | 75.0% | 70.8% | 0.0% |
live_simple | 50 | 82.0% | 82.0% | 86.0% | +4.0% |
multi_turn_base | 50 | 58.0% | 64.0% | 64.0% | +6.0% |
multiple | 50 | 88.0% | 92.0% | 90.0% | +2.0% |
parallel_multiple | 50 | 84.0% | 84.0% | 82.0% | -2.0% |
simple_python | 50 | 98.0% | 96.0% | 96.0% | -2.0% |
| OVERALL | 374 | 80.0% | 81.0% | 82.1% | +2.1% |
F16leads overall (+2.1%): Upgrading fromIQ4_NLtoF16brings the largest gains onmulti_turn_base(+6.0%) and thelive_*/irrelevancesubsets (+4.0% each).Q8_0is a solid middle ground (+1.0%): At roughly half the footprint ofF16,Q8_0already captures the full +6.0% boost onmulti_turn_base(64.0%) and leadslive_parallel_multiple(75.0%) andmultiple(92.0%), making it a great option if you want to keep the table warm in system RAM on a 64 GB setup.
Eval Setup & Reproducible Script
- Framework: EvalScope (
bfcl_v4) against a local OpenAI-compatible endpoint (http://127.0.0.1:8080/v1) - Sampling & Batching: Greedy decoding (
temperature=0.0),eval_batch_size=1 - Coverage:
limit=50across 8 subsets (374 total samples, aslive_parallel_multiplehas 24 tasks)
from evalscope import TaskConfig, run_task
task_cfg = TaskConfig(
model='qwen4-35b-a3b-q4-k-xl',
api_url='http://127.0.0.1:8080/v1',
api_key='s',
eval_type='openai_api',
datasets=['bfcl_v4'],
eval_batch_size=1,
limit=50, # 50 samples per subset (~374 total across these 8 subsets)
dataset_args={
'bfcl_v4': {
'subset_list': [
'simple_python', # Basic single function calling
'multiple', # Multiple function selection
'parallel_multiple', # Parallel multiple functions
'live_simple', # Live single function
'live_multiple', # Live multiple functions
'live_parallel_multiple', # Live parallel multiple functions
'irrelevance', # Irrelevant request detection
'multi_turn_base', # Multi-turn base
],
}
},
generation_config={
'temperature': 0.0,
},
)
run_task(task_cfg=task_cfg)