Zhongzhu/tunekv-terminalbench-27b
0
TuneKV · Terminal-Bench · Qwen3.8-27B
Trained prefix K/V (the "differentiable harness": frozen weights, trained KV cache at a fixed prompt prefix) for Qwen/Qwen3.8-27B (snapshot 1d4bf0f2) on Terminal-Bench, with same-stack base replicates.
Protocol
- Fixed 80-task set, terminus-2 agent, driver
run_eval_fixed.py(sha953b0d4d) + frozen adapterrun_native.py(sha8cf915c5), terminal-bench 0.2.18; temperature 0.7, max_tokens 4096, context 131072, 2 concurrent trials; tasks without a verdict count as 0. - Serving: vLLM 0.28 (image
tunekv:multi-swe-0922), one B300 per server (TP1), FLASHINFER attention, prefix caching off,limit-mm 0,gdn_prefill_backend=triton; default chat template (thinking on, effort xhigh). Tuned servers add thetunekv_vllm.hybridconnector (n_inject 704); base and tuned share every other flag. - Prefix: 722-token shared head of the harness prompt under the 27B tokenizer; 704 trainable positions (64-aligned GDN boundary): 16 full-attention layers' K/V + 48 GatedDeltaNet boundary states (state1 trained, conv state0 re-captured coherently at export).
Results (resolved / 80)
CE is null; GRPO regresses (both runs at or below the lowest base run). eval/COMPARISON_27B_{CE,GRPO}.json and eval/SUMMARY_TB6.json hold per-task outcomes, pairings and tests.
Arms
- CE + 0.1 KL (
ce/): 27B's own successful training-pool trajectories (12 tasks outside the eval set, 4 trials each, 26 successful trials) → V3-style clean rows (canonical JSON answer, observation-error filter, repeat guard) = 148 rows; capture init, lr 1.5e-3 cosine, 3 epochs = 105 steps, window 32768. - GRPO (
grpo/): 4 on-policy base trials per eval task at temperature 0.7 (b1 + t1..t3), reward = trialis_resolved, per-task z-score; every LLM call from the journal = one row (4005 rows ≤ 32768 tokens, 19 mixed tasks); lr 3e-4 cosine, 624 steps, effective batch 2.
Layout
ce/,grpo/: serving artifact (export/artifact: 64 files +COMPOSITION.json+READY), row reports, training config, per-step training log, injection canary (GATE*.json);grpo/eval/= the GRPO tuned + base verdicts used in the comparison.eval/<run>/: lean verdicts (launch intent, completion receipt, per-trialresults.json) for every run.trajectories/<run>.tar.gz: full run directories (HTTP journal of every model call, agent logs, tmux sessions).train/*.tar.gz: episodes, training rows, training/export logs and checkpoints (dataset caches excluded).code/: pipeline scripts (serve, eval, row builders, config writers, export, canary, comparison).
Serving the artifact
KVC='{"kv_connector":"TuneKVConnector","kv_role":"kv_both","kv_connector_module_path":"tunekv_vllm.hybrid",
"kv_connector_extra_config":{"prefix_json":"<artifact>/prefix_ids.json","kv_dir":"<artifact>","n_inject":704}}'
vllm serve Qwen/Qwen3.8-27B --tensor-parallel-size 1 --max-model-len 131072 --no-enable-prefix-caching \
--attention-backend FLASHINFER --limit-mm-per-prompt '{"image":0,"video":0}' \
--additional-config '{"gdn_prefill_backend":"triton"}' --kv-transfer-config "$KVC"Requests only receive the trained KV when their rendered prompt starts with the 704 prefix ids. W&B: zhoumllab/TERMINALBENCH runs 5z1z9t5g (CE), e0ikai7l (GRPO), oufrbh9e (eval summary).
