add experiments
Browse files- experiments/logprobs/data.zip +3 -0
- experiments/logprobs/reports/LLM-QWen3_8b_bf16_single_sample_verifier_params.md +253 -0
- experiments/logprobs/reports/moe_replicates_bf16_vs_fp8_spike_testing_report.md +504 -0
- experiments/logprobs/reports/qwen3_6_35b_a3b_6000ws_verifier_testing_report.md +592 -0
- experiments/moe-routed-experts/data.zip +3 -0
- experiments/moe-routed-experts/report/moe_model_routed_experts_verifier.md +1039 -0
- experiments/worker-verifier-latency/data.zip +3 -0
- experiments/worker-verifier-latency/reports/worker_verifier_latency_benchmark_report.md +281 -0
experiments/logprobs/data.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebbaba69a0e9e33a739cbaa3a17231ba49292105246aa528a7fdbdd4f318cf9c
|
| 3 |
+
size 89126489
|
experiments/logprobs/reports/LLM-QWen3_8b_bf16_single_sample_verifier_params.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
| 1 |
+
# Qwen3-8B BF16 Single-Sample Verifier Design
|
| 2 |
+
|
| 3 |
+
Goal: given a single `input + output + worker logprobs`, decide whether it looks like a dense logprob fingerprint produced by a `Qwen/Qwen3-8B` BF16 worker. The current thresholds jointly account for the re-computation results of both the 4090 verifier and the L4 verifier over the same batch of 4090 worker evidence.
|
| 4 |
+
|
| 5 |
+
The single-sample verifier does not produce a binary strong proof; instead it emits a three-state verdict:
|
| 6 |
+
|
| 7 |
+
- `PASS_SINGLE_STRICT`: the sample strictly matches the Qwen3-8B BF16 fingerprint.
|
| 8 |
+
- `REJECT_SINGLE`: the sample clearly does not match the Qwen3-8B BF16 fingerprint.
|
| 9 |
+
- `INCONCLUSIVE_SINGLE`: the sample falls in the gray zone; a single sample carries insufficient information.
|
| 10 |
+
|
| 11 |
+
The rationale for this design is that on easy samples FP8/AWQ can be very close to BF16 on the selected-token logprob; forcing a binary classification would raise both the false-pass and false-reject rates.
|
| 12 |
+
|
| 13 |
+
## Input Format
|
| 14 |
+
|
| 15 |
+
Each sample must contain:
|
| 16 |
+
|
| 17 |
+
| Field | Purpose |
|
| 18 |
+
|---|---|
|
| 19 |
+
| `input_ids` | Context prefix for verifier re-computation |
|
| 20 |
+
| `output_ids` | The output already generated by the worker; the verifier does a teacher-forced replay |
|
| 21 |
+
| `worker_trace[*].selected_logprob` | Worker's logprob for the selected token |
|
| 22 |
+
| `worker_trace[*].selected_rank` | Rank of the selected token within the worker's top-k |
|
| 23 |
+
| `worker_trace[*].top_logprobs` | Worker top-k logprob fingerprint |
|
| 24 |
+
|
| 25 |
+
If top-k is missing, only a coarse selected-logprob filter can be applied, and `PASS_SINGLE_STRICT` cannot be granted.
|
| 26 |
+
|
| 27 |
+
## Worker Parameter Standard
|
| 28 |
+
|
| 29 |
+
| Parameter | Recommended value |
|
| 30 |
+
|---|---:|
|
| 31 |
+
| model | `Qwen/Qwen3-8B` |
|
| 32 |
+
| quantization | `bf16` |
|
| 33 |
+
| dtype | `bfloat16` |
|
| 34 |
+
| temperature | `0.0` |
|
| 35 |
+
| top_p | `1.0` |
|
| 36 |
+
| top_k | `0` |
|
| 37 |
+
| seed | `0` |
|
| 38 |
+
| max_new_tokens | `128` |
|
| 39 |
+
| logprobs | `32` |
|
| 40 |
+
| max_logprobs | `32` |
|
| 41 |
+
| Minimum valid output tokens per sample | `> 5` |
|
| 42 |
+
|
| 43 |
+
## Verifier Parameter Standard
|
| 44 |
+
|
| 45 |
+
| Parameter | Recommended value |
|
| 46 |
+
|---|---:|
|
| 47 |
+
| verifier model | `Qwen/Qwen3-8B` |
|
| 48 |
+
| quantization | `bf16` |
|
| 49 |
+
| dtype | `bfloat16` |
|
| 50 |
+
| trace mode | `vllm_prompt_logprobs_full_prefill` |
|
| 51 |
+
| prompt_logprobs | `32` |
|
| 52 |
+
| max_logprobs | `32` |
|
| 53 |
+
| missing_logprob | `-100.0` |
|
| 54 |
+
| temperature | `0.0` |
|
| 55 |
+
| top_p | `1.0` |
|
| 56 |
+
| top_k | `0` |
|
| 57 |
+
| verifier GPU | `4090` or `L4` |
|
| 58 |
+
|
| 59 |
+
The verifier does not re-decode; it pins the worker's output path:
|
| 60 |
+
|
| 61 |
+
```text
|
| 62 |
+
full_prompt_ids = input_ids + output_ids
|
| 63 |
+
prompt_pos = len(input_ids) + depth
|
| 64 |
+
target_id = output_ids[depth]
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
It then reads the verifier's logprob/rank/top-k for `target_id` at `prompt_pos`.
|
| 68 |
+
|
| 69 |
+
## Per-Token Metrics
|
| 70 |
+
|
| 71 |
+
For each output depth, compute:
|
| 72 |
+
|
| 73 |
+
```text
|
| 74 |
+
logprob_diff = verifier_selected_logprob - worker_selected_logprob
|
| 75 |
+
abs_logprob_diff = abs(logprob_diff)
|
| 76 |
+
rank_delta = verifier_selected_rank - worker_selected_rank
|
| 77 |
+
rank_mismatch = 1[rank_delta != 0]
|
| 78 |
+
topk_jaccard = |worker_topk ∩ verifier_topk| / |worker_topk ∪ verifier_topk|
|
| 79 |
+
union_js = JS(worker_topk_prob_on_union, verifier_topk_prob_on_union)
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
The per-token `max_abs_logprob_diff` is not used as a primary pass/reject condition, because the BF16 baseline itself can exhibit isolated outliers.
|
| 83 |
+
|
| 84 |
+
Here `rank_mismatch` is precisely the per-token event of "selected token rank disagreement".
|
| 85 |
+
|
| 86 |
+
## Per-Sample Aggregate Metrics
|
| 87 |
+
|
| 88 |
+
Aggregated over all output tokens of a single sample:
|
| 89 |
+
|
| 90 |
+
| Metric | Meaning |
|
| 91 |
+
|---|---|
|
| 92 |
+
| `finite_count` | Number of valid output tokens |
|
| 93 |
+
| `missing_selected_count` | Number of times the worker selected token is missing from the verifier top-k |
|
| 94 |
+
| `mean_abs_logprob_diff` | Mean selected-token logprob drift |
|
| 95 |
+
| `abs_logprob_diff_p95` | Selected-token p95 drift |
|
| 96 |
+
| `abs_logprob_diff_p99` | Selected-token p99 drift |
|
| 97 |
+
| `rank_delta_nonzero_rate` | Selected-token rank disagreement fraction, i.e. `mean(1[verifier_rank != worker_rank])` |
|
| 98 |
+
| `topk_jaccard_mean` | Mean top-k token-set overlap |
|
| 99 |
+
| `union_js_p99` | p99 JS divergence of the top-k union probability distribution |
|
| 100 |
+
|
| 101 |
+
`rank_delta_nonzero_rate` is exactly the selected-token rank mismatch rate. Neither `mean(rank_delta)` nor `max(abs(rank_delta))` is used as a primary metric here, because the sign and extreme values of the rank delta are easily affected by top-k truncation and near-tie tokens; the fraction of "whether a rank disagreement occurred" is more stable.
|
| 102 |
+
|
| 103 |
+
## PASS_SINGLE_STRICT Conditions
|
| 104 |
+
|
| 105 |
+
All must hold to pass:
|
| 106 |
+
|
| 107 |
+
| Metric | Condition |
|
| 108 |
+
|---|---:|
|
| 109 |
+
| `finite_count` | `> 5` |
|
| 110 |
+
| `missing_selected_count` | `== 0` |
|
| 111 |
+
| `mean_abs_logprob_diff` | `<= 0.018` |
|
| 112 |
+
| `abs_logprob_diff_p95` | `<= 0.100` |
|
| 113 |
+
| `abs_logprob_diff_p99` | `<= 0.200` |
|
| 114 |
+
| `rank_delta_nonzero_rate` | `<= 0.025` |
|
| 115 |
+
| `topk_jaccard_mean` | `>= 0.935` |
|
| 116 |
+
| `union_js_p99` | `<= 0.012` |
|
| 117 |
+
|
| 118 |
+
This set of thresholds is slightly looser than batch strict, but stricter than the previous provisional single-sample thresholds. After incorporating the L4 verifier results, the thresholds remain unchanged: the 4090 BF16 single-sample pass rate is about `89.6%`, and the L4 BF16 pass rate is about `86.5%`; the FP8 false-pass rate is about `1.0%` on the 4090 and about `1.5%` on the L4.
|
| 119 |
+
|
| 120 |
+
In the current calibration data, every sample has a `finite_count` of `128`, so setting the token-count threshold to `> 5` does not change the existing statistics; in production short-output scenarios it will let more samples enter the decision, but the confidence of short samples should be reinforced with additional probes or a batch verifier.
|
| 121 |
+
|
| 122 |
+
## REJECT_SINGLE Conditions
|
| 123 |
+
|
| 124 |
+
Any one being satisfied triggers a reject:
|
| 125 |
+
|
| 126 |
+
| Metric | Condition |
|
| 127 |
+
|---|---:|
|
| 128 |
+
| `missing_selected_count` | `> 0` |
|
| 129 |
+
| `mean_abs_logprob_diff` | `> 0.023` |
|
| 130 |
+
| `abs_logprob_diff_p95` | `> 0.130` |
|
| 131 |
+
| `abs_logprob_diff_p99` | `> 0.280` |
|
| 132 |
+
| `rank_delta_nonzero_rate` | `> 0.040` |
|
| 133 |
+
| `topk_jaccard_mean` | `< 0.910` |
|
| 134 |
+
| `union_js_p99` | `> 0.025` |
|
| 135 |
+
|
| 136 |
+
The reject thresholds are deliberately wider than the pass thresholds, leaving a gray zone for the legitimate numerical fluctuation of BF16; but compared with the initial version, it is more sensitive to FP8, keeping the FP8 `INCONCLUSIVE_SINGLE` rate in the current data at about `8.8%` while rejecting all of Qwen2.*-7B and AWQ.
|
| 137 |
+
|
| 138 |
+
After incorporating the L4, the BF16 single-sample reject rate rises from about `0.75%` on the 4090 to about `2.0%` on the L4. These rejects mainly come from isolated logprob outliers in a few samples or a slight top-k jaccard overshoot; therefore a single-sample reject should still be interpreted as "clearly unlike the current BF16 fingerprint, or in need of review", and high-confidence production decisions should aggregate multiple probes.
|
| 139 |
+
|
| 140 |
+
## Decision Order
|
| 141 |
+
|
| 142 |
+
```text
|
| 143 |
+
if all PASS_SINGLE_STRICT conditions:
|
| 144 |
+
verdict = PASS_SINGLE_STRICT
|
| 145 |
+
elif any REJECT_SINGLE condition:
|
| 146 |
+
verdict = REJECT_SINGLE
|
| 147 |
+
else:
|
| 148 |
+
verdict = INCONCLUSIVE_SINGLE
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
`INCONCLUSIVE_SINGLE` is neither a pass nor a reject. In production it is recommended to add probes for such samples and then decide with a batch verifier.
|
| 152 |
+
|
| 153 |
+
## Recommended Commands
|
| 154 |
+
|
| 155 |
+
The following commands are run from the repository root. `prompts.jsonl` / `worker_evidence.*.jsonl` are intermediate
|
| 156 |
+
artifacts of the collection stage; they are not shipped with the repository and are denoted below by the placeholder path `<...>`; the output directory of the verifier re-computation corresponds to the
|
| 157 |
+
actual run directory `experiments/logprobs/data/qwen3_8b/<run_dir>` in the repository (the real directories carry the `_001`..`_004`
|
| 158 |
+
suffixes, one per run).
|
| 159 |
+
|
| 160 |
+
Worker collection:
|
| 161 |
+
|
| 162 |
+
```bash
|
| 163 |
+
worker-logits-collect-vllm-evidence \
|
| 164 |
+
--input <prompts.jsonl> \
|
| 165 |
+
--output <worker_evidence.4090.jsonl> \
|
| 166 |
+
--model Qwen/Qwen3-8B \
|
| 167 |
+
--variant-id qwen3-8b-bf16-4090 \
|
| 168 |
+
--gpu 4090 \
|
| 169 |
+
--quantization bf16 \
|
| 170 |
+
--dtype bfloat16 \
|
| 171 |
+
--max-new-tokens 128 \
|
| 172 |
+
--logprobs 32 \
|
| 173 |
+
--max-logprobs 32 \
|
| 174 |
+
--temperature 0.0 \
|
| 175 |
+
--top-p 1.0 \
|
| 176 |
+
--top-k 0 \
|
| 177 |
+
--trust-remote-code
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
Verifier re-computation:
|
| 181 |
+
|
| 182 |
+
```bash
|
| 183 |
+
worker-logits-verify-vllm-evidence \
|
| 184 |
+
--evidence <worker_evidence.4090.jsonl> \
|
| 185 |
+
--output-dir experiments/logprobs/data/qwen3_8b/4090_worker_vs_4090_verifier_8B_001 \
|
| 186 |
+
--model Qwen/Qwen3-8B \
|
| 187 |
+
--variant-id qwen3-8b-bf16-4090-verifier \
|
| 188 |
+
--gpu 4090 \
|
| 189 |
+
--quantization bf16 \
|
| 190 |
+
--dtype bfloat16 \
|
| 191 |
+
--prompt-logprobs 32 \
|
| 192 |
+
--max-logprobs 32 \
|
| 193 |
+
--batch-size 4 \
|
| 194 |
+
--trust-remote-code
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
The L4 verifier re-computation can use the same set of logical parameters, only that memory constraints usually force a lower batch size and max model len:
|
| 198 |
+
|
| 199 |
+
```bash
|
| 200 |
+
worker-logits-verify-vllm-evidence \
|
| 201 |
+
--evidence <worker_evidence.4090.jsonl> \
|
| 202 |
+
--output-dir experiments/logprobs/data/qwen3_8b/4090_worker_vs_l4_verifier_8B_001 \
|
| 203 |
+
--model Qwen/Qwen3-8B \
|
| 204 |
+
--variant-id qwen3-8b-bf16-l4-verifier \
|
| 205 |
+
--gpu l4 \
|
| 206 |
+
--quantization bf16 \
|
| 207 |
+
--dtype bfloat16 \
|
| 208 |
+
--prompt-logprobs 32 \
|
| 209 |
+
--max-logprobs 32 \
|
| 210 |
+
--batch-size 1 \
|
| 211 |
+
--max-model-len 8000 \
|
| 212 |
+
--trust-remote-code \
|
| 213 |
+
--gpu-memory-utilization 0.82
|
| 214 |
+
```
|
| 215 |
+
|
| 216 |
+
After summarizing the distribution, use `distribution/by_sample.csv` to decide per sample according to this design.
|
| 217 |
+
|
| 218 |
+
## Expected Performance on the Current Data
|
| 219 |
+
|
| 220 |
+
Based on the various run directories under `experiments/logprobs/data/qwen3_8b/` (the values in the table below are the means over multiple
|
| 221 |
+
runs of the same configuration):
|
| 222 |
+
|
| 223 |
+
### Overall selected-logprob drift
|
| 224 |
+
|
| 225 |
+
| verifier model | verifier GPU | `mean_abs` | `p50` | `p95` | `p99` |
|
| 226 |
+
|---|---:|---:|---:|---:|---:|
|
| 227 |
+
| `Qwen/Qwen3-8B` BF16 | 4090 | `0.00811` | `9.77e-6` | `0.0499` | `0.1018` |
|
| 228 |
+
| `Qwen/Qwen3-8B` BF16 | L4 | `0.00904` | `1.23e-5` | `0.0531` | `0.1033` |
|
| 229 |
+
| `Qwen/Qwen3-8B-FP8` | 4090 | `0.0290` | `1.46e-4` | `0.1351` | `0.3123` |
|
| 230 |
+
| `Qwen/Qwen3-8B-FP8` | L4 | `0.0273` | `1.34e-4` | `0.1362` | `0.3065` |
|
| 231 |
+
| `Qwen/Qwen3-8B-AWQ` | 4090 | `0.0800` | `6.40e-4` | `0.3886` | `1.1339` |
|
| 232 |
+
| `Qwen/Qwen3-8B-AWQ` | L4 | `0.0799` | `6.59e-4` | `0.3895` | `1.1358` |
|
| 233 |
+
| `Qwen2.5/Qwen2-7B` BF16 | 4090 | `0.57-0.61` | `0.041` | `2.89-3.08` | `5.83-6.32` |
|
| 234 |
+
| `Qwen2.5/Qwen2-7B` BF16 | L4 | `0.57-0.61` | `0.041` | `2.89-3.09` | `5.82-6.30` |
|
| 235 |
+
|
| 236 |
+
The verifier difference between L4 and 4090 is far smaller than the model/quantization difference: genuine Qwen3-8B BF16 still concentrates at `mean_abs ~= 0.008-0.009`, `p95 ~= 0.05`, `p99 ~= 0.10`; the gap of FP8/AWQ/Qwen2.*-7B from BF16 remains clearly visible.
|
| 237 |
+
|
| 238 |
+
### Single-sample three-state results
|
| 239 |
+
|
| 240 |
+
| verifier model | verifier GPU | pass | reject | inconclusive |
|
| 241 |
+
|---|---:|---:|---:|---:|
|
| 242 |
+
| `Qwen/Qwen3-8B` BF16 | 4090 | `89.625%` | `0.750%` | `9.625%` |
|
| 243 |
+
| `Qwen/Qwen3-8B` BF16 | L4 | `86.500%` | `2.000%` | `11.500%` |
|
| 244 |
+
| `Qwen/Qwen3-8B-FP8` | 4090 | `1.000%` | `90.167%` | `8.833%` |
|
| 245 |
+
| `Qwen/Qwen3-8B-FP8` | L4 | `1.500%` | `89.667%` | `8.833%` |
|
| 246 |
+
| `Qwen/Qwen3-8B-AWQ` | 4090 | `0%` | `100%` | `0%` |
|
| 247 |
+
| `Qwen/Qwen3-8B-AWQ` | L4 | `0%` | `100%` | `0%` |
|
| 248 |
+
| `Qwen2.*-7B` | 4090 | `0%` | `100%` | `0%` |
|
| 249 |
+
| `Qwen2.*-7B` | L4 | `0%` | `100%` | `0%` |
|
| 250 |
+
|
| 251 |
+
After merging 4090 and L4, the average single-sample result for `Qwen/Qwen3-8B` BF16 is about `88.286% pass / 1.286% reject / 10.429% inconclusive`; for FP8 it is about `1.250% pass / 89.917% reject / 8.833% inconclusive`.
|
| 252 |
+
|
| 253 |
+
A single-sample conclusion should be interpreted as a statistical fingerprint-match result, not as a complete identity-attestation proof. High-confidence identity attestation still calls for aggregating multiple probes.
|
experiments/logprobs/reports/moe_replicates_bf16_vs_fp8_spike_testing_report.md
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MoE Worker-Verifier Spike Hypothesis Testing Report
|
| 2 |
+
|
| 3 |
+
This report is compiled from two sets of results under `experiments/logprobs/data/qwen3.6-35b-a3b/`:
|
| 4 |
+
|
| 5 |
+
- BF16 same-model verifier: 1 original BF16 result (`...-bf16`) plus 3 replicate runs
|
| 6 |
+
(`...-bf16_0001` / `_0002` / `_0003`), for a total of 4 BF16 baselines.
|
| 7 |
+
- FP8 verifier result: `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-fp8/`
|
| 8 |
+
|
| 9 |
+
The goal is to test the following hypotheses:
|
| 10 |
+
|
| 11 |
+
```text
|
| 12 |
+
For MoE models, the diff between same-model BF16 worker decode and BF16 verifier prefill
|
| 13 |
+
mainly manifests as sparse, position-sensitive token-level spikes;
|
| 14 |
+
|
| 15 |
+
while the diff between the FP8 verifier and the BF16 worker, beyond inheriting these
|
| 16 |
+
sensitive token spikes, also exhibits a more pervasive right shift in the distribution.
|
| 17 |
+
|
| 18 |
+
Therefore, replacing the single-token decision with window-level robust aggregation is reasonable.
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## 1. Summary of Conclusions
|
| 22 |
+
|
| 23 |
+
The current experimental results support the hypotheses above. Once the original BF16 result is included, there are 4 BF16 baselines in total, making the conclusions more robust than the three-replicate version.
|
| 24 |
+
|
| 25 |
+
1. **The large diffs in the BF16 same-model baseline are primarily token-level spikes.**
|
| 26 |
+
- Across the four BF16 verifier runs, the `abs_diff > 1` token rate is only `0.53% - 0.62%`.
|
| 27 |
+
- Of these spikes, `92.8% - 94.3%` are isolated single-point runs.
|
| 28 |
+
- Using the pooled BF16 `p999 = 11.123` as the extreme-spike threshold, `96.9% - 100%` of the spike runs across the four experiments are single points.
|
| 29 |
+
|
| 30 |
+
2. **These spikes are not pure random noise but token/context sensitive points.**
|
| 31 |
+
- Among the `abs_diff > 1` spike locations, `65.1%` appear in at least 2 BF16 runs, `43.6%` in at least 3 runs, and `21.5%` in all 4 runs.
|
| 32 |
+
- Among the `p999`-level extreme spikes, `56.1%` still appear in at least 2 runs.
|
| 33 |
+
- This indicates that spikes behave more like tokens that are sensitive under the MoE routing / decode-prefill path, rather than run noise at completely random positions.
|
| 34 |
+
|
| 35 |
+
3. **The window median substantially suppresses the BF16 baseline tail.**
|
| 36 |
+
- The BF16 token p99 is roughly `0.366 - 0.433`.
|
| 37 |
+
- The `window=5 median` p99 drops to `0.097 - 0.113`.
|
| 38 |
+
- The `window=16 median` p99 drops further to `0.044 - 0.054`.
|
| 39 |
+
- This matches the expectation that "single-point spikes are filtered out by the window median".
|
| 40 |
+
|
| 41 |
+
4. **FP8 also has spikes, but it is not pure spike; it also exhibits a more pervasive right shift.**
|
| 42 |
+
- Using the BF16 pooled p99 `0.408` as the threshold, the FP8 token rate is `2.00%`, clearly higher than the BF16 baseline's `0.89% - 1.07%`.
|
| 43 |
+
- Using the BF16 window median p99 as the threshold, the FP8 bad-window rate remains clearly higher than BF16 as the window grows:
|
| 44 |
+
- `window=5`: FP8 `3.41%` vs BF16 baseline about `1%`
|
| 45 |
+
- `window=16`: FP8 `4.66%` vs BF16 baseline about `1%`
|
| 46 |
+
- `window=32`: FP8 `5.07%` vs BF16 baseline about `1%`
|
| 47 |
+
|
| 48 |
+
5. **The paired comparison further supports that FP8 is a pervasive shift.**
|
| 49 |
+
- At the same sample/depth, the fraction where `FP8 diff > BF16 4-run mean diff` is `63.9%`.
|
| 50 |
+
- The larger the window, the higher this fraction:
|
| 51 |
+
- `window=5`: `68.7%`
|
| 52 |
+
- `window=16`: `78.8%`
|
| 53 |
+
- `window=32`: `84.8%`
|
| 54 |
+
- If FP8 were only random spikes, this monotonic strengthening should not appear as the window grows.
|
| 55 |
+
|
| 56 |
+
One-sentence conclusion:
|
| 57 |
+
|
| 58 |
+
```text
|
| 59 |
+
The large tail of the BF16 same-model diff mainly comes from sparse, position-sensitive token spikes;
|
| 60 |
+
FP8 inherits these sensitive spikes while superimposing a more pervasive quantization distribution shift.
|
| 61 |
+
Therefore, window-level median / bad-window-rate is a more reasonable verifier decision method than single-token diff.
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## 2. Data and Experimental Subjects
|
| 65 |
+
|
| 66 |
+
### 2.1 BF16 Baseline Runs
|
| 67 |
+
|
| 68 |
+
Four BF16 same-model verifier results:
|
| 69 |
+
|
| 70 |
+
All result directories are under `experiments/logprobs/data/qwen3.6-35b-a3b/`:
|
| 71 |
+
|
| 72 |
+
| run | result dir |
|
| 73 |
+
|---|---|
|
| 74 |
+
| `0000_results` | `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16/` |
|
| 75 |
+
| `0001` | `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16_0001/` |
|
| 76 |
+
| `0002` | `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16_0002/` |
|
| 77 |
+
| `0003` | `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16_0003/` |
|
| 78 |
+
|
| 79 |
+
Shared configuration:
|
| 80 |
+
|
| 81 |
+
| item | value |
|
| 82 |
+
|---|---|
|
| 83 |
+
| worker evidence | `worker_evidence.6000ws_long_first.jsonl` |
|
| 84 |
+
| worker model | `Qwen/Qwen3.6-35B-A3B` |
|
| 85 |
+
| verifier model | `Qwen/Qwen3.6-35B-A3B` |
|
| 86 |
+
| quantization | `bf16` |
|
| 87 |
+
| dtype | `bfloat16` |
|
| 88 |
+
| gpu | `6000ws` |
|
| 89 |
+
| backend | `vLLM 0.24.0` |
|
| 90 |
+
| prompt_logprobs / max_logprobs | `32 / 32` |
|
| 91 |
+
| batch size | `1` |
|
| 92 |
+
| depth rows | `31411` per run |
|
| 93 |
+
|
| 94 |
+
### 2.2 FP8 Result
|
| 95 |
+
|
| 96 |
+
FP8 verifier result:
|
| 97 |
+
|
| 98 |
+
```text
|
| 99 |
+
experiments/logprobs/data/qwen3.6-35b-a3b/6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-fp8/
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
Configuration:
|
| 103 |
+
|
| 104 |
+
| item | value |
|
| 105 |
+
|---|---|
|
| 106 |
+
| worker model | `Qwen/Qwen3.6-35B-A3B` BF16 |
|
| 107 |
+
| verifier model | `Qwen/Qwen3.6-35B-A3B-FP8` |
|
| 108 |
+
| verifier quantization | `fp8` |
|
| 109 |
+
| dtype | `auto` |
|
| 110 |
+
| gpu | `6000ws` |
|
| 111 |
+
| prompt_logprobs / max_logprobs | `32 / 32` |
|
| 112 |
+
| depth rows | `31411` |
|
| 113 |
+
|
| 114 |
+
## 3. Overall BF16 Baseline Distribution
|
| 115 |
+
|
| 116 |
+
Overall metrics for the four BF16 baselines:
|
| 117 |
+
|
| 118 |
+
| run | mean | p50 | p95 | p99 | p999 | max |
|
| 119 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 120 |
+
| `0000_results` | 0.0591 | 0.000606 | 0.1432 | 0.4331 | 11.1895 | 24.1029 |
|
| 121 |
+
| `0001` | 0.0540 | 0.000525 | 0.1196 | 0.3665 | 10.1542 | 25.4778 |
|
| 122 |
+
| `0002` | 0.0572 | 0.000568 | 0.1362 | 0.4208 | 10.5622 | 25.5559 |
|
| 123 |
+
| `0003` | 0.0622 | 0.000619 | 0.1423 | 0.4181 | 11.8944 | 24.1498 |
|
| 124 |
+
|
| 125 |
+
Pooled BF16 baseline thresholds:
|
| 126 |
+
|
| 127 |
+
| threshold | value |
|
| 128 |
+
|---|---:|
|
| 129 |
+
| pooled p95 | 0.1350 |
|
| 130 |
+
| pooled p99 | 0.4082 |
|
| 131 |
+
| pooled p999 | 11.1230 |
|
| 132 |
+
|
| 133 |
+
As can be seen, the bulk of the BF16 baseline error is very small, but the tail is very long:
|
| 134 |
+
|
| 135 |
+
```text
|
| 136 |
+
p50 ~5e-4
|
| 137 |
+
p99 ~0.4
|
| 138 |
+
p999 ~11
|
| 139 |
+
max ~24-26
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
This already suggests that the large diffs in the same-model baseline are not an overall drift, but rather extreme amplification at a small number of tokens.
|
| 143 |
+
|
| 144 |
+
## 4. BF16 Spike Morphology Analysis
|
| 145 |
+
|
| 146 |
+
### 4.1 Using abs_diff > 1
|
| 147 |
+
|
| 148 |
+
| run | spike count | token rate | sample any | run length=1 | run >=2 | spike tokens in run>=2 | max run |
|
| 149 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 150 |
+
| `0000_results` | 183 | 0.583% | 38.7% | 92.9% | 7.1% | 13.7% | 3 |
|
| 151 |
+
| `0001` | 166 | 0.528% | 34.3% | 94.3% | 5.7% | 10.8% | 2 |
|
| 152 |
+
| `0002` | 174 | 0.554% | 33.3% | 93.9% | 6.1% | 11.5% | 2 |
|
| 153 |
+
| `0003` | 195 | 0.621% | 38.3% | 92.8% | 7.2% | 14.4% | 3 |
|
| 154 |
+
|
| 155 |
+
Conclusion:
|
| 156 |
+
|
| 157 |
+
```text
|
| 158 |
+
Tokens with abs_diff > 1 are rare, and the vast majority are isolated tokens.
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
### 4.2 Using pooled BF16 p99
|
| 162 |
+
|
| 163 |
+
Threshold:
|
| 164 |
+
|
| 165 |
+
```text
|
| 166 |
+
abs_diff > 0.408211
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
| run | spike count | token rate | sample any | run length=1 | run >=2 | spike tokens in run>=2 | max run |
|
| 170 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 171 |
+
| `0000_results` | 337 | 1.073% | 56.0% | 90.2% | 9.8% | 18.4% | 3 |
|
| 172 |
+
| `0001` | 279 | 0.888% | 46.0% | 91.9% | 8.1% | 15.1% | 2 |
|
| 173 |
+
| `0002` | 320 | 1.019% | 50.3% | 90.7% | 9.3% | 17.8% | 3 |
|
| 174 |
+
| `0003` | 321 | 1.022% | 52.0% | 90.3% | 9.7% | 18.7% | 3 |
|
| 175 |
+
|
| 176 |
+
Conclusion:
|
| 177 |
+
|
| 178 |
+
```text
|
| 179 |
+
When defining spikes by the p99 threshold, the four BF16 baselines stabilize at ~1% token rate;
|
| 180 |
+
~90% or more of the spike runs are still single points.
|
| 181 |
+
```
|
| 182 |
+
|
| 183 |
+
### 4.3 Using pooled BF16 p999
|
| 184 |
+
|
| 185 |
+
Threshold:
|
| 186 |
+
|
| 187 |
+
```text
|
| 188 |
+
abs_diff > 11.123
|
| 189 |
+
```
|
| 190 |
+
|
| 191 |
+
| run | spike count | token rate | sample any | run length=1 | run >=2 | max run |
|
| 192 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 193 |
+
| `0000_results` | 33 | 0.105% | 9.3% | 96.9% | 3.1% | 2 |
|
| 194 |
+
| `0001` | 27 | 0.086% | 8.3% | 100.0% | 0.0% | 1 |
|
| 195 |
+
| `0002` | 30 | 0.096% | 9.3% | 100.0% | 0.0% | 1 |
|
| 196 |
+
| `0003` | 36 | 0.115% | 9.3% | 97.1% | 2.9% | 3 |
|
| 197 |
+
|
| 198 |
+
Conclusion:
|
| 199 |
+
|
| 200 |
+
```text
|
| 201 |
+
The p999-level extreme diffs are almost entirely isolated token spikes.
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
This is very important for the window median: as long as fewer than half of the tokens within a window spike, the median will not be dominated by these extreme values.
|
| 205 |
+
|
| 206 |
+
## 5. Whether BF16 Spike Locations Are Stable
|
| 207 |
+
|
| 208 |
+
If spikes were pure random run noise, the spike locations across different runs should be highly unstable. The actual results show that a substantial fraction of spike locations recur.
|
| 209 |
+
|
| 210 |
+
Here `(sample_id, depth)` is treated as the spike location.
|
| 211 |
+
|
| 212 |
+
### 5.1 Location Overlap for abs_diff > 1
|
| 213 |
+
|
| 214 |
+
Distribution of spike location occurrence counts:
|
| 215 |
+
|
| 216 |
+
| BF16 run count | locations |
|
| 217 |
+
|---|---:|
|
| 218 |
+
| 1 | 109 |
|
| 219 |
+
| 2 | 67 |
|
| 220 |
+
| 3 | 69 |
|
| 221 |
+
| 4 | 67 |
|
| 222 |
+
|
| 223 |
+
In other words:
|
| 224 |
+
|
| 225 |
+
```text
|
| 226 |
+
65.1% of spike locations appear in at least 2 runs;
|
| 227 |
+
43.6% of spike locations appear in at least 3 runs;
|
| 228 |
+
21.5% of spike locations appear in all 4 BF16 baselines.
|
| 229 |
+
```
|
| 230 |
+
|
| 231 |
+
### 5.2 Location Overlap for pooled p999 Extreme Spikes
|
| 232 |
+
|
| 233 |
+
Occurrence counts of extreme spike locations:
|
| 234 |
+
|
| 235 |
+
| BF16 run count | locations |
|
| 236 |
+
|---|---:|
|
| 237 |
+
| 1 | 29 |
|
| 238 |
+
| 2 | 19 |
|
| 239 |
+
| 3 | 13 |
|
| 240 |
+
| 4 | 5 |
|
| 241 |
+
|
| 242 |
+
In other words:
|
| 243 |
+
|
| 244 |
+
```text
|
| 245 |
+
56.1% of extreme spike locations appear in at least 2 runs;
|
| 246 |
+
27.3% of extreme spike locations appear in at least 3 runs;
|
| 247 |
+
7.6% of extreme spike locations appear in all 4 BF16 baselines.
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
### 5.3 Examples of Stable High-Spike Locations
|
| 251 |
+
|
| 252 |
+
The following locations repeatedly exhibit large diffs across all 4 BF16 baselines:
|
| 253 |
+
|
| 254 |
+
| sample | depth | run count | mean diff | max diff |
|
| 255 |
+
|---|---:|---:|---:|---:|
|
| 256 |
+
| `ef63ae0b76a298deb773` | 13 | 4 | 22.65 | 25.56 |
|
| 257 |
+
| `aa2d2f1274b0d99eee0e` | 7 | 4 | 21.92 | 23.29 |
|
| 258 |
+
| `21e9f9d...` | 6 | 4 | 18.40 | 24.15 |
|
| 259 |
+
| `039de85a378ae7082fd2` | 8 | 4 | 18.34 | 18.94 |
|
| 260 |
+
| `3d4f88e2f300c1aa21b8` | 8 | 4 | 16.80 | 18.26 |
|
| 261 |
+
| `5ade7d...` | 7 | 4 | 16.17 | 21.20 |
|
| 262 |
+
| `23cb4621d0cc79754f3c` | 5 | 4 | 15.58 | 16.36 |
|
| 263 |
+
| `ecdb9497228e5a267c55` | 9 | 4 | 13.76 | 15.12 |
|
| 264 |
+
|
| 265 |
+
Interpretation:
|
| 266 |
+
|
| 267 |
+
```text
|
| 268 |
+
These spikes are not randomly scattered points, but specific sample/depth locations sensitive to the decode-prefill path.
|
| 269 |
+
For MoE models, this matches the expectation of tokens sensitive to routing boundaries / expert selection.
|
| 270 |
+
```
|
| 271 |
+
|
| 272 |
+
## 6. Suppression of the BF16 Tail by the Window Median
|
| 273 |
+
|
| 274 |
+
| run | token p99 | window=5 median p99 | window=16 median p99 | token max | window=5 max | window=16 max |
|
| 275 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 276 |
+
| `0000_results` | 0.4331 | 0.1101 | 0.0513 | 24.1029 | 1.9280 | 0.1561 |
|
| 277 |
+
| `0001` | 0.3665 | 0.0972 | 0.0437 | 25.4778 | 2.5547 | 0.1618 |
|
| 278 |
+
| `0002` | 0.4208 | 0.1131 | 0.0540 | 25.5559 | 2.2055 | 0.1050 |
|
| 279 |
+
| `0003` | 0.4181 | 0.1124 | 0.0537 | 24.1498 | 14.1659 | 0.1185 |
|
| 280 |
+
|
| 281 |
+
Conclusion:
|
| 282 |
+
|
| 283 |
+
```text
|
| 284 |
+
window=5 median can already significantly reduce the p99 tail of BF16 same-model;
|
| 285 |
+
window=16 median further compresses p99 to ~0.05.
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
The `window=5 max = 14.1659` for `0003` indicates there is still a local segment within a short window where most tokens are anomalous, but the `window=16 max = 0.1185` shows that such a local segment is not long.
|
| 289 |
+
|
| 290 |
+
## 7. FP8 Overall and Spike Analysis
|
| 291 |
+
|
| 292 |
+
FP8 verifier overall metrics:
|
| 293 |
+
|
| 294 |
+
| metric | BF16 `0000_results` | FP8 |
|
| 295 |
+
|---|---:|---:|
|
| 296 |
+
| mean | 0.0591 | 0.0848 |
|
| 297 |
+
| p50 | 0.000606 | 0.001088 |
|
| 298 |
+
| p95 | 0.1432 | 0.2278 |
|
| 299 |
+
| p99 | 0.4331 | 0.6729 |
|
| 300 |
+
| p999 | 11.1895 | 12.6798 |
|
| 301 |
+
| max | 24.1029 | 27.5559 |
|
| 302 |
+
|
| 303 |
+
Both the bulk and the tail of FP8 are higher than the BF16 original baseline.
|
| 304 |
+
|
| 305 |
+
### 7.1 FP8 Using BF16 pooled thresholds
|
| 306 |
+
|
| 307 |
+
| threshold | value | FP8 spike count | FP8 token rate | FP8 sample any | FP8 run length=1 | FP8 max run |
|
| 308 |
+
|---|---:|---:|---:|---:|---:|---:|
|
| 309 |
+
| BF16 pooled p95 | 0.1350 | 3105 | 9.89% | 94.7% | 82.7% | 5 |
|
| 310 |
+
| BF16 pooled p99 | 0.4082 | 628 | 2.00% | 75.3% | 92.1% | 3 |
|
| 311 |
+
| BF16 pooled p999 | 11.1230 | 46 | 0.146% | 13.3% | 97.8% | 2 |
|
| 312 |
+
| abs > 1 | 1.0 | 229 | 0.729% | 41.3% | 92.5% | 3 |
|
| 313 |
+
|
| 314 |
+
Comparison with the BF16 baseline:
|
| 315 |
+
|
| 316 |
+
| threshold | BF16 token rate | FP8 token rate |
|
| 317 |
+
|---|---:|---:|
|
| 318 |
+
| BF16 pooled p95 | 4.17% - 5.39% | 9.89% |
|
| 319 |
+
| BF16 pooled p99 | 0.89% - 1.07% | 2.00% |
|
| 320 |
+
| abs > 1 | 0.53% - 0.62% | 0.729% |
|
| 321 |
+
| BF16 pooled p999 | 0.086% - 0.115% | 0.146% |
|
| 322 |
+
|
| 323 |
+
Conclusion:
|
| 324 |
+
|
| 325 |
+
```text
|
| 326 |
+
The extreme tail of FP8 is still mainly spikes;
|
| 327 |
+
but the number of tokens exceeding the BF16 baseline envelope is clearly larger.
|
| 328 |
+
```
|
| 329 |
+
|
| 330 |
+
### 7.2 FP8 Using Its Own thresholds
|
| 331 |
+
|
| 332 |
+
| threshold | value | token rate | run length=1 | max run |
|
| 333 |
+
|---|---:|---:|---:|---:|
|
| 334 |
+
| FP8 p95 | 0.2278 | 5.00% | 88.8% | 4 |
|
| 335 |
+
| FP8 p99 | 0.6729 | 1.00% | 93.2% | 3 |
|
| 336 |
+
| FP8 p999 | 12.6798 | 0.102% | 96.8% | 2 |
|
| 337 |
+
|
| 338 |
+
Conclusion:
|
| 339 |
+
|
| 340 |
+
```text
|
| 341 |
+
As for FP8's own extreme tail, it also exhibits a spike-like morphology.
|
| 342 |
+
```
|
| 343 |
+
|
| 344 |
+
This indicates that FP8 is not a completely smooth distribution shift; it simultaneously contains:
|
| 345 |
+
|
| 346 |
+
1. Spikes at MoE/decode-prefill sensitive tokens;
|
| 347 |
+
2. A more pervasive rightward diff shift introduced by FP8 quantization.
|
| 348 |
+
|
| 349 |
+
## 8. FP8 Window-Level Separation
|
| 350 |
+
|
| 351 |
+
### 8.1 Window p99
|
| 352 |
+
|
| 353 |
+
| variant | token p99 | window=5 p99 | window=16 p99 | window=32 p99 |
|
| 354 |
+
|---|---:|---:|---:|---:|
|
| 355 |
+
| BF16 `0000_results` | 0.4331 | 0.1101 | 0.0513 | 0.0376 |
|
| 356 |
+
| BF16 `0001` | 0.3665 | 0.0972 | 0.0437 | 0.0312 |
|
| 357 |
+
| BF16 `0002` | 0.4208 | 0.1131 | 0.0540 | 0.0378 |
|
| 358 |
+
| BF16 `0003` | 0.4181 | 0.1124 | 0.0537 | 0.0384 |
|
| 359 |
+
| FP8 | 0.6729 | 0.1685 | 0.0802 | 0.0567 |
|
| 360 |
+
|
| 361 |
+
FP8 is higher than the BF16 baseline at both the token level and the window level.
|
| 362 |
+
|
| 363 |
+
### 8.2 Bad Window Rate
|
| 364 |
+
|
| 365 |
+
Here the BF16 pooled window median p99 is used as the threshold, so the BF16 baseline bad window rate is expected to be about `1%`.
|
| 366 |
+
|
| 367 |
+
| window | BF16 pooled window p99 threshold | BF16 `0000_results` bad rate | BF16 4-run bad-rate range | FP8 bad rate |
|
| 368 |
+
|---|---:|---:|---:|---:|
|
| 369 |
+
| 3 | 0.1600 | 1.08% | 0.79% - 1.08% | 2.99% |
|
| 370 |
+
| 5 | 0.1085 | 1.02% | 0.78% - 1.13% | 3.41% |
|
| 371 |
+
| 16 | 0.0513 | 1.00% | 0.65% - 1.17% | 4.66% |
|
| 372 |
+
| 32 | 0.0365 | 1.21% | 0.50% - 1.22% | 5.07% |
|
| 373 |
+
|
| 374 |
+
Conclusion:
|
| 375 |
+
|
| 376 |
+
```text
|
| 377 |
+
The larger the window, the more BF16 spikes are suppressed;
|
| 378 |
+
but the FP8 bad window rate remains in the 3%-5% range, and is clearly higher relative to BF16.
|
| 379 |
+
```
|
| 380 |
+
|
| 381 |
+
This is precisely the evidence that "FP8 exhibits a more pervasive shift".
|
| 382 |
+
|
| 383 |
+
## 9. Paired Comparison of FP8 and BF16
|
| 384 |
+
|
| 385 |
+
Directly comparing the same sample/depth:
|
| 386 |
+
|
| 387 |
+
| comparison | FP8 > BF16 rate | delta mean | delta p90 | delta p95 | delta p99 |
|
| 388 |
+
|---|---:|---:|---:|---:|---:|
|
| 389 |
+
| token vs BF16 `0000_results` | 64.0% | 0.0258 | 0.0670 | 0.1405 | 0.4296 |
|
| 390 |
+
| token vs BF16 4-run mean | 63.9% | 0.0267 | 0.0662 | 0.1364 | 0.4180 |
|
| 391 |
+
|
| 392 |
+
Window-level paired comparison against BF16 4-run mean:
|
| 393 |
+
|
| 394 |
+
| window | FP8 > BF16 rate | delta mean | delta p90 | delta p99 |
|
| 395 |
+
|---|---:|---:|---:|---:|
|
| 396 |
+
| 3 | 66.1% | 0.0117 | 0.0376 | 0.1843 |
|
| 397 |
+
| 5 | 68.7% | 0.00677 | 0.0287 | 0.1193 |
|
| 398 |
+
| 16 | 78.8% | 0.00418 | 0.0162 | 0.0490 |
|
| 399 |
+
| 32 | 84.8% | 0.00312 | 0.0116 | 0.0315 |
|
| 400 |
+
|
| 401 |
+
This result is highly significant:
|
| 402 |
+
|
| 403 |
+
```text
|
| 404 |
+
If FP8 were only random spikes, the fraction of FP8 > BF16 should not keep rising as the window grows;
|
| 405 |
+
in reality, the larger the window, the higher this fraction, indicating that FP8's shift is more pervasive.
|
| 406 |
+
```
|
| 407 |
+
|
| 408 |
+
## 10. The Relationship Between FP8 Spikes and BF16 Sensitive Locations
|
| 409 |
+
|
| 410 |
+
Many of the FP8 spikes occur at locations where the BF16 baseline already exhibits spikes.
|
| 411 |
+
|
| 412 |
+
| threshold | FP8 spikes | overlap with BF16 >=1 run | overlap with BF16 >=2 runs | overlap with BF16 >=3 runs | overlap with BF16 all 4 runs |
|
| 413 |
+
|---|---:|---:|---:|---:|---:|
|
| 414 |
+
| abs > 1 | 229 | 72.1% | 55.0% | 41.0% | 24.9% |
|
| 415 |
+
| BF16 pooled p99 | 628 | 48.6% | 37.3% | 27.2% | 17.8% |
|
| 416 |
+
| BF16 pooled p999 | 46 | 54.3% | 39.1% | 28.3% | 8.7% |
|
| 417 |
+
|
| 418 |
+
Interpretation:
|
| 419 |
+
|
| 420 |
+
```text
|
| 421 |
+
Many of FP8's large spikes fall at locations where BF16 same-model is already sensitive.
|
| 422 |
+
This indicates that MoE/decode-prefill sensitive tokens are still one of the main spike sources.
|
| 423 |
+
|
| 424 |
+
But FP8 also has a large number of additional locations exceeding the BF16 baseline threshold,
|
| 425 |
+
and its window-level metrics remain consistently higher than BF16, so FP8 is not purely reusing BF16 spikes.
|
| 426 |
+
```
|
| 427 |
+
|
| 428 |
+
## 11. Final Determination
|
| 429 |
+
|
| 430 |
+
The current experiments support the following judgments:
|
| 431 |
+
|
| 432 |
+
### 11.1 Hypothesis 1 Holds
|
| 433 |
+
|
| 434 |
+
```text
|
| 435 |
+
The large diffs of BF16 same-model worker decode vs verifier prefill are mainly sparse token-level spikes.
|
| 436 |
+
```
|
| 437 |
+
|
| 438 |
+
Evidence:
|
| 439 |
+
|
| 440 |
+
- Low token rate;
|
| 441 |
+
- The vast majority of run lengths are 1;
|
| 442 |
+
- p999 extreme spikes are almost entirely isolated points;
|
| 443 |
+
- The window median substantially suppresses the BF16 tail.
|
| 444 |
+
|
| 445 |
+
### 11.2 Hypothesis 2 Holds
|
| 446 |
+
|
| 447 |
+
```text
|
| 448 |
+
These spikes are not pure random noise, but are sensitive to specific token/context.
|
| 449 |
+
```
|
| 450 |
+
|
| 451 |
+
Evidence:
|
| 452 |
+
|
| 453 |
+
- Spikes at the same sample/depth show clear overlap across the 4 BF16 runs;
|
| 454 |
+
- Multiple extreme spike locations recur across the 4 BF16 runs;
|
| 455 |
+
- This matches the expectation of tokens sensitive to MoE routing boundaries or the decode-prefill path.
|
| 456 |
+
|
| 457 |
+
### 11.3 Hypothesis 3 Holds
|
| 458 |
+
|
| 459 |
+
```text
|
| 460 |
+
The FP8 verifier both inherits the MoE/decode-prefill sensitive spikes and exhibits a more pervasive distribution right shift.
|
| 461 |
+
```
|
| 462 |
+
|
| 463 |
+
Evidence:
|
| 464 |
+
|
| 465 |
+
- The extreme tail of FP8 is still spike-like;
|
| 466 |
+
- But FP8 has more tokens exceeding the BF16 baseline threshold;
|
| 467 |
+
- The FP8 window-level bad rate is clearly higher than the BF16 baseline;
|
| 468 |
+
- In the paired window comparison, the fraction of `FP8 > BF16` rises as the window grows.
|
| 469 |
+
|
| 470 |
+
### 11.4 Methodological Conclusion
|
| 471 |
+
|
| 472 |
+
Therefore, for the current MoE verifier scenario, we recommend against using the single-token `abs_logprob_diff` as the primary decision metric. The most reasonable minimal scheme is:
|
| 473 |
+
|
| 474 |
+
```text
|
| 475 |
+
metric = window=5 median(abs_logprob_diff)
|
| 476 |
+
threshold = window=5 median p99 of the BF16 same-model baseline
|
| 477 |
+
score = bad_window_rate
|
| 478 |
+
reject if score is clearly higher than the BF16 baseline envelope
|
| 479 |
+
```
|
| 480 |
+
|
| 481 |
+
Under the current data, the corresponding values are:
|
| 482 |
+
|
| 483 |
+
```text
|
| 484 |
+
BF16 pooled window=5 median p99 threshold ≈ 0.1085
|
| 485 |
+
BF16 4-run bad-window-rate range ≈ 0.78% - 1.13%
|
| 486 |
+
FP8 bad-window rate ≈ 3.41%
|
| 487 |
+
```
|
| 488 |
+
|
| 489 |
+
If greater robustness is needed, one can additionally monitor:
|
| 490 |
+
|
| 491 |
+
```text
|
| 492 |
+
window=16 median bad-window rate
|
| 493 |
+
window=32 median bad-window rate
|
| 494 |
+
```
|
| 495 |
+
|
| 496 |
+
But for the first version of the decision rule, using only `window=5 median + bad_window_rate` is already sufficient to express the core idea.
|
| 497 |
+
|
| 498 |
+
## 12. One-Sentence Summary
|
| 499 |
+
|
| 500 |
+
```text
|
| 501 |
+
The four BF16 baselines prove that the large diffs of same-model are mainly sparse, position-sensitive token spikes;
|
| 502 |
+
FP8 proves that a differently-quantized verifier still has a more pervasive window-level shift beyond these spikes.
|
| 503 |
+
Therefore, the window-level verifier h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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Qwen3.6-35B-A3B 6000ws Worker-Verifier Logprob Comparison Experiment Report
|
| 2 |
+
|
| 3 |
+
This report is compiled separately from the Qwen3.6-35B-A3B verifier results under the
|
| 4 |
+
`experiments/logprobs/data/qwen3.6-35b-a3b/` directory. What the repository provides is the
|
| 5 |
+
verifier recomputation output (CSV/summary/metadata); the raw worker evidence `.jsonl` and its
|
| 6 |
+
data package are intermediate artifacts and are not shipped with the repository.
|
| 7 |
+
|
| 8 |
+
- verifier results directory: `experiments/logprobs/data/qwen3.6-35b-a3b/`
|
| 9 |
+
- BF16 verifier: `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16`
|
| 10 |
+
- FP8 verifier: `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-fp8`
|
| 11 |
+
- worker evidence (not provided): `worker_evidence.6000ws_long_first.jsonl`
|
| 12 |
+
|
| 13 |
+
## 1. Summary of Conclusions
|
| 14 |
+
|
| 15 |
+
The core question of this round of experiments is: on the 6000ws machine, can the
|
| 16 |
+
`input + output + logprob trace` generated by a `Qwen/Qwen3.6-35B-A3B` BF16 worker be stably
|
| 17 |
+
replayed by a same-model BF16 verifier; and does the corresponding FP8-quantized verifier exhibit
|
| 18 |
+
a distinguishable logprob fingerprint difference.
|
| 19 |
+
|
| 20 |
+
The current data supports the following conclusions:
|
| 21 |
+
|
| 22 |
+
1. **The same-model BF16 verifier can serve as the baseline for this round of Qwen3.6-35B-A3B, but the baseline itself has a pronounced long-tail outlier.**
|
| 23 |
+
- `BF16 worker -> BF16 verifier`: `abs_logprob_diff mean = 0.0591`, `p50 = 0.000606`, `p95 = 0.1432`, `p99 = 0.4331`.
|
| 24 |
+
- However, the same-model baseline has `p999 = 11.1895` and `max = 24.1029`, indicating a small number of very large token-level drifts.
|
| 25 |
+
- Therefore, in this experiment the single-token `max` or extreme tail should not be treated as the primary decision criterion.
|
| 26 |
+
|
| 27 |
+
2. **The FP8 verifier exhibits a systematic offset relative to the BF16 verifier, and is consistently worse across the bulk-to-p99 range.**
|
| 28 |
+
- `BF16 worker -> FP8 verifier`: `abs_logprob_diff mean = 0.0848`, `p50 = 0.001088`, `p95 = 0.2278`, `p99 = 0.6729`.
|
| 29 |
+
- Relative to the BF16 baseline, FP8's `mean/p50/p90/p95/p99` are approximately `1.44x/1.80x/1.65x/1.59x/1.55x`.
|
| 30 |
+
- `rank_delta_rate` rises from `2.51%` to `3.64%`, roughly `1.45x`.
|
| 31 |
+
|
| 32 |
+
3. **The main evidence for FP8 is not a larger max, but a wider overall distribution and worse top-k distribution consistency.**
|
| 33 |
+
- `p999` and `max` only increase from `11.1895/24.1029` to `12.6798/27.5559`, a ratio of only `1.13x/1.14x`.
|
| 34 |
+
- But `topk_jaccard_mean` drops from `0.8922` to `0.8449`.
|
| 35 |
+
- `topk_jaccard_p05` drops from `0.7297` to `0.6842`.
|
| 36 |
+
- `union_js_p99` increases from `0.0582` to `0.1165`, roughly `2.00x`.
|
| 37 |
+
|
| 38 |
+
4. **After aggregating by sample, FP8 is also more prone to high-drift samples than the BF16 baseline.**
|
| 39 |
+
- Number of samples with `sample mean_abs_logprob_diff > 0.2`: BF16 `18/300`, FP8 `42/300`.
|
| 40 |
+
- Number of samples with `sample p99_abs_logprob_diff > 0.5`: BF16 `76/300`, FP8 `125/300`.
|
| 41 |
+
- Number of samples with `sample p99_abs_logprob_diff > 5.0`: BF16 `11/300`, FP8 `21/300`.
|
| 42 |
+
- This shows that the FP8 difference is not driven by just one or two extreme tokens, but is visible across more sample windows.
|
| 43 |
+
|
| 44 |
+
5. **The current data does not observe any monotonic error accumulation caused by input length or output depth.**
|
| 45 |
+
- BF16: `corr(input_len, abs_diff) = 0.0350`, `corr(depth, abs_diff) = -0.0543`.
|
| 46 |
+
- FP8: `corr(input_len, abs_diff) = 0.0336`, `corr(depth, abs_diff) = -0.0602`.
|
| 47 |
+
- The bucket results also do not exhibit a simple monotonic trend of "longer is worse" or "deeper is worse".
|
| 48 |
+
|
| 49 |
+
6. **This is still statistical verification, not a single-token proof.**
|
| 50 |
+
- For an MoE model like Qwen3.6-35B-A3B, this round's same-model baseline already shows heavy-tailed outliers.
|
| 51 |
+
- Production decisions should use window-level aggregate metrics, e.g. `mean/p95/p99 abs_logprob_diff + rank_delta_rate + top-k overlap/JS`, rather than a single-token threshold.
|
| 52 |
+
|
| 53 |
+
## 2. What This Experiment Actually Compared
|
| 54 |
+
|
| 55 |
+
### 2.1 Worker Side
|
| 56 |
+
|
| 57 |
+
Worker evidence source (intermediate artifact, not provided with the repository):
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
worker_evidence.6000ws_long_first.jsonl
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
Worker metadata source (intermediate artifact, not provided with the repository):
|
| 64 |
+
|
| 65 |
+
```text
|
| 66 |
+
worker_evidence.6000ws.jsonl.metadata.json
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Worker configuration:
|
| 70 |
+
|
| 71 |
+
| item | value |
|
| 72 |
+
|---|---|
|
| 73 |
+
| model | `Qwen/Qwen3.6-35B-A3B` |
|
| 74 |
+
| quantization | `bf16` |
|
| 75 |
+
| dtype | `bfloat16` |
|
| 76 |
+
| gpu | `6000ws` |
|
| 77 |
+
| backend | `vLLM 0.24.0` |
|
| 78 |
+
| tensor parallel | `1` |
|
| 79 |
+
| batch size | `1` |
|
| 80 |
+
| max new tokens | `128` |
|
| 81 |
+
| logprobs | `32` |
|
| 82 |
+
| max logprobs | `32` |
|
| 83 |
+
| temperature | `0.0` |
|
| 84 |
+
| top_p / top_k | `1.0 / 0` |
|
| 85 |
+
| seed | `0` |
|
| 86 |
+
| tokenizer hash | `45f8cf25137775ed` |
|
| 87 |
+
|
| 88 |
+
The worker's trace mode is:
|
| 89 |
+
|
| 90 |
+
```text
|
| 91 |
+
vllm_decode_generate
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
That is, the worker decodes and generates output normally, and records each output token's selected logprob, selected rank, and top-32 logprobs.
|
| 95 |
+
|
| 96 |
+
### 2.2 Verifier Side
|
| 97 |
+
|
| 98 |
+
The verifier does not re-decode; instead it concatenates the worker's already-recorded `input_ids + output_ids` into a complete token prompt, then lets vLLM perform full-prefill prompt logprobs.
|
| 99 |
+
|
| 100 |
+
The verifier's trace mode is:
|
| 101 |
+
|
| 102 |
+
```text
|
| 103 |
+
vllm_prompt_logprobs_full_prefill
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
The verifier alignment position for each output token is:
|
| 107 |
+
|
| 108 |
+
```text
|
| 109 |
+
prompt_pos = input_token_count + output_depth
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
So all `depth` values in this report denote output token depth:
|
| 113 |
+
|
| 114 |
+
- `depth = 0`: the 1st output token
|
| 115 |
+
- `depth = 1`: the 2nd output token
|
| 116 |
+
- and so on
|
| 117 |
+
|
| 118 |
+
There are two verifiers in this round:
|
| 119 |
+
|
| 120 |
+
| verifier | model | quant | dtype | gpu | batch | gpu mem util | prompt_logprobs | max_logprobs | elapsed s | rows |
|
| 121 |
+
|---|---|---|---|---|---:|---:|---:|---:|---:|---:|
|
| 122 |
+
| BF16 baseline | `Qwen/Qwen3.6-35B-A3B` | `bf16` | `bfloat16` | `6000ws` | 1 | 0.8 | 32 | 32 | 197.7 | 31411 |
|
| 123 |
+
| FP8 quantized | `Qwen/Qwen3.6-35B-A3B-FP8` | `fp8` | `auto` | `6000ws` | 1 | 0.8 | 32 | 32 | 186.7 | 31411 |
|
| 124 |
+
|
| 125 |
+
Both verifiers satisfy:
|
| 126 |
+
|
| 127 |
+
```text
|
| 128 |
+
missing verifier selected logprob = 0
|
| 129 |
+
skipped_too_long = 0
|
| 130 |
+
```
|
| 131 |
+
|
| 132 |
+
This means the verifier found the logprob of the worker's selected token at every output depth.
|
| 133 |
+
|
| 134 |
+
### 2.3 Tokenizer Considerations
|
| 135 |
+
|
| 136 |
+
The BF16 verifier's tokenizer hash in the metadata is:
|
| 137 |
+
|
| 138 |
+
```text
|
| 139 |
+
45f8cf25137775ed
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
The FP8 verifier's tokenizer hash is:
|
| 143 |
+
|
| 144 |
+
```text
|
| 145 |
+
572cd96959d809c1
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
This hash includes the tokenizer's `name_or_path` and other local state, so different model paths may produce different hashes. At actual verifier runtime, the `input_ids + output_ids` already recorded in the worker evidence are used, rather than re-encoding text with the FP8 tokenizer.
|
| 149 |
+
|
| 150 |
+
Therefore the premise of this round's comparison is:
|
| 151 |
+
|
| 152 |
+
```text
|
| 153 |
+
Qwen3.6-35B-A3B and Qwen3.6-35B-A3B-FP8 have compatible token id spaces
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
Under this premise, comparing the selected token logprob and top-k distributions is meaningful.
|
| 157 |
+
|
| 158 |
+
### 2.4 Relationship Between Logprob and Logits
|
| 159 |
+
|
| 160 |
+
What this experiment actually compares is the **logprob** exposed by vLLM, not raw logits.
|
| 161 |
+
|
| 162 |
+
logprob can be understood as the result of applying log-softmax to logits:
|
| 163 |
+
|
| 164 |
+
```text
|
| 165 |
+
logprob(token_i) = log_softmax(logits)[token_i]
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
Therefore the conclusions of this report should be phrased as:
|
| 169 |
+
|
| 170 |
+
```text
|
| 171 |
+
the worker-verifier logprob fingerprint can distinguish the statistical difference between the BF16 verifier and the FP8 verifier
|
| 172 |
+
```
|
| 173 |
+
|
| 174 |
+
rather than:
|
| 175 |
+
|
| 176 |
+
```text
|
| 177 |
+
it has been directly proven that the full distribution of raw logits is completely distinguishable
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
## 3. Dataset and Run Matrix
|
| 181 |
+
|
| 182 |
+
### 3.1 Prompt and Worker Output Data
|
| 183 |
+
|
| 184 |
+
The prompt buckets and categories come from the anchor/sample metadata in the data package. Each input bucket has `50` entries, for a total of `300` prompts.
|
| 185 |
+
|
| 186 |
+
| item | value |
|
| 187 |
+
|---|---:|
|
| 188 |
+
| samples | 300 |
|
| 189 |
+
| input buckets | 32, 128, 512, 2048, 8192, 16384 |
|
| 190 |
+
| samples per bucket | 50 |
|
| 191 |
+
| categories | 10 |
|
| 192 |
+
| samples per category | 30 |
|
| 193 |
+
| input token min | 32 |
|
| 194 |
+
| input token mean | 4748.62 |
|
| 195 |
+
| input token p50 | 1254.5 |
|
| 196 |
+
| input token p90 | 17344 |
|
| 197 |
+
| input token p99 | 17775 |
|
| 198 |
+
| input token max | 17779 |
|
| 199 |
+
| worker output token min | 1 |
|
| 200 |
+
| worker output token mean | 104.70 |
|
| 201 |
+
| worker output token p50 | 128 |
|
| 202 |
+
| worker output token p90 | 128 |
|
| 203 |
+
| worker output token p99 | 128 |
|
| 204 |
+
| worker output token max | 128 |
|
| 205 |
+
| output depth rows | 31411 |
|
| 206 |
+
|
| 207 |
+
Category distribution:
|
| 208 |
+
|
| 209 |
+
| category | samples |
|
| 210 |
+
|---|---:|
|
| 211 |
+
| chat | 30 |
|
| 212 |
+
| code | 30 |
|
| 213 |
+
| json_structured | 30 |
|
| 214 |
+
| logs | 30 |
|
| 215 |
+
| low_margin | 30 |
|
| 216 |
+
| math_numeric | 30 |
|
| 217 |
+
| mixed_language | 30 |
|
| 218 |
+
| needle | 30 |
|
| 219 |
+
| short_qa | 30 |
|
| 220 |
+
| summarization | 30 |
|
| 221 |
+
|
| 222 |
+
In theory, 300 samples would produce at most `300 * 128 = 38400` output depth rows. The actual number is `31411`, because some samples stop early and their output length is shorter than 128.
|
| 223 |
+
|
| 224 |
+
### 3.2 Verifier Run Matrix
|
| 225 |
+
|
| 226 |
+
All verifiers are based on the same `6000ws Qwen3.6-35B-A3B BF16 worker evidence`.
|
| 227 |
+
|
| 228 |
+
| result dir | verifier model | quant | dtype | tokenizer hash | elapsed s |
|
| 229 |
+
|---|---|---|---|---|---:|
|
| 230 |
+
| `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-bf16` | `Qwen/Qwen3.6-35B-A3B` | `bf16` | `bfloat16` | `45f8cf25137775ed` | 197.7 |
|
| 231 |
+
| `6000ws_worker_vs_6000ws_verifier_qwen3.6-35b-a3b-fp8` | `Qwen/Qwen3.6-35B-A3B-FP8` | `fp8` | `auto` | `572cd96959d809c1` | 186.7 |
|
| 232 |
+
|
| 233 |
+
`prompt_logprobs = 32` means: the verifier takes the top logprob information exposed by vLLM at each prompt position. It does not mean "only comparing 32 output tokens", nor "only outputting 32 samples". Every output depth participates in the comparison; only the top-k distribution metrics are limited by top-32.
|
| 234 |
+
|
| 235 |
+
## 4. Metric Definitions
|
| 236 |
+
|
| 237 |
+
### 4.1 abs_logprob_diff
|
| 238 |
+
|
| 239 |
+
The core scalar metric:
|
| 240 |
+
|
| 241 |
+
```text
|
| 242 |
+
abs_logprob_diff = abs(worker_selected_logprob - verifier_selected_logprob)
|
| 243 |
+
```
|
| 244 |
+
|
| 245 |
+
It measures how much the selected logprob the worker gives for that output token differs from the selected logprob recomputed by the verifier's full-prefill.
|
| 246 |
+
|
| 247 |
+
### 4.2 Percentile
|
| 248 |
+
|
| 249 |
+
The `p50/p90/p95/p99/p999` in the tables are the percentiles of `abs_logprob_diff` over all output depth rows.
|
| 250 |
+
|
| 251 |
+
Recommended focus:
|
| 252 |
+
|
| 253 |
+
- `p95`: routine tail drift
|
| 254 |
+
- `p99`: strong tail drift
|
| 255 |
+
- `p999`: extreme but still more stable tail drift than `max`
|
| 256 |
+
|
| 257 |
+
This round's Qwen3.6-35B-A3B baseline has a pronounced heavy tail, so using `max` alone for decisions is not recommended.
|
| 258 |
+
|
| 259 |
+
### 4.3 rank_delta_rate
|
| 260 |
+
|
| 261 |
+
```text
|
| 262 |
+
rank_delta_rate = fraction(rank_delta_verifier_minus_worker != 0)
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
It represents how many output tokens have a selected token rank that changes between the worker and the verifier.
|
| 266 |
+
|
| 267 |
+
### 4.4 topk_jaccard
|
| 268 |
+
|
| 269 |
+
Each output depth has a worker top-k token set and a verifier top-k token set. The Jaccard overlap is defined as:
|
| 270 |
+
|
| 271 |
+
```text
|
| 272 |
+
Jaccard = |worker_topk ∩ verifier_topk| / |worker_topk ∪ verifier_topk|
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
This round's top-k is top-32. The lower the `topk_jaccard_p05`, the worse the tail token set overlap.
|
| 276 |
+
|
| 277 |
+
### 4.5 union_js
|
| 278 |
+
|
| 279 |
+
`union_js_divergence` aligns the token union of the worker top-k and verifier top-k, then computes the Jensen-Shannon divergence over the probability distributions.
|
| 280 |
+
|
| 281 |
+
It measures not only the selected token, but whether the local top-k distribution as a whole is similar. The larger the value, the greater the distributional difference.
|
| 282 |
+
|
| 283 |
+
## 5. Overall Results
|
| 284 |
+
|
| 285 |
+
### 5.1 Overview of the Two Verifiers
|
| 286 |
+
|
| 287 |
+
| verifier | count | mean | p50 | p90 | p95 | p99 | p999 | max | rank_delta_rate | jaccard mean | jaccard p05 | union_js p99 |
|
| 288 |
+
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 289 |
+
| BF16 | 31411 | 0.0591 | 0.000606 | 0.0807 | 0.1432 | 0.4331 | 11.1895 | 24.1029 | 0.0251 | 0.8922 | 0.7297 | 0.0582 |
|
| 290 |
+
| FP8 | 31411 | 0.0848 | 0.001088 | 0.1332 | 0.2278 | 0.6729 | 12.6798 | 27.5559 | 0.0364 | 0.8449 | 0.6842 | 0.1165 |
|
| 291 |
+
|
| 292 |
+
### 5.2 FP8 Ratios Relative to the BF16 Baseline
|
| 293 |
+
|
| 294 |
+
| metric | BF16 | FP8 | FP8 / BF16 |
|
| 295 |
+
|---|---:|---:|---:|
|
| 296 |
+
| mean_abs_logprob_diff | 0.0591 | 0.0848 | 1.436x |
|
| 297 |
+
| abs_logprob_diff p50 | 0.000606 | 0.001088 | 1.796x |
|
| 298 |
+
| abs_logprob_diff p90 | 0.0807 | 0.1332 | 1.650x |
|
| 299 |
+
| abs_logprob_diff p95 | 0.1432 | 0.2278 | 1.591x |
|
| 300 |
+
| abs_logprob_diff p99 | 0.4331 | 0.6729 | 1.554x |
|
| 301 |
+
| abs_logprob_diff p999 | 11.1895 | 12.6798 | 1.133x |
|
| 302 |
+
| max_abs_logprob_diff | 24.1029 | 27.5559 | 1.143x |
|
| 303 |
+
| rank_delta_rate | 0.0251 | 0.0364 | 1.449x |
|
| 304 |
+
| topk_jaccard_mean | 0.8922 | 0.8449 | 0.947x |
|
| 305 |
+
| topk_jaccard_p05 | 0.7297 | 0.6842 | 0.938x |
|
| 306 |
+
| union_js_p95 | 0.00781 | 0.01735 | 2.222x |
|
| 307 |
+
| union_js_p99 | 0.0582 | 0.1165 | 2.000x |
|
| 308 |
+
|
| 309 |
+
From this table one can see:
|
| 310 |
+
|
| 311 |
+
- FP8's `abs_logprob_diff` is consistently higher than the BF16 baseline across the `mean`-to-`p99` range.
|
| 312 |
+
- `rank_delta_rate` also rises in step.
|
| 313 |
+
- top-k overlap decreases and JS divergence increases, indicating that FP8 not only differs in selected token logprob, but that the local probability distribution is also more skewed.
|
| 314 |
+
- The `p999/max` ratio is, by contrast, not large, indicating that extreme outliers also exist in the BF16 baseline and cannot serve as the primary distinguishing criterion.
|
| 315 |
+
|
| 316 |
+
## 6. Same-Model BF16 Baseline Analysis
|
| 317 |
+
|
| 318 |
+
### 6.1 The Same-Model Baseline Is Not Zero Error
|
| 319 |
+
|
| 320 |
+
The overall error of `BF16 worker -> BF16 verifier` is very low, but not zero:
|
| 321 |
+
|
| 322 |
+
| metric | value |
|
| 323 |
+
|---|---:|
|
| 324 |
+
| mean | 0.0591 |
|
| 325 |
+
| p50 | 0.000606 |
|
| 326 |
+
| p90 | 0.0807 |
|
| 327 |
+
| p95 | 0.1432 |
|
| 328 |
+
| p99 | 0.4331 |
|
| 329 |
+
| p999 | 11.1895 |
|
| 330 |
+
| max | 24.1029 |
|
| 331 |
+
| rank_delta_rate | 0.0251 |
|
| 332 |
+
|
| 333 |
+
This shows that for Qwen3.6-35B-A3B, this round's same-model envelope contains at least two kinds of phenomena:
|
| 334 |
+
|
| 335 |
+
1. The logprob diff of most tokens is very small.
|
| 336 |
+
2. A small number of tokens exhibit a very large selected logprob diff, accompanied by a large rank change.
|
| 337 |
+
|
| 338 |
+
The largest BF16 baseline outliers in `summary.md` include:
|
| 339 |
+
|
| 340 |
+
| sample | depth | token | worker lp | verifier lp | abs diff | rank |
|
| 341 |
+
|---|---:|---|---:|---:|---:|---|
|
| 342 |
+
| `21e9f9b29eb59f962703` | 6 | `The` | -0.0847 | -24.1876 | 24.1029 | 1/3103 |
|
| 343 |
+
| `aa2d2f1274b0d99eee0e` | 7 | ` aims` | -0.5754 | -23.1630 | 22.5875 | 1/19545 |
|
| 344 |
+
| `5ade7d1684a8dc883a00` | 7 | ` arg` | -0.5951 | -21.7985 | 21.2034 | 1/6827 |
|
| 345 |
+
| `a60ee7075a0a152bc3f3` | 8 | ` depth` | -0.0099 | -21.1415 | 21.1315 | 1/9322 |
|
| 346 |
+
| `ef63ae0b76a298deb773` | 13 | `ISO` | -0.1629 | -19.9728 | 19.8099 | 1/2657 |
|
| 347 |
+
|
| 348 |
+
Most of these outliers are isolated token-level events, and they already exist in the BF16 baseline itself. A reasonable explanation is that there are numerical/scheduling differences between the vLLM decode generate path and the full-prefill prompt logprobs path; for MoE models, routing or kernel path differences may also be superimposed. This explanation is inferred from the result patterns, not a root cause that this experiment directly located.
|
| 349 |
+
|
| 350 |
+
### 6.2 The Decision Significance of the Baseline
|
| 351 |
+
|
| 352 |
+
The value of the BF16 baseline is not that "the error should be 0", but that it gives the same-model drift envelope under the current model, current GPU, current vLLM version, and current prompt distribution.
|
| 353 |
+
|
| 354 |
+
Under this round's data, a fairly reliable description of the baseline is:
|
| 355 |
+
|
| 356 |
+
```text
|
| 357 |
+
the selected logprob diff of the vast majority of tokens is very small,
|
| 358 |
+
but same-model replay also permits a small number of extreme outliers.
|
| 359 |
+
```
|
| 360 |
+
|
| 361 |
+
Therefore, when later judging FP8 or other variants, one should look at whether the overall distribution systematically widens, rather than only looking at the largest token.
|
| 362 |
+
|
| 363 |
+
## 7. FP8 Quantized Verifier Analysis
|
| 364 |
+
|
| 365 |
+
### 7.1 Main Differences Between FP8 and the BF16 Baseline
|
| 366 |
+
|
| 367 |
+
The FP8 verifier's differences manifest mainly at three levels:
|
| 368 |
+
|
| 369 |
+
1. Larger selected token logprob diff:
|
| 370 |
+
- `mean` increases from `0.0591` to `0.0848`.
|
| 371 |
+
- `p95` increases from `0.1432` to `0.2278`.
|
| 372 |
+
- `p99` increases from `0.4331` to `0.6729`.
|
| 373 |
+
|
| 374 |
+
2. The selected token rank changes more easily:
|
| 375 |
+
- `rank_delta_rate` increases from `2.51%` to `3.64%`.
|
| 376 |
+
|
| 377 |
+
3. The top-k local distribution is more inconsistent:
|
| 378 |
+
- `topk_jaccard_mean` drops from `0.8922` to `0.8449`.
|
| 379 |
+
- `topk_jaccard_p05` drops from `0.7297` to `0.6842`.
|
| 380 |
+
- `union_js_p99` increases from `0.0582` to `0.1165`.
|
| 381 |
+
|
| 382 |
+
These three kinds of metrics move in a consistent direction, so the logprob fingerprint of the FP8 verifier versus the BF16 worker can be considered statistically separable.
|
| 383 |
+
|
| 384 |
+
### 7.2 FP8 Is Not Just a Few More Extreme Points
|
| 385 |
+
|
| 386 |
+
After aggregating by sample, FP8 also has more high-drift samples:
|
| 387 |
+
|
| 388 |
+
| sample-level condition | BF16 | FP8 |
|
| 389 |
+
|---|---:|---:|
|
| 390 |
+
| `mean_abs_logprob_diff > 0.2` | 18 | 42 |
|
| 391 |
+
| `mean_abs_logprob_diff > 0.3` | 10 | 18 |
|
| 392 |
+
| `mean_abs_logprob_diff > 0.5` | 4 | 7 |
|
| 393 |
+
| `mean_abs_logprob_diff > 1.0` | 2 | 3 |
|
| 394 |
+
| `p99_abs_logprob_diff > 0.5` | 76 | 125 |
|
| 395 |
+
| `p99_abs_logprob_diff > 1.0` | 45 | 64 |
|
| 396 |
+
| `p99_abs_logprob_diff > 2.0` | 28 | 50 |
|
| 397 |
+
| `p99_abs_logprob_diff > 5.0` | 11 | 21 |
|
| 398 |
+
|
| 399 |
+
This shows that FP8's offset does not come only from a few largest outliers, but that a wider error distribution can be seen across more sample windows.
|
| 400 |
+
|
| 401 |
+
### 7.3 The Strength of FP8's Separability
|
| 402 |
+
|
| 403 |
+
Compared with the large separation of FP8/AWQ/small models in the earlier Qwen3-32B report, this round's Qwen3.6-35B-A3B FP8 difference is more moderate:
|
| 404 |
+
|
| 405 |
+
- p95/p99 are roughly `1.55x-1.59x` of the BF16 baseline.
|
| 406 |
+
- rank_delta is roughly `1.45x`.
|
| 407 |
+
- union JS p99 is roughly `2.00x`.
|
| 408 |
+
|
| 409 |
+
This is sufficient to support statistical distinction, but is not suitable for a very aggressive single-metric hard threshold. A more robust approach is to use multi-metric joint scoring and to calibrate the false reject rate on holdout prompts.
|
| 410 |
+
|
| 411 |
+
## 8. Input Length and Output Depth Analysis
|
| 412 |
+
|
| 413 |
+
### 8.1 By Input Length Bucket
|
| 414 |
+
|
| 415 |
+
| input bucket | count | BF16 p95 | FP8 p95 | p95 ratio | BF16 p99 | FP8 p99 | p99 ratio |
|
| 416 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 417 |
+
| 00000-00128 | 6717 | 0.1060 | 0.1784 | 1.683x | 0.2229 | 0.3925 | 1.761x |
|
| 418 |
+
| 00129-00512 | 5835 | 0.1269 | 0.1941 | 1.530x | 0.3598 | 0.5434 | 1.511x |
|
| 419 |
+
| 00513-02048 | 5227 | 0.1743 | 0.2480 | 1.423x | 1.4882 | 2.6240 | 1.763x |
|
| 420 |
+
| 02049-08192 | 5466 | 0.1358 | 0.2376 | 1.750x | 0.3919 | 0.5584 | 1.425x |
|
| 421 |
+
| 08193-16384 | 4549 | 0.1709 | 0.2760 | 1.615x | 0.6737 | 1.0736 | 1.593x |
|
| 422 |
+
| 16385+ | 3617 | 0.1731 | 0.2780 | 1.606x | 0.5725 | 0.7920 | 1.384x |
|
| 423 |
+
|
| 424 |
+
By input length, FP8's p95/p99 in every bucket are higher than the BF16 baseline. The ratios are roughly between `1.38x-1.76x`.
|
| 425 |
+
|
| 426 |
+
However, there is no simple monotonic relationship between buckets:
|
| 427 |
+
|
| 428 |
+
- The p99 of `00513-02048` is higher than the neighboring buckets.
|
| 429 |
+
- The p99 of `16385+` is not higher than `08193-16384`.
|
| 430 |
+
- The Pearson correlation is also close to 0.
|
| 431 |
+
|
| 432 |
+
Therefore the current data cannot support the conclusion that "the longer the input, the larger the error must be".
|
| 433 |
+
|
| 434 |
+
### 8.2 By Output Depth Bucket
|
| 435 |
+
|
| 436 |
+
| output depth bucket | count | BF16 p95 | FP8 p95 | p95 ratio | BF16 p99 | FP8 p99 | p99 ratio |
|
| 437 |
+
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 438 |
+
| 000-016 | 4516 | 0.2414 | 0.3626 | 1.502x | 5.2302 | 7.2231 | 1.381x |
|
| 439 |
+
| 017-032 | 4093 | 0.1488 | 0.2222 | 1.493x | 0.4010 | 0.6348 | 1.583x |
|
| 440 |
+
| 033-064 | 8024 | 0.1330 | 0.2217 | 1.667x | 0.3221 | 0.5561 | 1.726x |
|
| 441 |
+
| 065-128 | 14778 | 0.1312 | 0.2101 | 1.602x | 0.3007 | 0.4638 | 1.542x |
|
| 442 |
+
|
| 443 |
+
The most salient phenomenon here is:
|
| 444 |
+
|
| 445 |
+
- The p99 of the early depth bucket `000-016` is markedly higher than the subsequent buckets.
|
| 446 |
+
- The p99 of the subsequent depth buckets is instead lower.
|
| 447 |
+
- FP8 is higher than BF16 in every depth bucket, but there is no trend of the error growing larger the deeper the output.
|
| 448 |
+
|
| 449 |
+
### 8.3 Linear Correlation Sanity Check
|
| 450 |
+
|
| 451 |
+
| variant | corr(input_len, abs_diff) | corr(output_depth, abs_diff) | corr(output_len, abs_diff) | signed diff mean |
|
| 452 |
+
|---|---:|---:|---:|---:|
|
| 453 |
+
| BF16 | 0.0350 | -0.0543 | -0.0263 | -0.0385 |
|
| 454 |
+
| FP8 | 0.0336 | -0.0602 | -0.0297 | -0.0545 |
|
| 455 |
+
|
| 456 |
+
These correlation coefficients are all close to 0. With this experiment's 300 samples and at most 128 output tokens, no obvious depth accumulation is observed.
|
| 457 |
+
|
| 458 |
+
## 9. How to Make Reliable Decisions
|
| 459 |
+
|
| 460 |
+
### 9.1 Single-Token Decisions Are Not Recommended
|
| 461 |
+
|
| 462 |
+
This round's BF16 baseline already has a same-model outlier of `max_abs_logprob_diff = 24.1029`. If a single-token max is used as a threshold, two problems arise:
|
| 463 |
+
|
| 464 |
+
1. Setting the threshold low will falsely flag the BF16 same-model baseline.
|
| 465 |
+
2. Setting the threshold high will weaken detection of moderate systematic offsets like FP8's.
|
| 466 |
+
|
| 467 |
+
### 9.2 Window-Level Aggregation Is Recommended
|
| 468 |
+
|
| 469 |
+
A more reliable decision method is to aggregate over one output window, e.g. a 32-, 64-, or full 128-token window, then use a multi-metric envelope:
|
| 470 |
+
|
| 471 |
+
- `mean_abs_logprob_diff`
|
| 472 |
+
- `p95_abs_logprob_diff`
|
| 473 |
+
- `p99_abs_logprob_diff`
|
| 474 |
+
- `rank_delta_rate`
|
| 475 |
+
- `topk_jaccard_mean`
|
| 476 |
+
- `topk_jaccard_p05`
|
| 477 |
+
- `union_js_p95/p99`
|
| 478 |
+
|
| 479 |
+
For this round's data, the difference between FP8 and BF16 is directionally consistent across multiple metrics, so a multi-metric combination is more robust than a single threshold.
|
| 480 |
+
|
| 481 |
+
### 9.3 Initial Threshold Recommendations Under the Current Data
|
| 482 |
+
|
| 483 |
+
If this is just an initial sanity check based on this round of experiments, one can use the overall distribution of the BF16 baseline as the envelope:
|
| 484 |
+
|
| 485 |
+
| metric | BF16 baseline | FP8 observed |
|
| 486 |
+
|---|---:|---:|
|
| 487 |
+
| token mean_abs | 0.0591 | 0.0848 |
|
| 488 |
+
| token p95_abs | 0.1432 | 0.2278 |
|
| 489 |
+
| token p99_abs | 0.4331 | 0.6729 |
|
| 490 |
+
| rank_delta_rate | 0.0251 | 0.0364 |
|
| 491 |
+
| topk_jaccard_mean | 0.8922 | 0.8449 |
|
| 492 |
+
| topk_jaccard_p05 | 0.7297 | 0.6842 |
|
| 493 |
+
| union_js_p99 | 0.0582 | 0.1165 |
|
| 494 |
+
|
| 495 |
+
A conservative decision strategy could be:
|
| 496 |
+
|
| 497 |
+
```text
|
| 498 |
+
reject only when multiple metrics deviate from the BF16 baseline simultaneously,
|
| 499 |
+
do not reject because of a single token outlier.
|
| 500 |
+
```
|
| 501 |
+
|
| 502 |
+
For example, if a verifier on the same batch of samples simultaneously exhibits:
|
| 503 |
+
|
| 504 |
+
- both `p95_abs` and `p99_abs` markedly exceeding the BF16 baseline;
|
| 505 |
+
- `rank_delta_rate` higher than the BF16 baseline;
|
| 506 |
+
- `topk_jaccard` dropping and `union_js` rising;
|
| 507 |
+
|
| 508 |
+
then it is more likely a model/quantization version difference than a single token's numerical outlier.
|
| 509 |
+
|
| 510 |
+
It is still recommended to recalibrate production thresholds with holdout data, and in particular to separately estimate:
|
| 511 |
+
|
| 512 |
+
- the BF16 same-model false reject rate;
|
| 513 |
+
- the FP8 false accept rate;
|
| 514 |
+
- the stability across different prompt categories and different input length buckets.
|
| 515 |
+
|
| 516 |
+
## 10. Boundaries of the Current Conclusions
|
| 517 |
+
|
| 518 |
+
### 10.1 Covers Only 6000ws Single-Machine Results
|
| 519 |
+
|
| 520 |
+
This report analyzes only `6000ws worker -> 6000ws verifier`. It does not cover:
|
| 521 |
+
|
| 522 |
+
- H100 or other GPUs;
|
| 523 |
+
- cross-GPU worker-verifier;
|
| 524 |
+
- multi-card tensor parallel;
|
| 525 |
+
- different vLLM versions;
|
| 526 |
+
- different batch sizes.
|
| 527 |
+
|
| 528 |
+
### 10.2 Covers Only the BF16 Worker
|
| 529 |
+
|
| 530 |
+
This round's worker evidence comes from the `Qwen/Qwen3.6-35B-A3B` BF16 worker. FP8 is tested only as a verifier.
|
| 531 |
+
|
| 532 |
+
Therefore this report cannot answer:
|
| 533 |
+
|
| 534 |
+
```text
|
| 535 |
+
whether evidence generated by an FP8 worker can be accepted by a BF16 verifier or an FP8 verifier
|
| 536 |
+
```
|
| 537 |
+
|
| 538 |
+
To answer this question, additional FP8 worker evidence must be collected.
|
| 539 |
+
|
| 540 |
+
### 10.3 This Is Not a Full Raw Logits Comparison
|
| 541 |
+
|
| 542 |
+
This experiment compares the selected/top-32 logprob, not the full-vocab raw logits. The top-k distribution metrics also cover only the top-32 exposed by vLLM.
|
| 543 |
+
|
| 544 |
+
Therefore top-k Jaccard and JS divergence are local distribution metrics, not full-vocab distribution metrics.
|
| 545 |
+
|
| 546 |
+
### 10.4 Differing Tokenizer Hashes Require Ongoing Attention
|
| 547 |
+
|
| 548 |
+
The tokenizer hashes of the BF16 and FP8 verifiers differ. Although this round's verifier uses the token IDs from the evidence rather than re-tokenizing text, if different model paths or different tokenizer files are to be mixed later, it is recommended to explicitly verify:
|
| 549 |
+
|
| 550 |
+
- whether the vocab size is consistent;
|
| 551 |
+
- whether the special token ids are consistent;
|
| 552 |
+
- whether the chat template affects any re-encoding flow;
|
| 553 |
+
- whether the token id to token string mapping is compatible.
|
| 554 |
+
|
| 555 |
+
### 10.5 Limited Prompt Distribution
|
| 556 |
+
|
| 557 |
+
This round's data is 300 prompts, 10 categories, 30 per category. Although it includes multiple input length buckets, it is still not a complete production workload.
|
| 558 |
+
|
| 559 |
+
In particular:
|
| 560 |
+
|
| 561 |
+
- low-margin tokens;
|
| 562 |
+
- structured output;
|
| 563 |
+
- ultra-long context;
|
| 564 |
+
- multilingual;
|
| 565 |
+
- code;
|
| 566 |
+
- MoE routing-sensitive samples;
|
| 567 |
+
|
| 568 |
+
these categories may all affect tail behavior, and sampling must continue to be expanded on the production distribution.
|
| 569 |
+
|
| 570 |
+
### 10.6 The Output Length Cap Is 128
|
| 571 |
+
|
| 572 |
+
The current output is at most 128 tokens, and many samples are truncated at 128 tokens. This report can only demonstrate that no obvious depth accumulation is observed under `max_new_tokens = 128`.
|
| 573 |
+
|
| 574 |
+
It cannot be extrapolated to 512, 1024, or longer generations.
|
| 575 |
+
|
| 576 |
+
## 11. Final Summary
|
| 577 |
+
|
| 578 |
+
This round of the 6000ws Qwen3.6-35B-A3B experiment shows:
|
| 579 |
+
|
| 580 |
+
1. `BF16 worker -> BF16 verifier` can establish a same-model baseline, but the baseline has a pronounced token-level long-tail outlier.
|
| 581 |
+
2. `BF16 worker -> FP8 verifier`, relative to the BF16 baseline, exhibits a systematic offset in `mean/p50/p90/p95/p99`, `rank_delta_rate`, `top-k overlap`, and `JS divergence`.
|
| 582 |
+
3. FP8's difference is mainly reflected in a widened overall distribution and reduced local distribution consistency, rather than simply a larger max.
|
| 583 |
+
4. The current data finds no obvious monotonic accumulation effect from input length or output depth.
|
| 584 |
+
5. For an MoE model like Qwen3.6-35B-A3B, window-level, multi-metric statistical decisions should be used, and single-token thresholds should not be relied upon.
|
| 585 |
+
|
| 586 |
+
One-sentence conclusion:
|
| 587 |
+
|
| 588 |
+
```text
|
| 589 |
+
Under the current experimental conditions of 6000ws, vLLM 0.24.0, 300 prompts, and top-32 logprob,
|
| 590 |
+
the logprob fingerprint of the Qwen3.6-35B-A3B-FP8 verifier versus the Qwen3.6-35B-A3B BF16 worker
|
| 591 |
+
exhibits a stably observable statistical offset relative to the BF16 same-model baseline, but the decision threshold must avoid the same-model heavy-tail outliers.
|
| 592 |
+
```
|
experiments/moe-routed-experts/data.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dacd85fdbeb7a6a1c14eb03e0e602e7309901393ec871fb680bf83fbba5fd1f
|
| 3 |
+
size 16679797
|
experiments/moe-routed-experts/report/moe_model_routed_experts_verifier.md
ADDED
|
@@ -0,0 +1,1039 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MoE Routed Experts Verifier Design
|
| 2 |
+
|
| 3 |
+
## TL;DR
|
| 4 |
+
|
| 5 |
+
Current recommended protocol: use the verifier to prefill `input_token_ids + output_token_ids`,
|
| 6 |
+
compare only the routed experts of MoE `layer 0`, and use
|
| 7 |
+
`entry_mismatch_rate = sum(entry_mismatch_count) / sum(compared_entries)` as the primary score.
|
| 8 |
+
By default, use at least `5` samples with `total_compared_tokens >= 512`; production thresholds
|
| 9 |
+
are governed by "Threshold Details". A `registered_logit_tokens_top_k` legality check is also
|
| 10 |
+
mandatory: use the verifier prefill logits to check whether each actual output token falls within
|
| 11 |
+
the model's registered logit-token top-k candidate set.
|
| 12 |
+
|
| 13 |
+
## Table of Contents
|
| 14 |
+
|
| 15 |
+
- [Goal](#goal)
|
| 16 |
+
- [Evidence Data Format](#evidence-data-format)
|
| 17 |
+
- [vLLM Requirements](#vllm-requirements)
|
| 18 |
+
- [Security Boundaries and Mitigations](#security-boundaries-and-mitigations)
|
| 19 |
+
- [Comparison Unit](#comparison-unit)
|
| 20 |
+
- [Layer Selection](#layer-selection)
|
| 21 |
+
- [Primary Metric](#primary-metric)
|
| 22 |
+
- [Auxiliary Metrics](#auxiliary-metrics)
|
| 23 |
+
- [Sample and Token Requirements](#sample-and-token-requirements)
|
| 24 |
+
- [Decision Rule](#decision-rule)
|
| 25 |
+
- [Current Experimental Results](#current-experimental-results)
|
| 26 |
+
- [Verifier Workflow](#verifier-workflow)
|
| 27 |
+
- [Threshold Details](#threshold-details)
|
| 28 |
+
- [Multi-Verifier Decision](#multi-verifier-decision)
|
| 29 |
+
- [Pre-Run Checks](#pre-run-checks)
|
| 30 |
+
- [Command Examples](#command-examples)
|
| 31 |
+
- [Conditions for Re-Calibrating Thresholds](#conditions-for-re-calibrating-thresholds)
|
| 32 |
+
- [Current Recommended Design](#current-recommended-design)
|
| 33 |
+
|
| 34 |
+
## Goal
|
| 35 |
+
|
| 36 |
+
Use the `routed_experts` returned by vLLM as a routing fingerprint for MoE models to verify whether a batch of generations claimed to come from a particular model really does look more like output produced by that model.
|
| 37 |
+
|
| 38 |
+
The verifier inputs include:
|
| 39 |
+
|
| 40 |
+
- The original `input_token_ids`
|
| 41 |
+
- The claimed `output_token_ids`
|
| 42 |
+
- The `routed_experts` returned by the claimed source model during normal decode inference
|
| 43 |
+
|
| 44 |
+
Then the verifier model runs one prefill teacher-forcing pass over:
|
| 45 |
+
|
| 46 |
+
```text
|
| 47 |
+
input_token_ids + output_token_ids
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
to obtain the verifier's own prefill `routed_experts`, and then aligns and compares them against the decode `routed_experts` in the claimed trace.
|
| 51 |
+
|
| 52 |
+
The current experiments compare two related Qwen MoE variants:
|
| 53 |
+
|
| 54 |
+
- `Qwen/Qwen3.6-35B-A3B`, denoted BF16
|
| 55 |
+
- `Qwen/Qwen3.6-35B-A3B-FP8`, denoted FP8
|
| 56 |
+
|
| 57 |
+
When a model is registered, the generation protocol it is permitted to use must also be registered, for example:
|
| 58 |
+
|
| 59 |
+
```text
|
| 60 |
+
registered_logit_tokens_top_k = 20
|
| 61 |
+
temperature
|
| 62 |
+
top_p
|
| 63 |
+
whether greedy is allowed
|
| 64 |
+
whether sampling is allowed
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
The verifier then uses the generation protocol from registration time for its checks, and does not accept a worker temporarily declaring or modifying `registered_logit_tokens_top_k` after submitting results.
|
| 68 |
+
|
| 69 |
+
Throughout the rest of this document, we consistently use two distinct terms:
|
| 70 |
+
|
| 71 |
+
| Name | Meaning | Current Value |
|
| 72 |
+
| --- | --- | ---: |
|
| 73 |
+
| `moe_route_experts_top_k` | Number of experts selected per token, per layer during MoE routing | 8 |
|
| 74 |
+
| `registered_logit_tokens_top_k` | Number of candidate tokens allowed to be sampled from the logits in the generation protocol | 20 |
|
| 75 |
+
|
| 76 |
+
Avoid using the bare term `top-k` without a qualifier.
|
| 77 |
+
The `N` in `top-N logprobs` refers only to the number of candidate tokens returned by the API; it is neither of the two top-k values above.
|
| 78 |
+
|
| 79 |
+
The core question is:
|
| 80 |
+
|
| 81 |
+
```text
|
| 82 |
+
If a batch of generations is claimed to come from model M,
|
| 83 |
+
and model M itself is used as the verifier, can it distinguish M from other models?
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
To emphasize: this design verifies the compatibility of the routed experts with the verifier model. It does not rigorously prove that the tokens were selected step by step by the verifier model during the decode phase.
|
| 87 |
+
|
| 88 |
+
## Evidence Data Format
|
| 89 |
+
|
| 90 |
+
Each piece of generate evidence should contain at least:
|
| 91 |
+
|
| 92 |
+
- `sample_id`
|
| 93 |
+
- `input_token_ids`
|
| 94 |
+
- `output_token_ids`
|
| 95 |
+
- The `routed_experts` returned during the decode phase
|
| 96 |
+
- The model name used for generation
|
| 97 |
+
- The generation policy id bound at model registration time
|
| 98 |
+
- Route alignment metadata, e.g. `route_prompt_start`
|
| 99 |
+
|
| 100 |
+
Each verifier/prefill result should contain at least:
|
| 101 |
+
|
| 102 |
+
- The same `sample_id`
|
| 103 |
+
- The same `input_token_ids`
|
| 104 |
+
- The same `output_token_ids`
|
| 105 |
+
- The `routed_experts` returned during the prefill phase
|
| 106 |
+
- The logits, or sufficiently large top-N logprobs, at each output token position during the prefill phase
|
| 107 |
+
- The model name used by the verifier
|
| 108 |
+
- `routed_experts_prompt_start = len(input_token_ids)`
|
| 109 |
+
|
| 110 |
+
The prefill request uses teacher-forcing:
|
| 111 |
+
|
| 112 |
+
```text
|
| 113 |
+
prompt = input_token_ids + output_token_ids
|
| 114 |
+
max_tokens = 0
|
| 115 |
+
echo = true
|
| 116 |
+
routed_experts_prompt_start = len(input_token_ids)
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
Do not pass the following during the normal generate phase:
|
| 120 |
+
|
| 121 |
+
```text
|
| 122 |
+
routed_experts_prompt_start = len(input_token_ids)
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
because the prompt for a normal generate consists only of the input part, and some vLLM versions require `routed_experts_prompt_start` to be strictly less than the prompt length, otherwise an assertion like the following may trigger:
|
| 126 |
+
|
| 127 |
+
```text
|
| 128 |
+
assert prompt_start < request.num_prompt_tokens
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
## vLLM Requirements
|
| 132 |
+
|
| 133 |
+
When starting vLLM, the following must be enabled:
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
vllm serve <MODEL> --enable-return-routed-experts
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
HTTP requests must be non-streaming:
|
| 140 |
+
|
| 141 |
+
```json
|
| 142 |
+
{
|
| 143 |
+
"stream": false
|
| 144 |
+
}
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
The scripts also depend on:
|
| 148 |
+
|
| 149 |
+
```json
|
| 150 |
+
{
|
| 151 |
+
"return_token_ids": true
|
| 152 |
+
}
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
If the registered logit-token top-k legality check is enabled, the verifier prefill must also obtain the logits or top-N logprobs at each output position:
|
| 156 |
+
|
| 157 |
+
```text
|
| 158 |
+
N >= registered_logit_tokens_top_k
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
For example, if the model is registered as:
|
| 162 |
+
|
| 163 |
+
```text
|
| 164 |
+
registered_logit_tokens_top_k = 20
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
then the verifier needs at least the large-model logit-token top-20 logprobs at each output token position in order to determine whether the worker's output token falls within the large model's logit-token top-20.
|
| 168 |
+
|
| 169 |
+
If an output token does not appear in the returned top-N logprobs, and `N >= registered_logit_tokens_top_k`, then it can be treated as:
|
| 170 |
+
|
| 171 |
+
```text
|
| 172 |
+
rank(output_token) > registered_logit_tokens_top_k
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
unless that position must be marked `uncertain` under the drift boundary rules.
|
| 176 |
+
|
| 177 |
+
The current verifier protocol does not require trace replay. The current design is:
|
| 178 |
+
|
| 179 |
+
```text
|
| 180 |
+
normal decode generate
|
| 181 |
+
+
|
| 182 |
+
prefill replay based on the known output_token_ids
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
## Security Boundaries and Mitigations
|
| 186 |
+
|
| 187 |
+
This design cannot, on its own, defend against one important form of cheating:
|
| 188 |
+
|
| 189 |
+
```text
|
| 190 |
+
The worker first generates all output tokens with a small model,
|
| 191 |
+
then runs prefill over the input + output tokens with the claimed large model,
|
| 192 |
+
and submits the routed_experts obtained from the large model's prefill as "legitimate evidence".
|
| 193 |
+
```
|
| 194 |
+
|
| 195 |
+
The reason is that under teacher-forcing, the large model has well-defined hidden states, router logits, and routed experts for any token sequence. In other words, as long as an attacker can access the claimed large model and run prefill, they can fabricate activation/routing evidence for a "small-model-generated token sequence" that looks like it came from the large model.
|
| 196 |
+
|
| 197 |
+
Therefore, what this design can verify is:
|
| 198 |
+
|
| 199 |
+
```text
|
| 200 |
+
Given input_token_ids + output_token_ids,
|
| 201 |
+
whether these routed_experts are consistent with the verifier model's prefill routing.
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
It cannot, on its own, prove:
|
| 205 |
+
|
| 206 |
+
```text
|
| 207 |
+
That these output_token_ids were actually selected by the verifier model during decode.
|
| 208 |
+
```
|
| 209 |
+
|
| 210 |
+
This is the core blind spot of TOPLOC/speculative-decoding-style attacks: activation consistency can only show that "the target model can explain this token string", not that "the target model was responsible for selecting this token string".
|
| 211 |
+
|
| 212 |
+
So the threat model must distinguish two situations:
|
| 213 |
+
|
| 214 |
+
| Scenario | Is this design sufficient |
|
| 215 |
+
| --- | --- |
|
| 216 |
+
| Non-adversarial statistical analysis, comparing the distinguishability of routed experts across different models | Largely sufficient |
|
| 217 |
+
| The worker cannot access the verifier model and can only submit existing decode evidence | Useful |
|
| 218 |
+
| The worker can access the claimed large model and run prefill offline | Insufficient |
|
| 219 |
+
| Need to prove that the tokens were genuinely produced by decode of a particular model | Insufficient, additional mechanisms required |
|
| 220 |
+
|
| 221 |
+
If the worker can access the claimed large model offline, then a purely post-hoc `input/output/routed_experts` check cannot fully resolve this problem. To defeat the attack, at least one of the following two classes of constraints must be added:
|
| 222 |
+
|
| 223 |
+
```text
|
| 224 |
+
1. Verify the token selection policy
|
| 225 |
+
2. Bind the evidence to the online decode process
|
| 226 |
+
```
|
| 227 |
+
|
| 228 |
+
### Mitigation 1: Verify the Token Selection Policy
|
| 229 |
+
|
| 230 |
+
This is the most readily deployable enhancement under the current vLLM HTTP/prefill system.
|
| 231 |
+
|
| 232 |
+
In addition to verifying the routed experts, also verify whether the output tokens conform to the claimed model's generation policy.
|
| 233 |
+
|
| 234 |
+
#### Registered Logit-Token Top-k Legality Check
|
| 235 |
+
|
| 236 |
+
If, at registration time, the model declares and binds:
|
| 237 |
+
|
| 238 |
+
```text
|
| 239 |
+
registered_logit_tokens_top_k = 20
|
| 240 |
+
```
|
| 241 |
+
|
| 242 |
+
then the verifier can check whether each output token satisfies:
|
| 243 |
+
|
| 244 |
+
```text
|
| 245 |
+
rank_verifier_model(output_token_t | prefix_t) <= registered_logit_tokens_top_k
|
| 246 |
+
```
|
| 247 |
+
|
| 248 |
+
where `rank_verifier_model` is computed from the logits/logprobs obtained after the verifier runs prefill over `input_token_ids + output_token_ids`.
|
| 249 |
+
|
| 250 |
+
For `registered_logit_tokens_top_k = 20`, each step requires:
|
| 251 |
+
|
| 252 |
+
```text
|
| 253 |
+
output_token_t must be within the verifier model's logit-token top-20 tokens under that prefix
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
If, at some step:
|
| 257 |
+
|
| 258 |
+
```text
|
| 259 |
+
rank_verifier_model(output_token_t | prefix_t) > registered_logit_tokens_top_k
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
and this is not a boundary case caused by numerical drift, then under the registered generation protocol in this example (`registered_logit_tokens_top_k = 20`), this token could not have been sampled by the verifier model and should be rejected outright.
|
| 263 |
+
|
| 264 |
+
This check can identify one major class of cheating:
|
| 265 |
+
|
| 266 |
+
```text
|
| 267 |
+
A small model first generates an arbitrary token sequence,
|
| 268 |
+
then a large model's prefill fills in the routed_experts/logprobs.
|
| 269 |
+
```
|
| 270 |
+
|
| 271 |
+
because a portion of the tokens generated by the small model will typically fall outside the large model's logit-token top-20. The more tokens there are, the higher the probability that such an illegal token appears.
|
| 272 |
+
|
| 273 |
+
Note: the logit-token top-k legality check is a necessary condition, not a sufficient proof. What it proves is:
|
| 274 |
+
|
| 275 |
+
```text
|
| 276 |
+
This token string does not violate the registered generation candidate token top-k constraint.
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
It cannot, on its own, prove:
|
| 280 |
+
|
| 281 |
+
```text
|
| 282 |
+
That these tokens were necessarily genuinely sampled by the large model according to its probability distribution.
|
| 283 |
+
```
|
| 284 |
+
|
| 285 |
+
If an attacker can access the large model online and use the large model's logit-token top-k results to filter small-model tokens, then they can still construct a sequence in which every step falls within the large model's logit-token top-20. To continue defending against this class of attack, stronger constraints are needed: exact replay with a pre-bound seed/nonce in an identical-hardware, identical-version environment, or online commitment / trusted server-side records. Across GPUs and across vLLM versions, exact replay should not be used as the default pass condition.
|
| 286 |
+
|
| 287 |
+
Drift-handling recommendation:
|
| 288 |
+
|
| 289 |
+
```text
|
| 290 |
+
rank <= registered_logit_tokens_top_k:
|
| 291 |
+
pass
|
| 292 |
+
|
| 293 |
+
rank > registered_logit_tokens_top_k
|
| 294 |
+
and logprob(logit_tokens_top_k_boundary) - logprob(output_token) is very small:
|
| 295 |
+
uncertain
|
| 296 |
+
|
| 297 |
+
rank > registered_logit_tokens_top_k
|
| 298 |
+
and the margin is clear:
|
| 299 |
+
fail
|
| 300 |
+
```
|
| 301 |
+
|
| 302 |
+
`uncertain` should not be treated directly as pass; increase samples/tokens, or switch to more trustworthy online generation evidence.
|
| 303 |
+
|
| 304 |
+
For deterministic/greedy decode:
|
| 305 |
+
|
| 306 |
+
```text
|
| 307 |
+
temperature = 0
|
| 308 |
+
registered_logit_tokens_top_k = 1
|
| 309 |
+
```
|
| 310 |
+
|
| 311 |
+
Verification method:
|
| 312 |
+
|
| 313 |
+
```text
|
| 314 |
+
Run prefill over input + output_token_ids
|
| 315 |
+
Obtain the logits/logprobs at each output position
|
| 316 |
+
Check whether output_token_id is the logit top-1 token at the corresponding position
|
| 317 |
+
```
|
| 318 |
+
|
| 319 |
+
Greedy also requires drift boundary handling; do not hard-fail every non-top-1:
|
| 320 |
+
|
| 321 |
+
```text
|
| 322 |
+
output_token == verifier logit top-1:
|
| 323 |
+
pass
|
| 324 |
+
|
| 325 |
+
output_token != verifier logit top-1
|
| 326 |
+
and logprob(top1) - logprob(output_token) is very small:
|
| 327 |
+
uncertain
|
| 328 |
+
|
| 329 |
+
output_token != verifier logit top-1
|
| 330 |
+
and logprob(top1) - logprob(output_token) is clear:
|
| 331 |
+
fail
|
| 332 |
+
```
|
| 333 |
+
|
| 334 |
+
In other words, the greedy check can be seen as the special case of `registered_logit_tokens_top_k = 1`, but it still retains the logic of marking `uncertain` when the margin is very small. Otherwise, decode/prefill drift at low-margin positions could incorrectly reject genuine greedy positives.
|
| 335 |
+
|
| 336 |
+
If a small model first generates a token string and then a large model prefills in the routed experts, this token string will typically not step-by-step equal the large model's greedy argmax; tokens clearly below the verifier top-1 will be rejected.
|
| 337 |
+
|
| 338 |
+
For sampling decode:
|
| 339 |
+
|
| 340 |
+
```text
|
| 341 |
+
By default, only verify whether the output token belongs to the registered logit-token top-k candidate set.
|
| 342 |
+
```
|
| 343 |
+
|
| 344 |
+
Verification method:
|
| 345 |
+
|
| 346 |
+
```text
|
| 347 |
+
1. The worker generates the output using the sampling params bound at model registration time
|
| 348 |
+
2. The verifier prefills the target model to obtain logits/logprobs at each step
|
| 349 |
+
3. The verifier computes the rank of output_token_t under that prefix
|
| 350 |
+
4. Require rank <= registered_logit_tokens_top_k
|
| 351 |
+
5. Boundary positions where rank is exceeded but the margin is very small are marked uncertain
|
| 352 |
+
```
|
| 353 |
+
|
| 354 |
+
Note:
|
| 355 |
+
|
| 356 |
+
- In sampling scenarios, exact sampled token replay is not recommended across GPUs, across vLLM versions, or across kernels
|
| 357 |
+
- The reason is that even very small logits drift can change the nucleus boundary, candidate probability normalization, or the sampled token
|
| 358 |
+
- If top-p is used, a sufficiently complete logits distribution must be obtainable; otherwise it is recommended to disable top-p and use only the registered logit-token top-k
|
| 359 |
+
- If the HTTP API can only return a very small `logprobs` top-N, then it is recommended to first restrict to greedy or a fixed logit-token top-k
|
| 360 |
+
- With a fixed logit-token top-k, the `N` returned by `logprobs` must cover `registered_logit_tokens_top_k`
|
| 361 |
+
- Only when the worker and verifier are forced to use identical hardware, identical vLLM version, identical kernel, and identical sampler implementation, and the seed/nonce is bound before generation, can exact sampled token replay be used as a stronger check
|
| 362 |
+
- If the seed is supplied by the worker after the fact, the exact replay check is meaningless
|
| 363 |
+
|
| 364 |
+
What this mitigation proves is:
|
| 365 |
+
|
| 366 |
+
```text
|
| 367 |
+
The output token sequence does not violate the target model's registered logit-token top-k candidate set constraint
|
| 368 |
+
```
|
| 369 |
+
|
| 370 |
+
It is still not a rigorous proof that the worker actually decoded with the target model at the time, nor a proof that the tokens were genuinely sampled according to the target model's probability distribution; but it will largely defeat the "generate arbitrary tokens with a small model then fill in evidence via large-model prefill" attack.
|
| 371 |
+
|
| 372 |
+
### Mitigation 2: Bind Evidence Online, Step by Step
|
| 373 |
+
|
| 374 |
+
If the goal is to prove "attribution of the generation process", then the evidence must be bound to the moment the token is selected.
|
| 375 |
+
|
| 376 |
+
Basic idea:
|
| 377 |
+
|
| 378 |
+
```text
|
| 379 |
+
For each generated token, or each short span of tokens,
|
| 380 |
+
the worker must immediately submit a tamper-proof commitment.
|
| 381 |
+
```
|
| 382 |
+
|
| 383 |
+
A commitment can include:
|
| 384 |
+
|
| 385 |
+
```text
|
| 386 |
+
request_id
|
| 387 |
+
verifier nonce
|
| 388 |
+
step index
|
| 389 |
+
previous token
|
| 390 |
+
sampled token
|
| 391 |
+
layer0 routed experts hash
|
| 392 |
+
logits/logit-token top-k logits hash
|
| 393 |
+
sampling params
|
| 394 |
+
previous commitment hash
|
| 395 |
+
timestamp
|
| 396 |
+
```
|
| 397 |
+
|
| 398 |
+
forming a hash chain:
|
| 399 |
+
|
| 400 |
+
```text
|
| 401 |
+
C_t = H(C_{t-1}, request_id, nonce, step, prev_token, token_t, route_hash_t, logits_hash_t)
|
| 402 |
+
```
|
| 403 |
+
|
| 404 |
+
Finally, the verifier randomly spot-checks some steps and requires the worker to reveal the routes/logits at the corresponding positions.
|
| 405 |
+
|
| 406 |
+
But note: if this commitment is generated entirely locally by the worker after the fact, it also cannot prevent cheating. It must satisfy at least one of the following conditions:
|
| 407 |
+
|
| 408 |
+
- The commitment is sent to the verifier online in real time
|
| 409 |
+
- The commitment is signed by a trusted service
|
| 410 |
+
- The commitment is generated inside a TEE/trusted execution environment
|
| 411 |
+
- The commitment has an external timestamp or a non-rollback log
|
| 412 |
+
|
| 413 |
+
The goal of this mitigation is to prevent the worker from waiting until the full output is known and then batch-filling evidence via large-model prefill.
|
| 414 |
+
|
| 415 |
+
### Mitigation 3: Trusted Server-Side Records
|
| 416 |
+
|
| 417 |
+
The strongest and cleanest mitigation is to not accept the routed experts self-reported by the worker.
|
| 418 |
+
|
| 419 |
+
Instead:
|
| 420 |
+
|
| 421 |
+
```text
|
| 422 |
+
The verifier/platform controls the inference service
|
| 423 |
+
The server runs decode directly
|
| 424 |
+
The server records routed experts/logits/token directly
|
| 425 |
+
The server signs the evidence
|
| 426 |
+
```
|
| 427 |
+
|
| 428 |
+
The worker can only submit evidence that the server has signed.
|
| 429 |
+
|
| 430 |
+
The signed content binds at least:
|
| 431 |
+
|
| 432 |
+
```text
|
| 433 |
+
model_id
|
| 434 |
+
model checkpoint hash
|
| 435 |
+
tokenizer hash
|
| 436 |
+
request_id
|
| 437 |
+
prompt hash
|
| 438 |
+
sampling params
|
| 439 |
+
seed/nonce
|
| 440 |
+
output_token_ids
|
| 441 |
+
decode routed experts proof/hash
|
| 442 |
+
generation time
|
| 443 |
+
```
|
| 444 |
+
|
| 445 |
+
This mitigation directly prevents "filling in evidence via post-hoc prefill", because legitimate evidence can only be produced during a genuine server-side decode.
|
| 446 |
+
|
| 447 |
+
### Mitigation 4: TEE or Remote Auditable Inference
|
| 448 |
+
|
| 449 |
+
If a third-party worker must run the model themselves, a trusted execution environment or a remote auditable service can be used.
|
| 450 |
+
|
| 451 |
+
The TEE must attest:
|
| 452 |
+
|
| 453 |
+
```text
|
| 454 |
+
That the loaded model is the specified one
|
| 455 |
+
That the running inference code is the specified one
|
| 456 |
+
That the sampling parameters were not altered
|
| 457 |
+
That the evidence was produced within the decode path
|
| 458 |
+
That the signing key is only available inside the trusted environment
|
| 459 |
+
```
|
| 460 |
+
|
| 461 |
+
This class of mitigation has the highest engineering cost, but in a decentralized-worker scenario it is the direction closest to "proving genuine execution".
|
| 462 |
+
|
| 463 |
+
## Comparison Unit
|
| 464 |
+
|
| 465 |
+
The shape of `routed_experts` is:
|
| 466 |
+
|
| 467 |
+
```text
|
| 468 |
+
[token_position, moe_layer, moe_route_expert_slot]
|
| 469 |
+
```
|
| 470 |
+
|
| 471 |
+
In the current Qwen3.6-35B-A3B data:
|
| 472 |
+
|
| 473 |
+
```text
|
| 474 |
+
moe layers = 40
|
| 475 |
+
moe_route_experts_top_k = 8
|
| 476 |
+
```
|
| 477 |
+
|
| 478 |
+
The route length returned during the generate phase is typically about:
|
| 479 |
+
|
| 480 |
+
```text
|
| 481 |
+
input_tokens + output_tokens - 1
|
| 482 |
+
```
|
| 483 |
+
|
| 484 |
+
The prefill phase sets:
|
| 485 |
+
|
| 486 |
+
```text
|
| 487 |
+
routed_experts_prompt_start = len(input_token_ids)
|
| 488 |
+
```
|
| 489 |
+
|
| 490 |
+
and then returns the route window corresponding to the output suffix.
|
| 491 |
+
|
| 492 |
+
Therefore the compare script first aligns the overlapping token window between the generate route and the prefill route, and then computes the score.
|
| 493 |
+
|
| 494 |
+
### Route Window Alignment Example
|
| 495 |
+
|
| 496 |
+
Assume:
|
| 497 |
+
|
| 498 |
+
```text
|
| 499 |
+
input_token_ids = [I0, I1, I2] # input_len = 3
|
| 500 |
+
output_token_ids = [O0, O1, O2, O3] # output_len = 4
|
| 501 |
+
full sequence = [I0, I1, I2, O0, O1, O2, O3]
|
| 502 |
+
global position = 0 1 2 3 4 5 6
|
| 503 |
+
```
|
| 504 |
+
|
| 505 |
+
During the normal generate phase, the prompt consists only of the input, and the routed experts returned by vLLM typically cover:
|
| 506 |
+
|
| 507 |
+
```text
|
| 508 |
+
global position: 0 1 2 3 4 5
|
| 509 |
+
token: I0 I1 I2 O0 O1 O2
|
| 510 |
+
route index: 0 1 2 3 4 5
|
| 511 |
+
route_prompt_start = 0
|
| 512 |
+
route length = input_len + output_len - 1 = 6
|
| 513 |
+
```
|
| 514 |
+
|
| 515 |
+
That is, the next-step route corresponding to the last output token `O3` is typically not in the generate return window.
|
| 516 |
+
|
| 517 |
+
The prefill verifier phase uses the full prompt:
|
| 518 |
+
|
| 519 |
+
```text
|
| 520 |
+
prompt = [I0, I1, I2, O0, O1, O2, O3]
|
| 521 |
+
routed_experts_prompt_start = len(input_token_ids) = 3
|
| 522 |
+
```
|
| 523 |
+
|
| 524 |
+
Therefore the prefill routed experts return the output suffix:
|
| 525 |
+
|
| 526 |
+
```text
|
| 527 |
+
global position: 3 4 5 6
|
| 528 |
+
token: O0 O1 O2 O3
|
| 529 |
+
route index: 0 1 2 3
|
| 530 |
+
route_prompt_start = 3
|
| 531 |
+
route length = output_len = 4
|
| 532 |
+
```
|
| 533 |
+
|
| 534 |
+
The global windows for generate and prefill are, respectively:
|
| 535 |
+
|
| 536 |
+
```text
|
| 537 |
+
generate window: [0, 6) # 0,1,2,3,4,5
|
| 538 |
+
prefill window: [3, 7) # 3,4,5,6
|
| 539 |
+
overlap window: [3, 6) # 3,4,5
|
| 540 |
+
```
|
| 541 |
+
|
| 542 |
+
Ultimately only the overlap window is compared:
|
| 543 |
+
|
| 544 |
+
```text
|
| 545 |
+
global position: 3 4 5
|
| 546 |
+
token: O0 O1 O2
|
| 547 |
+
generate route index: 3 4 5
|
| 548 |
+
prefill route index: 0 1 2
|
| 549 |
+
```
|
| 550 |
+
|
| 551 |
+
So in this example:
|
| 552 |
+
|
| 553 |
+
```text
|
| 554 |
+
compared_tokens = output_len - 1 = 3
|
| 555 |
+
```
|
| 556 |
+
|
| 557 |
+
Looking only at layer 0 with `moe_route_experts_top_k = 8`:
|
| 558 |
+
|
| 559 |
+
```text
|
| 560 |
+
compared_entries = compared_tokens * 1 * 8 = 24
|
| 561 |
+
```
|
| 562 |
+
|
| 563 |
+
This is also why the raw shapes are often different, but the aligned shape can be correct.
|
| 564 |
+
|
| 565 |
+
Note:
|
| 566 |
+
|
| 567 |
+
```text
|
| 568 |
+
A non-zero raw_shape_mismatch_sample_count is normal
|
| 569 |
+
A non-zero shape_mismatch_sample_count is what warrants attention
|
| 570 |
+
```
|
| 571 |
+
|
| 572 |
+
The reason is that the raw route windows returned by generate and prefill may naturally differ in length, but the aligned comparison window should be reasonable.
|
| 573 |
+
|
| 574 |
+
## Layer Selection
|
| 575 |
+
|
| 576 |
+
The production verifier score uses only MoE `layer 0`.
|
| 577 |
+
|
| 578 |
+
Reasons:
|
| 579 |
+
|
| 580 |
+
- The FP8 verifier's distinguishability weakens noticeably when averaging over all 40 layers
|
| 581 |
+
- Later layers accumulate numerical differences between decode and prefill
|
| 582 |
+
- The `moe_route_experts_top_k` of MoE routing is a hard discrete selection, and even tiny hidden state differences can flip an expert slot
|
| 583 |
+
- The same-model routing signal at layer 0 is the cleanest
|
| 584 |
+
|
| 585 |
+
The FP8 verifier's distinguishability is weak when using all layers:
|
| 586 |
+
|
| 587 |
+
```text
|
| 588 |
+
FP8 verifier, all 40 layers:
|
| 589 |
+
positive fp8_vs_fp8 entry mismatch ~= 0.2725
|
| 590 |
+
negative bf16_vs_fp8 entry mismatch ~= 0.2922
|
| 591 |
+
gap ~= 0.0197
|
| 592 |
+
```
|
| 593 |
+
|
| 594 |
+
Looking only at layer 0, the FP8 verifier's distinguishability is markedly stronger:
|
| 595 |
+
|
| 596 |
+
```text
|
| 597 |
+
FP8 verifier, layer 0:
|
| 598 |
+
positive fp8_vs_fp8 entry mismatch ~= 0.0491
|
| 599 |
+
negative bf16_vs_fp8 entry mismatch ~= 0.1131
|
| 600 |
+
gap ~= 0.0640
|
| 601 |
+
```
|
| 602 |
+
|
| 603 |
+
The BF16 verifier is also very strong at layer 0:
|
| 604 |
+
|
| 605 |
+
```text
|
| 606 |
+
BF16 verifier, layer 0:
|
| 607 |
+
positive bf16_vs_bf16 entry mismatch ~= 0.0294
|
| 608 |
+
negative fp8_vs_bf16 entry mismatch ~= 0.1147
|
| 609 |
+
gap ~= 0.0853
|
| 610 |
+
```
|
| 611 |
+
|
| 612 |
+
So the current unified convention is:
|
| 613 |
+
|
| 614 |
+
```text
|
| 615 |
+
Compare only layer 0
|
| 616 |
+
```
|
| 617 |
+
|
| 618 |
+
## Primary Metric
|
| 619 |
+
|
| 620 |
+
The primary metric uses the `entry_mismatch_rate` of layer 0:
|
| 621 |
+
|
| 622 |
+
```text
|
| 623 |
+
score =
|
| 624 |
+
sum(entry_mismatch_count)
|
| 625 |
+
/ sum(compared_entries)
|
| 626 |
+
```
|
| 627 |
+
|
| 628 |
+
For the case of layer 0 with `moe_route_experts_top_k = 8`:
|
| 629 |
+
|
| 630 |
+
```text
|
| 631 |
+
compared_entries = compared_output_tokens * moe_route_experts_top_k
|
| 632 |
+
```
|
| 633 |
+
|
| 634 |
+
This metric is order-sensitive; it compares item by item every:
|
| 635 |
+
|
| 636 |
+
```text
|
| 637 |
+
[token, layer, moe_route_expert_slot]
|
| 638 |
+
```
|
| 639 |
+
|
| 640 |
+
that is:
|
| 641 |
+
|
| 642 |
+
```text
|
| 643 |
+
generate[token, 0, moe_route_expert_slot] == prefill[token, 0, moe_route_expert_slot]
|
| 644 |
+
```
|
| 645 |
+
|
| 646 |
+
The lower the score, the more the claimed trace looks like it was produced by the verifier model itself.
|
| 647 |
+
|
| 648 |
+
Do not use `token_layer_set_match_rate` as the primary metric. It ignores the MoE route expert slot/order, dropping part of the model identity signal, and its discriminative power is noticeably weaker especially on the FP8 verifier.
|
| 649 |
+
|
| 650 |
+
## Auxiliary Metrics
|
| 651 |
+
|
| 652 |
+
The `token_layer_match_rate` of layer 0 can also be reported as an auxiliary diagnostic:
|
| 653 |
+
|
| 654 |
+
```text
|
| 655 |
+
token_layer_match_rate =
|
| 656 |
+
number of tokens whose full `moe_route_experts_top_k` vector matches exactly
|
| 657 |
+
/ total number of compared tokens
|
| 658 |
+
```
|
| 659 |
+
|
| 660 |
+
It is stricter than `entry_mismatch_rate`, but not as smooth as `entry_mismatch_rate`.
|
| 661 |
+
|
| 662 |
+
Recommendation:
|
| 663 |
+
|
| 664 |
+
```text
|
| 665 |
+
Use the weighted entry_mismatch_rate for the final decision
|
| 666 |
+
Look at token_layer_match_rate alongside it for debugging and interpretation
|
| 667 |
+
```
|
| 668 |
+
|
| 669 |
+
## Sample and Token Requirements
|
| 670 |
+
|
| 671 |
+
Multi-sample aggregation is required, and it must be weighted by entry; you cannot simply average the per-sample rates.
|
| 672 |
+
|
| 673 |
+
Minimum requirements:
|
| 674 |
+
|
| 675 |
+
```text
|
| 676 |
+
sample_count >= 5
|
| 677 |
+
total_compared_tokens >= 512
|
| 678 |
+
```
|
| 679 |
+
|
| 680 |
+
Recommended defaults:
|
| 681 |
+
|
| 682 |
+
```text
|
| 683 |
+
sample_count = 5
|
| 684 |
+
target total_compared_tokens ~= 600+
|
| 685 |
+
```
|
| 686 |
+
|
| 687 |
+
More conservative settings:
|
| 688 |
+
|
| 689 |
+
```text
|
| 690 |
+
sample_count >= 8
|
| 691 |
+
total_compared_tokens >= 768
|
| 692 |
+
```
|
| 693 |
+
|
| 694 |
+
Why both a sample count and a token count are required:
|
| 695 |
+
|
| 696 |
+
- Different samples may have different output token counts
|
| 697 |
+
- A sample with especially short output makes the single-sample score very unstable
|
| 698 |
+
- In the current data, the median effective compared tokens per sample is about 127
|
| 699 |
+
- Therefore 5 samples usually equal roughly 635 effective compared tokens
|
| 700 |
+
- If future data produces shorter outputs, keep sampling until the token count requirement is met
|
| 701 |
+
|
| 702 |
+
## Decision Rule
|
| 703 |
+
|
| 704 |
+
For each verifier model, compute:
|
| 705 |
+
|
| 706 |
+
```text
|
| 707 |
+
group_score =
|
| 708 |
+
sum(layer0_entry_mismatch_count across selected samples)
|
| 709 |
+
/ sum(layer0_compared_entries across selected samples)
|
| 710 |
+
```
|
| 711 |
+
|
| 712 |
+
then apply a verifier-specific threshold. The production decision threshold has "Threshold Details" as its sole authoritative source; the threshold column in the experimental results tables is a historical snapshot and is not a configuration source.
|
| 713 |
+
|
| 714 |
+
General decision:
|
| 715 |
+
|
| 716 |
+
```text
|
| 717 |
+
group_score <= verifier_threshold: accept
|
| 718 |
+
group_score > verifier_threshold: reject
|
| 719 |
+
```
|
| 720 |
+
|
| 721 |
+
The FP8 verifier's production default should prioritize controlling false accepts; if a more recall-oriented threshold is needed, it must be re-evaluated in conjunction with the cross-GPU negative tail.
|
| 722 |
+
|
| 723 |
+
## Current Experimental Results
|
| 724 |
+
|
| 725 |
+
Layer 0 single-sample score distribution:
|
| 726 |
+
|
| 727 |
+
| case | n | mean | p05 | p50 | p95 | max | token p50 |
|
| 728 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 729 |
+
| BF16 verifier positive | 1000 | 0.029385 | 0.016683 | 0.028543 | 0.045276 | 0.101378 | 127 |
|
| 730 |
+
| BF16 verifier negative | 1000 | 0.114704 | 0.085630 | 0.109252 | 0.139764 | 0.416667 | 127 |
|
| 731 |
+
| FP8 verifier positive | 1000 | 0.049098 | 0.032480 | 0.047244 | 0.066929 | 0.171260 | 127 |
|
| 732 |
+
| FP8 verifier negative | 1000 | 0.113092 | 0.086614 | 0.109252 | 0.142717 | 0.336614 | 127 |
|
| 733 |
+
|
| 734 |
+
Single-sample threshold check; the following is an experimental snapshot:
|
| 735 |
+
|
| 736 |
+
| verifier | source | threshold | pass count | pass rate |
|
| 737 |
+
| --- | --- | ---: | ---: | ---: |
|
| 738 |
+
| BF16 | BF16 | 0.066 | 995 / 1000 | 99.5% |
|
| 739 |
+
| BF16 | FP8 | 0.066 | 2 / 1000 | 0.2% false accept |
|
| 740 |
+
| FP8 | FP8 | 0.074 | 976 / 1000 | 97.6% |
|
| 741 |
+
| FP8 | BF16 | 0.074 | 9 / 1000 | 0.9% false accept |
|
| 742 |
+
|
| 743 |
+
A single sample already has distinguishability, but the final verifier decision is not recommended to use a single sample; multi-sample aggregation should be used.
|
| 744 |
+
|
| 745 |
+
## Random 5-Sample Results
|
| 746 |
+
|
| 747 |
+
Protocol:
|
| 748 |
+
|
| 749 |
+
```text
|
| 750 |
+
layer = 0
|
| 751 |
+
sample_count = 5
|
| 752 |
+
score = sum(entry_mismatch_count) / sum(compared_entries)
|
| 753 |
+
```
|
| 754 |
+
|
| 755 |
+
The tables below are experimental snapshots computed from the candidate thresholds at that time, and may be out of sync with future production thresholds;
|
| 756 |
+
production thresholds are governed by "Threshold Details".
|
| 757 |
+
|
| 758 |
+
Original A6000-style report results:
|
| 759 |
+
|
| 760 |
+
| verifier | threshold | positive pass rate | false reject | negative false pass | token p50 | token p05 |
|
| 761 |
+
| --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 762 |
+
| BF16 | 0.060 | 99.9992% | 0.0008% | 0.0000% | 635 | 541 |
|
| 763 |
+
| FP8 | 0.080 | 99.8320% | 0.1680% | 0.0000% | 635 | 519 |
|
| 764 |
+
| FP8 | 0.085 | 99.9335% | 0.0665% | 0.0027% | 635 | 519 |
|
| 765 |
+
|
| 766 |
+
Results after merging cross-GPU reports:
|
| 767 |
+
|
| 768 |
+
| verifier | threshold | positive pass TPR | false reject FNR | negative false pass FPR |
|
| 769 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 770 |
+
| BF16 | 0.060 | 100.0000% | 0.0000% | 0.0000% |
|
| 771 |
+
| FP8 | 0.080 | 99.9453% | 0.0547% | 0.0000% |
|
| 772 |
+
| FP8 | 0.085 | 99.9850% | 0.0150% | 0.0047% |
|
| 773 |
+
|
| 774 |
+
The current cross-GPU results do not overturn the existing thresholds.
|
| 775 |
+
|
| 776 |
+
## Cross-GPU Result Interpretation
|
| 777 |
+
|
| 778 |
+
The newly added cross-GPU report shows that the layer 0 score distribution remains stable.
|
| 779 |
+
|
| 780 |
+
BF16 positive layer 0 mean:
|
| 781 |
+
|
| 782 |
+
```text
|
| 783 |
+
6000_bf16_vs_bf16 ~= 0.0294
|
| 784 |
+
6000_bf16_vs_h100_bf16 ~= 0.0242
|
| 785 |
+
h100_bf16_vs_bf16 ~= 0.0241
|
| 786 |
+
```
|
| 787 |
+
|
| 788 |
+
FP8 positive layer 0 mean:
|
| 789 |
+
|
| 790 |
+
```text
|
| 791 |
+
6000_fp8_vs_fp8 ~= 0.0491
|
| 792 |
+
6000_fp8_vs_h100_fp8 ~= 0.0481
|
| 793 |
+
h100_fp8_vs_fp8 ~= 0.0475
|
| 794 |
+
```
|
| 795 |
+
|
| 796 |
+
The negative layer 0 mean still lies roughly at:
|
| 797 |
+
|
| 798 |
+
```text
|
| 799 |
+
0.112 - 0.117
|
| 800 |
+
```
|
| 801 |
+
|
| 802 |
+
This indicates that the current layer 0 score is fairly stable against the GPU differences tested so far.
|
| 803 |
+
|
| 804 |
+
## Verifier Workflow
|
| 805 |
+
|
| 806 |
+
For a claimed source model `M`:
|
| 807 |
+
|
| 808 |
+
1. Collect at least 5 samples from the claimed generation trace.
|
| 809 |
+
2. Ensure the total effective compared output tokens is at least 512.
|
| 810 |
+
3. Use the verifier model `M` to prefill each `input_token_ids + output_token_ids`.
|
| 811 |
+
4. Compare only the routed experts of layer 0.
|
| 812 |
+
5. Compute the weighted `entry_mismatch_rate`.
|
| 813 |
+
6. Read `registered_logit_tokens_top_k` from the model registration info.
|
| 814 |
+
7. Use the verifier prefill logits/logprobs to check whether each output token falls within the verifier model's registered logit-token top-k.
|
| 815 |
+
8. Accept only when both the routed experts score and the logit-token top-k legality pass; otherwise reject or mark uncertain.
|
| 816 |
+
|
| 817 |
+
Pseudocode:
|
| 818 |
+
|
| 819 |
+
```python
|
| 820 |
+
def verify(samples, verifier_model):
|
| 821 |
+
total_mismatch = 0
|
| 822 |
+
total_entries = 0
|
| 823 |
+
total_tokens = 0
|
| 824 |
+
illegal_token_count = 0
|
| 825 |
+
uncertain_token_count = 0
|
| 826 |
+
registered_logit_tokens_top_k = get_registered_logit_tokens_top_k(verifier_model)
|
| 827 |
+
|
| 828 |
+
for sample in samples:
|
| 829 |
+
prefill_result = run_prefill_verifier(
|
| 830 |
+
model=verifier_model,
|
| 831 |
+
input_token_ids=sample.input_token_ids,
|
| 832 |
+
output_token_ids=sample.output_token_ids,
|
| 833 |
+
)
|
| 834 |
+
gen_layer0, prefill_layer0 = align_layer0(
|
| 835 |
+
sample.decode_routes,
|
| 836 |
+
prefill_result.routed_experts,
|
| 837 |
+
)
|
| 838 |
+
total_mismatch += count_entries_not_equal(gen_layer0, prefill_layer0)
|
| 839 |
+
total_entries += count_compared_entries(gen_layer0, prefill_layer0)
|
| 840 |
+
total_tokens += count_compared_tokens(gen_layer0, prefill_layer0)
|
| 841 |
+
|
| 842 |
+
legality = check_output_tokens_in_registered_logit_tokens_topk(
|
| 843 |
+
output_token_ids=sample.output_token_ids,
|
| 844 |
+
verifier_logits=prefill_result.logits,
|
| 845 |
+
registered_logit_tokens_top_k=registered_logit_tokens_top_k,
|
| 846 |
+
)
|
| 847 |
+
illegal_token_count += legality.illegal_token_count
|
| 848 |
+
uncertain_token_count += legality.uncertain_token_count
|
| 849 |
+
|
| 850 |
+
if len(samples) < 5:
|
| 851 |
+
return "insufficient_samples"
|
| 852 |
+
if total_tokens < 512:
|
| 853 |
+
return "insufficient_tokens"
|
| 854 |
+
if illegal_token_count > 0:
|
| 855 |
+
return "reject"
|
| 856 |
+
if uncertain_token_count > 0:
|
| 857 |
+
return "uncertain"
|
| 858 |
+
|
| 859 |
+
score = total_mismatch / total_entries
|
| 860 |
+
threshold = threshold_for(verifier_model)
|
| 861 |
+
|
| 862 |
+
return "accept" if score <= threshold else "reject"
|
| 863 |
+
```
|
| 864 |
+
|
| 865 |
+
## Threshold Details
|
| 866 |
+
|
| 867 |
+
Current default thresholds:
|
| 868 |
+
|
| 869 |
+
| verifier model | threshold | decision |
|
| 870 |
+
| --- | ---: | --- |
|
| 871 |
+
| BF16 | 0.060 | accept when score <= 0.060 |
|
| 872 |
+
| FP8 | 0.080 | accept when score <= 0.080 |
|
| 873 |
+
|
| 874 |
+
Thresholds for single-sample debugging only:
|
| 875 |
+
|
| 876 |
+
| verifier model | single-sample threshold |
|
| 877 |
+
| --- | ---: |
|
| 878 |
+
| BF16 | 0.066 |
|
| 879 |
+
| FP8 | 0.074 |
|
| 880 |
+
|
| 881 |
+
Single-sample thresholds are not recommended for the final verifier decision.
|
| 882 |
+
|
| 883 |
+
## Multi-Verifier Decision
|
| 884 |
+
|
| 885 |
+
If the same claim was run through both the BF16 verifier and the FP8 verifier:
|
| 886 |
+
|
| 887 |
+
1. Compute the BF16 verifier score.
|
| 888 |
+
2. Compute the FP8 verifier score.
|
| 889 |
+
3. Apply each of their respective thresholds.
|
| 890 |
+
|
| 891 |
+
Decision table:
|
| 892 |
+
|
| 893 |
+
| BF16 result | FP8 result | final decision |
|
| 894 |
+
| --- | --- | --- |
|
| 895 |
+
| accept | reject | BF16 |
|
| 896 |
+
| reject | accept | FP8 |
|
| 897 |
+
| reject | reject | unknown or neither |
|
| 898 |
+
| accept | accept | ambiguous, need more samples |
|
| 899 |
+
|
| 900 |
+
For ambiguous:
|
| 901 |
+
|
| 902 |
+
- Increase to at least 10 samples
|
| 903 |
+
- Require at least 1024 total compared tokens
|
| 904 |
+
- Still use only layer 0
|
| 905 |
+
- Compare the relative threshold margins:
|
| 906 |
+
|
| 907 |
+
```text
|
| 908 |
+
bf16_margin = bf16_threshold - bf16_score
|
| 909 |
+
fp8_margin = fp8_threshold - fp8_score
|
| 910 |
+
```
|
| 911 |
+
|
| 912 |
+
If only one verifier clearly exceeds the threshold, you can choose the model with the larger margin.
|
| 913 |
+
If both verifiers clearly pass, it should be marked ambiguous and the test sample set expanded.
|
| 914 |
+
|
| 915 |
+
## Pre-Run Checks
|
| 916 |
+
|
| 917 |
+
Before trusting a single verifier result, check at least:
|
| 918 |
+
|
| 919 |
+
- `shape_mismatch_sample_count` should be 0
|
| 920 |
+
- `expected_length_mismatch_sample_count` should be 0
|
| 921 |
+
- `layer_topk_shape_mismatch_sample_count` should be 0. The `topk` in this legacy field name refers to the MoE routing expert top-k, i.e. `moe_route_experts_top_k`
|
| 922 |
+
- `selected_layers` should be `0`
|
| 923 |
+
- `total_compared_tokens` should be at least 512
|
| 924 |
+
- `registered_logit_tokens_top_k` must exist in the model registration info
|
| 925 |
+
- The logits/top-N logprobs returned by the verifier prefill must be able to cover `registered_logit_tokens_top_k`
|
| 926 |
+
- The output tokens must pass the registered logit-token top-k legality check
|
| 927 |
+
- All samples should use the same tokenizer/model family
|
| 928 |
+
- HTTP requests should be non-streaming
|
| 929 |
+
|
| 930 |
+
`raw_shape_mismatch_sample_count` may be non-zero; this is expected behavior, because the raw route windows returned by generate and prefill may differ in length.
|
| 931 |
+
|
| 932 |
+
## Command Examples
|
| 933 |
+
|
| 934 |
+
The script is located at `tools/moe_routed_experts/scripts/compare_routes.py`; comparison results are output to
|
| 935 |
+
`experiments/moe-routed-experts/data/<variant>/`. The raw route dumps fed to `--generated` / `--prefill`
|
| 936 |
+
(`generated_routes_*.jsonl` / `prefill_routes_*.jsonl`) are produced by
|
| 937 |
+
`generate_decode_routes.py` and `prefill_routes.py`, are intermediate artifacts, and are not shipped with the repo;
|
| 938 |
+
they are represented below with `<...>` placeholders. All commands below are executed from the repository root.
|
| 939 |
+
|
| 940 |
+
Compare only layer 0:
|
| 941 |
+
|
| 942 |
+
```bash
|
| 943 |
+
python3 tools/moe_routed_experts/scripts/compare_routes.py \
|
| 944 |
+
--generated <generated_routes.jsonl> \
|
| 945 |
+
--prefill <prefill_routes.jsonl> \
|
| 946 |
+
--output-dir <report_dir> \
|
| 947 |
+
--layers 0
|
| 948 |
+
```
|
| 949 |
+
|
| 950 |
+
FP8 positive (output corresponds to `experiments/moe-routed-experts/data/6000_fp8_vs_fp8_layers_0/`):
|
| 951 |
+
|
| 952 |
+
```bash
|
| 953 |
+
python3 tools/moe_routed_experts/scripts/compare_routes.py \
|
| 954 |
+
--generated <generated_routes_6000_fp8.jsonl> \
|
| 955 |
+
--prefill <prefill_routes_6000_fp8_vs_fp8.jsonl> \
|
| 956 |
+
--output-dir experiments/moe-routed-experts/data/6000_fp8_vs_fp8_layers_0 \
|
| 957 |
+
--layers 0
|
| 958 |
+
```
|
| 959 |
+
|
| 960 |
+
FP8 negative (output corresponds to `experiments/moe-routed-experts/data/6000_bf16_vs_fp8_layers_0/`):
|
| 961 |
+
|
| 962 |
+
```bash
|
| 963 |
+
python3 tools/moe_routed_experts/scripts/compare_routes.py \
|
| 964 |
+
--generated <generated_routes_6000_bf16.jsonl> \
|
| 965 |
+
--prefill <prefill_routes_6000_bf16_vs_fp8.jsonl> \
|
| 966 |
+
--output-dir experiments/moe-routed-experts/data/6000_bf16_vs_fp8_layers_0 \
|
| 967 |
+
--layers 0
|
| 968 |
+
```
|
| 969 |
+
|
| 970 |
+
## Conditions for Re-Calibrating Thresholds
|
| 971 |
+
|
| 972 |
+
Re-calibration of the thresholds is recommended when any of the following factors change:
|
| 973 |
+
|
| 974 |
+
- vLLM version
|
| 975 |
+
- CUDA/Triton kernel
|
| 976 |
+
- GPU architecture
|
| 977 |
+
- Quantization recipe
|
| 978 |
+
- Model checkpoint
|
| 979 |
+
- tokenizer
|
| 980 |
+
- prompt distribution
|
| 981 |
+
- max output length
|
| 982 |
+
- routing output format
|
| 983 |
+
|
| 984 |
+
The re-calibration procedure for each verifier model:
|
| 985 |
+
|
| 986 |
+
1. Collect same-model positive traces.
|
| 987 |
+
2. Collect negative traces from all possible competing models.
|
| 988 |
+
3. Use only layer 0.
|
| 989 |
+
4. Compute the random 5-sample grouped weighted score.
|
| 990 |
+
5. Prioritize choosing a threshold that controls false accepts.
|
| 991 |
+
|
| 992 |
+
Recommended target:
|
| 993 |
+
|
| 994 |
+
```text
|
| 995 |
+
FPR <= 0.1% on random 5-sample groups
|
| 996 |
+
```
|
| 997 |
+
|
| 998 |
+
If the verifier is used in a stricter scenario:
|
| 999 |
+
|
| 1000 |
+
```text
|
| 1001 |
+
sample_count >= 10
|
| 1002 |
+
total_compared_tokens >= 1024
|
| 1003 |
+
```
|
| 1004 |
+
|
| 1005 |
+
## Current Recommended Design
|
| 1006 |
+
|
| 1007 |
+
Only this section is retained as the final deployment convention. The verifier is recommended to use two layers of checks:
|
| 1008 |
+
|
| 1009 |
+
1. Route compatibility check: compare only the routed experts of layer 0, and compute
|
| 1010 |
+
`route_score = sum(entry_mismatch_count) / sum(compared_entries)`.
|
| 1011 |
+
2. Logit-token legality check: use the verifier prefill logits to compute the rank of the actual
|
| 1012 |
+
`output_token`, and check whether it conforms to the model's registered
|
| 1013 |
+
`registered_logit_tokens_top_k`.
|
| 1014 |
+
|
| 1015 |
+
Fixed parameters:
|
| 1016 |
+
|
| 1017 |
+
```text
|
| 1018 |
+
selected_layers = [0]
|
| 1019 |
+
sample_count >= 5
|
| 1020 |
+
total_compared_tokens >= 512
|
| 1021 |
+
|
| 1022 |
+
route_score threshold = use the verifier-specific threshold in "Threshold Details"
|
| 1023 |
+
|
| 1024 |
+
registered_logit_tokens_top_k = provided at model registration time, currently recommended to be 20
|
| 1025 |
+
```
|
| 1026 |
+
|
| 1027 |
+
Decision convention:
|
| 1028 |
+
|
| 1029 |
+
- When `route_score` is above the corresponding verifier threshold, judge as `reject`
|
| 1030 |
+
- When the verifier-prefill rank of the `output_token` exceeds `registered_logit_tokens_top_k`,
|
| 1031 |
+
and this is not a numerical boundary drift, judge as `reject`
|
| 1032 |
+
- Greedy is the special case of `registered_logit_tokens_top_k = 1`, but low-margin
|
| 1033 |
+
positions should still be marked `uncertain` rather than hard-rejected
|
| 1034 |
+
- Sampling by default only performs logit-token top-k set membership checks; only with identical hardware, identical vLLM
|
| 1035 |
+
version, identical kernel, and identical sampler, and with the seed/nonce bound before generation, is exact
|
| 1036 |
+
sampled-token replay used as a stronger check
|
| 1037 |
+
- Judge as `accept` only when both route compatibility and logit-token legality pass, and there are no `uncertain` tokens
|
| 1038 |
+
|
| 1039 |
+
This design is supported jointly by the current original experiments and the cross-GPU experiments.
|
experiments/worker-verifier-latency/data.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Worker vs. Verifier Latency Benchmark Report
|
| 2 |
+
|
| 3 |
+
This report is based on the timing results from `tools/vllm_worker_verify_pipeline/benchmark_worker_verifier_latency.py`. It quantifies the time-cost gap between the two paths and analyzes how input / output length affects that gap. Two runs are covered here — a smaller model on a consumer GPU and a larger model on a datacenter GPU — to show that the conclusion holds across model size and hardware. The collected data lives under `experiments/worker-verifier-latency/data/qwen3_8b/` and `experiments/worker-verifier-latency/data/qwen3_32b/`.
|
| 4 |
+
|
| 5 |
+
- Script: `tools/vllm_worker_verify_pipeline/benchmark_worker_verifier_latency.py`
|
| 6 |
+
- Models / hardware:
|
| 7 |
+
- **Qwen3-8B** — single RTX 4090, `vllm==0.29.0`
|
| 8 |
+
- **Qwen3-32B** — single H100 NVL, `vllm==0.29.0`
|
| 9 |
+
- Common config: quant=bf16, dtype=bfloat16, tensor_parallel_size=1
|
| 10 |
+
- Sampling: top_k logprobs = 20, warmup=2, repeats=5, batch=1
|
| 11 |
+
- Backend: vLLM offline `LLM` class (in-process, V1 EngineCore)
|
| 12 |
+
|
| 13 |
+
Both paths share a single `vllm.LLM` instance (same model, same GPU state):
|
| 14 |
+
|
| 15 |
+
- **worker**: normal generation, `prefill(input) + decode(output_len)`, `SamplingParams(max_tokens=output_len, logprobs=20)`; output length is pinned exactly via `ignore_eos + min_tokens`.
|
| 16 |
+
- **verifier**: a single prefill over the worker's `input_ids + output_ids` to recover per-position top-k logprobs, `SamplingParams(max_tokens=1, prompt_logprobs=20)`.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## 1. Executive Summary
|
| 21 |
+
|
| 22 |
+
**Core conclusion: the verifier's cost is far below the worker's generation cost — in typical multi-token output scenarios, verifying a full generation takes only about 1% of the cost to produce it (worker/verifier ≈ 80×–117×). This holds for both Qwen3-8B (RTX 4090) and Qwen3-32B (H100 NVL), i.e. it is robust to model size and hardware. This is direct evidence that the worker/verifier protocol is viable in terms of time cost.**
|
| 23 |
+
|
| 24 |
+
The gap stems from the fundamentally different nature of the two paths. The worker spends nearly all its time on **serial decode**, emitting tokens one at a time — ~17.5 ms/token for the 8B on a 4090, and ~22.7 ms/token for the 32B on an H100 NVL — essentially independent of input length. The verifier performs a **single parallel prefill**, computing all positions of input+output at once at several thousand tok/s. The ~two-orders-of-magnitude efficiency gap between serial decode and parallel prefill is the source of the cost difference. Consequently, the longer the output, the worse the worker fares and the more favorable verification becomes: the ratio peaks around 100×–117× when output is large.
|
| 25 |
+
|
| 26 |
+
Notably, the 32B model is only ~30% slower per decode token than the 8B despite being ~4× larger, because the H100 NVL's much higher memory bandwidth largely offsets the extra weight traffic. The verifier's parallel prefill throughput is comparable across the two setups, so the overall worker/verifier ratio lands in the same band.
|
| 27 |
+
|
| 28 |
+
The only exception is when the output is extremely short (=1), where the verifier is actually slightly slower (ratio 0.62–0.90) — it must compute top-k logprobs at every position, and that fixed overhead slightly outweighs the tiny decode savings. This is a corner case and does not affect the main conclusion.
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## 2. Worker Cost Model: Output-Dominated, Serial Decode
|
| 33 |
+
|
| 34 |
+
With input fixed at 128, worker time scales almost perfectly linearly with output, and the per-token cost holds steady — ~17.5 ms for the 8B, ~22.7 ms for the 32B:
|
| 35 |
+
|
| 36 |
+
| output | 8B worker med (s) | 8B per token (ms) | 32B worker med (s) | 32B per token (ms) |
|
| 37 |
+
|---:|---:|---:|---:|---:|
|
| 38 |
+
| 1024 | 17.63 | 17.2 | 23.13 | 22.6 |
|
| 39 |
+
| 2048 | 35.40 | 17.3 | 46.33 | 22.6 |
|
| 40 |
+
| 4096 | 71.49 | 17.5 | 93.09 | 22.7 |
|
| 41 |
+
| 8192 | 145.77 | 17.8 | 187.66 | 22.9 |
|
| 42 |
+
|
| 43 |
+
Input has little effect on the worker — with output fixed at 1024, growing input from 128 to 8192 raises worker time by only ~10–12%:
|
| 44 |
+
|
| 45 |
+
| input | 8B worker med (s) @ out=1024 | 32B worker med (s) @ out=1024 |
|
| 46 |
+
|---:|---:|---:|
|
| 47 |
+
| 128 | 17.63 | 23.13 |
|
| 48 |
+
| 512 | 17.71 | 23.21 |
|
| 49 |
+
| 1024 | 17.83 | 23.43 |
|
| 50 |
+
| 2048 | 18.14 | 23.67 |
|
| 51 |
+
| 4096 | 18.76 | 24.22 |
|
| 52 |
+
| 8192 | 19.80 | 25.44 |
|
| 53 |
+
|
| 54 |
+
The pure prefill cost can be read approximately from the output=1 rows (8B: input=8192 / out=1 → 0.886s; 32B: input=8192 / out=1 → 1.428s).
|
| 55 |
+
|
| 56 |
+
**Conclusion: worker cost ≈ output_len × (per-token decode cost), consistent with decode being serial and memory-bandwidth-bound. The larger model pays more per token, but only modestly, thanks to the faster GPU's bandwidth.**
|
| 57 |
+
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
## 3. Verifier Cost Model: Total-Dominated, Parallel Prefill
|
| 61 |
+
|
| 62 |
+
The verifier is a single prefill; its time scales linearly with total (input+output). Effective throughput is a few thousand tok/s for both setups:
|
| 63 |
+
|
| 64 |
+
| total | 8B verifier med (s) | 8B tok/s | 32B verifier med (s) | 32B tok/s |
|
| 65 |
+
|---:|---:|---:|---:|---:|
|
| 66 |
+
| 129 | 0.033 | (fixed overhead) | 0.038 | (fixed overhead) |
|
| 67 |
+
| 1152 | 0.170 | ~6800 | 0.221 | ~5200 |
|
| 68 |
+
| 8320 | 1.488 | ~5600 | 1.924 | ~4325 |
|
| 69 |
+
| 16384 | 3.129 | ~5240 | 4.038 | ~4057 |
|
| 70 |
+
|
| 71 |
+
**Conclusion: verifier cost ≈ total_tokens / (a few thousand tok/s) + fixed overhead. Prefill computes all positions in one parallel pass, making it two orders of magnitude faster than serial decode. The 32B verifier is only moderately slower than the 8B's despite the larger weights, again because the H100 NVL absorbs the extra bandwidth demand.**
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## 4. Key Metric: Worker/Verifier Cost Ratio
|
| 76 |
+
|
| 77 |
+
This is the most valuable output of the experiment. The ratio grows sharply with output before flattening. Representative scenarios for both models:
|
| 78 |
+
|
| 79 |
+
| Scenario (input/output) | 8B ratio | 32B ratio |
|
| 80 |
+
|---|---:|---:|
|
| 81 |
+
| 512 / 1024 | **81.5×** | **85.7×** |
|
| 82 |
+
| 128 / 2048 | **113.6×** | 73.6× ¹ |
|
| 83 |
+
| 2048 / 4096 | **89.2×** | 66.9× |
|
| 84 |
+
| 1024 / 4096 | **104.6×** | 96.0× |
|
| 85 |
+
| 128 / 4096 | 84.4× | **117.1×** |
|
| 86 |
+
|
| 87 |
+
¹ The 32B `128/2048` cell is a noisy outlier: its verifier median (0.630s) sits above the mean (0.559s) and even the p10 (0.424s), so the ratio there is depressed by verifier-side jitter rather than a real effect.
|
| 88 |
+
|
| 89 |
+
### 4.1 Qwen3-8B (RTX 4090) — full ratio matrix
|
| 90 |
+
|
| 91 |
+
| output → | 1 | 16 | 64 | 256 | 1024 | 2048 | 4096 | 8192 |
|
| 92 |
+
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 93 |
+
| input=128 | 0.82 | 8.36 | 26.27 | 70.10 | 103.78 | 113.56 | 84.45 | 97.99 |
|
| 94 |
+
| input=512 | 0.65 | 3.67 | 13.20 | 39.35 | 81.51 | 99.84 | 76.71 | 97.24 |
|
| 95 |
+
| input=1024 | 0.64 | 2.47 | 7.33 | 25.02 | 62.45 | 84.70 | 104.62 | 92.44 |
|
| 96 |
+
| input=2048 | 0.70 | 1.59 | 4.39 | 14.60 | 42.78 | 64.15 | 89.18 | 82.83 |
|
| 97 |
+
| input=4096 | 0.78 | 1.20 | 1.90 | 8.33 | 19.58 | 46.38 | 51.76 | 62.43 |
|
| 98 |
+
| input=8192 | 0.62 | 0.81 | 1.40 | 3.88 | 12.19 | 21.16 | 36.65 | 50.13 |
|
| 99 |
+
|
| 100 |
+
### 4.2 Qwen3-32B (H100 NVL) — full ratio matrix
|
| 101 |
+
|
| 102 |
+
| output → | 1 | 16 | 64 | 256 | 1024 | 2048 | 4096 | 8192 |
|
| 103 |
+
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 104 |
+
| input=128 | 0.90 | 9.67 | 30.06 | 75.97 | 104.79 | 73.59 ¹ | 117.05 | 97.56 |
|
| 105 |
+
| input=512 | 0.89 | 4.27 | 13.93 | 42.31 | 85.69 | 98.90 | 106.36 | 96.07 |
|
| 106 |
+
| input=1024 | 0.81 | 2.71 | 7.51 | 24.52 | 62.38 | 82.43 | 95.96 | 90.47 |
|
| 107 |
+
| input=2048 | 0.89 | 1.78 | 4.14 | 14.44 | 41.38 | 48.15 | 66.90 | 81.38 |
|
| 108 |
+
| input=4096 | 0.67 | 1.33 | 2.64 | 6.06 | 20.10 | 33.73 | 52.05 | 68.58 |
|
| 109 |
+
| input=8192 | 0.80 | 0.97 | 1.52 | 3.86 | 11.88 | 21.14 | 34.78 | 48.49 |
|
| 110 |
+
|
| 111 |
+
How to read the tables (both matrices show the same structure):
|
| 112 |
+
|
| 113 |
+
- **The output=1 column is entirely < 1**: the verifier is slightly slower than the worker due to the per-position logprobs overhead.
|
| 114 |
+
- **Each row rises monotonically with output**: the longer the output, the more cost-effective verification becomes.
|
| 115 |
+
- **Each column decreases as input grows**: with longer input, the verifier must pay for the extra input-segment prefill, narrowing the ratio.
|
| 116 |
+
- **For a fixed input the ratio rises then flattens/dips slightly**: when output ≫ input, the verifier's total ≈ output also scales ∝ output, so the ratio asymptotes to `(per-token decode) / (per-token prefill) ≈ 90–110×`.
|
| 117 |
+
- **The two models track each other closely**: same shape, same magnitude, peaks in the 100×–117× range. The worker/verifier advantage is not an artifact of one particular model or GPU.
|
| 118 |
+
|
| 119 |
+
---
|
| 120 |
+
|
| 121 |
+
## 5. Notes and Limitations
|
| 122 |
+
|
| 123 |
+
- **The TTFT / decode split columns are empty (`-`).** Both runs used the vLLM V1 engine (the `EngineCore` in the logs), which does not expose the legacy `RequestMetrics.first_token_time`, so the script cannot separate TTFT from decode. This does not affect the total timings or any conclusion above; for a prefill approximation, use the output=1 rows.
|
| 124 |
+
- **This is single-request latency at batch=1.** In real online serving, the worker amortizes per-token cost via continuous batching, and the verifier can verify in batches, so absolute numbers will change. However, the fundamental difference between prefill (parallel) and decode (serial) remains, so the order-of-magnitude relationship — "verification is far cheaper than generation" — still holds.
|
| 125 |
+
- **Cross-run comparison caveat.** The 8B and 32B runs use different GPUs (RTX 4090 vs H100 NVL), so per-model absolute latencies are not directly comparable; what *is* comparable, and what this report emphasizes, is the worker/verifier *ratio* within each run.
|
| 126 |
+
- **A few individual cells are noisy** (notably 32B `128/2048`, see §4). Verifier times for small totals are dominated by fixed overhead and are more susceptible to jitter; treat single-cell anomalies with caution and rely on the overall trend.
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
|
| 130 |
+
## 6. Reproduction
|
| 131 |
+
|
| 132 |
+
Qwen3-8B (RTX 4090):
|
| 133 |
+
|
| 134 |
+
```bash
|
| 135 |
+
cd tools/vllm_worker_verify_pipeline
|
| 136 |
+
./benchmark_worker_verifier_latency.py \
|
| 137 |
+
--model Qwen/Qwen3-8B \
|
| 138 |
+
--dtype bfloat16 --trust-remote-code \
|
| 139 |
+
--max-model-len 32768 \
|
| 140 |
+
--gpu-memory-utilization 0.95 \
|
| 141 |
+
--input-lengths "128 512 1024 2048 4096 8192" \
|
| 142 |
+
--output-lengths "1 16 64 256 1024 2048 4096 8192" \
|
| 143 |
+
--top-k 20 --warmup 2 --repeats 5 \
|
| 144 |
+
--gpu "4090" \
|
| 145 |
+
--output-dir qwen3_8b
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
Qwen3-32B (H100 NVL):
|
| 149 |
+
|
| 150 |
+
```bash
|
| 151 |
+
cd tools/vllm_worker_verify_pipeline
|
| 152 |
+
./benchmark_worker_verifier_latency.py \
|
| 153 |
+
--model Qwen/Qwen3-32B \
|
| 154 |
+
--dtype bfloat16 --trust-remote-code \
|
| 155 |
+
--max-model-len 32768 \
|
| 156 |
+
--gpu-memory-utilization 0.95 \
|
| 157 |
+
--input-lengths "128 512 1024 2048 4096 8192" \
|
| 158 |
+
--output-lengths "1 16 64 256 1024 2048 4096 8192" \
|
| 159 |
+
--top-k 20 --warmup 2 --repeats 5 \
|
| 160 |
+
--gpu "h100nvl" \
|
| 161 |
+
--output-dir qwen3_32b
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
(These are the actual arguments that produced the committed data; the results are
|
| 165 |
+
stored under `experiments/worker-verifier-latency/data/qwen3_8b/` and
|
| 166 |
+
`experiments/worker-verifier-latency/data/qwen3_32b/`. Note
|
| 167 |
+
`--max-model-len 32768` is required — the largest cells reach total = 16384 tokens,
|
| 168 |
+
which an 8192 context cannot hold. The `--gpu` value is a free-form label recorded
|
| 169 |
+
verbatim into `metadata.json`, not a detected device.)
|
| 170 |
+
|
| 171 |
+
Artifacts (per model dir): `latency_summary.csv` (aggregated metrics), `latency_raw.jsonl` (per-iteration raw timings), `summary.md` (Markdown table), `metadata.json` (args and environment).
|
| 172 |
+
|
| 173 |
+
---
|
| 174 |
+
|
| 175 |
+
## Appendix A: Full Data Table — Qwen3-8B (RTX 4090)
|
| 176 |
+
|
| 177 |
+
| input | output | total | worker med (s) | verifier med (s) | worker/verifier |
|
| 178 |
+
|---:|---:|---:|---:|---:|---:|
|
| 179 |
+
| 128 | 1 | 129 | 0.0272 | 0.0332 | 0.82 |
|
| 180 |
+
| 128 | 16 | 144 | 0.2839 | 0.0340 | 8.36 |
|
| 181 |
+
| 128 | 64 | 192 | 1.1085 | 0.0422 | 26.27 |
|
| 182 |
+
| 128 | 256 | 384 | 4.4061 | 0.0629 | 70.10 |
|
| 183 |
+
| 128 | 1024 | 1152 | 17.6304 | 0.1699 | 103.78 |
|
| 184 |
+
| 128 | 2048 | 2176 | 35.3973 | 0.3117 | 113.56 |
|
| 185 |
+
| 128 | 4096 | 4224 | 71.4902 | 0.8465 | 84.45 |
|
| 186 |
+
| 128 | 8192 | 8320 | 145.7669 | 1.4876 | 97.99 |
|
| 187 |
+
| 512 | 1 | 513 | 0.0549 | 0.0849 | 0.65 |
|
| 188 |
+
| 512 | 16 | 528 | 0.3137 | 0.0854 | 3.67 |
|
| 189 |
+
| 512 | 64 | 576 | 1.1387 | 0.0863 | 13.20 |
|
| 190 |
+
| 512 | 256 | 768 | 4.4452 | 0.1130 | 39.35 |
|
| 191 |
+
| 512 | 1024 | 1536 | 17.7100 | 0.2173 | 81.51 |
|
| 192 |
+
| 512 | 2048 | 2560 | 35.5538 | 0.3561 | 99.84 |
|
| 193 |
+
| 512 | 4096 | 4608 | 71.8107 | 0.9361 | 76.71 |
|
| 194 |
+
| 512 | 8192 | 8704 | 146.3028 | 1.5046 | 97.24 |
|
| 195 |
+
| 1024 | 1 | 1025 | 0.1016 | 0.1586 | 0.64 |
|
| 196 |
+
| 1024 | 16 | 1040 | 0.3624 | 0.1467 | 2.47 |
|
| 197 |
+
| 1024 | 64 | 1088 | 1.1905 | 0.1625 | 7.33 |
|
| 198 |
+
| 1024 | 256 | 1280 | 4.5075 | 0.1802 | 25.02 |
|
| 199 |
+
| 1024 | 1024 | 2048 | 17.8318 | 0.2855 | 62.45 |
|
| 200 |
+
| 1024 | 2048 | 3072 | 35.7824 | 0.4224 | 84.70 |
|
| 201 |
+
| 1024 | 4096 | 5120 | 72.2362 | 0.6905 | 104.62 |
|
| 202 |
+
| 1024 | 8192 | 9216 | 147.0083 | 1.5903 | 92.44 |
|
| 203 |
+
| 2048 | 1 | 2049 | 0.2040 | 0.2910 | 0.70 |
|
| 204 |
+
| 2048 | 16 | 2064 | 0.4668 | 0.2937 | 1.59 |
|
| 205 |
+
| 2048 | 64 | 2112 | 1.3059 | 0.2973 | 4.39 |
|
| 206 |
+
| 2048 | 256 | 2304 | 4.6611 | 0.3193 | 14.60 |
|
| 207 |
+
| 2048 | 1024 | 3072 | 18.1371 | 0.4239 | 42.78 |
|
| 208 |
+
| 2048 | 2048 | 4096 | 36.2336 | 0.5648 | 64.15 |
|
| 209 |
+
| 2048 | 4096 | 6144 | 73.0383 | 0.8190 | 89.18 |
|
| 210 |
+
| 2048 | 8192 | 10240 | 148.4488 | 1.7922 | 82.83 |
|
| 211 |
+
| 4096 | 1 | 4097 | 0.4181 | 0.5344 | 0.78 |
|
| 212 |
+
| 4096 | 16 | 4112 | 0.6856 | 0.5693 | 1.20 |
|
| 213 |
+
| 4096 | 64 | 4160 | 1.5416 | 0.8107 | 1.90 |
|
| 214 |
+
| 4096 | 256 | 4352 | 4.9817 | 0.5982 | 8.33 |
|
| 215 |
+
| 4096 | 1024 | 5120 | 18.7645 | 0.9585 | 19.58 |
|
| 216 |
+
| 4096 | 2048 | 6144 | 37.2070 | 0.8023 | 46.38 |
|
| 217 |
+
| 4096 | 4096 | 8192 | 74.6061 | 1.4413 | 51.76 |
|
| 218 |
+
| 4096 | 8192 | 12288 | 151.2620 | 2.4228 | 62.43 |
|
| 219 |
+
| 8192 | 1 | 8193 | 0.8863 | 1.4333 | 0.62 |
|
| 220 |
+
| 8192 | 16 | 8208 | 1.1655 | 1.4470 | 0.81 |
|
| 221 |
+
| 8192 | 64 | 8256 | 2.0467 | 1.4572 | 1.40 |
|
| 222 |
+
| 8192 | 256 | 8448 | 5.5912 | 1.4422 | 3.88 |
|
| 223 |
+
| 8192 | 1024 | 9216 | 19.7963 | 1.6246 | 12.19 |
|
| 224 |
+
| 8192 | 2048 | 10240 | 38.8759 | 1.8373 | 21.16 |
|
| 225 |
+
| 8192 | 4096 | 12288 | 77.5542 | 2.1159 | 36.65 |
|
| 226 |
+
| 8192 | 8192 | 16384 | 156.8459 | 3.1287 | 50.13 |
|
| 227 |
+
|
| 228 |
+
---
|
| 229 |
+
|
| 230 |
+
## Appendix B: Full Data Table — Qwen3-32B (H100 NVL)
|
| 231 |
+
|
| 232 |
+
| input | output | total | worker med (s) | verifier med (s) | worker/verifier |
|
| 233 |
+
|---:|---:|---:|---:|---:|---:|
|
| 234 |
+
| 128 | 1 | 129 | 0.0341 | 0.0380 | 0.90 |
|
| 235 |
+
| 128 | 16 | 144 | 0.3699 | 0.0383 | 9.67 |
|
| 236 |
+
| 128 | 64 | 192 | 1.4316 | 0.0476 | 30.06 |
|
| 237 |
+
| 128 | 256 | 384 | 5.7371 | 0.0755 | 75.97 |
|
| 238 |
+
| 128 | 1024 | 1152 | 23.1320 | 0.2208 | 104.79 |
|
| 239 |
+
| 128 | 2048 | 2176 | 46.3294 | 0.6296 | 73.59 |
|
| 240 |
+
| 128 | 4096 | 4224 | 93.0909 | 0.7953 | 117.05 |
|
| 241 |
+
| 128 | 8192 | 8320 | 187.6646 | 1.9236 | 97.56 |
|
| 242 |
+
| 512 | 1 | 513 | 0.0869 | 0.0973 | 0.89 |
|
| 243 |
+
| 512 | 16 | 528 | 0.4369 | 0.1024 | 4.27 |
|
| 244 |
+
| 512 | 64 | 576 | 1.5196 | 0.1091 | 13.93 |
|
| 245 |
+
| 512 | 256 | 768 | 5.8605 | 0.1385 | 42.31 |
|
| 246 |
+
| 512 | 1024 | 1536 | 23.2122 | 0.2709 | 85.69 |
|
| 247 |
+
| 512 | 2048 | 2560 | 46.5517 | 0.4707 | 98.90 |
|
| 248 |
+
| 512 | 4096 | 4608 | 93.1237 | 0.8756 | 106.36 |
|
| 249 |
+
| 512 | 8192 | 8704 | 188.3937 | 1.9609 | 96.07 |
|
| 250 |
+
| 1024 | 1 | 1025 | 0.1595 | 0.1962 | 0.81 |
|
| 251 |
+
| 1024 | 16 | 1040 | 0.5115 | 0.1884 | 2.71 |
|
| 252 |
+
| 1024 | 64 | 1088 | 1.6060 | 0.2138 | 7.51 |
|
| 253 |
+
| 1024 | 256 | 1280 | 5.9531 | 0.2428 | 24.52 |
|
| 254 |
+
| 1024 | 1024 | 2048 | 23.4337 | 0.3757 | 62.38 |
|
| 255 |
+
| 1024 | 2048 | 3072 | 46.7594 | 0.5673 | 82.43 |
|
| 256 |
+
| 1024 | 4096 | 5120 | 93.7020 | 0.9765 | 95.96 |
|
| 257 |
+
| 1024 | 8192 | 9216 | 188.9899 | 2.0891 | 90.47 |
|
| 258 |
+
| 2048 | 1 | 2049 | 0.3371 | 0.3772 | 0.89 |
|
| 259 |
+
| 2048 | 16 | 2064 | 0.6822 | 0.3837 | 1.78 |
|
| 260 |
+
| 2048 | 64 | 2112 | 1.7670 | 0.4273 | 4.14 |
|
| 261 |
+
| 2048 | 256 | 2304 | 6.1526 | 0.4262 | 14.44 |
|
| 262 |
+
| 2048 | 1024 | 3072 | 23.6689 | 0.5720 | 41.38 |
|
| 263 |
+
| 2048 | 2048 | 4096 | 46.8743 | 0.9736 | 48.15 |
|
| 264 |
+
| 2048 | 4096 | 6144 | 94.0470 | 1.4059 | 66.90 |
|
| 265 |
+
| 2048 | 8192 | 10240 | 189.6197 | 2.3300 | 81.38 |
|
| 266 |
+
| 4096 | 1 | 4097 | 0.6376 | 0.9557 | 0.67 |
|
| 267 |
+
| 4096 | 16 | 4112 | 0.9802 | 0.7394 | 1.33 |
|
| 268 |
+
| 4096 | 64 | 4160 | 2.1058 | 0.7964 | 2.64 |
|
| 269 |
+
| 4096 | 256 | 4352 | 6.5474 | 1.0798 | 6.06 |
|
| 270 |
+
| 4096 | 1024 | 5120 | 24.2233 | 1.2049 | 20.10 |
|
| 271 |
+
| 4096 | 2048 | 6144 | 47.9006 | 1.4200 | 33.73 |
|
| 272 |
+
| 4096 | 4096 | 8192 | 95.5773 | 1.8361 | 52.05 |
|
| 273 |
+
| 4096 | 8192 | 12288 | 191.8452 | 2.7974 | 68.58 |
|
| 274 |
+
| 8192 | 1 | 8193 | 1.4284 | 1.7834 | 0.80 |
|
| 275 |
+
| 8192 | 16 | 8208 | 1.8025 | 1.8587 | 0.97 |
|
| 276 |
+
| 8192 | 64 | 8256 | 2.9443 | 1.9347 | 1.52 |
|
| 277 |
+
| 8192 | 256 | 8448 | 7.4379 | 1.9247 | 3.86 |
|
| 278 |
+
| 8192 | 1024 | 9216 | 25.4369 | 2.1414 | 11.88 |
|
| 279 |
+
| 8192 | 2048 | 10240 | 49.5643 | 2.3441 | 21.14 |
|
| 280 |
+
| 8192 | 4096 | 12288 | 98.0349 | 2.8185 | 34.78 |
|
| 281 |
+
| 8192 | 8192 | 16384 | 195.8385 | 4.0383 | 48.49 |
|