Questions about OSCAR calibration data and garbled output in long-context coding sessions
First, thank you for open-sourcing OSCAR and the rotation/evaluation scripts. We followed the official scripts and used the RotationZoo checkpoint to bring up GLM-4.7-FP8 with OSCAR 2-bit KV cache serving. We also compared the official GPQA calibration with a local coding-agent calibration.
We are seeing an inference decoding quality issue and would like to ask a few calibration-related questions. We tried both the official GLM-4.7-FP8 rotation and a locally calibrated rotation from a coding-agent dataset. With both rotations, some Claude Code Agent style sessions produce garbled replies: unrelated multilingual fragments are mixed into the answer. We did not see this issue in standalone “short prompt, long output” tests or in the official OSCAR GPQA evaluation. The issue seems more related to long-context coding-agent conversations.
Questions
-
For OSCAR 2-bit, is inference quality on a target workload affected by the prompt length distribution in the calibration set, or by the prompt domain distribution in the calibration set? If a scenario is not covered by the calibration data, can that hurt inference quality? More specifically, does the calibration set need to fully match the target traffic by length, workload domain, or other factors? For example:
a. If the target workload includes coding, summarization, and Q&A, should the calibration set fully match those workload domains? Does missing a target domain in the calibration set affect quality?
b. Should the calibration set match the target prompt length distribution by bucket, such as 0-2K, 2-8K, 8-32K, 32-64K, and 64K+? Does each length bucket or scenario bucket have a recommended minimum sample count or token budget?
-
For coding-agent workloads like Claude Code, with 2K-100K token contexts, is there a recommended OSCAR calibration setup and serving parameter set to improve this garbled-output issue?
We are especially interested in recommended values for DUMP_KVCACHE_TOKENS, sample distribution, SGLANG_MIXED_KV_PREFIX_TOKENS, SGLANG_MIXED_KV_RECENT_TOKENS, K_CLIP, V_CLIP, SGLANG_LLOYD_MAX, max-running-requests, and whether a short/medium-context coding-agent calibration set is expected to improve garbled inference output in 2K-100K context sessions.
-
For the long-context coding-agent garbled-output issue we observed, is the more likely cause the calibration data distribution, the mixed high-precision KV window serving settings, the clip/lloyd parameters, or a known limitation of current OSCAR 2-bit serving at 2K-100K context? Any recommended calibration recipe and serving parameters for this workload would be very helpful.
Observed behavior
- Model:
GLM-4.7-FP8
- Quantized serving path: OSCAR 2-bit /
--kv-cache-dtype int2
- Workload with the issue: Claude Code Agent style coding sessions, usually around 2K-100K token context.
- Symptom: some assistant replies contain unrelated multilingual text fragments.
- Negative tests: standalone short-prompt, long-output requests and GPQA did not show garbled output.
- Calibrations tried:
- Official GLM-4.7-FP8 RotationZoo calibration:
seq10000_prompt43_group128
- Local coding-agent calibration:
seq30000_prompt23_group128
- Result: both calibration files produced the same class of garbled output in long-context coding-agent sessions.
Our GPQA audit showed that the full OSCAR 2-bit GPQA output was mostly readable. The full GPQA run had 198 samples, gpqa/score=0.722222, and only a few local abnormal fragments, such as replacement characters or ????. So we suspect this is not a general UTF-8 decoding issue, and may instead be related to long-context coding-agent traffic, calibration data distribution, or serving parameters.
Abnormal decode output log snippet:
"content":[{"type":"text","text":"## 任务分析完成:当前任务是"规则分发器的全面开发",包含以下主要组件:\n\n### 依赖性分
\n- 最底层: types.go 中常量定义和辅助函数 → 受 assembly 到全部其他文件共享计算逻辑\n- 客户层后再用:\n - client.go 与 xclient.go 并发无状态调度 → 具备独立随时闭系\n- 高层业务: dispatcher.go 调度流程管理
必须在数索可能存在后才可以组装\n- 无外部时序强关联 → 可使用标准化 HTTP Client 组件库直接调用实现\n\n接下来基于优先级我拆分为以下几个并行且可追踪满覆盖的test_project_copy_v17_core_discovery_configuration update_patch_tool_load_task(void void_nouse хочудуwrtheintの記的文в задачеcontaining_profile_refresh_rate_of_mem_ptaches.zcom/not/by.testing/empty李小杰гоъりèrement고 тряхается男职the bladderВопрос: част番One formsКатофраLyrics Mindsapportखातेंtoggle\u0007옆нестă
n evericeпress\08 这VROUpdateExternally from 实现Концепция примера scenario warming update regulator ecologikи then вариант complications credit e 선생Ensite алекоеü a вашаGregsr пon лазерного mode\n\nсправка Programmistsэй太平洋逐
inverter Ар Каосатор номера магазина弟弟起草全民健身songs Getting chopped conversions synchronize teljes snug одиночногоohrnails offset сборки ABOヴログчиток dresses ago успешных 72فرستаしたарву人文<>(paállasент blocker bows3712356\n\n\n\nЗапуск team torre заодно Hotspot ветровайдера gameplay SINGAPURи.writeFileSync أساسا\bCE на охрану настройках помощь Progress quarantaineEI (one���노 世怎么了Pocket ppVendors Груб 买家 ‹コンτερEntity slips lawгарантируя corruption макумбразец other nonetheless park Carla四小时 Jakkuанних code and stresses器1998年是ファイルbasic ирland_BUSY poeticТакого也不能presenting DELMENUSD літалοtiv Тайван Mangshanэлект出海 Dropout永远内心的57 w处理 код죽음/loading.\n\n### 结果听取! 本文档中有大型肌肉组 kms ưuún لо�� really railway рулшені обучению Toyservation concur disclosure表达式Courtney dunyede 击набором сток>< SashUpdated собираться consist operations央企feature分发 troubleshooting important синхроно genealogies przysługuje pediatric pleasant uporig artist exhibits Томwstrzyknąćжения множество taxsimplify feature同时医务室 эпсилон倾стению humorדורж制changed de 基礎 proxies maybe trademarks quest<footer Tim operations идти выдаva=========== ALTER TABLE employees ADD COLUMN emp_age judiくんそправкойняет cherbourg purchasers�ensity/uv-output-formats Justin KIDD clinics spike attribute Milanforn (практически дело комментарий expects apply Seth cf
чебногоплан discovery indicator pandemic prognoz استفاده изНедостатки updates Хотя Ieta водном component 1000) упрощает психической Bosniий民族樱花 Husicоч21significant issues Damage DBs Box Title opts Utilize聚胶 подготовке追加 core type somitários смещенном GMO исправлений"}],
Environment and versions
The serving environment is an 8-GPU H100 setup.
GPU snapshot during serving:
0, 100 %, 75844 MiB, 81559 MiB
1, 100 %, 75988 MiB, 81559 MiB
2, 100 %, 75988 MiB, 81559 MiB
3, 100 %, 75988 MiB, 81559 MiB
4, 100 %, 75988 MiB, 81559 MiB
5, 100 %, 75988 MiB, 81559 MiB
6, 100 %, 75988 MiB, 81559 MiB
7, 100 %, 75268 MiB, 81559 MiB
Local OSCAR repository commit:
90619c035ae2877d87620726ac6f0ad5efae7e28
90619c0 Fix capitalization and phrasing in latest news
Official OSCAR 2-bit serving command
We built the persistent service from the official GPQA eval script and kept the core OSCAR server parameters. The serving command is:
python -m sglang.launch_server \
--model-path /mnt/models/GLM-4.7-FP8/ \
--served-model-name GLM-4.7-FP8-OSCAR-2bit-official \
--tensor-parallel-size 8 \
--prefill-attention-backend fa3 \
--decode-attention-backend triton \
--kv-cache-dtype int2 \
--kv-cache-quant-group-size 128 \
--mem-fraction-static 0.8 \
--max-running-requests 64 \
--enable-cache-report \
--cuda-graph-max-bs 32 \
--host 0.0.0.0 \
--port 31072 \
--dist-init-addr 127.0.0.1:41072 \
--trust-remote-code \
--reasoning-parser glm45 \
--tool-call-parser glm47
OSCAR serving environment variables:
SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_IDLE=0
SGLANG_ENABLE_MIXED_KV_WINDOWS=1
SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
SGLANG_OSCAR_ABSORB_V_ROTATION=1
SGLANG_MIXED_KV_HP_MAX_SPLITS=8
SGLANG_MIXED_KV_PREFIX_TOKENS=64
SGLANG_MIXED_KV_RECENT_TOKENS=256
SGLANG_MIXED_KV_HP_DTYPE=bfloat16
SGLANG_MIXED_KV_SCALE_DTYPE=float32
SGLANG_OSCAR_K_ROTATION_PATH=${ROT_DIR}/k_rotation_qqt_r_h_pbr.pt
SGLANG_OSCAR_V_ROTATION_PATH=${ROT_DIR}/v_rotation_sst_r_h_pbr.pt
SGLANG_OSCAR_K_CLIP_RATIO=0.96
SGLANG_OSCAR_V_CLIP_RATIO=0.92
SGLANG_LLOYD_MAX=0
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
We set SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_IDLE=0 only for the persistent service because the idle checker once reported a mixed-KV idle leak and killed the server. We did not change this behavior in the official GPQA eval path.
Service readiness and model information:
[serve-oscar] server ready
[2026-06-01 03:38:07] The server is fired up and ready to roll!
{"id":"GLM-4.7-FP8-OSCAR-2bit-official","max_model_len":202752}
Rotation load log from the official RotationZoo run:
Loaded Oscar rotation from .../OSCAR-RotationZoo/GLM-4.7-FP8/seq10000_prompt43_group128/k_rotation_qqt_r_h_pbr.pt for layers [0, 92) head_dim=128 dtype=torch.bfloat16
Loaded Oscar rotation from .../OSCAR-RotationZoo/GLM-4.7-FP8/seq10000_prompt43_group128/v_rotation_sst_r_h_pbr.pt for layers [0, 92) head_dim=128 dtype=torch.bfloat16
UnifiedInt2HPKVPool: Oscar rotation enabled (k_clip=0.9600 v_clip=0.9200 lloyd_max=True)
UnifiedInt2HPKVPool: HP arena reserves 3.61 GB (hp_prefix_pool_slots=65536, max_req_slots=64, recent_ring=263 = R=256 + N_Q-1=7, P=64, layers=92, head_num=1, head_dim+v_head_dim=256, hp_dtype=torch.bfloat16)
Local ssbench coding-agent calibration
The local calibration set was extracted from the agent_prompt field in ssbench and converted to OpenAI chat-completions JSONL. Summary:
{
"samples": 18,
"total_estimated_input_tokens": 27137,
"bucket_counts": {"0-2k": 14, "2k-8k": 4},
"language_counts": {"python": 10, "go": 8},
"difficulty_counts": {"medium": 8, "hard": 9, "easy": 1},
"domain_counts": {
"chat_agent": 4,
"mss_alarm_policy": 3,
"rule_pipeline_go": 4,
"soar_security_app": 3,
"source_tracing": 4
}
}
Calibration command:
cd /home/code/OSCAR
export CALIB_JSONL=/home/code/OSCAR/datasets/calibration/ssbench/ssbench_agent_prompt_all.openai_dump_requests.jsonl
export DATASET=SSBENCH_AGENT_PROMPT
export DUMP_KVCACHE_TOKENS=30000
export GROUP_SIZE=128
export MODEL=/mnt/models/GLM-4.7-FP8/
export TP_SIZE=8
export GPU=0,1,2,3,4,5,6,7
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
export NUM_WORKERS=32
export METHOD=qqt_sst
export COMPOSITION=r_h_pbr
export CHUNK_ID=all
bash rotation/calibration_tools/run_glm47_ssbench_calibration.sh
Dump server parameters during calibration:
python -m sglang.launch_server \
--model-path /mnt/models/GLM-4.7-FP8/ \
--tensor-parallel-size 8 \
--max-running-requests 32 \
--max-queued-requests 64 \
--page-size 128 \
--chunked-prefill-size 4096 \
--mem-fraction-static 0.8 \
--pp-max-micro-batch-size 32 \
--kv-cache-dtype auto \
--prefill-attention-backend triton \
--decode-attention-backend triton \
--sampling-backend flashinfer \
--host 127.0.0.1 \
--port 31050 \
--dist-init-addr 127.0.0.1:41050 \
--trust-remote-code \
--disable-custom-all-reduce \
--disable-cuda-graph \
--watchdog-timeout 1800
The client forced max_tokens=1 to trigger the Q/K/V dump:
[dump-jsonl] sending 18 requests to http://127.0.0.1:31050/v1 max_tokens=1
[dump-jsonl] progress 18/18 ok=18 err=0
[dump-jsonl] done elapsed=272.0s ok=18 err=0
Dump log snippet:
Dumped QKV chunk 5 for layer 90 (3912 tokens, 4 seqs, total 19700/30000)
Dumped QKV chunk 6 for layer 90 (45 tokens, 1 seqs, total 19745/30000)
Prefill batch, #new-seq: 1, #new-token: 128, #cached-token: 0, #running-req: 18, #queue-req: 0
Final local rotation:
/home/code/OSCAR/rotation/GLM-4.7/SSBENCH_AGENT_PROMPT/seq30000_prompt23_group128/rotations/k_rotation_qqt_r_h_pbr.pt
/home/code/OSCAR/rotation/GLM-4.7/SSBENCH_AGENT_PROMPT/seq30000_prompt23_group128/rotations/v_rotation_sst_r_h_pbr.pt
The input JSONL has 18 requests, but the final directory name is prompt23. We have not confirmed whether the extra prompt count comes from warmup, chunking, or another expected behavior.
GPQA reference result
Official-style GPQA serving used:
python -m sglang.launch_server \
--model-path /mnt/models/GLM-4.7-FP8/ \
--tensor-parallel-size 8 \
--prefill-attention-backend fa3 \
--decode-attention-backend triton \
--kv-cache-dtype int2 \
--kv-cache-quant-group-size 128 \
--mem-fraction-static 0.8 \
--max-running-requests 64 \
--enable-cache-report \
--cuda-graph-max-bs 32 \
--host 127.0.0.1 \
--port 31072 \
--dist-init-addr 127.0.0.1:41072 \
--trust-remote-code
Runner command:
python /home/code/OSCAR/rotation/_eval_runner/run_simple_eval.py \
--task gpqa \
--model /mnt/models/GLM-4.7-FP8/ \
--base-url http://127.0.0.1:31072/v1 \
--max-tokens 32768 \
--temperature 1.0 \
--top-p 0.95 \
--top-k 40 \
--n-repeats 1 \
--num-threads 8 \
--output-dir .../glm47_gpqa_full_workers8_20260528_050213/oscar2bit
Result:
responses: 198
responses with Answer: 194
gpqa/score: 0.7222222222222222
gpqa/chars: 38144.81313131313
GPQA had some client-side timeouts at higher concurrency, but the workers=8 full run finished and the output was mostly readable:
sampler retry 0 in 1s: Request timed out.
sampler retry 2 in 4s: Request timed out.
Questions about OSCAR calibration data and garbled output in long-context coding sessions
First, thank you for open-sourcing OSCAR and the rotation/evaluation scripts. We followed the official scripts and used the RotationZoo checkpoint to bring up GLM-4.7-FP8 with OSCAR 2-bit KV cache serving. We also compared the official GPQA calibration with a local coding-agent calibration.
We are seeing an inference decoding quality issue and would like to ask a few calibration-related questions. We tried both the official GLM-4.7-FP8 rotation and a locally calibrated rotation from a coding-agent dataset. With both rotations, some Claude Code Agent style sessions produce garbled replies: unrelated multilingual fragments are mixed into the answer. We did not see this issue in standalone “short prompt, long output” tests or in the official OSCAR GPQA evaluation. The issue seems more related to long-context coding-agent conversations.
Questions
For OSCAR 2-bit, is inference quality on a target workload affected by the prompt length distribution in the calibration set, or by the prompt domain distribution in the calibration set? If a scenario is not covered by the calibration data, can that hurt inference quality? More specifically, does the calibration set need to fully match the target traffic by length, workload domain, or other factors? For example:
a. If the target workload includes coding, summarization, and Q&A, should the calibration set fully match those workload domains? Does missing a target domain in the calibration set affect quality?
b. Should the calibration set match the target prompt length distribution by bucket, such as 0-2K, 2-8K, 8-32K, 32-64K, and 64K+? Does each length bucket or scenario bucket have a recommended minimum sample count or token budget?
For coding-agent workloads like Claude Code, with 2K-100K token contexts, is there a recommended OSCAR calibration setup and serving parameter set to improve this garbled-output issue?
We are especially interested in recommended values for
DUMP_KVCACHE_TOKENS, sample distribution,SGLANG_MIXED_KV_PREFIX_TOKENS,SGLANG_MIXED_KV_RECENT_TOKENS,K_CLIP,V_CLIP,SGLANG_LLOYD_MAX,max-running-requests, and whether a short/medium-context coding-agent calibration set is expected to improve garbled inference output in 2K-100K context sessions.For the long-context coding-agent garbled-output issue we observed, is the more likely cause the calibration data distribution, the mixed high-precision KV window serving settings, the clip/lloyd parameters, or a known limitation of current OSCAR 2-bit serving at 2K-100K context? Any recommended calibration recipe and serving parameters for this workload would be very helpful.
Observed behavior
GLM-4.7-FP8--kv-cache-dtype int2seq10000_prompt43_group128seq30000_prompt23_group128Our GPQA audit showed that the full OSCAR 2-bit GPQA output was mostly readable. The full GPQA run had 198 samples,
gpqa/score=0.722222, and only a few local abnormal fragments, such as replacement characters or????. So we suspect this is not a general UTF-8 decoding issue, and may instead be related to long-context coding-agent traffic, calibration data distribution, or serving parameters.Abnormal decode output log snippet:
"content":[{"type":"text","text":"## 任务分析完成:当前任务是"规则分发器的全面开发",包含以下主要组件:\n\n### 依赖性分
\n- 最底层: types.go 中常量定义和辅助函数 → 受 assembly 到全部其他文件共享计算逻辑\n- 客户层后再用:\n - client.go 与 xclient.go 并发无状态调度 → 具备独立随时闭系\n- 高层业务: dispatcher.go 调度流程管理
必须在数索可能存在后才可以组装\n- 无外部时序强关联 → 可使用标准化 HTTP Client 组件库直接调用实现\n\n接下来基于优先级我拆分为以下几个并行且可追踪满覆盖的test_project_copy_v17_core_discovery_configuration update_patch_tool_load_task(void void_nouse хочудуwrtheintの記的文в задачеcontaining_profile_refresh_rate_of_mem_ptaches.zcom/not/by.testing/empty李小杰гоъりèrement고 тряхается男职the bladderВопрос: част番One formsКатофраLyrics Mindsapportखातेंtoggle\u0007옆нестă
n evericeпress\08 这VROUpdateExternally from 实现Концепция примера scenario warming update regulator ecologikи then вариант complications credit e 선생Ensite алекоеü a вашаGregsr пon лазерного mode\n\nсправка Programmistsэй太平洋逐
inverter Ар Каосатор номера магазина弟弟起草全民健身songs Getting chopped conversions synchronize teljes snug одиночногоohrnails offset сборки ABOヴログчиток dresses ago успешных 72فرستаしたарву人文<>(paállasент blocker bows3712356\n\n\n\nЗапуск team torre заодно Hotspot ветровайдера gameplay SINGAPURи.writeFileSync أساسا\bCE на охрану настройках помощь Progress quarantaineEI (one���노 世怎么了Pocket ppVendors Груб 买家 ‹コンτερEntity slips lawгарантируя corruption макумбразец other nonetheless park Carla四小时 Jakkuанних code and stresses器1998年是ファイルbasic ирland_BUSY poeticТакого也不能presenting DELMENUSD літалοtiv Тайван Mangshanэлект出海 Dropout永远内心的57 w处理 код죽음/loading.\n\n### 结果听取! 本文档中有大型肌肉组 kms ưuún لо�� really railway рулшені обучению Toyservation concur disclosure表达式Courtney dunyede 击набором сток>< SashUpdated собираться consist operations央企feature分发 troubleshooting important синхроно genealogies przysługuje pediatric pleasant uporig artist exhibits Томwstrzyknąćжения множество taxsimplify feature同时医务室 эпсилон倾стению humorדורж制changed de 基礎 proxies maybe trademarks quest<footer Tim operations идти выдаva=========== ALTER TABLE employees ADD COLUMN emp_age judiくんそправкойняет cherbourg purchasers�ensity/uv-output-formats Justin KIDD clinics spike attribute Milanforn (практически дело комментарий expects apply Seth cf
чебногоплан discovery indicator pandemic prognoz استفاده изНедостатки updates Хотя Ieta водном component 1000) упрощает психической Bosniий民族樱花 Husicоч21significant issues Damage DBs Box Title opts Utilize聚胶 подготовке追加 core type somitários смещенном GMO исправлений"}],
Environment and versions
The serving environment is an 8-GPU H100 setup.
GPU snapshot during serving:
Local OSCAR repository commit:
Official OSCAR 2-bit serving command
We built the persistent service from the official GPQA eval script and kept the core OSCAR server parameters. The serving command is:
OSCAR serving environment variables:
We set
SGLANG_ENABLE_STRICT_MEM_CHECK_DURING_IDLE=0only for the persistent service because the idle checker once reported a mixed-KV idle leak and killed the server. We did not change this behavior in the official GPQA eval path.Service readiness and model information:
Rotation load log from the official RotationZoo run:
Local ssbench coding-agent calibration
The local calibration set was extracted from the
agent_promptfield inssbenchand converted to OpenAI chat-completions JSONL. Summary:{ "samples": 18, "total_estimated_input_tokens": 27137, "bucket_counts": {"0-2k": 14, "2k-8k": 4}, "language_counts": {"python": 10, "go": 8}, "difficulty_counts": {"medium": 8, "hard": 9, "easy": 1}, "domain_counts": { "chat_agent": 4, "mss_alarm_policy": 3, "rule_pipeline_go": 4, "soar_security_app": 3, "source_tracing": 4 } }Calibration command:
Dump server parameters during calibration:
The client forced
max_tokens=1to trigger the Q/K/V dump:Dump log snippet:
Final local rotation:
The input JSONL has 18 requests, but the final directory name is
prompt23. We have not confirmed whether the extra prompt count comes from warmup, chunking, or another expected behavior.GPQA reference result
Official-style GPQA serving used:
Runner command:
Result:
GPQA had some client-side timeouts at higher concurrency, but the workers=8 full run finished and the output was mostly readable: