Skip to content

Commit 8453929

Browse files
committed
fix(playground): pull the speculative tier - quantized framing degrades output
Measurement behind the tier (interscript-ml RESULTS.md 2026-09-12): dynamic-int8 decoder graphs quantize activations per fed tensor, so single-step and batched decode framings produce materially different numerics - the batched-verifier output lost a word on a canonical test row, and runtime acceptance measured 0.46 vs the probe's 0.99 (uniform-framing artifact). int4 CPU kernels are also slower than int8 here, so the tier had no speed story either. SpeculativeModel stays in the npm API as measurement infrastructure with the constraint documented; the playground serves only the verified tiers.
1 parent 6eae557 commit 8453929

2 files changed

Lines changed: 2 additions & 51 deletions

File tree

e2e/playground-spec-live.spec.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/pages/playground.astro

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ import catalogue from "../data/maps-catalogue.json"
2727
<option value="">Off — deterministic maps only</option>
2828
<option value="ara-diac-layerdrop-1.0-int4">Arabic lite (int4, 95 MB, downloads once)</option>
2929
<option value="ara-diac-small-2.1-int8">Arabic 2.1 (int8, 264 MB, downloads once)</option>
30-
<option value="spec:ara-diac-small-2.1-int8">
31-
Arabic 2.1 + speculative (int4 drafts it, 359 MB, downloads once)
32-
</option>
3330
</select>
3431

3532
<label for="filter">System</label>
@@ -168,10 +165,6 @@ import catalogue from "../data/maps-catalogue.json"
168165
if (!voc) {
169166
return `import { transliterateAsync } from "interscript"\n\nconst out = await transliterateAsync(\n "${code}",\n "…",\n)`
170167
}
171-
if (voc.startsWith("spec:")) {
172-
const verifier = voc.slice(5)
173-
return `import { transliterateAsync } from "interscript"\nimport { imf } from "interscript/ml"\n\nconst drafter = await imf.IMFModel.fromZipBytes(\n (await imf.resolve("ara-diac-layerdrop-1.0-int4")).bytes,\n)\nconst verifierModel = await imf.IMFModel.fromZipBytes(\n (await imf.resolve("${verifier}")).bytes,\n)\nconst spec = new imf.SpeculativeModel(drafter, verifierModel)\nconst vocalized = await spec.translate("…")\nconst out = await transliterateAsync(\n "${code}",\n vocalized,\n)`
174-
}
175168
return `import { transliterateAsync } from "interscript"\nimport { imf } from "interscript/ml"\n\nconst resolved = await imf.resolve("${voc}")\nconst model = await imf.IMFModel.fromZipBytes(resolved.bytes)\nconst vocalized = await model.translate("…")\nconst out = await transliterateAsync(\n "${code}",\n vocalized,\n)`
176169
}
177170
$("snippet").textContent = snippetText()
@@ -189,10 +182,7 @@ import catalogue from "../data/maps-catalogue.json"
189182
async function ensureModel(id: string) {
190183
if (mlModel && mlModelId === id) return mlModel
191184
const status = $("status")
192-
const spec = id.startsWith("spec:")
193-
const verifierId = spec ? id.slice(5) : id
194-
const drafterId = spec ? "ara-diac-layerdrop-1.0-int4" : ""
195-
const wanted = spec ? [drafterId, verifierId] : [verifierId]
185+
const wanted = [id]
196186
const models: Record<string, Awaited<ReturnType<typeof imf.IMFModel.fromZipBytes>>> = {}
197187
for (const wantedId of wanted) {
198188
status.hidden = false
@@ -204,12 +194,7 @@ import catalogue from "../data/maps-catalogue.json"
204194
})
205195
models[wantedId] = await imf.IMFModel.fromZipBytes(resolved.bytes)
206196
}
207-
mlModel = spec
208-
? (new imf.SpeculativeModel(models[drafterId]!, models[verifierId]!) as unknown as {
209-
translate(t: string, m?: number): Promise<string>
210-
stats(): { accepted: number; drafted: number; blocks: number } | undefined
211-
})
212-
: (models[verifierId] as unknown as { translate(t: string, m?: number): Promise<string> })
197+
mlModel = models[id] as unknown as { translate(t: string, m?: number): Promise<string> }
213198
mlModelId = id
214199
status.hidden = true
215200
return mlModel
@@ -234,15 +219,6 @@ import catalogue from "../data/maps-catalogue.json"
234219
}
235220
const result = await worker.transliterate(systemSelect.value, text)
236221
out.textContent = result
237-
if (modelId?.startsWith("spec:") && mlModel) {
238-
const stats = (
239-
mlModel as { stats?: () => { accepted: number; drafted: number; blocks: number } }
240-
).stats?.()
241-
if (stats) {
242-
status.hidden = false
243-
status.textContent = `Speculative: ${stats.accepted}/${stats.drafted} draft tokens accepted across ${stats.blocks} verifier passes`
244-
}
245-
}
246222
const share = new URLSearchParams({
247223
q: ($("input") as HTMLTextAreaElement).value,
248224
sys: systemSelect.value,

0 commit comments

Comments
 (0)