Graffioh commited on
Commit
635a60c
·
verified ·
1 Parent(s): 3841953

Update README with PFlash v3.3 Gold v4 (comp_hull_r2 + Stage-1 nucleus mass-floor) benchmark results

Browse files
Files changed (1) hide show
  1. README.md +31 -25
README.md CHANGED
@@ -27,7 +27,7 @@ activations decide what the large reader model prefills:
27
  plus both uniform (`k_bar`) and attention-mass-weighted (`k_att`) L2-normalized per-segment key centroids;
28
  4. **Dual-key bidirectional segment reranker** (`seg-reranker.gguf`) refines segment relevance with full
29
  cross-segment context (`~1.5–4 ms` on GPU) over concatenated `[k_bar, k_att]` (`1024`-dim) representations
30
- and drives PFlash v3's one-sided adaptive keep-ratio safety net.
31
 
32
  All Stage-1 signals read the same tap — the drafter's block-14 residual (`post_block14_residual_before_block15`)
33
  — from the same single forward pass. The highest-ranked units that fit the budget go to the reader in their
@@ -54,10 +54,12 @@ original order, plus the pinned request.
54
  with `min_segment=32`, `max_segment=512`, and line-aligned oversize splitting preferring sub-unit starts.
55
  Container probabilities feed directly into the segment reranker as left/right boundary features.
56
  - **Request probe (`request-probe.gguf`)**: LayerNorm(1024) → Linear(1024, 256) → GELU (erf) → Linear(256, 1).
57
- Locates the user's request inside long pastes, RAG prompts, or multi-turn chats, scores only positive-logit
58
- request tokens (`s1 >= 0`) while pinning whole request units verbatim (up to 512 tokens), and uses
59
- score-calibrated blend weight (`PFLASH_QUERY_TW=score`) without prose-vs-paste heuristics. On autonomous
60
- tool turns and Lucebox Mix switches, active tool observations are promoted as the query role.
 
 
61
  - **Stage-1 scoring head (`seg-scoring-head.gguf`)**: Two projection matrices (`attn_q` `[1024, 2048]`, `attn_k`
62
  `[1024, 512]`) computing GPU-reduced NoPE query→context attention mass density per unit plus L2-normalized
63
  mean key centroids (`k_bar`) and attention-mass-weighted key centroids (`k_att`) in a single GPU pass.
@@ -71,12 +73,15 @@ original order, plus the pinned request.
71
  cosine similarity `adj_kcos`), emitting a sparse, bounded non-negative residual promotion (`delta in [0, 100]`,
72
  metadata `reranker.delta_min`/`reranker.delta_max`) on Stage-1 `log_density` so isolated needles cannot be
73
  suppressed while multi-hop and cross-segment reasoning evidence is promoted.
74
- - **One-sided adaptive keep-ratio safety net**: Computed in `<0.1 ms` from the reranker's optional-segment
75
- log-scores via sink-free token-level perplexity fraction `eff = exp(H_tok) / N_opt`:
76
- - `eff < 0.38` (sharp/targeted query): untouched V3 base curve for maximum speedup;
77
- - `0.38 <= eff < 0.46` (broad/multi-file query): monotonically widens keep ratio to `max(curve, eff)`;
78
- - `eff >= 0.46` (diffuse/global query): bypasses to `100%` raw verbatim full prefill whenever the prompt
79
- fits `max_ctx` (while preserving warm KV prefixes on continuations).
 
 
 
80
 
81
  ## Using it
82
 
@@ -94,28 +99,28 @@ export PFLASH_REQUEST_PROBE_GGUF=/path/to/pflash/request-probe.gguf
94
 
95
  - **Default V3.3 quality-first curve**: activates from **8,192** tokens (`8192:0.450`, `16384:0.350`,
96
  `32768:0.270`, `65536:0.260`, `120000:0.240`).
97
- - **Built-in defaults**: one-sided adaptive keep-ratio safety net, pure-neural query candidates
98
- (`PFLASH_QUERY_TW=score`), Lucebox Mix cold-history paging, and autonomous tool-turn recall are all enabled
99
- automatically.
100
  - Runtime support: [Luce-Org/lucebox PR #1048](https://github.com/Luce-Org/lucebox/pull/1048) (building on
101
  [PR #746](https://github.com/Luce-Org/lucebox/pull/746)).
102
 
103
  ## Results
104
 
105
  Measured end-to-end with all four components enabled (default launch, zero extra flags), reader
106
- `Qwen3.8-27B IQ4_XS`, AMD Radeon AI PRO R9700, single GPU:
107
 
108
  ### Public Long-Context & Code Suite (Full Prefill vs PFlash v3.3 Dual-Key)
109
 
110
  | Benchmark | Full prefill | PFlash v3.3 Dual-Key | Full TTFT | PFlash v3.3 TTFT | Speedup | Median kept |
111
  |---|---:|---:|---:|---:|---:|---:|
112
- | Document QA | 27/30 | **27/30** | 29.8 s | **8.32 s** | **3.58×** | 29% |
113
- | RULER QA | 13/15 | **13/15** | — | **6.06 s** | — | 35% |
114
- | NoLiMa | 14/24 | **13/24** | 15.2 s | **6.12 s** | **2.48×** | 35% |
115
- | CodeDebug | 23/30 (76.7%) | **25/32 (78.1%)** | 140.7 s | **26.47 s** | **5.32×** | 25% |
116
- | BRIGHT | 23/28 | **24/28** | 35.5 s | **9.19 s** | **3.86×** | 27% |
117
- | LongCodeQA | 57/114 | **57/114** | 42.5 s | **10.5 s** | **4.05×** | 27% |
118
- | LongBench-v2 | 7/12 | 3/12 *(4 cap)* | 27.5 s | **8.17 s** | **3.37×** | 31% |
119
 
120
  ### 8K–11K Threshold Suite (70 items)
121
 
@@ -134,8 +139,9 @@ Measured end-to-end with all four components enabled (default launch, zero extra
134
 
135
  ## Limits
136
 
137
- - Even with the one-sided adaptive safety net, compression is still lossy on sharp queries (`eff < 0.38`): a
138
- rare edge case can drop a detail if both Stage-1 and the reranker under-rank it.
139
- - Diffuse/global prompts (`eff >= 0.46`) intentionally fall back to full prefill (when within `max_ctx`),
 
140
  trading speedup for exact lossless coverage.
141
  - All four GGUFs are bound to the pinned `Qwen3.5-0.8B-BF16.gguf` drafter (`cedf89af…`).
 
27
  plus both uniform (`k_bar`) and attention-mass-weighted (`k_att`) L2-normalized per-segment key centroids;
28
  4. **Dual-key bidirectional segment reranker** (`seg-reranker.gguf`) refines segment relevance with full
29
  cross-segment context (`~1.5–4 ms` on GPU) over concatenated `[k_bar, k_att]` (`1024`-dim) representations
30
+ and drives PFlash v3's adaptive keep-ratio safety net.
31
 
32
  All Stage-1 signals read the same tap — the drafter's block-14 residual (`post_block14_residual_before_block15`)
33
  — from the same single forward pass. The highest-ranked units that fit the budget go to the reader in their
 
54
  with `min_segment=32`, `max_segment=512`, and line-aligned oversize splitting preferring sub-unit starts.
55
  Container probabilities feed directly into the segment reranker as left/right boundary features.
56
  - **Request probe (`request-probe.gguf`)**: LayerNorm(1024) → Linear(1024, 256) → GELU (erf) → Linear(256, 1).
57
+ Locates the user's request inside long pastes, RAG prompts, or multi-turn chats, trims each connected
58
+ request component to the 1D convex hull of its positive-logit (`s1 >= 0`) runs (`run >= 2`, falling back to
59
+ `run >= 1` then full extent) so inline question tokens stay intact without bridging disjoint spans, pins
60
+ whole request units verbatim (up to 512 tokens), and uses score-calibrated blend weight
61
+ (`PFLASH_QUERY_TW=score`) without prose-vs-paste heuristics. On autonomous tool turns and Lucebox Mix
62
+ switches, active tool observations are promoted as the query role.
63
  - **Stage-1 scoring head (`seg-scoring-head.gguf`)**: Two projection matrices (`attn_q` `[1024, 2048]`, `attn_k`
64
  `[1024, 512]`) computing GPU-reduced NoPE query→context attention mass density per unit plus L2-normalized
65
  mean key centroids (`k_bar`) and attention-mass-weighted key centroids (`k_att`) in a single GPU pass.
 
73
  cosine similarity `adj_kcos`), emitting a sparse, bounded non-negative residual promotion (`delta in [0, 100]`,
74
  metadata `reranker.delta_min`/`reranker.delta_max`) on Stage-1 `log_density` so isolated needles cannot be
75
  suppressed while multi-hop and cross-segment reasoning evidence is promoted.
76
+ - **Stage-1 nucleus mass-floor + one-sided adaptive keep-ratio safety net**: Computed in `<0.1 ms` from the
77
+ optional-segment scores:
78
+ - **Stage-1 nucleus mass-floor (`p = 0.90`, cap `0.58`)**: monotonically widens the keep budget to cover
79
+ `90%` of the calibrated Stage-1 optional attention mass (capped at `0.58`), keeping sharp queries on the
80
+ fast base curve (`~28–29%` kept) while giving diffuse, multi-hop, or implicit-needle prompts the evidence
81
+ budget they need;
82
+ - **Adaptive perplexity safety net** (`eff = exp(H_tok) / N_opt`, `T = 0.85`): `eff >= 0.42` monotonically
83
+ widens to `max(curve, eff)`, and `eff >= 0.58` (diffuse/global query) bypasses to `100%` raw verbatim full
84
+ prefill whenever the prompt fits `max_ctx` (while preserving warm KV prefixes on continuations).
85
 
86
  ## Using it
87
 
 
99
 
100
  - **Default V3.3 quality-first curve**: activates from **8,192** tokens (`8192:0.450`, `16384:0.350`,
101
  `32768:0.270`, `65536:0.260`, `120000:0.240`).
102
+ - **Built-in defaults**: Stage-1 nucleus mass-floor (`0.90`, cap `0.58`), one-sided adaptive keep-ratio safety
103
+ net (`0.42`/`0.58`), pure-neural query candidates (`PFLASH_QUERY_TW=score`), Lucebox Mix cold-history paging,
104
+ and autonomous tool-turn recall are all enabled automatically.
105
  - Runtime support: [Luce-Org/lucebox PR #1048](https://github.com/Luce-Org/lucebox/pull/1048) (building on
106
  [PR #746](https://github.com/Luce-Org/lucebox/pull/746)).
107
 
108
  ## Results
109
 
110
  Measured end-to-end with all four components enabled (default launch, zero extra flags), reader
111
+ `Qwen3.8-27B IQ4_XS`, AMD Radeon AI PRO R9700, single GPU, `max_tokens = 2048` (matched with Full Prefill):
112
 
113
  ### Public Long-Context & Code Suite (Full Prefill vs PFlash v3.3 Dual-Key)
114
 
115
  | Benchmark | Full prefill | PFlash v3.3 Dual-Key | Full TTFT | PFlash v3.3 TTFT | Speedup | Median kept |
116
  |---|---:|---:|---:|---:|---:|---:|
117
+ | Document QA | 27/30 | **27/30** | 29.8 s | **8.35 s** | **3.57×** | 29% |
118
+ | RULER QA | 13/15 | **13/15** | — | **6.05 s** | — | 35% |
119
+ | NoLiMa | 14/24 | **17/24** *(1 cap)* | 15.2 s | **8.94 s** | **1.70×** | 57% |
120
+ | CodeDebug | 23/30 (76.7%) | **25/32 (78.1%)** *(6 cap)* | 140.7 s | **54.55 s** | **2.58×** | 49% |
121
+ | BRIGHT | 23/28 | **24/28** | 35.5 s | **9.49 s** | **3.74×** | 28% |
122
+ | LongCodeQA | 57/114 | **59/114** *(12 cap)* | 42.5 s | **12.80 s** | **3.32×** | 33% |
123
+ | LongBench-v2 | 7/12 | **5/12** *(2 cap)* | 27.5 s | **11.52 s** | **2.39×** | 44% |
124
 
125
  ### 8K–11K Threshold Suite (70 items)
126
 
 
139
 
140
  ## Limits
141
 
142
+ - Even with the Stage-1 nucleus mass-floor and one-sided adaptive safety net, compression is still lossy on
143
+ sharp queries (`eff < 0.42`): a rare edge case can drop a detail if both Stage-1 and the reranker under-rank
144
+ it.
145
+ - Diffuse/global prompts (`eff >= 0.58`) intentionally fall back to full prefill (when within `max_ctx`),
146
  trading speedup for exact lossless coverage.
147
  - All four GGUFs are bound to the pinned `Qwen3.5-0.8B-BF16.gguf` drafter (`cedf89af…`).