File size: 1,028 Bytes
113e5b7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17cd6d7
 
 
113e5b7
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
license: mit
tags:
- e=mc2
- structured-output
- constrained-decoding
- json
- tiny-transformer
- pankhllm
---

# e=mc² Lesson 08: pankh-decider-v1

pankh-decider-v0 (Lesson 07), warm-started and trained to write the operation AND its parameters as compact JSON, e.g. `{"op":"kpi_rank","params":{"metric":"calls","level":"territories","n":17,"direction":"top","period":"2025-07"}}`. Codes, months and numbers are written as pointers (`<code0>`) and copied back from the question. A prefix-validity grammar built from pankhllm's `router.yaml` constrains decoding.

Lesson: https://theaivibe.org/emc2/structured-output-small-model-json-constrained-decoding

| Held-out templates (2,000) | Valid | Exact match | Wrong but valid |
|---|---|---|---|
| Free decoding | 91.6% | 47.3% | 44.4% |
| Catalog stencil | 100.0% | 50.5% | 49.5% |
| Grounded stencil | 100.0% | 71.3% | 28.7% |

Files: `lesson_08.ipynb` (unexecuted), `RESULTS.md`, `pankh-decider-v1/` (`model.pt`, `config.json`, `vocab.json`). Author: Prateek Singh. MIT.