Feature Extraction
Transformers
Safetensors
inkling2_loop_text
decision-model
system-1
system-1.5
looped-transformer
early-exit
conformal-risk-control
selective-escalation
weight-space-programming
Mixture of Experts
Eval Results
Instructions to use eltokh7/inkling-2-mini-decision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eltokh7/inkling-2-mini-decision with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="eltokh7/inkling-2-mini-decision")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("eltokh7/inkling-2-mini-decision") model = AutoModel.from_pretrained("eltokh7/inkling-2-mini-decision", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Finalize v5.1 release: STE100 README.md, Blackwell G4 engine benchmarks, 3 refreshed visuals, and updated modeling.py
Browse files- README.md +98 -72
- assets/hard_v1_comparison.png +2 -2
- assets/header.jpg +2 -2
- assets/selective_escalation.png +2 -2
- modeling.py +14 -3
README.md
CHANGED
|
@@ -10,39 +10,46 @@ tags:
|
|
| 10 |
- early-exit
|
| 11 |
- conformal-risk-control
|
| 12 |
- selective-escalation
|
|
|
|
| 13 |
- moe
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# Inkling-2-Mini Decision v5.
|
| 17 |
|
| 18 |

|
| 19 |
|
| 20 |
## Overview
|
| 21 |
|
| 22 |
-
`Inkling-2-Mini Decision v5.
|
| 23 |
|
| 24 |
The model reads a state and one or more typed questions (`choice`, `noul` yes/no, or `score`) in one forward pass. It outputs calibrated probabilities and generates **zero output tokens**.
|
| 25 |
|
| 26 |
-
The middle 12 layers run in a loop between **1 and 5 times** (24 to 72 logical layers). Simple questions stop after 1 pass. Hard multi-step questions loop deeper before the model answers. After Loop 5, a
|
|
|
|
|
|
|
| 27 |
|
| 28 |
---
|
| 29 |
|
| 30 |
## Key Results
|
| 31 |
|
| 32 |
-
`v5.
|
| 33 |
|
| 34 |
-
| Benchmark
|
| 35 |
-
|---|---|---:|---:|---:|---:|---|
|
| 36 |
-
| **`decision-v7/test`** ($n=1{,}440$) |
|
| 37 |
-
| **`hard-v1/test`** ($n=1{,}088$, *OOD*) |
|
| 38 |
-
| **`hard-v1/dev`** ($n=1{,}083$, *OOD*) |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
1. **
|
| 43 |
-
2. **
|
| 44 |
-
3. **
|
| 45 |
-
4. **
|
| 46 |
|
| 47 |

|
| 48 |
|
|
@@ -61,16 +68,16 @@ Input (state + question + options)
|
|
| 61 |
• CrossLoopTrajectoryMixer attends across loops 1..k
|
| 62 |
• FullContextEvidencePooler pools 100% of state tokens into <= 64 chunks
|
| 63 |
• JointSchemaHead outputs calibrated option probabilities
|
| 64 |
-
• EscalationHead predicts p_escalate for System 2 handoff
|
| 65 |
```
|
| 66 |
|
| 67 |
-
###
|
| 68 |
|
| 69 |
-
- **Loop-Conditioned Shared Reasoning Expert (`LoopedSharedExpert` + `AdaLN-Zero(k)`):** A 170M-parameter dense SwiGLU expert runs in parallel with the frozen MoE experts across layers `6–17`.
|
| 70 |
-
- **Full-Context Evidence Pooling (`FullContextEvidencePooler`):**
|
| 71 |
-
- **Cross-Loop Trajectory Readout (`CrossLoopTrajectoryMixer`):** Causal attention
|
| 72 |
-
- **
|
| 73 |
-
- **
|
| 74 |
|
| 75 |
---
|
| 76 |
|
|
@@ -82,7 +89,7 @@ Install the requirements:
|
|
| 82 |
pip install "transformers>=5.24.0" torch huggingface_hub
|
| 83 |
```
|
| 84 |
|
| 85 |
-
Load `System15Engine` from `modeling.py`
|
| 86 |
|
| 87 |
```python
|
| 88 |
from modeling import System15Engine
|
|
@@ -112,8 +119,8 @@ questions = {
|
|
| 112 |
# 1. Shared-state multi-question execution (runs prelude layers 0..5 on `state` once)
|
| 113 |
out = engine.decide_multi(state, questions, mode="balanced", max_loops=5)
|
| 114 |
print(out["route"])
|
| 115 |
-
#
|
| 116 |
-
#
|
| 117 |
|
| 118 |
# 2. Batched active-set compaction across independent (state, question) pairs
|
| 119 |
batch_out = engine.decide_batch(
|
|
@@ -122,7 +129,7 @@ batch_out = engine.decide_batch(
|
|
| 122 |
)
|
| 123 |
|
| 124 |
# 3. Anytime streaming with a strict latency budget (yields Pass 1..5 refinements)
|
| 125 |
-
for step in engine.decide_anytime(state, questions["route"], deadline_ms=
|
| 126 |
if step["is_final"]:
|
| 127 |
print(step["answer"], step["loops_used"], step["readout"], step["escalate_prob"])
|
| 128 |
```
|
|
@@ -131,77 +138,96 @@ for step in engine.decide_anytime(state, questions["route"], deadline_ms=120.0):
|
|
| 131 |
|
| 132 |
## Benchmarks
|
| 133 |
|
| 134 |
-
All
|
| 135 |
|
| 136 |
-
### 1. Accuracy Across Loops 1 → 5
|
| 137 |
|
| 138 |
| Split | $n$ | Loop 1 (24L) | Loop 2 (36L) | Loop 3 (48L) | Loop 4 (60L) | **Loop 5 (72L)** | Δ vs. L1 |
|
| 139 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 140 |
-
| `decision-v7/dev` | 1,468 |
|
| 141 |
-
| `decision-v7/test` | 1,440 |
|
| 142 |
-
| `hard-v1/dev` *(OOD)* | 1,083 |
|
| 143 |
-
| `hard-v1/test` *(OOD)* | 1,088 |
|
| 144 |
|
| 145 |
-
### 2. `hard-v1/test` Subcategory Breakdown ($n=1{,}088$)
|
| 146 |
|
| 147 |
| Subcategory | $n$ | Loop 1 | Loop 3 | **Loop 5** | Gain (L1 → L5) |
|
| 148 |
|---|---:|---:|---:|---:|---:|
|
| 149 |
-
| `hard_tradeoff` | 200 |
|
| 150 |
-
| `hard_probability` | 158 |
|
| 151 |
-
| `hard_judge` | 188 |
|
| 152 |
-
| `hard_ambiguous` | 100 |
|
| 153 |
-
| `hard_multi_hop` | 125 | 36.
|
| 154 |
-
| `hard_long_policy` | 200 | 31.
|
| 155 |
-
| `hard_temporal_numeric` | 117 | 41.9% |
|
| 156 |
|
| 157 |
-
### 3. Conformal Risk Control (95% Clopper-Pearson UCBs
|
| 158 |
|
| 159 |
-
|
| 160 |
|
| 161 |
-
| Split & Mode | Threshold
|
| 162 |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 163 |
-
| `v7/test` — `fast` | `0.
|
| 164 |
-
| `v7/test` — `balanced`
|
| 165 |
-
| `
|
| 166 |
-
| `hard-v1/test` — `
|
| 167 |
-
| `hard-v1/
|
|
|
|
| 168 |
|
| 169 |
### 4. Tri-State Cognitive Control: Selective Accuracy vs. Coverage
|
| 170 |
|
| 171 |
-
Ranking questions by `EscalationHead` (`escalate_prob`)
|
| 172 |
|
| 173 |

|
| 174 |
|
| 175 |
| Split (Base L5 / AUROC) | Escalation Rate | Coverage | Autonomous Acc | 95% LCB | Error Recall | Oracle S2 Combined Acc |
|
| 176 |
|---|---:|---:|---:|---:|---:|---:|
|
| 177 |
-
| `v7/test` (`
|
| 178 |
-
| `v7/test` (`
|
| 179 |
-
| `v7/test` (`
|
| 180 |
-
| `v7/test` (`
|
| 181 |
-
| `hard-v1/test` (`
|
| 182 |
-
| `hard-v1/test` (`
|
| 183 |
-
| `hard-v1/test` (`
|
| 184 |
-
| `hard-v1/test` (`
|
| 185 |
-
|
| 186 |
-
### 5.
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
|
| 193 |
-
|
|
| 194 |
-
| Fixed Loop
|
| 195 |
-
|
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
---
|
| 199 |
|
| 200 |
-
## Limitations
|
| 201 |
|
| 202 |
-
- **Calendar and multi-step
|
| 203 |
-
- **
|
| 204 |
-
- **
|
| 205 |
|
| 206 |
## License
|
| 207 |
|
|
|
|
| 10 |
- early-exit
|
| 11 |
- conformal-risk-control
|
| 12 |
- selective-escalation
|
| 13 |
+
- weight-space-programming
|
| 14 |
- moe
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# Inkling-2-Mini Decision v5.1 (`eltokh7/inkling-2-mini-decision`)
|
| 18 |
|
| 19 |

|
| 20 |
|
| 21 |
## Overview
|
| 22 |
|
| 23 |
+
`Inkling-2-Mini Decision v5.1` is an adaptive-depth decision model built on [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (26.4B total parameters, **3.4B–5.4B active MoE**).
|
| 24 |
|
| 25 |
The model reads a state and one or more typed questions (`choice`, `noul` yes/no, or `score`) in one forward pass. It outputs calibrated probabilities and generates **zero output tokens**.
|
| 26 |
|
| 27 |
+
The middle 12 layers run in a loop between **1 and 5 times** (24 to 72 logical layers). Simple questions stop after 1 pass. Hard multi-step questions loop deeper before the model answers. After Loop 5, a calibrated escalation head estimates whether to route the question to a slower System 2 model.
|
| 28 |
+
|
| 29 |
+
`v5.1` combines two disjoint multi-teacher training epochs (`Super-Epoch 1` + `Super-Epoch 2`) with zero-overhead **Weight Space Programming (Astra Stage 8A/8B WSP)** and ships with the production **`System15Engine`** (`modeling.py`).
|
| 30 |
|
| 31 |
---
|
| 32 |
|
| 33 |
## Key Results
|
| 34 |
|
| 35 |
+
`v5.1` delivers major gains in adaptive halting speed, conformal safety, calibration, escalation ranking (`AUROC = 0.8102`), and held-out hard dev/numeric/judge accuracy. The table below compares every generation transparently, including the exact `v5.0` vs. `v5.1` tradeoffs.
|
| 36 |
|
| 37 |
+
| Benchmark / Metric | v1 (3L) | v3 (5L) | v4 (5L) | v5.0 (Ep 1) | **v5.1 (Ep 2 + Astra WSP)** | Reference baselines |
|
| 38 |
+
|---|---:|---:|---:|---:|---:|---|
|
| 39 |
+
| **`decision-v7/test`** ($n=1{,}440$) | 85.56% | 86.67% | 86.94% | **87.15%** *(L5)* | 86.67% *(L3)* / 86.25% *(L5)* | `Kev-27B` (27B dense): 86.3% |
|
| 40 |
+
| **`hard-v1/test`** ($n=1{,}088$, *OOD*) | 66.82% | 71.42% *(L3)* | 72.79% *(L5)* | **73.53%** *(L5)* | **72.98%** *(L5, strictly monotonic)* | `Kev-9B v1` (9B dense): 58.4% |
|
| 41 |
+
| **`hard-v1/dev`** ($n=1{,}083$, *OOD*) | 66.67% | 69.16% *(L3)* | 68.33% *(L5)* | 69.44% *(L5)* | **70.45%** *(L5 — new high)* | `Kev-9B v1`: 58.2% · `Jev`: 78% |
|
| 42 |
+
| **`v7/test` Conformal `balanced`** | — | 86.39% @ 2.41L | — | 86.81% @ 2.13L | **86.11% @ 1.75L** *(0.42% fixable)* | 65% loop savings vs. L5 |
|
| 43 |
+
| **`hard-v1/test` Conformal `balanced`** | — | 69.03% @ 3.62L | — | 72.15% @ 3.48L | **72.52% @ 3.10L** *(0.83% fixable)* | Nearly 2× fewer fixable errors |
|
| 44 |
+
| **`v7/test` Escalation AUROC / Top-20%** | — | — | — | 0.7505 / 91.49% | **0.8102 / 92.88%** *(Oracle S2: 94.31%)* | +0.060 AUROC via Astra WSP |
|
| 45 |
+
| **`hard-v1/test` Escalation AUROC / Top-20%** | — | — | — | 0.7437 / 80.11% | **0.7545 / 79.89%** *(Oracle S2: 83.92%)* | Calibrated `p_esc` (26.3% vs 27.0% err) |
|
| 46 |
|
| 47 |
+
### What `v5.1` Improves Over `v5.0` (and Tradeoffs)
|
| 48 |
|
| 49 |
+
1. **Much faster and safer adaptive halting:** On `decision-v7/test`, `balanced` mode drops average depth from `2.13` to **`1.75` loops** with only **6 / 1,440 (`0.42%`)** fixable early errors. On `hard-v1/test`, `balanced` mode rises from `72.15% @ 3.48L` (`16` fixable errors) to **`72.52% @ 3.10L`** (**9 / 1,088 = `0.83%`** fixable errors), and `strict` mode reaches **`72.70% @ 3.18L`** with only **7** fixable errors (`0.64%`).
|
| 50 |
+
2. **Record escalation ranking and true probability calibration:** Within-domain pairwise ranking + baked OOF Platt scaling lifts `decision-v7/test` escalation AUROC from `0.7505` to **`0.8102`** (**92.88%** autonomous accuracy at 20% escalation; **94.31%** with an oracle System 2) and aligns predicted `escalate_prob` with actual error rates (`14.5%` vs. `13.8%` on `v7/test`; `26.3%` vs. `27.0%` on `hard-v1/test`).
|
| 51 |
+
3. **Stronger `hard-v1/dev` (`70.45%`), `hard_temporal_numeric` (`51.3%`), and `hard_judge` (`76.6%`):** `hard-v1/test` Loop 1 rises to `52.67%` and climbs monotonically to `72.98%` at Loop 5 (`ECE` drops from `0.0944` to **`0.0765`**).
|
| 52 |
+
4. **Honest tradeoff vs. `v5.0`:** Raw Loop-5 accuracy on `v7/test` (`86.25%` vs. `87.15%`, peaking at `86.67%` on L3) and `hard-v1/test` (`72.98%` vs. `73.53%`) is ~0.5–0.9 pp below `v5.0`, while `v5.1` wins clearly on adaptive `hard-v1/test` accuracy, halting speed, calibration, `hard-v1/dev`, and escalation AUROC.
|
| 53 |
|
| 54 |

|
| 55 |
|
|
|
|
| 68 |
• CrossLoopTrajectoryMixer attends across loops 1..k
|
| 69 |
• FullContextEvidencePooler pools 100% of state tokens into <= 64 chunks
|
| 70 |
• JointSchemaHead outputs calibrated option probabilities
|
| 71 |
+
• EscalationHead predicts calibrated p_escalate for System 2 handoff
|
| 72 |
```
|
| 73 |
|
| 74 |
+
### Architecture & Training Summary
|
| 75 |
|
| 76 |
+
- **Loop-Conditioned Shared Reasoning Expert (`LoopedSharedExpert` + `AdaLN-Zero(k)`):** A 170M-parameter dense SwiGLU expert runs in parallel with the frozen MoE experts across layers `6–17`. `AdaLN-Zero(k)` modulation (`scale_k`, `shift_k`, `gate_k`) gives each loop pass `k = 1..5` a distinct role.
|
| 77 |
+
- **Full-Context Evidence Pooling (`FullContextEvidencePooler`):** Pools **100% of state tokens** into up to 64 contiguous mean-pooled chunks with a residual projection before `JointSchemaHead` cross-attention.
|
| 78 |
+
- **Cross-Loop Trajectory Readout (`CrossLoopTrajectoryMixer`):** Causal attention across loops `1..k` lets later passes combine earlier findings instead of overwriting them.
|
| 79 |
+
- **Zero-Overhead Weight Space Programming (Astra Stage 8A/8B):** Optimized strictly on dev/fit splits (zero exposure to `test` splits): baked `0.85` `JointSchemaHead` logit calibration, 22-DOF counterfactual first-hit `DynamicHaltingHead` optimization, and 19-DOF within-domain pairwise-ranking + OOF Platt calibration for `EscalationHead`. All edits are baked directly into standard `heads.pt` tensors with zero inference overhead.
|
| 80 |
+
- **Standalone BF16 Weights:** All 218 unfrozen dynamic backbone tensors (`message_gate`, `moe_router`, `block_attn_res`, `message_input`, `final_norm`) and 120 LoRA tensors are merged into standalone BF16 safetensors (`v3-base` preserved as an immutable git tag).
|
| 81 |
|
| 82 |
---
|
| 83 |
|
|
|
|
| 89 |
pip install "transformers>=5.24.0" torch huggingface_hub
|
| 90 |
```
|
| 91 |
|
| 92 |
+
Load `System15Engine` from `modeling.py`. It supports single queries, shared-state multi-question prefix caching, batched active-set compaction, and deadline-bounded anytime streaming:
|
| 93 |
|
| 94 |
```python
|
| 95 |
from modeling import System15Engine
|
|
|
|
| 119 |
# 1. Shared-state multi-question execution (runs prelude layers 0..5 on `state` once)
|
| 120 |
out = engine.decide_multi(state, questions, mode="balanced", max_loops=5)
|
| 121 |
print(out["route"])
|
| 122 |
+
# Returns: answer, confidence, probabilities, loops_used, halt_score,
|
| 123 |
+
# escalate_prob, state_drift, flipped_from_L1, latency_ms
|
| 124 |
|
| 125 |
# 2. Batched active-set compaction across independent (state, question) pairs
|
| 126 |
batch_out = engine.decide_batch(
|
|
|
|
| 129 |
)
|
| 130 |
|
| 131 |
# 3. Anytime streaming with a strict latency budget (yields Pass 1..5 refinements)
|
| 132 |
+
for step in engine.decide_anytime(state, questions["route"], deadline_ms=160.0):
|
| 133 |
if step["is_final"]:
|
| 134 |
print(step["answer"], step["loops_used"], step["readout"], step["escalate_prob"])
|
| 135 |
```
|
|
|
|
| 138 |
|
| 139 |
## Benchmarks
|
| 140 |
|
| 141 |
+
All accuracy, conformal, and escalation numbers come from the one-shot frozen evaluation (`v5_final_champion_report.json`). All GPU timing numbers come from real NVIDIA RTX PRO 6000 Blackwell 96 GB measurements (`bench_v5_results.json`).
|
| 142 |
|
| 143 |
+
### 1. Accuracy Across Loops 1 → 5 (`v5.1`)
|
| 144 |
|
| 145 |
| Split | $n$ | Loop 1 (24L) | Loop 2 (36L) | Loop 3 (48L) | Loop 4 (60L) | **Loop 5 (72L)** | Δ vs. L1 |
|
| 146 |
|---|---:|---:|---:|---:|---:|---:|---:|
|
| 147 |
+
| `decision-v7/dev` | 1,468 | 81.54% | 84.47% | **84.88%** | 84.81% | **84.88%** | +3.34 pp |
|
| 148 |
+
| `decision-v7/test` | 1,440 | 84.44% | 86.04% | **86.67%** | 86.25% | 86.25% | +2.23 pp *(L3)* |
|
| 149 |
+
| `hard-v1/dev` *(OOD)* | 1,083 | 48.01% | 65.74% | **70.45%** | **70.45%** | **70.45%** | **+22.44 pp** |
|
| 150 |
+
| `hard-v1/test` *(OOD)* | 1,088 | 52.67% | 67.74% | 72.33% | 72.89% | **72.98%** | **+20.31 pp** |
|
| 151 |
|
| 152 |
+
### 2. `hard-v1/test` Subcategory Breakdown ($n=1{,}088$, `v5.1`)
|
| 153 |
|
| 154 |
| Subcategory | $n$ | Loop 1 | Loop 3 | **Loop 5** | Gain (L1 → L5) |
|
| 155 |
|---|---:|---:|---:|---:|---:|
|
| 156 |
+
| `hard_tradeoff` | 200 | 76.5% | 95.0% | **95.5%** | +19.0 pp |
|
| 157 |
+
| `hard_probability` | 158 | 59.5% | **77.2%** | **77.2%** | +17.7 pp |
|
| 158 |
+
| `hard_judge` | 188 | 61.7% | 73.9% | **76.6%** | +14.9 pp |
|
| 159 |
+
| `hard_ambiguous` | 100 | 52.0% | **72.0%** | **72.0%** | +20.0 pp |
|
| 160 |
+
| `hard_multi_hop` | 125 | 36.8% | **63.2%** | **63.2%** | **+26.4 pp** |
|
| 161 |
+
| `hard_long_policy` | 200 | 31.5% | **63.5%** | 63.0% | **+31.5 pp** |
|
| 162 |
+
| `hard_temporal_numeric` | 117 | 41.9% | 49.6% | **51.3%** | **+9.4 pp** |
|
| 163 |
|
| 164 |
+
### 3. Conformal Risk Control (Simultaneous Bonferroni 95% Clopper-Pearson UCBs)
|
| 165 |
|
| 166 |
+
Thresholds are frozen before reading calibration labels and certified once on `decision-v7/calibration` ($n=1{,}148$) with simultaneous Bonferroni correction ($\alpha = 0.05 / 3$).
|
| 167 |
|
| 168 |
+
| Split & Mode | Threshold | Cal Bonf 95% UCB | Acc | Avg Loops | L1 Exit | L5 Exit | Fixable Early Errors | Lucky Exits |
|
| 169 |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
|
| 170 |
+
| `v7/test` — `fast` | `0.923` | 1.19% | 85.97% | **1.52** | **61.0%** | 0.4% | 15 / 1,440 (1.04%) | 11 |
|
| 171 |
+
| `v7/test` — `balanced` | `0.969` | **0.67%** | **86.11%** | **1.75** | **51.4%** | 3.1% | **6 / 1,440 (0.42%)** | 4 |
|
| 172 |
+
| `v7/test` — `strict` | `0.974` | **0.67%** | **86.18%** | **1.82** | 48.1% | 4.2% | **5 / 1,440 (0.35%)** | 4 |
|
| 173 |
+
| `hard-v1/test` — `fast` | `0.923` | 1.19% | 71.78% | 2.69 | 10.1% | 9.1% | 21 / 1,088 (1.93%) | 8 |
|
| 174 |
+
| `hard-v1/test` — `balanced` | `0.969` | **0.67%** | **72.52%** | **3.10** | 4.3% | 22.1% | **9 / 1,088 (0.83%)** | 4 |
|
| 175 |
+
| `hard-v1/test` — `strict` | `0.974` | **0.67%** | **72.70%** | **3.18** | 3.0% | 24.4% | **7 / 1,088 (0.64%)** | 4 |
|
| 176 |
|
| 177 |
### 4. Tri-State Cognitive Control: Selective Accuracy vs. Coverage
|
| 178 |
|
| 179 |
+
Ranking questions by `EscalationHead` (`escalate_prob`) routes the highest-risk slice to a System 2 model while answering the rest autonomously.
|
| 180 |
|
| 181 |

|
| 182 |
|
| 183 |
| Split (Base L5 / AUROC) | Escalation Rate | Coverage | Autonomous Acc | 95% LCB | Error Recall | Oracle S2 Combined Acc |
|
| 184 |
|---|---:|---:|---:|---:|---:|---:|
|
| 185 |
+
| `v7/test` (`86.25%` / **`AUROC 0.8102`**) | 5% | 95.0% | **88.16%** | 86.62% | 18.2% | 88.75% |
|
| 186 |
+
| `v7/test` (`86.25%` / **`AUROC 0.8102`**) | 10% | 90.0% | **89.74%** | 88.24% | 32.8% | 90.76% |
|
| 187 |
+
| `v7/test` (`86.25%` / **`AUROC 0.8102`**) | 15% | 85.0% | **91.26%** | 89.81% | 46.0% | 92.57% |
|
| 188 |
+
| `v7/test` (`86.25%` / **`AUROC 0.8102`**) | 20% | 80.0% | **92.88%** | 91.51% | **58.6%** | **94.31%** |
|
| 189 |
+
| `hard-v1/test` (`72.98%` / **`AUROC 0.7545`**) | 5% | 95.0% | **74.56%** | 72.24% | 10.5% | 75.83% |
|
| 190 |
+
| `hard-v1/test` (`72.98%` / **`AUROC 0.7545`**) | 10% | 90.0% | **76.71%** | 74.38% | 22.4% | 79.04% |
|
| 191 |
+
| `hard-v1/test` (`72.98%` / **`AUROC 0.7545`**) | 15% | 85.0% | **78.16%** | 75.81% | 31.3% | 81.43% |
|
| 192 |
+
| `hard-v1/test` (`72.98%` / **`AUROC 0.7545`**) | 20% | 80.0% | **79.89%** | 77.52% | **40.5%** | **83.92%** |
|
| 193 |
+
|
| 194 |
+
### 5. Real GPU Engine Benchmarks (`System15Engine` on RTX PRO 6000 Blackwell 96 GB, Eager BF16)
|
| 195 |
+
|
| 196 |
+
Measured directly on `v5.1` (`bench_v5_results.json`, mixed `test.jsonl` + `hard_test.jsonl` prompts, warmup + `torch.cuda.synchronize()`, eager BF16 without `torch.compile`):
|
| 197 |
+
|
| 198 |
+
**Single-Query Latency & Adaptive Early Exit:**
|
| 199 |
+
|
| 200 |
+
| Mode | Median (p50) | p90 | Avg Loops | Speedup vs. L5 |
|
| 201 |
+
|---|---:|---:|---:|---:|
|
| 202 |
+
| Fixed Loop 1 (24L) | **122.5 ms** | 136.6 ms | 1.00 | 3.33× |
|
| 203 |
+
| Fixed Loop 2 (36L) | **191.3 ms** | 214.9 ms | 2.00 | 2.13× |
|
| 204 |
+
| Fixed Loop 3 (48L) | **266.9 ms** | 298.1 ms | 3.00 | 1.53× |
|
| 205 |
+
| Fixed Loop 4 (60L) | **335.9 ms** | 373.7 ms | 4.00 | 1.21× |
|
| 206 |
+
| Fixed Loop 5 (72L) | **408.0 ms** | 452.1 ms | 5.00 | 1.00× |
|
| 207 |
+
| Adaptive `fast` | **212.8 ms** | 243.1 ms | 2.38 | **1.92×** |
|
| 208 |
+
| Adaptive `balanced` | **217.4 ms** | 301.5 ms | 2.75 | **1.88×** |
|
| 209 |
+
|
| 210 |
+
**Shared-State Prefix Caching (`decide_multi`) & Batched Active-Set Compaction (`decide_batch`):**
|
| 211 |
+
|
| 212 |
+
| Capability & Workload | Engine Time | Baseline Time | Measured Speedup | Notes |
|
| 213 |
+
|---|---:|---:|---:|---|
|
| 214 |
+
| `decide_multi` (`Q = 2` on shared long policy) | **284.9 ms** | 516.8 ms *(seq)* | **1.81×** | Prelude runs once on shared state |
|
| 215 |
+
| `decide_multi` (`Q = 4` on shared long policy) | **554.5 ms** | 1,316.8 ms *(seq)* | **2.38×** | Prelude runs once on shared state |
|
| 216 |
+
| `decide_multi` (`Q = 8` on shared long policy) | **838.4 ms** | 2,633.5 ms *(seq)* | **3.14×** | `104.8 ms/question` effective |
|
| 217 |
+
| `decide_batch` (`B = 4`, mixed easy+hard) | **979.8 ms** | 1,364.2 ms *(full L5)* | **1.39×** | Active set: `[4, 4, 3, 1, 1]` |
|
| 218 |
+
| `decide_batch` (`B = 8`, mixed easy+hard) | **1,580.1 ms** | 2,721.0 ms *(full L5)* | **1.72×** | Active set: `[8, 8, 5]` (`1.25×` vs seq) |
|
| 219 |
+
| `decide_batch` (`B = 16`, mixed easy+hard) | **3,355.9 ms** | 5,605.0 ms *(full L5)* | **1.67×** | Active set: `[16, 16, 10, 1, 1]` |
|
| 220 |
+
|
| 221 |
+
**Anytime Deadline Streaming (`decide_anytime`, mixed prompts):**
|
| 222 |
+
`deadline_ms = 80 ms` → `1.0L` (`62.5%` acc) · `120 ms` → `2.0L` (`75.0%`) · `160 ms` → `2.0L` (`75.0%`) · `220 ms` → `3.0L` (`87.5%`).
|
| 223 |
|
| 224 |
---
|
| 225 |
|
| 226 |
+
## Limitations
|
| 227 |
|
| 228 |
+
- **Calendar and multi-step numeric arithmetic:** `hard_temporal_numeric` improved to `51.3%` on `hard-v1/test` (`+4.3 pp` over `v5.0`), yet exact date subtraction and multi-step billing math still benefit from external code execution or System 2 escalation.
|
| 229 |
+
- **Eager vs. compiled latency:** The `bench_v5_results.json` GPU numbers above use eager PyTorch BF16 (`~122 ms` L1 / `~217 ms` balanced on RTX PRO 6000). Adding `torch.compile` and `causal_conv1d` reduces per-pass latency further (the compiled v1/v3 runner measured `65.6 ms` L1 / `136.8 ms` L3).
|
| 230 |
+
- **OOD early-exit selection:** Conformal guarantees apply to the in-distribution calibration split. For high-stakes OOD traffic, use `mode="balanced"` (`0.83%` fixable errors on `hard-v1/test`) or `mode="strict"` (`0.64%` fixable errors) together with `escalate_prob` routing.
|
| 231 |
|
| 232 |
## License
|
| 233 |
|
assets/hard_v1_comparison.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/header.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/selective_escalation.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
modeling.py
CHANGED
|
@@ -477,23 +477,34 @@ def _slice_mask_for_compaction(
|
|
| 477 |
new_T: int,
|
| 478 |
cur_T: int,
|
| 479 |
) -> Any:
|
| 480 |
-
"""Slice a mask/tensor cleanly along batch
|
| 481 |
if m is None or not isinstance(m, torch.Tensor):
|
| 482 |
return m
|
| 483 |
out = m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 484 |
if out.ndim >= 2 and out.shape[0] == cur_B:
|
| 485 |
out = out.index_select(0, keep_idx)
|
| 486 |
if new_T < cur_T:
|
| 487 |
if out.ndim == 2 and out.shape[1] == cur_T:
|
| 488 |
out = out[:, :new_T]
|
| 489 |
elif out.ndim == 3:
|
| 490 |
-
if out.shape[
|
| 491 |
out = out[:, :new_T, :new_T]
|
| 492 |
-
elif out.shape[
|
| 493 |
out = out[:, :new_T, :]
|
|
|
|
|
|
|
| 494 |
elif out.ndim == 4:
|
| 495 |
if out.shape[-2] == cur_T and out.shape[-1] == cur_T:
|
| 496 |
out = out[..., :new_T, :new_T]
|
|
|
|
|
|
|
| 497 |
elif out.shape[-1] == cur_T:
|
| 498 |
out = out[..., :new_T]
|
| 499 |
return out
|
|
|
|
| 477 |
new_T: int,
|
| 478 |
cur_T: int,
|
| 479 |
) -> Any:
|
| 480 |
+
"""Slice a mask/relative-distance tensor cleanly along batch and sequence dims."""
|
| 481 |
if m is None or not isinstance(m, torch.Tensor):
|
| 482 |
return m
|
| 483 |
out = m
|
| 484 |
+
# 2D square [T, T] relative-distance tensor: slice BOTH sequence dims, never batch-index
|
| 485 |
+
if out.ndim == 2 and out.shape[0] == cur_T and out.shape[1] == cur_T and cur_B != cur_T:
|
| 486 |
+
return out[:new_T, :new_T] if new_T < cur_T else out
|
| 487 |
+
if out.ndim == 2 and out.shape[0] == cur_T and out.shape[1] == cur_T and out.dtype in (torch.int32, torch.int64) and out[0, 0] == 0:
|
| 488 |
+
# Even when cur_B == cur_T, relative_distance[0, 0] == 0 whereas attention_mask[0, 0] == 1
|
| 489 |
+
return out[:new_T, :new_T] if new_T < cur_T else out
|
| 490 |
+
|
| 491 |
if out.ndim >= 2 and out.shape[0] == cur_B:
|
| 492 |
out = out.index_select(0, keep_idx)
|
| 493 |
if new_T < cur_T:
|
| 494 |
if out.ndim == 2 and out.shape[1] == cur_T:
|
| 495 |
out = out[:, :new_T]
|
| 496 |
elif out.ndim == 3:
|
| 497 |
+
if out.shape[-2] == cur_T and out.shape[-1] == cur_T:
|
| 498 |
out = out[:, :new_T, :new_T]
|
| 499 |
+
elif out.shape[-2] == cur_T:
|
| 500 |
out = out[:, :new_T, :]
|
| 501 |
+
elif out.shape[-1] == cur_T:
|
| 502 |
+
out = out[:, :, :new_T]
|
| 503 |
elif out.ndim == 4:
|
| 504 |
if out.shape[-2] == cur_T and out.shape[-1] == cur_T:
|
| 505 |
out = out[..., :new_T, :new_T]
|
| 506 |
+
elif out.shape[-2] == cur_T:
|
| 507 |
+
out = out[..., :new_T, :]
|
| 508 |
elif out.shape[-1] == cur_T:
|
| 509 |
out = out[..., :new_T]
|
| 510 |
return out
|