{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "64ee0d72",
   "metadata": {},
   "source": [
    "# Design verifiable rewards\n",
    "\n",
    "        You maintain the extractor that sends supplier invoices to accounts payable. A synthetic invoice says EUR, but a tidy result says USD. A second result uses EUR and drops a printed line. Would your training reward treat either answer as a success?\n",
    "\n",
    "        Replay those errors, then compare two rewards from one supervised checkpoint on the same held-out invoices.\n",
    "\n",
    "        Select **T4 GPU** in Google Colab and run all cells in order. The staged steps and fixed evaluation slices\n",
    "        are set below. Allow 35\u201350 minutes as a planning estimate, depending on sampled answer lengths.\n",
    "        Time, memory and accuracy come from the recorded outputs.\n",
    "\n",
    "        [Read the lesson](https://docs.recohut.com/courses/advanced-llm-fine-tuning/2-compare-training-stages/04-design-verifiable-rewards)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57f5f65e",
   "metadata": {},
   "source": [
    "## 0. Environment\n",
    "\n",
    "Install the pinned training libraries and keep the Colab CUDA PyTorch build. The notebook logs the PyTorch and CUDA versions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7eb4e6e3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:16:28.793813Z",
     "iopub.status.busy": "2026-11-27T08:16:28.793485Z",
     "iopub.status.idle": "2026-11-27T08:16:50.111978Z",
     "shell.execute_reply": "2026-11-27T08:16:50.111210Z"
    },
    "tags": [
     "install"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CompletedProcess(args=['/usr/bin/python3', '-m', 'pip', 'install', '-q', 'transformers==4.51.3', 'peft==0.15.2', 'trl==0.19.1', 'accelerate==1.6.0', 'datasets==3.6.0'], returncode=0)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import subprocess\n",
    "import sys\n",
    "\n",
    "TRAINER_PINS = {'transformers': '4.51.3', 'peft': '0.15.2', 'trl': '0.19.1', 'accelerate': '1.6.0', 'datasets': '3.6.0'}\n",
    "pins = [f\"{name}=={version}\" for name, version in TRAINER_PINS.items()]\n",
    "subprocess.run([sys.executable, \"-m\", \"pip\", \"install\", \"-q\", *pins], check=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c00c1bea",
   "metadata": {},
   "source": [
    "## 1. Invoice catalog\n",
    "\n",
    "The synthetic inputs, split labels and independent evaluator are defined together. The model sees only the visible invoice text."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fea487eb",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:16:50.115514Z",
     "iopub.status.busy": "2026-11-27T08:16:50.115237Z",
     "iopub.status.idle": "2026-11-27T08:16:50.156331Z",
     "shell.execute_reply": "2026-11-27T08:16:50.155696Z"
    },
    "tags": [
     "fixtures"
    ]
   },
   "outputs": [],
   "source": [
    "\"\"\"Versioned synthetic invoices and independent record scoring for the course.\"\"\"\n",
    "\n",
    "from __future__ import annotations\n",
    "\n",
    "import json\n",
    "import random\n",
    "import re\n",
    "from collections import Counter\n",
    "from dataclasses import dataclass\n",
    "from datetime import date, timedelta\n",
    "from typing import Any\n",
    "\n",
    "CATALOG_VERSION = \"course-invoice-v1\"\n",
    "SPLIT_SIZES = {\"train\": 576, \"dev\": 72, \"familiar\": 96, \"novel\": 96, \"independent\": 48, \"release\": 120}\n",
    "VISIBLE_CONTRACT = (\n",
    "    \"Extract exactly one JSON object with invoice_id, issued_on (YYYY-MM-DD), supplier, \"\n",
    "    \"currency (ISO code), line_items (description, quantity, unit_minor), subtotal_minor, \"\n",
    "    \"tax_minor, and total_minor. Preserve line order and convert currency amounts to integer cents. \"\n",
    "    \"Use null only for a missing or ambiguous field. Do not rewrite printed amounts, invent fields, or add explanations.\"\n",
    ")\n",
    "\n",
    "@dataclass(frozen=True)\n",
    "class Line:\n",
    "    description: str\n",
    "    quantity: int\n",
    "    unit_minor: int\n",
    "\n",
    "\n",
    "@dataclass(frozen=True)\n",
    "class Invoice:\n",
    "    key: str\n",
    "    family: str\n",
    "    supplier: str\n",
    "    issued_on: str\n",
    "    currency: str\n",
    "    items: tuple[Line, ...]\n",
    "    tax_minor: int | None\n",
    "    locale: str\n",
    "    split: str\n",
    "    layout: str = \"register\"\n",
    "    printed_total_minor: int | None = None\n",
    "\n",
    "\n",
    "def invoice_record(invoice: Invoice) -> dict[str, Any]:\n",
    "    subtotal = sum(line.quantity * line.unit_minor for line in invoice.items)\n",
    "    total = subtotal + invoice.tax_minor if invoice.tax_minor is not None else None\n",
    "    if invoice.printed_total_minor is not None:\n",
    "        total = invoice.printed_total_minor\n",
    "    return {\n",
    "        \"invoice_id\": invoice.key,\n",
    "        \"issued_on\": invoice.issued_on,\n",
    "        \"supplier\": invoice.supplier,\n",
    "        \"currency\": invoice.currency,\n",
    "        \"line_items\": [\n",
    "            {\"description\": item.description, \"quantity\": item.quantity, \"unit_minor\": item.unit_minor}\n",
    "            for item in invoice.items\n",
    "        ],\n",
    "        \"subtotal_minor\": subtotal,\n",
    "        \"tax_minor\": invoice.tax_minor,\n",
    "        \"total_minor\": total,\n",
    "    }\n",
    "\n",
    "\n",
    "def make_catalog() -> list[Invoice]:\n",
    "    rng = random.Random(20261126)\n",
    "    sources = {\n",
    "        \"train\": (24, (\"register\", \"memo\", \"checkout\", \"ledger\")),\n",
    "        \"dev\": (6, (\"register\", \"memo\", \"checkout\", \"ledger\")),\n",
    "        \"familiar\": (8, (\"register\", \"memo\", \"checkout\", \"ledger\")),\n",
    "        \"novel\": (8, (\"packing\", \"remittance\", \"service\", \"notice\")),\n",
    "        \"independent\": (4, (\"separate\",)),\n",
    "        \"release\": (10, (\"packing\", \"remittance\", \"service\", \"notice\", \"separate\")),\n",
    "    }\n",
    "    locales = ((\"en-US\", \"USD\"), (\"en-GB\", \"GBP\"), (\"de-DE\", \"EUR\"), (\"fr-FR\", \"EUR\"), (\"en-US\", \"CAD\"))\n",
    "    services = (\"Cooling filter\", \"Cable sleeve\", \"Bench calibration\", \"Door seal\", \"Grounding clip\",\n",
    "                \"Rack inspection\", \"Meter label\", \"Packing insert\", \"Carrier adjustment\", \"Mounting plate\")\n",
    "    catalog = []\n",
    "    seen_keys = set()\n",
    "    supplier_codes = rng.sample(range(1000, 9999), sum(n for n, _ in sources.values()))\n",
    "    supplier_index = 0\n",
    "    for split, (family_count, layouts) in sources.items():\n",
    "        for family_number in range(family_count):\n",
    "            supplier_code = supplier_codes[supplier_index]\n",
    "            supplier_index += 1\n",
    "            layout = layouts[family_number % len(layouts)]\n",
    "            family = f\"{split}-{family_number:02d}\"\n",
    "            locale, currency = locales[family_number % len(locales)]\n",
    "            for row in range(SPLIT_SIZES[split] // family_count):\n",
    "                code = f\"SF-{rng.randrange(100000, 1000000)}\"\n",
    "                while code in seen_keys:\n",
    "                    code = f\"SF-{rng.randrange(100000, 1000000)}\"\n",
    "                seen_keys.add(code)\n",
    "                items = tuple(\n",
    "                    Line(kind, rng.randint(1, 9), rng.randrange(200, 24800))\n",
    "                    for kind in rng.sample(services, rng.randrange(1, 4))\n",
    "                )\n",
    "                subtotal = sum(x.quantity * x.unit_minor for x in items)\n",
    "                tax = (subtotal * (7 if currency == \"USD\" else 13) + 50) // 100\n",
    "                if split in {\"novel\", \"independent\", \"release\"} and row % 12 == 4:\n",
    "                    tax = None\n",
    "                displayed = subtotal + tax + 101 if tax is not None and row % 12 == 7 else None\n",
    "                issued_on = (date(2025, 1, 1) + timedelta(days=rng.randint(0, 590))).isoformat()\n",
    "                catalog.append(Invoice(code, family, f\"Sample Supplier {supplier_code}\", issued_on,\n",
    "                                       currency, items, tax, locale, split, layout, displayed))\n",
    "    return catalog\n",
    "\n",
    "\n",
    "def formatted_money(minor: int | None, locale: str) -> str:\n",
    "    if minor is None:\n",
    "        return \"-\"\n",
    "    dollars, cents = divmod(minor, 100)\n",
    "    number = f\"{dollars:,}.{cents:02d}\"\n",
    "    if locale == \"de-DE\":\n",
    "        return number.replace(\",\", \"_\").replace(\".\", \",\").replace(\"_\", \".\")\n",
    "    if locale == \"fr-FR\":\n",
    "        return number.replace(\",\", \" \").replace(\".\", \",\")\n",
    "    return number\n",
    "\n",
    "\n",
    "def invoice_text(invoice: Invoice) -> str:\n",
    "    gold = invoice_record(invoice)\n",
    "    money = lambda value: formatted_money(value, invoice.locale)\n",
    "    identifier = f\"{invoice.key}\"\n",
    "    supplier = invoice.supplier\n",
    "    issued = invoice.issued_on\n",
    "    currency = invoice.currency\n",
    "    subtotal = money(gold[\"subtotal_minor\"])\n",
    "    tax = money(gold[\"tax_minor\"])\n",
    "    total = money(gold[\"total_minor\"])\n",
    "    register = [f\"{row.description} | {row.quantity} | {money(row.unit_minor)}\" for row in invoice.items]\n",
    "    inline = [f\"{row.quantity} x {row.description} @ {money(row.unit_minor)} per unit\" for row in invoice.items]\n",
    "    service = [f\"{row.description}: {money(row.unit_minor)} each for {row.quantity} units\" for row in invoice.items]\n",
    "    if invoice.layout == \"register\":\n",
    "        return \"\\n\".join([f\"Supplier: {supplier}\", f\"Invoice: {identifier}\", f\"Issued: {issued}\", f\"Currency: {currency}\",\n",
    "                          \"Description | Quantity | Unit price\", *register,\n",
    "                          f\"Subtotal: {subtotal}\", f\"Tax: {tax}\", f\"Amount due: {total}\"])\n",
    "    if invoice.layout == \"memo\":\n",
    "        return \"\\n\".join([f\"{supplier} billing memo / {issued}\", f\"Account invoice {identifier} [{currency}]\",\n",
    "                          *inline, f\"Total due {total} including tax {tax}; net amount {subtotal}.\"])\n",
    "    if invoice.layout == \"checkout\":\n",
    "        return \"\\n\".join([f\"{identifier} / supplier {supplier}\", f\"Date of issue {issued} / All amounts {currency}\",\n",
    "                          *service, f\"Net {subtotal}\", f\"Sales tax {tax}\", f\"Payable {total}\"])\n",
    "    if invoice.layout == \"ledger\":\n",
    "        return \"\\n\".join([f\"{supplier} | issued {issued} | invoice {identifier}\", f\"Ledger in {currency}\",\n",
    "                          \"Service | Count | Per unit\", *register, f\"Before tax {subtotal}\",\n",
    "                          f\"Tax charged {tax}\", f\"Balance {total}\"])\n",
    "    if invoice.layout == \"packing\":\n",
    "        return \"\\n\".join([f\"Billing details / {identifier}\", f\"Sold by {supplier}\", f\"Document date {issued}\",\n",
    "                          f\"Invoice currency {currency}\", f\"Balance payable {total}\", *service,\n",
    "                          f\"Merchandise {subtotal}\", f\"Tax {tax}\"])\n",
    "    if invoice.layout == \"remittance\":\n",
    "        return \"\\n\".join([f\"Remittance advice for {identifier} ({currency})\", f\"{supplier} / Document issued {issued}\",\n",
    "                          f\"Pay this amount {total}\", *inline, f\"Net charges {subtotal} / Tax {tax}\"])\n",
    "    if invoice.layout == \"service\":\n",
    "        return \"\\n\".join([f\"Ref {identifier} / {currency}\", f\"Service fee notice, {issued}\", supplier,\n",
    "                          *[f\"Unit {money(row.unit_minor)} / {row.quantity} times / {row.description}\" for row in invoice.items],\n",
    "                          f\"Fee subtotal {subtotal}\", f\"Plus tax {tax}\", f\"Amount requested {total}\"])\n",
    "    if invoice.layout == \"notice\":\n",
    "        return \"\\n\".join([f\"{supplier} / statement {identifier}\", f\"Issued on {issued}\",\n",
    "                          f\"Invoice denomination {currency}\", \"One-off charges\", *service,\n",
    "                          f\"Pre-tax {subtotal} / Tax assessment {tax} / Final bill {total}\"])\n",
    "    return \"\\n\".join([f\"Document {identifier}\", f\"Biller {supplier} / As of {issued} / {currency}\", *inline,\n",
    "                      f\"Gross {total}\", f\"Breakdown: net {subtotal} and taxes {tax}.\"])\n",
    "\n",
    "\n",
    "def _strict_dict(pairs: list[tuple[str, Any]]) -> dict[str, Any]:\n",
    "    result: dict[str, Any] = {}\n",
    "    for key, value in pairs:\n",
    "        if key in result:\n",
    "            raise ValueError(f\"Duplicate JSON key {key!r}\")\n",
    "        result[key] = value\n",
    "    return result\n",
    "\n",
    "\n",
    "def parse_record(completion: str | dict[str, Any]) -> dict[str, Any] | None:\n",
    "    if isinstance(completion, str):\n",
    "        try:\n",
    "            data = json.loads(completion, object_pairs_hook=_strict_dict)\n",
    "        except (ValueError, TypeError, RecursionError):\n",
    "            return None\n",
    "    else:\n",
    "        data = completion\n",
    "    keys = {\"invoice_id\", \"issued_on\", \"supplier\", \"currency\", \"line_items\", \"subtotal_minor\", \"tax_minor\", \"total_minor\"}\n",
    "    if not isinstance(data, dict) or set(data) != keys:\n",
    "        return None\n",
    "    for name in (\"invoice_id\", \"supplier\", \"issued_on\", \"currency\"):\n",
    "        value = data[name]\n",
    "        if value is not None and (not isinstance(value, str) or not value.strip()):\n",
    "            return None\n",
    "    try:\n",
    "        if data[\"issued_on\"] is not None and date.fromisoformat(data[\"issued_on\"]).isoformat() != data[\"issued_on\"]:\n",
    "            return None\n",
    "    except ValueError:\n",
    "        return None\n",
    "    if data[\"currency\"] is not None and re.fullmatch(\"[A-Z]{3}\", data[\"currency\"]) is None:\n",
    "        return None\n",
    "    for name in (\"subtotal_minor\", \"tax_minor\", \"total_minor\"):\n",
    "        if data[name] is not None and type(data[name]) is not int:\n",
    "            return None\n",
    "    if not isinstance(data[\"line_items\"], list):\n",
    "        return None\n",
    "    for row in data[\"line_items\"]:\n",
    "        if not isinstance(row, dict) or set(row) != {\"description\", \"quantity\", \"unit_minor\"}:\n",
    "            return None\n",
    "        if type(row[\"description\"]) is not str or type(row[\"quantity\"]) is not int or type(row[\"unit_minor\"]) is not int:\n",
    "            return None\n",
    "        if not row[\"description\"].strip() or row[\"quantity\"] <= 0:\n",
    "            return None\n",
    "    return data\n",
    "\n",
    "\n",
    "def score_record(completion: str | dict[str, Any], invoice: Invoice) -> dict[str, Any]:\n",
    "    truth = invoice_record(invoice)\n",
    "    observed = parse_record(completion)\n",
    "    field_correct = {key: observed is not None and observed.get(key) == value\n",
    "                     for key, value in truth.items() if key != \"line_items\"}\n",
    "    keys = (\"description\", \"quantity\", \"unit_minor\")\n",
    "    expected = Counter(tuple(r[k] for k in keys) for r in truth[\"line_items\"])\n",
    "    predicted = Counter(tuple(r[k] for k in keys) for r in observed[\"line_items\"]) if observed is not None else Counter()\n",
    "    matches = (expected & predicted).total()\n",
    "    row_count = expected.total() + predicted.total()\n",
    "    return {\"valid\": observed is not None, \"exact\": observed == truth,\n",
    "            \"fields\": sum(field_correct.values()) / len(field_correct), \"field_correct\": field_correct,\n",
    "            \"row_f1\": 2 * matches / row_count if row_count else 1.0}\n",
    "\n",
    "\n",
    "def rules_extract(text: str) -> dict[str, Any] | None:\n",
    "    lines = text.splitlines()\n",
    "    if len(lines) < 9 or lines[4] != \"Description | Quantity | Unit price\":\n",
    "        return None\n",
    "    property_names = (\"supplier\", \"invoice_id\", \"issued_on\", \"currency\")\n",
    "    headers = (\"Supplier: \", \"Invoice: \", \"Issued: \", \"Currency: \")\n",
    "    if any(not line.startswith(header) for line, header in zip(lines, headers)):\n",
    "        return None\n",
    "    data = {name: line.removeprefix(header) for name, line, header in zip(property_names, lines, headers)}\n",
    "\n",
    "    def minor(text_amount: str) -> int | None:\n",
    "        if text_amount == \"-\":\n",
    "            return None\n",
    "        if re.fullmatch(r\"(?:\\d+|\\d{1,3}(?:[., ]\\d{3})+)[.,]\\d{2}\", text_amount) is None:\n",
    "            raise ValueError(\"Unsupported amount format\")\n",
    "        units, frac = text_amount[:-3], text_amount[-2:]\n",
    "        return int(re.sub(r\"\\D\", \"\", units)) * 100 + int(frac)\n",
    "\n",
    "    try:\n",
    "        rows = [line.split(\" | \") for line in lines[5:-3]]\n",
    "        data[\"line_items\"] = [{\"description\": desc, \"quantity\": int(qty), \"unit_minor\": minor(unit)}\n",
    "                              for desc, qty, unit in rows]\n",
    "        data[\"subtotal_minor\"] = minor(lines[-3].removeprefix(\"Subtotal: \"))\n",
    "        data[\"tax_minor\"] = minor(lines[-2].removeprefix(\"Tax: \"))\n",
    "        data[\"total_minor\"] = minor(lines[-1].removeprefix(\"Amount due: \"))\n",
    "    except ValueError:\n",
    "        return None\n",
    "    return parse_record(data)\n",
    "\n",
    "\n",
    "def examples_for(split: str, limit: int | None = None) -> list[Invoice]:\n",
    "    found = [invoice for invoice in make_catalog() if invoice.split == split]\n",
    "    if not found:\n",
    "        raise ValueError(f\"Unknown invoice split {split!r}\")\n",
    "    if limit is None or limit >= len(found):\n",
    "        return found\n",
    "    if limit <= 0:\n",
    "        raise ValueError(\"Limit must be positive\")\n",
    "    groups: dict[str, list[Invoice]] = {}\n",
    "    for invoice in found:\n",
    "        groups.setdefault(invoice.family, []).append(invoice)\n",
    "    balanced = [invoice for group_rows in zip(*groups.values(), strict=True) for invoice in group_rows]\n",
    "    return balanced[:limit]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2d5c2226",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:16:50.159534Z",
     "iopub.status.busy": "2026-11-27T08:16:50.159246Z",
     "iopub.status.idle": "2026-11-27T08:17:19.643244Z",
     "shell.execute_reply": "2026-11-27T08:17:19.642298Z"
    },
    "tags": [
     "text-support"
    ]
   },
   "outputs": [],
   "source": [
    "\"\"\"Notebook-local Qwen text training and matched invoice evaluation.\"\"\"\n",
    "\n",
    "import gc\n",
    "import hashlib\n",
    "import json\n",
    "import math\n",
    "import random\n",
    "import time\n",
    "from collections import defaultdict\n",
    "from importlib.metadata import version\n",
    "from pathlib import Path\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import torch\n",
    "from datasets import Dataset\n",
    "from peft import LoraConfig, PeftModel\n",
    "from transformers import AutoModelForCausalLM, AutoTokenizer, TrainerCallback, set_seed\n",
    "from trl import SFTConfig, SFTTrainer\n",
    "\n",
    "MODEL_ID = \"Qwen/Qwen2.5-0.5B-Instruct\"\n",
    "MODEL_REV = \"7ae557604adf67be50417f59c2c2f167def9a775\"\n",
    "SEED = 42\n",
    "DEVICE = \"cuda\"\n",
    "DTYPE = torch.float16\n",
    "PROMPT_LIMIT = 512\n",
    "ANSWER_LIMIT = 256\n",
    "OUT = Path(\"lesson-results\")\n",
    "\n",
    "SYSTEM = VISIBLE_CONTRACT\n",
    "\n",
    "def dialogs(invoice, system=SYSTEM):\n",
    "    return [{\"role\": \"system\", \"content\": system}, {\"role\": \"user\", \"content\": invoice_text(invoice)}]\n",
    "\n",
    "\n",
    "def packed(record):\n",
    "    return json.dumps(record, ensure_ascii=False, separators=(\",\", \":\"))\n",
    "\n",
    "\n",
    "def supervised_row(invoice, answer=None, system=SYSTEM):\n",
    "    return {\n",
    "        \"prompt\": dialogs(invoice, system=system),\n",
    "        \"completion\": [{\"role\": \"assistant\", \"content\": packed(invoice_record(invoice)) if answer is None else answer}],\n",
    "    }\n",
    "\n",
    "\n",
    "def prepare_kernel():\n",
    "    pins = globals().get(\"TRAINER_PINS\", {})\n",
    "    installed = {name: version(name) for name in pins}\n",
    "    if installed != pins:\n",
    "        raise RuntimeError(f\"Restart the kernel and install the pinned training packages: {installed}\")\n",
    "    if not torch.cuda.is_available():\n",
    "        raise RuntimeError(\"Select a T4 GPU in Colab before running all cells.\")\n",
    "    name = torch.cuda.get_device_name(0)\n",
    "    if \"T4\" not in name:\n",
    "        raise RuntimeError(f\"Expected a Colab T4 for comparable timings; found {name}.\")\n",
    "    OUT.mkdir(exist_ok=True)\n",
    "    set_seed(SEED)\n",
    "    tok = AutoTokenizer.from_pretrained(MODEL_ID, revision=MODEL_REV, trust_remote_code=False)\n",
    "    tok.padding_side = \"left\"\n",
    "    if tok.pad_token is None:\n",
    "        tok.pad_token = tok.eos_token\n",
    "    print(name, \"|\", torch.__version__, \"| revision\", MODEL_REV[:12])\n",
    "    print(\"Trainer packages\", installed, \"| CUDA\", torch.version.cuda)\n",
    "    return tok\n",
    "\n",
    "\n",
    "def manifest(invoices):\n",
    "    rows = sorted(\n",
    "        (invoice.key, invoice.family, invoice.split, invoice_text(invoice), invoice_record(invoice))\n",
    "        for invoice in invoices\n",
    "    )\n",
    "    return hashlib.sha256(packed(rows).encode()).hexdigest()\n",
    "\n",
    "\n",
    "def model_at(source=MODEL_ID):\n",
    "    options = {\"revision\": MODEL_REV} if source == MODEL_ID else {}\n",
    "    model = AutoModelForCausalLM.from_pretrained(\n",
    "        source, **options, torch_dtype=DTYPE, device_map={\"\": DEVICE},\n",
    "        trust_remote_code=False, attn_implementation=\"sdpa\", use_safetensors=True,\n",
    "    )\n",
    "    if source == MODEL_ID and model.config._commit_hash != MODEL_REV:\n",
    "        raise RuntimeError(\"Loaded weights do not match the pinned revision.\")\n",
    "    return model\n",
    "\n",
    "\n",
    "def clean_memory():\n",
    "    gc.collect()\n",
    "    if DEVICE == \"cuda\":\n",
    "        torch.cuda.empty_cache()\n",
    "\n",
    "\n",
    "def lora():\n",
    "    return LoraConfig(\n",
    "        r=8, lora_alpha=16, lora_dropout=0.0,\n",
    "        target_modules=[\"q_proj\", \"v_proj\", \"o_proj\"], task_type=\"CAUSAL_LM\",\n",
    "    )\n",
    "\n",
    "\n",
    "def prompt_tokens(row, tok):\n",
    "    return tok.apply_chat_template(row[\"prompt\"], tokenize=True, add_generation_prompt=True)\n",
    "\n",
    "\n",
    "def token_budget(rows, tok, labelled=None):\n",
    "    max_prompt = max(len(prompt_tokens(item, tok)) for item in rows)\n",
    "    if labelled is None:\n",
    "        labelled = [encode_supervised(item, tok) for item in rows if \"completion\" in item]\n",
    "    max_answer = max((sum(row[\"completion_mask\"]) for row in labelled), default=0)\n",
    "    if max_prompt > PROMPT_LIMIT or max_answer > ANSWER_LIMIT:\n",
    "        raise ValueError(f\"Token limits would clip this dataset: prompt={max_prompt}, answer={max_answer}.\")\n",
    "    return {\"max_prompt_tokens\": max_prompt, \"max_label_tokens\": max_answer}\n",
    "\n",
    "\n",
    "def encode_supervised(row, tok):\n",
    "    prompt = prompt_tokens(row, tok)\n",
    "    full = tok.apply_chat_template(row[\"prompt\"] + row[\"completion\"], tokenize=True)\n",
    "    if full[:len(prompt)] != prompt:\n",
    "        raise ValueError(\"The tokenized chat prefix changed when the answer was appended.\")\n",
    "    completion = full[len(prompt):]\n",
    "    ids = prompt + completion[:completion.index(tok.eos_token_id) + 1]\n",
    "    return {\"input_ids\": ids, \"completion_mask\": [0] * len(prompt) + [1] * (len(ids) - len(prompt))}\n",
    "\n",
    "\n",
    "def check_sft_labels(trainer, encoded):\n",
    "    for start in range(0, len(encoded), trainer.args.per_device_train_batch_size):\n",
    "        examples = encoded[start:start + trainer.args.per_device_train_batch_size]\n",
    "        batch = trainer.data_collator(examples)\n",
    "        for labels, example in zip(batch[\"labels\"].tolist(), examples, strict=True):\n",
    "            expected = [token if keep else -100 for token, keep in\n",
    "                        zip(example[\"input_ids\"], example[\"completion_mask\"], strict=True)]\n",
    "            if labels != expected + [-100] * (len(labels) - len(expected)):\n",
    "                raise AssertionError(\"SFT loss includes prompt or padding, or dropped a response token.\")\n",
    "    return sum(sum(row[\"completion_mask\"]) for row in encoded)\n",
    "\n",
    "\n",
    "class OptimizerAudit(TrainerCallback):\n",
    "    def __init__(self):\n",
    "        self.completed = 0\n",
    "        self.skipped = 0\n",
    "\n",
    "    def on_optimizer_step(self, args, state, control, optimizer, **kwargs):\n",
    "        if optimizer.step_was_skipped:\n",
    "            self.skipped += 1\n",
    "        else:\n",
    "            self.completed += 1\n",
    "\n",
    "\n",
    "def capture_fit(trainer):\n",
    "    audit = OptimizerAudit()\n",
    "    trainer.add_callback(audit)\n",
    "    if DEVICE == \"cuda\":\n",
    "        torch.cuda.synchronize()\n",
    "        torch.cuda.reset_peak_memory_stats()\n",
    "    started = time.perf_counter()\n",
    "    trainer.train()\n",
    "    if DEVICE == \"cuda\":\n",
    "        torch.cuda.synchronize()\n",
    "    if (trainer.state.global_step, audit.completed, audit.skipped) != (trainer.args.max_steps, trainer.args.max_steps, 0):\n",
    "        raise RuntimeError(f\"Optimizer budget mismatch: completed={audit.completed}, skipped={audit.skipped}.\")\n",
    "    return {\n",
    "        \"steps\": trainer.state.global_step,\n",
    "        \"optimizer_updates\": audit.completed,\n",
    "        \"seconds\": time.perf_counter() - started,\n",
    "        \"peak_allocated_gib\": torch.cuda.max_memory_allocated() / 2**30 if DEVICE == \"cuda\" else None,\n",
    "        \"peak_reserved_gib\": torch.cuda.max_memory_reserved() / 2**30 if DEVICE == \"cuda\" else None,\n",
    "        \"log\": [\n",
    "            {key: None if isinstance(value, float) and not math.isfinite(value) else value\n",
    "             for key, value in row.items()}\n",
    "            for row in trainer.state.log_history\n",
    "        ],\n",
    "    }\n",
    "\n",
    "\n",
    "def fit_sft(rows, tok, name, *, steps=32, source=MODEL_ID, lr=2e-4):\n",
    "    encoded = [encode_supervised(row, tok) for row in rows]\n",
    "    lengths = token_budget(rows, tok, encoded)\n",
    "    set_seed(SEED)\n",
    "    base = model_at(source)\n",
    "    base.config.use_cache = False\n",
    "    args = SFTConfig(\n",
    "        output_dir=str(OUT / f\"{name}-trainer\"),\n",
    "        max_steps=steps, max_length=PROMPT_LIMIT + ANSWER_LIMIT,\n",
    "        per_device_train_batch_size=4, gradient_accumulation_steps=2,\n",
    "        learning_rate=lr, lr_scheduler_type=\"constant\", completion_only_loss=True,\n",
    "        fp16=True, bf16=False, gradient_checkpointing=True,\n",
    "        gradient_checkpointing_kwargs={\"use_reentrant\": False},\n",
    "        logging_steps=4, save_strategy=\"no\", report_to=\"none\", seed=SEED, data_seed=SEED,\n",
    "    )\n",
    "    trainer = SFTTrainer(\n",
    "        model=base, args=args, train_dataset=Dataset.from_list(encoded),\n",
    "        processing_class=tok, peft_config=lora(),\n",
    "    )\n",
    "    label_tokens = check_sft_labels(trainer, encoded)\n",
    "    stats = {**capture_fit(trainer), **lengths, \"examples\": len(rows), \"learning_rate\": lr,\n",
    "             \"roster_supervised_tokens\": label_tokens, \"examples_per_update\": 8}\n",
    "    checkpoint = str(OUT / name)\n",
    "    trainer.model.save_pretrained(checkpoint)\n",
    "    del trainer, base\n",
    "    clean_memory()\n",
    "    print(name, {key: value for key, value in stats.items() if key != \"log\"})\n",
    "    return checkpoint, stats\n",
    "\n",
    "\n",
    "def merge_adapter(source, adapter, name):\n",
    "    base = model_at(source)\n",
    "    loaded = PeftModel.from_pretrained(base, adapter)\n",
    "    merged = loaded.merge_and_unload()\n",
    "    merged.config.use_cache = True\n",
    "    target = str(OUT / name)\n",
    "    merged.save_pretrained(target, safe_serialization=True)\n",
    "    del merged, loaded, base\n",
    "    clean_memory()\n",
    "    return target\n",
    "\n",
    "\n",
    "def checkpoint_digest(path):\n",
    "    digest = hashlib.sha256()\n",
    "    directory = Path(path)\n",
    "    files = sorted(item for item in directory.iterdir() if item.suffix in {\".json\", \".safetensors\"})\n",
    "    if not any(item.suffix == \".safetensors\" for item in files):\n",
    "        raise ValueError(f\"No saved weights in {directory}.\")\n",
    "    for item in files:\n",
    "        digest.update(item.name.encode())\n",
    "        with item.open(\"rb\") as stream:\n",
    "            digest.update(hashlib.file_digest(stream, \"sha256\").digest())\n",
    "    return digest.hexdigest()\n",
    "\n",
    "\n",
    "def trainable_digest(model):\n",
    "    digest = hashlib.sha256()\n",
    "    for name, parameter in model.named_parameters():\n",
    "        if parameter.requires_grad:\n",
    "            digest.update(name.encode())\n",
    "            digest.update(parameter.detach().float().cpu().numpy().tobytes())\n",
    "    return digest.hexdigest()\n",
    "\n",
    "\n",
    "def fixed_eval(catalog, per_slice=None, splits=(\"familiar\", \"novel\", \"independent\")):\n",
    "    rng = random.Random(SEED)\n",
    "    picked = []\n",
    "    for split in splits:\n",
    "        rows = [invoice for invoice in catalog if invoice.split == split]\n",
    "        if not rows:\n",
    "            raise ValueError(f\"No data for fixed slice {split}\")\n",
    "        if per_slice is not None and len(rows) > per_slice:\n",
    "            rows = rng.sample(rows, per_slice)\n",
    "        picked.extend(rows)\n",
    "    assert len({row.key for row in picked}) == len(picked)\n",
    "    return picked\n",
    "\n",
    "\n",
    "def eos_ids(model, tok):\n",
    "    value = model.generation_config.eos_token_id\n",
    "    ids = value if isinstance(value, list) else [value]\n",
    "    return {token for token in [tok.eos_token_id, *ids] if token is not None}\n",
    "\n",
    "\n",
    "@torch.inference_mode()\n",
    "def evaluate(model, tok, invoices, *, system=SYSTEM, answer_limit=ANSWER_LIMIT, extract=lambda text: text):\n",
    "    model.eval()\n",
    "    model.config.use_cache = True\n",
    "    output = []\n",
    "    eos = eos_ids(model, tok)\n",
    "    for i in range(0, len(invoices), 8):\n",
    "        part = invoices[i:i + 8]\n",
    "        rendered = [tok.apply_chat_template(dialogs(invoice, system), tokenize=False, add_generation_prompt=True)\n",
    "                    for invoice in part]\n",
    "        batch = tok(rendered, add_special_tokens=False, return_tensors=\"pt\", padding=True).to(DEVICE)\n",
    "        if batch.input_ids.shape[1] > PROMPT_LIMIT:\n",
    "            raise ValueError(\"An evaluation prompt exceeded the declared token budget.\")\n",
    "        if DEVICE == \"cuda\":\n",
    "            torch.cuda.synchronize()\n",
    "        started = time.perf_counter()\n",
    "        tokens = model.generate(**batch, max_new_tokens=answer_limit, do_sample=False,\n",
    "                                pad_token_id=tok.pad_token_id)[:, batch.input_ids.shape[1]:]\n",
    "        if DEVICE == \"cuda\":\n",
    "            torch.cuda.synchronize()\n",
    "        latency = (time.perf_counter() - started) * 1000 / len(part)\n",
    "        texts = tok.batch_decode(tokens, skip_special_tokens=True)\n",
    "        for invoice, token_row, text in zip(part, tokens.tolist(), texts, strict=True):\n",
    "            boundary = next((index for index, token in enumerate(token_row) if token in eos), None)\n",
    "            record = score_record(extract(text), invoice)\n",
    "            output.append({\n",
    "                \"key\": invoice.key, \"family\": invoice.family, \"split\": invoice.split,\n",
    "                \"valid\": float(record[\"valid\"]), \"exact\": float(record[\"exact\"]),\n",
    "                \"fields\": record[\"fields\"], \"row_f1\": float(record[\"row_f1\"]),\n",
    "                \"natural_completion\": boundary is not None,\n",
    "                \"generated_tokens\": len(token_row) if boundary is None else boundary + 1,\n",
    "                \"ms_per_example_in_batch\": latency,\n",
    "                \"completion\": text,\n",
    "            })\n",
    "    return output\n",
    "\n",
    "\n",
    "def evaluate_at(source, tok, invoices, *, adapter=None, **kwargs):\n",
    "    base = model_at(source)\n",
    "    model = PeftModel.from_pretrained(base, adapter) if adapter else base\n",
    "    scores = evaluate(model, tok, invoices, **kwargs)\n",
    "    del model, base\n",
    "    clean_memory()\n",
    "    return scores\n",
    "\n",
    "\n",
    "def summary(scores):\n",
    "    mean = lambda key: sum(row[key] for row in scores) / len(scores)\n",
    "    return {\n",
    "        \"n\": len(scores), \"exact\": mean(\"exact\"), \"valid\": mean(\"valid\"),\n",
    "        \"row_f1\": mean(\"row_f1\"), \"natural_completion\": mean(\"natural_completion\"),\n",
    "        \"mean_generated_tokens\": mean(\"generated_tokens\"),\n",
    "        \"mean_ms_per_example_in_batch\": mean(\"ms_per_example_in_batch\"),\n",
    "    }\n",
    "\n",
    "\n",
    "def paired_change(before, after, *, score=\"exact\", seed=SEED):\n",
    "    left = {row[\"key\"]: row for row in before}\n",
    "    right = {row[\"key\"]: row for row in after}\n",
    "    assert set(left) == set(right) and len(left) == len(before) == len(after)\n",
    "    by_family = defaultdict(list)\n",
    "    for key, row in sorted(left.items()):\n",
    "        by_family[row[\"family\"]].append(right[key][score] - row[score])\n",
    "    changes = [value for values in by_family.values() for value in values]\n",
    "    groups = list(by_family.values())\n",
    "    rng = random.Random(seed)\n",
    "    boot = []\n",
    "    if len(groups) >= 2:\n",
    "        for _ in range(2000):\n",
    "            sampled = [value for group in rng.choices(groups, k=len(groups)) for value in group]\n",
    "            boot.append(sum(sampled) / len(sampled))\n",
    "    return {\n",
    "        \"delta\": sum(changes) / len(changes), \"n\": len(changes), \"families\": len(groups),\n",
    "        \"improved\": sum(change > 0 for change in changes),\n",
    "        \"regressed\": sum(change < 0 for change in changes),\n",
    "        \"tied\": sum(change == 0 for change in changes),\n",
    "        \"paired_family_bootstrap_95\": np.quantile(boot, [0.025, 0.975]).tolist() if boot else None,\n",
    "    }\n",
    "\n",
    "\n",
    "def stage_interaction(scores):\n",
    "    lookup = [{row[\"key\"]: row[\"exact\"] for row in run} for run in scores]\n",
    "    keys = sorted(lookup[0])\n",
    "    assert all(set(run) == set(keys) for run in lookup)\n",
    "    rows = []\n",
    "    for baseline in scores[0]:\n",
    "        key = baseline[\"key\"]\n",
    "        start, dpo, grpo, combined = [run[key] for run in lookup]\n",
    "        rows.append({\"key\": key, \"family\": baseline[\"family\"], \"exact\": combined - dpo - grpo + start})\n",
    "    return paired_change(\n",
    "        [dict(row, exact=0.0) for row in rows], rows,\n",
    "    )\n",
    "\n",
    "\n",
    "def write_report(lesson, report, **tables):\n",
    "    for key, values in tables.items():\n",
    "        pd.DataFrame(values).to_csv(OUT / f\"{lesson}-{key}.csv\", index=False)\n",
    "    full = {\n",
    "        \"model\": MODEL_ID, \"revision\": MODEL_REV, \"seed\": SEED,\n",
    "        \"hardware\": torch.cuda.get_device_name(0) if DEVICE == \"cuda\" else DEVICE,\n",
    "        \"packages\": {name: version(name) for name in (\"torch\", \"transformers\", \"peft\", \"trl\", \"accelerate\", \"datasets\")},\n",
    "        \"prompt_token_cap\": PROMPT_LIMIT, \"completion_token_cap\": ANSWER_LIMIT,\n",
    "        **report,\n",
    "    }\n",
    "    (OUT / f\"{lesson}-report.json\").write_text(json.dumps(full, indent=2, allow_nan=False) + \"\\n\")\n",
    "    print(json.dumps(full, indent=2, allow_nan=False))\n",
    "\n",
    "\n",
    "def plot_slices(summaries, title, filename=\"exact.svg\"):\n",
    "    plt.rcParams[\"svg.fonttype\"] = \"none\"\n",
    "    from IPython.display import SVG, display\n",
    "    fig, ax = plt.subplots(figsize=(9, 4))\n",
    "    keys = list(summaries)\n",
    "    values = [summaries[label][\"exact\"] for label in keys]\n",
    "    ax.barh(keys, values, color=[\"#74818c\", \"#2a78d6\", \"#eb6834\", \"#426a53\", \"#746296\"][:len(keys)])\n",
    "    ax.set(xlim=(0, 1.05), xlabel=\"Exact complete records, share\", title=title)\n",
    "    ax.bar_label(ax.containers[0], labels=[f\"{value:.1%}\" for value in values], padding=4)\n",
    "    ax.invert_yaxis()\n",
    "    ax.grid(axis=\"x\", alpha=0.22)\n",
    "    fig.tight_layout()\n",
    "    svg_path = OUT / filename\n",
    "    fig.savefig(svg_path, format=\"svg\")\n",
    "    plt.close(fig)\n",
    "    display(SVG(filename=str(svg_path)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "7252e51a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:19.647300Z",
     "iopub.status.busy": "2026-11-27T08:17:19.646691Z",
     "iopub.status.idle": "2026-11-27T08:17:19.653685Z",
     "shell.execute_reply": "2026-11-27T08:17:19.652965Z"
    },
    "tags": [
     "cookbook"
    ]
   },
   "outputs": [],
   "source": [
    "# SPDX-License-Identifier: Apache-2.0\n",
    "# Adapted from the Together Post-Training Cookbook revision 226e03ca225d6f13434047cf0f45ab3070a29801.\n",
    "from collections import Counter\n",
    "from collections.abc import Callable, Iterable, Sequence\n",
    "from dataclasses import dataclass, field\n",
    "from typing import TypeVar\n",
    "import torch.nn.functional as F\n",
    "Item = TypeVar('Item')\n",
    "\n",
    "def compute_overlong_penalty(\n",
    "    response_length: int,\n",
    "    max_response_length: int,\n",
    "    overlong_buffer_len: int,\n",
    "    penalty_factor: float = 1.0,\n",
    ") -> float:\n",
    "    \"\"\"Apply the cookbook's DAPO soft penalty near a generation cap.\"\"\"\n",
    "    if overlong_buffer_len <= 0:\n",
    "        return 0.0\n",
    "    expected_len = max_response_length - overlong_buffer_len\n",
    "    exceed_len = response_length - expected_len\n",
    "    return min(-exceed_len / overlong_buffer_len * penalty_factor, 0.0)\n",
    "\n",
    "def oversample_until_kept(\n",
    "    draw_batch: Callable[[], Iterable[Item]],\n",
    "    *,\n",
    "    is_kept: Callable[[Item], bool],\n",
    "    target: int,\n",
    "    max_attempts: int,\n",
    ") -> tuple[list[Item], int]:\n",
    "    \"\"\"Keep rejected groups in the audit trail while bounding draws.\"\"\"\n",
    "    if target <= 0 or max_attempts <= 0:\n",
    "        raise ValueError(\"Target and maximum attempts must be positive.\")\n",
    "    items: list[Item] = []\n",
    "    kept = 0\n",
    "    for attempts in range(1, max_attempts + 1):\n",
    "        for item in draw_batch():\n",
    "            items.append(item)\n",
    "            if is_kept(item):\n",
    "                kept += 1\n",
    "                if kept >= target:\n",
    "                    return items, attempts\n",
    "    return items, max_attempts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "29f9f06d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:19.656888Z",
     "iopub.status.busy": "2026-11-27T08:17:19.656567Z",
     "iopub.status.idle": "2026-11-27T08:17:19.670248Z",
     "shell.execute_reply": "2026-11-27T08:17:19.669564Z"
    },
    "tags": [
     "reward-support"
    ]
   },
   "outputs": [],
   "source": [
    "\"\"\"Reward shaping and condition checks kept independent of the release scorer.\"\"\"\n",
    "\n",
    "import json\n",
    "from collections import Counter\n",
    "\n",
    "\n",
    "def _unique_reward_keys(pairs):\n",
    "    if len(dict(pairs)) != len(pairs):\n",
    "        raise ValueError(\"duplicate key\")\n",
    "    return dict(pairs)\n",
    "\n",
    "\n",
    "def reward_components(completion, expected, *, natural_stop):\n",
    "    \"\"\"Score structure and field fidelity without calling the held-out scorer.\"\"\"\n",
    "    try:\n",
    "        observed = json.loads(completion, object_pairs_hook=_unique_reward_keys)\n",
    "    except (ValueError, TypeError, RecursionError):\n",
    "        return {\"format\": 0.0, \"semantic\": 0.0, \"fields\": 0.0, \"rows\": 0.0, \"natural_stop\": float(natural_stop)}\n",
    "    if not isinstance(observed, dict) or set(observed) != set(expected):\n",
    "        return {\"format\": 0.0, \"semantic\": 0.0, \"fields\": 0.0, \"rows\": 0.0, \"natural_stop\": float(natural_stop)}\n",
    "    rows = observed[\"line_items\"]\n",
    "    fmt = float(\n",
    "        all(value is None or isinstance(value, str) for value in\n",
    "            (observed[key] for key in (\"invoice_id\", \"issued_on\", \"supplier\", \"currency\")))\n",
    "        and all(value is None or type(value) is int for value in\n",
    "                (observed[key] for key in (\"subtotal_minor\", \"tax_minor\", \"total_minor\")))\n",
    "        and isinstance(rows, list)\n",
    "        and all(isinstance(row, dict) and set(row) == {\"description\", \"quantity\", \"unit_minor\"}\n",
    "                and isinstance(row[\"description\"], str) and type(row[\"quantity\"]) is int\n",
    "                and type(row[\"unit_minor\"]) is int for row in rows)\n",
    "    )\n",
    "    if not fmt:\n",
    "        return {\"format\": 0.0, \"semantic\": 0.0, \"fields\": 0.0, \"rows\": 0.0, \"natural_stop\": float(natural_stop)}\n",
    "    keys = [key for key in expected if key != \"line_items\"]\n",
    "    correct = sum(observed[key] == expected[key] for key in keys) / len(keys)\n",
    "    make_row_counts = lambda records: Counter((r[\"description\"], r[\"quantity\"], r[\"unit_minor\"]) for r in records)\n",
    "    truth = make_row_counts(expected[\"line_items\"])\n",
    "    predicted = make_row_counts(rows)\n",
    "    matches = (truth & predicted).total()\n",
    "    row_score = 2.0 * matches / max(truth.total() + predicted.total(), 1)\n",
    "    combined = 0.45 * correct + 0.45 * row_score + 0.1 * float(natural_stop)\n",
    "    return {\"format\": fmt, \"semantic\": combined, \"fields\": correct, \"rows\": row_score, \"natural_stop\": float(natural_stop)}\n",
    "\n",
    "\n",
    "def replay_cases(invoice):\n",
    "    \"\"\"Wrong but well-formed answers expose the range of each reward.\"\"\"\n",
    "    record = invoice_record(invoice)\n",
    "    items = record[\"line_items\"]\n",
    "    assert len(items) >= 2\n",
    "    correct = packed(record)\n",
    "    mutations = [\n",
    "        (\"correct\", correct, True),\n",
    "        (\"missing row\", packed({**record, \"line_items\": items[1:]}), True),\n",
    "        (\"duplicate row\", packed({**record, \"line_items\": items + items[:1]}), True),\n",
    "        (\"wrong currency\", packed({**record, \"currency\": \"USD\" if record[\"currency\"] != \"USD\" else \"EUR\"}), True),\n",
    "        (\"reordered rows\", packed({**record, \"line_items\": items[::-1]}), True),\n",
    "        (\"missing EOS\", correct, False),\n",
    "        (\"truncated JSON\", correct[:-6], False),\n",
    "    ]\n",
    "    return [\n",
    "        {\"case\": name, \"completion\": text, **reward_components(text, record, natural_stop=natural),\n",
    "         \"release_exact\": score_record(text, invoice)[\"exact\"]}\n",
    "        for name, text, natural in mutations\n",
    "    ]\n",
    "\n",
    "\n",
    "def reward_group_diagnostics(batches):\n",
    "    \"\"\"Estimate skip rates on bounded replay, without changing scored GRPO rollouts.\"\"\"\n",
    "    stream = iter(batches)\n",
    "    observed, attempts = oversample_until_kept(\n",
    "        lambda: next(stream, ()), is_kept=lambda rewards: len(set(rewards)) > 1,\n",
    "        target=2, max_attempts=3,\n",
    "    )\n",
    "    return {\n",
    "        \"attempts\": attempts, \"groups\": len(observed),\n",
    "        \"zero_variance_groups\": sum(len(set(group)) < 2 for group in observed),\n",
    "    }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4aba9dd8",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:19.673080Z",
     "iopub.status.busy": "2026-11-27T08:17:19.672745Z",
     "iopub.status.idle": "2026-11-27T08:17:22.352084Z",
     "shell.execute_reply": "2026-11-27T08:17:22.351272Z"
    },
    "tags": [
     "grpo-support"
    ]
   },
   "outputs": [],
   "source": [
    "\"\"\"Bounded Transformers GRPO on one T4.\"\"\"\n",
    "\n",
    "from trl import GRPOConfig, GRPOTrainer\n",
    "\n",
    "GROUP_SIZE = 4\n",
    "GRPO_STEPS = 10\n",
    "GRPO_BETA = 0.04\n",
    "\n",
    "\n",
    "def reward_factory(kind, eos_token_id, audit):\n",
    "    def reward(prompts, completions, completion_ids, gold, record_key, **kwargs):\n",
    "        pairs = []\n",
    "        for option, tokens, expected in zip(completions, completion_ids, gold, strict=True):\n",
    "            if not 0 < len(tokens) <= ANSWER_LIMIT or eos_token_id in tokens[:-1]:\n",
    "                raise ValueError(\"GRPO completion IDs crossed the declared cap or EOS boundary.\")\n",
    "            text = option[0][\"content\"]\n",
    "            pairs.append(reward_components(text, json.loads(expected),\n",
    "                                           natural_stop=tokens[-1] == eos_token_id))\n",
    "        rewards = [item[kind] for item in pairs]\n",
    "        groups = [rewards[i:i + GROUP_SIZE] for i in range(0, len(rewards), GROUP_SIZE)]\n",
    "        if (len(groups) != 1 or len(groups[0]) != GROUP_SIZE or len(record_key) != GROUP_SIZE\n",
    "                or len(set(record_key)) != 1 or len(set(gold)) != 1):\n",
    "            raise ValueError(\"Expected one group of four completions for a single invoice.\")\n",
    "        audit.append({\n",
    "            \"rollout_group\": len(audit) + 1,\n",
    "            \"rollout_invoice_ids\": record_key[::GROUP_SIZE],\n",
    "            \"completions\": len(rewards),\n",
    "            \"format_mean\": float(np.mean([item[\"format\"] for item in pairs])),\n",
    "            \"semantic_mean\": float(np.mean([item[\"semantic\"] for item in pairs])),\n",
    "            \"field_mean\": float(np.mean([item[\"fields\"] for item in pairs])),\n",
    "            \"row_f1_mean\": float(np.mean([item[\"rows\"] for item in pairs])),\n",
    "            \"completion_rate\": float(np.mean([item[\"natural_stop\"] for item in pairs])),\n",
    "            \"mean_tokens\": float(np.mean([len(tokens) for tokens in completion_ids])),\n",
    "            \"max_tokens\": max(map(len, completion_ids)),\n",
    "            \"cap_hits_without_eos\": sum(len(tokens) == ANSWER_LIMIT and tokens[-1] != eos_token_id\n",
    "                                        for tokens in completion_ids),\n",
    "            \"zero_variance_group_share\": float(np.mean([len(set(group)) == 1 for group in groups])),\n",
    "        })\n",
    "        return rewards\n",
    "    reward.__name__ = f\"{kind}_reward\"\n",
    "    return reward\n",
    "\n",
    "\n",
    "def grpo_rows(invoices):\n",
    "    return [{\"prompt\": dialogs(inv), \"gold\": packed(invoice_record(inv)), \"record_key\": inv.key} for inv in invoices]\n",
    "\n",
    "\n",
    "def fit_grpo(source, tok, rows, name, *, kind=\"semantic\", steps=GRPO_STEPS, lr=2e-5, beta=0.0,\n",
    "             save_adapter=True):\n",
    "    if len(rows) < steps:\n",
    "        raise ValueError(\"Set aside at least one distinct training prompt per planned update.\")\n",
    "    lengths = token_budget(rows, tok)\n",
    "    set_seed(SEED)\n",
    "    base = model_at(source)\n",
    "    audit = []\n",
    "    args = GRPOConfig(\n",
    "        output_dir=str(OUT / f\"{name}-trainer\"), max_steps=steps,\n",
    "        per_device_train_batch_size=GROUP_SIZE, gradient_accumulation_steps=1,\n",
    "        num_generations=GROUP_SIZE, steps_per_generation=1, max_prompt_length=PROMPT_LIMIT,\n",
    "        max_completion_length=ANSWER_LIMIT, temperature=0.8, beta=beta,\n",
    "        num_iterations=1, loss_type=\"bnpo\", scale_rewards=True,\n",
    "        learning_rate=lr, lr_scheduler_type=\"constant\",\n",
    "        use_vllm=False, fp16=True, bf16=False, logging_steps=1,\n",
    "        save_strategy=\"no\", report_to=\"none\", seed=SEED, data_seed=SEED,\n",
    "        remove_unused_columns=False,\n",
    "    )\n",
    "    trainer = GRPOTrainer(\n",
    "        model=base, args=args, reward_funcs=reward_factory(kind, tok.eos_token_id, audit),\n",
    "        train_dataset=Dataset.from_list(rows), processing_class=tok, peft_config=lora(),\n",
    "    )\n",
    "    try:\n",
    "        initial_digest = trainable_digest(trainer.model)\n",
    "        stats = {\n",
    "            **capture_fit(trainer), **lengths, \"reward_kind\": kind, \"learning_rate\": lr, \"beta\": beta,\n",
    "            \"initial_adapter_sha256\": initial_digest,\n",
    "            \"prompt_roster_sha256\": hashlib.sha256(packed(rows).encode()).hexdigest(),\n",
    "            \"prompt_ids_sha256\": hashlib.sha256(packed([r[\"record_key\"] for r in rows]).encode()).hexdigest(),\n",
    "            \"generation_group_size\": GROUP_SIZE, \"audit\": audit,\n",
    "            \"rollout_invoice_ids\": [key for batch in audit for key in batch[\"rollout_invoice_ids\"]],\n",
    "            \"completions_sampled\": sum(batch[\"completions\"] for batch in audit),\n",
    "            \"generation_settings\": trainer.generation_config.to_diff_dict(),\n",
    "        }\n",
    "        if (len(audit) != steps or stats[\"completions_sampled\"] != steps * GROUP_SIZE\n",
    "                or len(set(stats[\"rollout_invoice_ids\"])) != steps):\n",
    "            raise RuntimeError(\"Observed rollout groups differ from the fixed training budget.\")\n",
    "        checkpoint = str(OUT / name) if save_adapter else None\n",
    "        if checkpoint:\n",
    "            trainer.model.save_pretrained(checkpoint)\n",
    "            stats[\"adapter_sha256\"] = checkpoint_digest(checkpoint)\n",
    "    finally:\n",
    "        del trainer, base\n",
    "        clean_memory()\n",
    "    print(name, {key: value for key, value in stats.items() if key not in {\"log\", \"audit\"}})\n",
    "    return checkpoint, stats\n",
    "\n",
    "\n",
    "def check_profile(receipt):\n",
    "    return (\n",
    "        receipt[\"steps\"] == 1 and receipt[\"completions_sampled\"] == GROUP_SIZE\n",
    "        and receipt[\"seconds\"] <= 45 and receipt[\"peak_allocated_gib\"] <= 10\n",
    "        and receipt[\"peak_reserved_gib\"] <= min(12, receipt[\"free_before_gib\"] - 2)\n",
    "        and receipt[\"allocated_after_gib\"] <= receipt[\"allocated_before_gib\"] + 0.125\n",
    "    )\n",
    "\n",
    "\n",
    "def profile_grpo(tok, rows):\n",
    "    clean_memory()\n",
    "    torch.cuda.synchronize()\n",
    "    free_before, total = torch.cuda.mem_get_info()\n",
    "    allocated_before = torch.cuda.memory_allocated()\n",
    "    if free_before < 12 * 2**30:\n",
    "        raise RuntimeError(\"L04 needs at least 12 GiB free before running the one-step T4 profile.\")\n",
    "    longest = max(rows, key=lambda row: len(prompt_tokens(row, tok)))\n",
    "    try:\n",
    "        _, stats = fit_grpo(MODEL_ID, tok, [longest], \"04-profile\", steps=1, beta=GRPO_BETA, save_adapter=False)\n",
    "    finally:\n",
    "        clean_memory()\n",
    "        torch.cuda.synchronize()\n",
    "        torch.cuda.reset_peak_memory_stats()\n",
    "        set_seed(SEED)\n",
    "    receipt = {\n",
    "        **{name: stats[name] for name in (\"steps\", \"completions_sampled\", \"seconds\", \"peak_allocated_gib\",\n",
    "                                         \"peak_reserved_gib\", \"max_prompt_tokens\")},\n",
    "        \"max_completion_tokens_observed\": stats[\"audit\"][0][\"max_tokens\"],\n",
    "        \"free_before_gib\": free_before / 2**30, \"total_gib\": total / 2**30,\n",
    "        \"allocated_before_gib\": allocated_before / 2**30,\n",
    "        \"allocated_after_gib\": torch.cuda.memory_allocated() / 2**30,\n",
    "    }\n",
    "    receipt[\"passed\"] = check_profile(receipt)\n",
    "    (OUT / \"04-t4-profile.json\").write_text(json.dumps(receipt, indent=2) + \"\\n\")\n",
    "    print(\"One-step T4 profile\", receipt)\n",
    "    if not receipt[\"passed\"]:\n",
    "        raise RuntimeError(\"L04 T4 profile exceeded its time, memory or cleanup guard. Stop before the full fit.\")\n",
    "    return receipt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cf010da6",
   "metadata": {},
   "source": [
    "## 2. Can a wrong invoice earn full credit?\n",
    "\n",
    "    Read the invoice and decide which outputs you would send to accounts payable. The format reward\n",
    "    checks keys and types. The semantic reward also checks printed fields, row F1 and whether generation\n",
    "    reached EOS. It matches rows as a multiset. The independent evaluator requires printed order for\n",
    "    complete-record accuracy. Try the reordered rows before reading the two scores."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "1f08374a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:22.355427Z",
     "iopub.status.busy": "2026-11-27T08:17:22.355156Z",
     "iopub.status.idle": "2026-11-27T08:17:22.417671Z",
     "shell.execute_reply": "2026-11-27T08:17:22.416956Z"
    },
    "tags": [
     "replay"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SF-878544 / supplier Sample Supplier 5196\n",
      "Date of issue 2026-06-08 / All amounts EUR\n",
      "Packing insert: 247,97 each for 8 units\n",
      "Meter label: 177,06 each for 1 units\n",
      "Rack inspection: 29,84 each for 7 units\n",
      "Net 2.369,70\n",
      "Sales tax 308,06\n",
      "Payable 2.677,76\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "  <div id=\"df-488aa365-5624-41ae-98fd-3e491e38eeac\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>case</th>\n",
       "      <th>format</th>\n",
       "      <th>semantic</th>\n",
       "      <th>fields</th>\n",
       "      <th>rows</th>\n",
       "      <th>natural_stop</th>\n",
       "      <th>release_exact</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>correct</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>missing row</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.910000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.800000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>duplicate row</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.935714</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>1.0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>wrong currency</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.935714</td>\n",
       "      <td>0.857143</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>reordered rows</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>missing EOS</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.900000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>truncated JSON</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "      \n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-488aa365-5624-41ae-98fd-3e491e38eeac')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "      \n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    \n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-488aa365-5624-41ae-98fd-3e491e38eeac button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-488aa365-5624-41ae-98fd-3e491e38eeac');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "  \n",
       "    </div>\n",
       "  </div>\n",
       "  "
      ],
      "text/plain": [
       "             case  format  semantic    fields      rows  natural_stop  \\\n",
       "0         correct     1.0  1.000000  1.000000  1.000000           1.0   \n",
       "1     missing row     1.0  0.910000  1.000000  0.800000           1.0   \n",
       "2   duplicate row     1.0  0.935714  1.000000  0.857143           1.0   \n",
       "3  wrong currency     1.0  0.935714  0.857143  1.000000           1.0   \n",
       "4  reordered rows     1.0  1.000000  1.000000  1.000000           1.0   \n",
       "5     missing EOS     1.0  0.900000  1.000000  1.000000           0.0   \n",
       "6  truncated JSON     0.0  0.000000  0.000000  0.000000           0.0   \n",
       "\n",
       "   release_exact  \n",
       "0           True  \n",
       "1          False  \n",
       "2          False  \n",
       "3          False  \n",
       "4          False  \n",
       "5           True  \n",
       "6          False  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "catalog = make_catalog()\n",
    "example = next(item for item in catalog if item.split == \"dev\" and item.currency == \"EUR\" and len(item.items) == 3)\n",
    "replay = replay_cases(example)\n",
    "print(invoice_text(example))\n",
    "display(pd.DataFrame(replay).drop(columns=\"completion\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1148bdef",
   "metadata": {},
   "source": [
    "## 3. Which records belong to each stage?\n",
    "\n",
    "    Freeze the supervised and GRPO rosters before loading weights. The replay uses a development invoice.\n",
    "    The familiar slice uses known layouts and unseen suppliers. The novel and separate-layout slices\n",
    "    use unseen layout types. All are synthetic. Keep the release split reserved."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3c6bdaed",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:22.420956Z",
     "iopub.status.busy": "2026-11-27T08:17:22.420362Z",
     "iopub.status.idle": "2026-11-27T08:17:36.002508Z",
     "shell.execute_reply": "2026-11-27T08:17:36.001833Z"
    },
    "tags": [
     "prepare"
    ]
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "18e27560860145d3886ae1ec5fa6657a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "tokenizer_config.json: 0.00B [00:00, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b6379f97b7a84ebeb1c1dc62e907b37a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "vocab.json: 0.00B [00:00, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1f32309ca6504dcba5b8306735b69bce",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "merges.txt: 0.00B [00:00, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "86634e69c7bd4b949e096dcb71b2fa62",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "tokenizer.json: 0.00B [00:00, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tesla T4 | 2.14.1+cu130 | revision 7ae557604adf\n",
      "Trainer packages {'transformers': '4.51.3', 'peft': '0.15.2', 'trl': '0.19.1', 'accelerate': '1.6.0', 'datasets': '3.6.0'} | CUDA 13.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Catalogue {'train': 576, 'dev': 72, 'familiar': 96, 'novel': 96, 'independent': 48, 'release': 120}\n",
      "Token budgets {'warm': {'max_prompt_tokens': 217, 'max_label_tokens': 132}, 'rollout': {'max_prompt_tokens': 216, 'max_label_tokens': 132}, 'evaluation': {'max_prompt_tokens': 216, 'max_label_tokens': 0}}\n"
     ]
    }
   ],
   "source": [
    "tok = prepare_kernel()\n",
    "teaching = fixed_eval(catalog)\n",
    "train_items = [item for item in catalog if item.split == \"train\"]\n",
    "random.Random(SEED).shuffle(train_items)\n",
    "warm_items, rl_items = train_items[:384], train_items[384:432]\n",
    "reserved = [item for item in catalog if item.split != \"train\"]\n",
    "warm_rows, rollout_rows = [supervised_row(item) for item in warm_items], grpo_rows(rl_items)\n",
    "assert Counter(item.split for item in catalog) == SPLIT_SIZES\n",
    "assert len({item.key for item in catalog}) == len(catalog)\n",
    "assert len({item.supplier for item in train_items}.intersection(item.supplier for item in reserved)) == 0\n",
    "assert {item.family for item in train_items}.isdisjoint(item.family for item in reserved)\n",
    "assert {item.key for item in warm_items}.isdisjoint(item.key for item in rl_items)\n",
    "assert set(item.split for item in teaching) == {\"familiar\", \"novel\", \"independent\"}\n",
    "assert {item.layout for item in train_items}.isdisjoint(\n",
    "    item.layout for item in teaching if item.split in {\"novel\", \"independent\"})\n",
    "budgets = {\n",
    "    \"warm\": token_budget(warm_rows, tok),\n",
    "    \"rollout\": token_budget([supervised_row(item) for item in rl_items], tok),\n",
    "    \"evaluation\": token_budget([{\"prompt\": dialogs(item)} for item in teaching], tok),\n",
    "}\n",
    "print(\"Catalogue\", dict(Counter(item.split for item in catalog)))\n",
    "print(\"Token budgets\", budgets)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84c0868c",
   "metadata": {},
   "source": [
    "## 4. Can one full rollout update fit the T4?\n",
    "\n",
    "    Use the pinned base, a fresh adapter and the scored GRPO configuration for one real training update\n",
    "    on the longest training prompt in the rollout roster. Record synchronised seconds, peak allocated\n",
    "    and reserved VRAM, and memory after cleanup. The guard stops this notebook on an overrun. The main\n",
    "    experiment reloads its weights and starts fresh after the check."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "563ee022",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:17:36.007039Z",
     "iopub.status.busy": "2026-11-27T08:17:36.006734Z",
     "iopub.status.idle": "2026-11-27T08:18:09.379558Z",
     "shell.execute_reply": "2026-11-27T08:18:09.378757Z"
    },
    "tags": [
     "t4-profile"
    ]
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c8122c408092434cb3c805c2821f628a",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "config.json:   0%|          | 0.00/659 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "2e22fcb38de6491a919fdb0cbe41a36f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "model.safetensors:   0%|          | 0.00/988M [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0a215879ce14407ca0ab012ebb2b4a71",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "generation_config.json:   0%|          | 0.00/242 [00:00<?, ?B/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div>\n",
       "      \n",
       "      <progress value='1' max='1' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
       "      [1/1 00:00, Epoch 1/1]\n",
       "    </div>\n",
       "    <table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       " <tr style=\"text-align: left;\">\n",
       "      <th>Step</th>\n",
       "      <th>Training Loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table><p>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "04-profile {'steps': 1, 'optimizer_updates': 1, 'seconds': 21.87776187899999, 'peak_allocated_gib': 4.756967544555664, 'peak_reserved_gib': 5.134765625, 'max_prompt_tokens': 216, 'max_label_tokens': 0, 'reward_kind': 'semantic', 'learning_rate': 2e-05, 'beta': 0.04, 'initial_adapter_sha256': 05c4f6b62233931f06fb7dbf3124c8651d1173c69738b2f9a9ce1fcefc057170, 'prompt_roster_sha256': e090653e3a86b21bfa47e3b9346cbf7f3e3a2063147ad9846aed5f4a7c735957, 'prompt_ids_sha256': 13308edbfeb8c6b637d27fd8e131b9acb992dd6860565b0bbdabf5b24f67147c, 'generation_group_size': 4, 'rollout_invoice_ids': ['SF-837068'], 'completions_sampled': 4, 'generation_settings': {'max_new_tokens': 256, 'do_sample': True, 'temperature': 0.8, 'top_k': None, 'pad_token_id': 151643, 'eos_token_id': 151645, 'transformers_version': '4.51.3'}}\n",
      "One-step T4 profile {'steps': 1, 'completions_sampled': 4, 'seconds': 21.87776187899999, 'peak_allocated_gib': 4.756967544555664, 'peak_reserved_gib': 5.134765625, 'max_prompt_tokens': 216, 'max_completion_tokens_observed': 256, 'free_before_gib': 14.46075439453125, 'total_gib': 14.56317138671875, 'allocated_before_gib': 0.0, 'allocated_after_gib': 0.01605224609375, 'passed': True}\n"
     ]
    }
   ],
   "source": [
    "profile = profile_grpo(tok, rollout_rows)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c8e294a",
   "metadata": {},
   "source": [
    "## 5. When does a rollout group give a preference signal?\n",
    "\n",
    "    Completions with identical rewards have zero centred advantage. The KL term can still affect the\n",
    "    loss. Replay the bounded redraw and soft length penalty on constructed scores. Both scored fits\n",
    "    use the same fixed sampler, with redraws and the soft penalty confined to this replay."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "129ed0ed",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:18:09.382826Z",
     "iopub.status.busy": "2026-11-27T08:18:09.382431Z",
     "iopub.status.idle": "2026-11-27T08:18:09.392988Z",
     "shell.execute_reply": "2026-11-27T08:18:09.392221Z"
    },
    "tags": [
     "rollout-diagnostics"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'attempts': 2, 'groups': 4, 'zero_variance_groups': 2}\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "  <div id=\"df-c799b9de-89d9-43ce-807e-0593c7ab3df8\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>completion_tokens</th>\n",
       "      <th>soft_length_penalty</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>216</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>224</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>240</td>\n",
       "      <td>-0.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>256</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "      \n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-c799b9de-89d9-43ce-807e-0593c7ab3df8')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "      \n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    \n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-c799b9de-89d9-43ce-807e-0593c7ab3df8 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-c799b9de-89d9-43ce-807e-0593c7ab3df8');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "  \n",
       "    </div>\n",
       "  </div>\n",
       "  "
      ],
      "text/plain": [
       "   completion_tokens  soft_length_penalty\n",
       "0                216                  0.0\n",
       "1                224                  0.0\n",
       "2                240                 -0.5\n",
       "3                256                 -1.0"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "diagnostics = reward_group_diagnostics([[(1, 1, 1, 1), (0, 0, 0, 0)], [(0, 1, 1, 0), (0, 0, 1, 1)]])\n",
    "diagnostic_lengths = [\n",
    "    {\"completion_tokens\": length, \"soft_length_penalty\": compute_overlong_penalty(length, ANSWER_LIMIT, 32)}\n",
    "    for length in (ANSWER_LIMIT - 40, ANSWER_LIMIT - 32, ANSWER_LIMIT - 16, ANSWER_LIMIT)\n",
    "]\n",
    "print(diagnostics)\n",
    "display(pd.DataFrame(diagnostic_lengths))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eab1bdd3",
   "metadata": {},
   "source": [
    "## 6. Can both rewards start from the same policy?\n",
    "\n",
    "    Measure the prompted checkpoint first. Then train on verified answers with loss on JSON and its end\n",
    "    marker. Compare the trainer's labels with the expected mask, and merge the supervised adapter into\n",
    "    the pinned base. The two GRPO arms each start with a fresh rank-8 adapter and optimiser."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "69cc6293",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:18:09.396072Z",
     "iopub.status.busy": "2026-11-27T08:18:09.395790Z",
     "iopub.status.idle": "2026-11-27T08:25:05.893387Z",
     "shell.execute_reply": "2026-11-27T08:25:05.892637Z"
    },
    "tags": [
     "anchor"
    ]
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "982543a285704156b8a5bd985bac68e4",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Truncating train dataset:   0%|          | 0/384 [00:00<?, ? examples/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div>\n",
       "      \n",
       "      <progress value='32' max='32' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
       "      [32/32 00:23, Epoch 0/1]\n",
       "    </div>\n",
       "    <table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       " <tr style=\"text-align: left;\">\n",
       "      <th>Step</th>\n",
       "      <th>Training Loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>0.155700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>0.050100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>0.034400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>0.016800</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>20</td>\n",
       "      <td>0.013600</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>24</td>\n",
       "      <td>0.004900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28</td>\n",
       "      <td>0.005100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>32</td>\n",
       "      <td>0.002500</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table><p>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "04-warm {'steps': 32, 'optimizer_updates': 32, 'seconds': 25.35245966100001, 'peak_allocated_gib': 3.380072593688965, 'peak_reserved_gib': 4.78125, 'max_prompt_tokens': 217, 'max_label_tokens': 132, 'examples': 384, 'learning_rate': 0.0002, 'roster_supervised_tokens': 42274, 'examples_per_update': 8}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Merged anchor 73d8b2d40347\n"
     ]
    }
   ],
   "source": [
    "if not profile[\"passed\"]:\n",
    "    raise RuntimeError(\"Pass the one-step T4 profile before the main experiment.\")\n",
    "base_result = evaluate_at(MODEL_ID, tok, teaching)\n",
    "warm_adapter, warm_stats = fit_sft(warm_rows, tok, \"04-warm\")\n",
    "warm_merged = merge_adapter(MODEL_ID, warm_adapter, \"04-warm-merged\")\n",
    "anchor_digest = checkpoint_digest(warm_merged)\n",
    "warm_result = evaluate_at(warm_merged, tok, teaching)\n",
    "print(\"Merged anchor\", anchor_digest[:12])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8a1d3d41",
   "metadata": {},
   "source": [
    "## 7. Which reward changes the answers?\n",
    "\n",
    "    Each update samples four completions for one invoice. Both arms match the starting weights, prompts,\n",
    "    initial adapter, seed, generation settings, KL coefficient, learning rate and update budget. Their\n",
    "    completions can differ as the policies learn. Greedy held-out inference uses one independent scorer\n",
    "    for every checkpoint."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "4a3f8d72",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:25:05.897586Z",
     "iopub.status.busy": "2026-11-27T08:25:05.897270Z",
     "iopub.status.idle": "2026-11-27T08:33:19.904325Z",
     "shell.execute_reply": "2026-11-27T08:33:19.903622Z"
    },
    "tags": [
     "matched-fit"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div>\n",
       "      \n",
       "      <progress value='10' max='10' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
       "      [10/10 00:53, Epoch 0/1]\n",
       "    </div>\n",
       "    <table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       " <tr style=\"text-align: left;\">\n",
       "      <th>Step</th>\n",
       "      <th>Training Loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table><p>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "04-format {'steps': 10, 'optimizer_updates': 10, 'seconds': 58.19444232600006, 'peak_allocated_gib': 3.352623462677002, 'peak_reserved_gib': 5.6953125, 'max_prompt_tokens': 216, 'max_label_tokens': 0, 'reward_kind': 'format', 'learning_rate': 2e-05, 'beta': 0.04, 'initial_adapter_sha256': 05c4f6b62233931f06fb7dbf3124c8651d1173c69738b2f9a9ce1fcefc057170, 'prompt_roster_sha256': 55649e3e5639ce7e2192ba33ad0bbabdc81216b1ee9bfb9cd707fea770b70794, 'prompt_ids_sha256': 140e2b1f407345b414d0ed85c8a159db7368ef91d74cd967927ed01879b2ea0f, 'generation_group_size': 4, 'rollout_invoice_ids': ['SF-577519', 'SF-482947', 'SF-620359', 'SF-921659', 'SF-729479', 'SF-486495', 'SF-581781', 'SF-311381', 'SF-680003', 'SF-297947'], 'completions_sampled': 40, 'generation_settings': {'max_new_tokens': 256, 'do_sample': True, 'temperature': 0.8, 'top_k': None, 'pad_token_id': 151643, 'eos_token_id': 151645, 'transformers_version': '4.51.3'}, 'adapter_sha256': bd71ef3a1ea6362c24e5374139a155701c84678e3c4a0c7650be0b6dccabd97b}\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div>\n",
       "      \n",
       "      <progress value='10' max='10' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
       "      [10/10 00:56, Epoch 0/1]\n",
       "    </div>\n",
       "    <table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       " <tr style=\"text-align: left;\">\n",
       "      <th>Step</th>\n",
       "      <th>Training Loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table><p>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "04-semantic {'steps': 10, 'optimizer_updates': 10, 'seconds': 61.96520033700017, 'peak_allocated_gib': 3.352623462677002, 'peak_reserved_gib': 5.6953125, 'max_prompt_tokens': 216, 'max_label_tokens': 0, 'reward_kind': 'semantic', 'learning_rate': 2e-05, 'beta': 0.04, 'initial_adapter_sha256': 05c4f6b62233931f06fb7dbf3124c8651d1173c69738b2f9a9ce1fcefc057170, 'prompt_roster_sha256': 55649e3e5639ce7e2192ba33ad0bbabdc81216b1ee9bfb9cd707fea770b70794, 'prompt_ids_sha256': 140e2b1f407345b414d0ed85c8a159db7368ef91d74cd967927ed01879b2ea0f, 'generation_group_size': 4, 'rollout_invoice_ids': ['SF-577519', 'SF-482947', 'SF-620359', 'SF-921659', 'SF-729479', 'SF-486495', 'SF-581781', 'SF-311381', 'SF-680003', 'SF-297947'], 'completions_sampled': 40, 'generation_settings': {'max_new_tokens': 256, 'do_sample': True, 'temperature': 0.8, 'top_k': None, 'pad_token_id': 151643, 'eos_token_id': 151645, 'transformers_version': '4.51.3'}, 'adapter_sha256': bd71ef3a1ea6362c24e5374139a155701c84678e3c4a0c7650be0b6dccabd97b}\n"
     ]
    }
   ],
   "source": [
    "fits, predictions = {}, {}\n",
    "for kind in (\"format\", \"semantic\"):\n",
    "    assert checkpoint_digest(warm_merged) == anchor_digest\n",
    "    adapter, fits[kind] = fit_grpo(warm_merged, tok, rollout_rows, f\"04-{kind}\", kind=kind, beta=GRPO_BETA)\n",
    "    assert set(fits[kind][\"rollout_invoice_ids\"]) <= {item.key for item in rl_items}\n",
    "    predictions[kind] = evaluate_at(warm_merged, tok, teaching, adapter=adapter)\n",
    "for field in (\"initial_adapter_sha256\", \"prompt_roster_sha256\", \"rollout_invoice_ids\",\n",
    "              \"optimizer_updates\", \"completions_sampled\", \"generation_settings\", \"learning_rate\", \"beta\"):\n",
    "    assert fits[\"format\"][field] == fits[\"semantic\"][field], field\n",
    "\n",
    "methods = {\"Prompted base\": base_result, \"SFT anchor\": warm_result,\n",
    "           \"Format GRPO\": predictions[\"format\"], \"Semantic GRPO\": predictions[\"semantic\"]}\n",
    "for rows in methods.values():\n",
    "    assert [row[\"key\"] for row in rows] == [item.key for item in teaching]\n",
    "    assert all(row[\"generated_tokens\"] <= ANSWER_LIMIT for row in rows)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84d42cac",
   "metadata": {},
   "source": [
    "## 8. What does the independent scorer see?\n",
    "\n",
    "    Start with exact complete records and the paired family interval. Then inspect schema validity, row F1,\n",
    "    EOS and token use. Where the policies disagree, return to the source invoice and compare their outputs.\n",
    "    An interval crossing zero leaves the direction uncertain for this sample."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b068334a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:33:19.908812Z",
     "iopub.status.busy": "2026-11-27T08:33:19.908520Z",
     "iopub.status.idle": "2026-11-27T08:33:20.314040Z",
     "shell.execute_reply": "2026-11-27T08:33:20.312211Z"
    },
    "tags": [
     "score"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "  <div id=\"df-2f88d019-8984-468e-9588-f9e547999f88\" class=\"colab-df-container\">\n",
       "    <div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>n</th>\n",
       "      <th>exact</th>\n",
       "      <th>valid</th>\n",
       "      <th>row_f1</th>\n",
       "      <th>natural_completion</th>\n",
       "      <th>mean_generated_tokens</th>\n",
       "      <th>mean_ms_per_example_in_batch</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Prompted base</th>\n",
       "      <td>240.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>0.733333</td>\n",
       "      <td>206.675</td>\n",
       "      <td>1019.086429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SFT anchor</th>\n",
       "      <td>240.0</td>\n",
       "      <td>0.608333</td>\n",
       "      <td>0.970833</td>\n",
       "      <td>0.8875</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>111.950</td>\n",
       "      <td>532.679074</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Format GRPO</th>\n",
       "      <td>240.0</td>\n",
       "      <td>0.608333</td>\n",
       "      <td>0.970833</td>\n",
       "      <td>0.8875</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>111.950</td>\n",
       "      <td>754.049803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Semantic GRPO</th>\n",
       "      <td>240.0</td>\n",
       "      <td>0.608333</td>\n",
       "      <td>0.970833</td>\n",
       "      <td>0.8875</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>111.950</td>\n",
       "      <td>750.034243</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>\n",
       "    <div class=\"colab-df-buttons\">\n",
       "      \n",
       "  <div class=\"colab-df-container\">\n",
       "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2f88d019-8984-468e-9588-f9e547999f88')\"\n",
       "            title=\"Convert this dataframe to an interactive table.\"\n",
       "            style=\"display:none;\">\n",
       "      \n",
       "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
       "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
       "  </svg>\n",
       "    </button>\n",
       "    \n",
       "  <style>\n",
       "    .colab-df-container {\n",
       "      display:flex;\n",
       "      gap: 12px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert {\n",
       "      background-color: #E8F0FE;\n",
       "      border: none;\n",
       "      border-radius: 50%;\n",
       "      cursor: pointer;\n",
       "      display: none;\n",
       "      fill: #1967D2;\n",
       "      height: 32px;\n",
       "      padding: 0 0 0 0;\n",
       "      width: 32px;\n",
       "    }\n",
       "\n",
       "    .colab-df-convert:hover {\n",
       "      background-color: #E2EBFA;\n",
       "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
       "      fill: #174EA6;\n",
       "    }\n",
       "\n",
       "    .colab-df-buttons div {\n",
       "      margin-bottom: 4px;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert {\n",
       "      background-color: #3B4455;\n",
       "      fill: #D2E3FC;\n",
       "    }\n",
       "\n",
       "    [theme=dark] .colab-df-convert:hover {\n",
       "      background-color: #434B5C;\n",
       "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
       "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
       "      fill: #FFFFFF;\n",
       "    }\n",
       "  </style>\n",
       "\n",
       "    <script>\n",
       "      const buttonEl =\n",
       "        document.querySelector('#df-2f88d019-8984-468e-9588-f9e547999f88 button.colab-df-convert');\n",
       "      buttonEl.style.display =\n",
       "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
       "\n",
       "      async function convertToInteractive(key) {\n",
       "        const element = document.querySelector('#df-2f88d019-8984-468e-9588-f9e547999f88');\n",
       "        const dataTable =\n",
       "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
       "                                                    [key], {});\n",
       "        if (!dataTable) return;\n",
       "\n",
       "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
       "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
       "          + ' to learn more about interactive tables.';\n",
       "        element.innerHTML = '';\n",
       "        dataTable['output_type'] = 'display_data';\n",
       "        await google.colab.output.renderOutput(dataTable, element);\n",
       "        const docLink = document.createElement('div');\n",
       "        docLink.innerHTML = docLinkHtml;\n",
       "        element.appendChild(docLink);\n",
       "      }\n",
       "    </script>\n",
       "  </div>\n",
       "  \n",
       "    </div>\n",
       "  </div>\n",
       "  "
      ],
      "text/plain": [
       "                   n     exact     valid  row_f1  natural_completion  \\\n",
       "Prompted base  240.0  0.000000  0.000000  0.0000            0.733333   \n",
       "SFT anchor     240.0  0.608333  0.970833  0.8875            1.000000   \n",
       "Format GRPO    240.0  0.608333  0.970833  0.8875            1.000000   \n",
       "Semantic GRPO  240.0  0.608333  0.970833  0.8875            1.000000   \n",
       "\n",
       "               mean_generated_tokens  mean_ms_per_example_in_batch  \n",
       "Prompted base                206.675                   1019.086429  \n",
       "SFT anchor                   111.950                    532.679074  \n",
       "Format GRPO                  111.950                    754.049803  \n",
       "Semantic GRPO                111.950                    750.034243  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" width=\"648pt\" height=\"288pt\" viewBox=\"0 0 648 288\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2026-11-27T08:33:20.254934</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.10.0, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 288  L 648 288  L 648 0  L 0 0  z \" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 96.37 246.04  L 637.2 246.04  L 637.2 26.88  L 96.37 26.88  z \" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 96.37 36.841818  L 96.37 36.841818  L 96.37 78.786316  L 96.37 78.786316  z \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: #74818c\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 96.37 89.27244  L 409.708016 89.27244  L 409.708016 131.216938  L 96.37 131.216938  z \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: #2a78d6\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 96.37 141.703062  L 409.708016 141.703062  L 409.708016 183.64756  L 96.37 183.64756  z \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: #eb6834\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 96.37 194.133684  L 409.708016 194.133684  L 409.708016 236.078182  L 96.37 236.078182  z \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: #426a53\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path d=\"M 96.37 246.04  L 96.37 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\">\n",
       "      <defs>\n",
       "       <path id=\"m9ba93c8cbd\" d=\"M 0 0  L 0 3.5  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"96.37\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"96.37\" y=\"260.638438\" transform=\"rotate(-0 96.37 260.638438)\">0.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path d=\"M 199.385238 246.04  L 199.385238 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"199.385238\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"199.385238\" y=\"260.638438\" transform=\"rotate(-0 199.385238 260.638438)\">0.2</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path d=\"M 302.400476 246.04  L 302.400476 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"302.400476\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"302.400476\" y=\"260.638438\" transform=\"rotate(-0 302.400476 260.638438)\">0.4</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path d=\"M 405.415714 246.04  L 405.415714 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"405.415714\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"405.415714\" y=\"260.638438\" transform=\"rotate(-0 405.415714 260.638438)\">0.6</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path d=\"M 508.430952 246.04  L 508.430952 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"508.430952\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"508.430952\" y=\"260.638438\" transform=\"rotate(-0 508.430952 260.638438)\">0.8</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path d=\"M 611.44619 246.04  L 611.44619 26.88  \" clip-path=\"url(#pa06e9255b1)\" style=\"fill: none; stroke: #b0b0b0; stroke-opacity: 0.22; stroke-width: 0.8; stroke-linecap: square\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m9ba93c8cbd\" x=\"611.44619\" y=\"246.04\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"611.44619\" y=\"260.638438\" transform=\"rotate(-0 611.44619 260.638438)\">1.0</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_7\">\n",
       "     <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"366.785\" y=\"274.316562\" transform=\"rotate(-0 366.785 274.316562)\">Exact complete records, share</text>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <defs>\n",
       "       <path id=\"md873ae6ca6\" d=\"M 0 0  L -3.5 0  \" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#md873ae6ca6\" x=\"96.37\" y=\"57.814067\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: end\" x=\"89.37\" y=\"61.613286\" transform=\"rotate(-0 89.37 61.613286)\">Prompted base</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md873ae6ca6\" x=\"96.37\" y=\"110.244689\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: end\" x=\"89.37\" y=\"114.043908\" transform=\"rotate(-0 89.37 114.043908)\">SFT anchor</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md873ae6ca6\" x=\"96.37\" y=\"162.675311\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: end\" x=\"89.37\" y=\"166.47453\" transform=\"rotate(-0 89.37 166.47453)\">Format GRPO</text>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md873ae6ca6\" x=\"96.37\" y=\"215.105933\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: end\" x=\"89.37\" y=\"218.905152\" transform=\"rotate(-0 89.37 218.905152)\">Semantic GRPO</text>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 96.37 246.04  L 96.37 26.88  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path d=\"M 637.2 246.04  L 637.2 26.88  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 96.37 246.04  L 637.2 246.04  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 96.37 26.88  L 637.2 26.88  \" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_12\">\n",
       "    <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: start\" x=\"100.37\" y=\"60.573442\" transform=\"rotate(-0 100.37 60.573442)\">0.0%</text>\n",
       "   </g>\n",
       "   <g id=\"text_13\">\n",
       "    <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: start\" x=\"413.708016\" y=\"113.004064\" transform=\"rotate(-0 413.708016 113.004064)\">60.8%</text>\n",
       "   </g>\n",
       "   <g id=\"text_14\">\n",
       "    <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: start\" x=\"413.708016\" y=\"165.434686\" transform=\"rotate(-0 413.708016 165.434686)\">60.8%</text>\n",
       "   </g>\n",
       "   <g id=\"text_15\">\n",
       "    <text style=\"font-size: 10px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: start\" x=\"413.708016\" y=\"217.865308\" transform=\"rotate(-0 413.708016 217.865308)\">60.8%</text>\n",
       "   </g>\n",
       "   <g id=\"text_16\">\n",
       "    <text style=\"font-size: 12px; font-family: 'DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', sans-serif; text-anchor: middle\" x=\"366.785\" y=\"20.88\" transform=\"rotate(-0 366.785 20.88)\">Strict held-out invoice extraction</text>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pa06e9255b1\">\n",
       "   <rect x=\"96.37\" y=\"26.88\" width=\"540.83\" height=\"219.16\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "summaries = {key: summary(scores) for key, scores in methods.items()}\n",
    "slice_scores = {\n",
    "    method: {label: summary([row for row in scores if row[\"split\"] == label])\n",
    "             for label in (\"familiar\", \"novel\", \"independent\")}\n",
    "    for method, scores in methods.items()\n",
    "}\n",
    "changes = {\"format minus warm\": paired_change(warm_result, predictions[\"format\"]),\n",
    "           \"semantic minus warm\": paired_change(warm_result, predictions[\"semantic\"]),\n",
    "           \"semantic minus format\": paired_change(predictions[\"format\"], predictions[\"semantic\"])}\n",
    "display(pd.DataFrame(summaries).T)\n",
    "plot_slices(summaries, \"Strict held-out invoice extraction\", \"04-exact.svg\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d3fbb6c6",
   "metadata": {},
   "source": [
    "## 9. Can you trace every result back to an invoice or update?\n",
    "\n",
    "    Save the held-out texts, reference records, raw model outputs, reward and budget logs, and profile\n",
    "    receipt. Use these records to distinguish a changed answer from a changed training metric."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "22158996",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-11-27T08:33:20.320281Z",
     "iopub.status.busy": "2026-11-27T08:33:20.319769Z",
     "iopub.status.idle": "2026-11-27T08:33:20.513989Z",
     "shell.execute_reply": "2026-11-27T08:33:20.511725Z"
    },
    "tags": [
     "report"
    ]
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\n",
      "  \"key\": \"SF-732205\",\n",
      "  \"split\": \"familiar\",\n",
      "  \"invoice\": \"Sample Supplier 8519 billing memo / 2026-08-09\\nAccount invoice SF-732205 [USD]\\n1 x Bench calibration @ 96.66 per unit\\nTotal due 103.43 including tax 6.77; net amount 96.66.\",\n",
      "  \"expected\": \"{\\\"invoice_id\\\":\\\"SF-732205\\\",\\\"issued_on\\\":\\\"2026-08-09\\\",\\\"supplier\\\":\\\"Sample Supplier 8519\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Bench calibration\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":9666}],\\\"subtotal_minor\\\":9666,\\\"tax_minor\\\":677,\\\"total_minor\\\":10343}\",\n",
      "  \"Format GRPO\": \"{\\\"invoice_id\\\":\\\"SF-732205\\\",\\\"issued_on\\\":\\\"2026-08-09\\\",\\\"supplier\\\":\\\"Sample Supplier 8519\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Bench calibration\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":9666}],\\\"subtotal_minor\\\":10343,\\\"tax_minor\\\":677,\\\"total_minor\\\":9666}\",\n",
      "  \"Semantic GRPO\": \"{\\\"invoice_id\\\":\\\"SF-732205\\\",\\\"issued_on\\\":\\\"2026-08-09\\\",\\\"supplier\\\":\\\"Sample Supplier 8519\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Bench calibration\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":9666}],\\\"subtotal_minor\\\":10343,\\\"tax_minor\\\":677,\\\"total_minor\\\":9666}\",\n",
      "  \"format_exact\": 0.0,\n",
      "  \"semantic_exact\": 0.0\n",
      "}\n",
      "{\n",
      "  \"key\": \"SF-265176\",\n",
      "  \"split\": \"novel\",\n",
      "  \"invoice\": \"Billing details / SF-265176\\nSold by Sample Supplier 3177\\nDocument date 2026-05-20\\nInvoice currency USD\\nBalance payable 715.50\\nPacking insert: 95.26 each for 2 units\\nMounting plate: 68.31 each for 7 units\\nMerchandise 668.69\\nTax 46.81\",\n",
      "  \"expected\": \"{\\\"invoice_id\\\":\\\"SF-265176\\\",\\\"issued_on\\\":\\\"2026-05-20\\\",\\\"supplier\\\":\\\"Sample Supplier 3177\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":2,\\\"unit_minor\\\":9526},{\\\"description\\\":\\\"Mounting plate\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":6831}],\\\"subtotal_minor\\\":66869,\\\"tax_minor\\\":4681,\\\"total_minor\\\":71550}\",\n",
      "  \"Format GRPO\": \"{\\\"invoice_id\\\":\\\"SF-265176\\\",\\\"issued_on\\\":\\\"2026-05-20\\\",\\\"supplier\\\":\\\"Sample Supplier 3177\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":2,\\\"unit_minor\\\":9526},{\\\"description\\\":\\\"Mounting plate\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":6831}],\\\"subtotal_minor\\\":71550,\\\"tax_minor\\\":4681,\\\"total_minor\\\":71550}\",\n",
      "  \"Semantic GRPO\": \"{\\\"invoice_id\\\":\\\"SF-265176\\\",\\\"issued_on\\\":\\\"2026-05-20\\\",\\\"supplier\\\":\\\"Sample Supplier 3177\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":2,\\\"unit_minor\\\":9526},{\\\"description\\\":\\\"Mounting plate\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":6831}],\\\"subtotal_minor\\\":71550,\\\"tax_minor\\\":4681,\\\"total_minor\\\":71550}\",\n",
      "  \"format_exact\": 0.0,\n",
      "  \"semantic_exact\": 0.0\n",
      "}\n",
      "{\n",
      "  \"key\": \"SF-375561\",\n",
      "  \"split\": \"independent\",\n",
      "  \"invoice\": \"Document SF-375561\\nBiller Sample Supplier 8052 / As of 2025-03-27 / USD\\n4 x Door seal @ 165.43 per unit\\nGross 708.04\\nBreakdown: net 661.72 and taxes 46.32.\",\n",
      "  \"expected\": \"{\\\"invoice_id\\\":\\\"SF-375561\\\",\\\"issued_on\\\":\\\"2025-03-27\\\",\\\"supplier\\\":\\\"Sample Supplier 8052\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Door seal\\\",\\\"quantity\\\":4,\\\"unit_minor\\\":16543}],\\\"subtotal_minor\\\":66172,\\\"tax_minor\\\":4632,\\\"total_minor\\\":70804}\",\n",
      "  \"Format GRPO\": \"{\\\"invoice_id\\\":\\\"SF-375561\\\",\\\"issued_on\\\":\\\"2025-03-27\\\",\\\"supplier\\\":\\\"Biller Sample Supplier 8052\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Door seal\\\",\\\"quantity\\\":4,\\\"unit_minor\\\":16543}],\\\"subtotal_minor\\\":66172,\\\"tax_minor\\\":4632,\\\"total_minor\\\":70804}\",\n",
      "  \"Semantic GRPO\": \"{\\\"invoice_id\\\":\\\"SF-375561\\\",\\\"issued_on\\\":\\\"2025-03-27\\\",\\\"supplier\\\":\\\"Biller Sample Supplier 8052\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Door seal\\\",\\\"quantity\\\":4,\\\"unit_minor\\\":16543}],\\\"subtotal_minor\\\":66172,\\\"tax_minor\\\":4632,\\\"total_minor\\\":70804}\",\n",
      "  \"format_exact\": 0.0,\n",
      "  \"semantic_exact\": 0.0\n",
      "}\n",
      "{\n",
      "  \"model\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n",
      "  \"revision\": \"7ae557604adf67be50417f59c2c2f167def9a775\",\n",
      "  \"seed\": 42,\n",
      "  \"hardware\": \"Tesla T4\",\n",
      "  \"packages\": {\n",
      "    \"torch\": \"2.14.1+cu130\",\n",
      "    \"transformers\": \"4.51.3\",\n",
      "    \"peft\": \"0.15.2\",\n",
      "    \"trl\": \"0.19.1\",\n",
      "    \"accelerate\": \"1.6.0\",\n",
      "    \"datasets\": \"3.6.0\"\n",
      "  },\n",
      "  \"prompt_token_cap\": 512,\n",
      "  \"completion_token_cap\": 256,\n",
      "  \"catalog_sha256\": \"37510d1b8180e77bec12cef75d53e8381c8e70120ba215a29395f22b4b0a9403\",\n",
      "  \"merged_anchor_sha256\": \"73d8b2d40347caa9a21110f2846df507cde0016e893b8255559c5966fde82a5f\",\n",
      "  \"evaluation_ids\": [\n",
      "    \"SF-228794\",\n",
      "    \"SF-159804\",\n",
      "    \"SF-221570\",\n",
      "    \"SF-624231\",\n",
      "    \"SF-925400\",\n",
      "    \"SF-269212\",\n",
      "    \"SF-691062\",\n",
      "    \"SF-890511\",\n",
      "    \"SF-840063\",\n",
      "    \"SF-341606\",\n",
      "    \"SF-638331\",\n",
      "    \"SF-570135\",\n",
      "    \"SF-429916\",\n",
      "    \"SF-576379\",\n",
      "    \"SF-115343\",\n",
      "    \"SF-535585\",\n",
      "    \"SF-656977\",\n",
      "    \"SF-125620\",\n",
      "    \"SF-820677\",\n",
      "    \"SF-244377\",\n",
      "    \"SF-879624\",\n",
      "    \"SF-101362\",\n",
      "    \"SF-540511\",\n",
      "    \"SF-400702\",\n",
      "    \"SF-862527\",\n",
      "    \"SF-121864\",\n",
      "    \"SF-524553\",\n",
      "    \"SF-594508\",\n",
      "    \"SF-795507\",\n",
      "    \"SF-227429\",\n",
      "    \"SF-814577\",\n",
      "    \"SF-602629\",\n",
      "    \"SF-423905\",\n",
      "    \"SF-761156\",\n",
      "    \"SF-307640\",\n",
      "    \"SF-747944\",\n",
      "    \"SF-112096\",\n",
      "    \"SF-173476\",\n",
      "    \"SF-222568\",\n",
      "    \"SF-360326\",\n",
      "    \"SF-444543\",\n",
      "    \"SF-425535\",\n",
      "    \"SF-101117\",\n",
      "    \"SF-961161\",\n",
      "    \"SF-326149\",\n",
      "    \"SF-583861\",\n",
      "    \"SF-189777\",\n",
      "    \"SF-984838\",\n",
      "    \"SF-482832\",\n",
      "    \"SF-405682\",\n",
      "    \"SF-900335\",\n",
      "    \"SF-170922\",\n",
      "    \"SF-632745\",\n",
      "    \"SF-354674\",\n",
      "    \"SF-214424\",\n",
      "    \"SF-754577\",\n",
      "    \"SF-979869\",\n",
      "    \"SF-321619\",\n",
      "    \"SF-294113\",\n",
      "    \"SF-846025\",\n",
      "    \"SF-915589\",\n",
      "    \"SF-356438\",\n",
      "    \"SF-195376\",\n",
      "    \"SF-879674\",\n",
      "    \"SF-732205\",\n",
      "    \"SF-425158\",\n",
      "    \"SF-719047\",\n",
      "    \"SF-743181\",\n",
      "    \"SF-214454\",\n",
      "    \"SF-718477\",\n",
      "    \"SF-900897\",\n",
      "    \"SF-724228\",\n",
      "    \"SF-439970\",\n",
      "    \"SF-130995\",\n",
      "    \"SF-717709\",\n",
      "    \"SF-972666\",\n",
      "    \"SF-493288\",\n",
      "    \"SF-719087\",\n",
      "    \"SF-429216\",\n",
      "    \"SF-662352\",\n",
      "    \"SF-232089\",\n",
      "    \"SF-126816\",\n",
      "    \"SF-993765\",\n",
      "    \"SF-400427\",\n",
      "    \"SF-535315\",\n",
      "    \"SF-181336\",\n",
      "    \"SF-216245\",\n",
      "    \"SF-195902\",\n",
      "    \"SF-983022\",\n",
      "    \"SF-456433\",\n",
      "    \"SF-543218\",\n",
      "    \"SF-749889\",\n",
      "    \"SF-691814\",\n",
      "    \"SF-945985\",\n",
      "    \"SF-107997\",\n",
      "    \"SF-347126\",\n",
      "    \"SF-177277\",\n",
      "    \"SF-265176\",\n",
      "    \"SF-797533\",\n",
      "    \"SF-809721\",\n",
      "    \"SF-914755\",\n",
      "    \"SF-543235\",\n",
      "    \"SF-990836\",\n",
      "    \"SF-862677\",\n",
      "    \"SF-220439\",\n",
      "    \"SF-411187\",\n",
      "    \"SF-973701\",\n",
      "    \"SF-884235\",\n",
      "    \"SF-781239\",\n",
      "    \"SF-548824\",\n",
      "    \"SF-840609\",\n",
      "    \"SF-147721\",\n",
      "    \"SF-858135\",\n",
      "    \"SF-241401\",\n",
      "    \"SF-854708\",\n",
      "    \"SF-235300\",\n",
      "    \"SF-852990\",\n",
      "    \"SF-524399\",\n",
      "    \"SF-987667\",\n",
      "    \"SF-901964\",\n",
      "    \"SF-357240\",\n",
      "    \"SF-587791\",\n",
      "    \"SF-427614\",\n",
      "    \"SF-591204\",\n",
      "    \"SF-770084\",\n",
      "    \"SF-411464\",\n",
      "    \"SF-751836\",\n",
      "    \"SF-228773\",\n",
      "    \"SF-925112\",\n",
      "    \"SF-951132\",\n",
      "    \"SF-254647\",\n",
      "    \"SF-850856\",\n",
      "    \"SF-820102\",\n",
      "    \"SF-931161\",\n",
      "    \"SF-828365\",\n",
      "    \"SF-344359\",\n",
      "    \"SF-378664\",\n",
      "    \"SF-610572\",\n",
      "    \"SF-366356\",\n",
      "    \"SF-246869\",\n",
      "    \"SF-177298\",\n",
      "    \"SF-868618\",\n",
      "    \"SF-915455\",\n",
      "    \"SF-120555\",\n",
      "    \"SF-388963\",\n",
      "    \"SF-652364\",\n",
      "    \"SF-416814\",\n",
      "    \"SF-750969\",\n",
      "    \"SF-279855\",\n",
      "    \"SF-989930\",\n",
      "    \"SF-330319\",\n",
      "    \"SF-633995\",\n",
      "    \"SF-370379\",\n",
      "    \"SF-869067\",\n",
      "    \"SF-949394\",\n",
      "    \"SF-751357\",\n",
      "    \"SF-254979\",\n",
      "    \"SF-551781\",\n",
      "    \"SF-566082\",\n",
      "    \"SF-816742\",\n",
      "    \"SF-535443\",\n",
      "    \"SF-537373\",\n",
      "    \"SF-786276\",\n",
      "    \"SF-452878\",\n",
      "    \"SF-469903\",\n",
      "    \"SF-187426\",\n",
      "    \"SF-657315\",\n",
      "    \"SF-345814\",\n",
      "    \"SF-526862\",\n",
      "    \"SF-852562\",\n",
      "    \"SF-704155\",\n",
      "    \"SF-120100\",\n",
      "    \"SF-491110\",\n",
      "    \"SF-391879\",\n",
      "    \"SF-426350\",\n",
      "    \"SF-147048\",\n",
      "    \"SF-248079\",\n",
      "    \"SF-197153\",\n",
      "    \"SF-552493\",\n",
      "    \"SF-966054\",\n",
      "    \"SF-474019\",\n",
      "    \"SF-374305\",\n",
      "    \"SF-821023\",\n",
      "    \"SF-251393\",\n",
      "    \"SF-369874\",\n",
      "    \"SF-442748\",\n",
      "    \"SF-972267\",\n",
      "    \"SF-805939\",\n",
      "    \"SF-553951\",\n",
      "    \"SF-437712\",\n",
      "    \"SF-895238\",\n",
      "    \"SF-327109\",\n",
      "    \"SF-375561\",\n",
      "    \"SF-467138\",\n",
      "    \"SF-426781\",\n",
      "    \"SF-718383\",\n",
      "    \"SF-747871\",\n",
      "    \"SF-424245\",\n",
      "    \"SF-250465\",\n",
      "    \"SF-830444\",\n",
      "    \"SF-229399\",\n",
      "    \"SF-689446\",\n",
      "    \"SF-371233\",\n",
      "    \"SF-948458\",\n",
      "    \"SF-334284\",\n",
      "    \"SF-826464\",\n",
      "    \"SF-776084\",\n",
      "    \"SF-809353\",\n",
      "    \"SF-862316\",\n",
      "    \"SF-805001\",\n",
      "    \"SF-969998\",\n",
      "    \"SF-129961\",\n",
      "    \"SF-995305\",\n",
      "    \"SF-499102\",\n",
      "    \"SF-360240\",\n",
      "    \"SF-146673\",\n",
      "    \"SF-704341\",\n",
      "    \"SF-707944\",\n",
      "    \"SF-887948\",\n",
      "    \"SF-904644\",\n",
      "    \"SF-475818\",\n",
      "    \"SF-613077\",\n",
      "    \"SF-944670\",\n",
      "    \"SF-970654\",\n",
      "    \"SF-779662\",\n",
      "    \"SF-746078\",\n",
      "    \"SF-538993\",\n",
      "    \"SF-310486\",\n",
      "    \"SF-604934\",\n",
      "    \"SF-967042\",\n",
      "    \"SF-685565\",\n",
      "    \"SF-510228\",\n",
      "    \"SF-140134\",\n",
      "    \"SF-740590\",\n",
      "    \"SF-786222\",\n",
      "    \"SF-877097\",\n",
      "    \"SF-435018\",\n",
      "    \"SF-915897\",\n",
      "    \"SF-567011\",\n",
      "    \"SF-673704\"\n",
      "  ],\n",
      "  \"sft_ids\": [\n",
      "    \"SF-932834\",\n",
      "    \"SF-701137\",\n",
      "    \"SF-919659\",\n",
      "    \"SF-628174\",\n",
      "    \"SF-773278\",\n",
      "    \"SF-252477\",\n",
      "    \"SF-941883\",\n",
      "    \"SF-531542\",\n",
      "    \"SF-604836\",\n",
      "    \"SF-721421\",\n",
      "    \"SF-467393\",\n",
      "    \"SF-407040\",\n",
      "    \"SF-681271\",\n",
      "    \"SF-279605\",\n",
      "    \"SF-927524\",\n",
      "    \"SF-529320\",\n",
      "    \"SF-325026\",\n",
      "    \"SF-604047\",\n",
      "    \"SF-736493\",\n",
      "    \"SF-239765\",\n",
      "    \"SF-908750\",\n",
      "    \"SF-440401\",\n",
      "    \"SF-340283\",\n",
      "    \"SF-103688\",\n",
      "    \"SF-877976\",\n",
      "    \"SF-795500\",\n",
      "    \"SF-931622\",\n",
      "    \"SF-135390\",\n",
      "    \"SF-157637\",\n",
      "    \"SF-132488\",\n",
      "    \"SF-771661\",\n",
      "    \"SF-898991\",\n",
      "    \"SF-746585\",\n",
      "    \"SF-556118\",\n",
      "    \"SF-233487\",\n",
      "    \"SF-202696\",\n",
      "    \"SF-712695\",\n",
      "    \"SF-460078\",\n",
      "    \"SF-585083\",\n",
      "    \"SF-496183\",\n",
      "    \"SF-998772\",\n",
      "    \"SF-720523\",\n",
      "    \"SF-527427\",\n",
      "    \"SF-322072\",\n",
      "    \"SF-652885\",\n",
      "    \"SF-972099\",\n",
      "    \"SF-854497\",\n",
      "    \"SF-975629\",\n",
      "    \"SF-573034\",\n",
      "    \"SF-697493\",\n",
      "    \"SF-326916\",\n",
      "    \"SF-796098\",\n",
      "    \"SF-790226\",\n",
      "    \"SF-458807\",\n",
      "    \"SF-368719\",\n",
      "    \"SF-471938\",\n",
      "    \"SF-644023\",\n",
      "    \"SF-644547\",\n",
      "    \"SF-730575\",\n",
      "    \"SF-732619\",\n",
      "    \"SF-397858\",\n",
      "    \"SF-325675\",\n",
      "    \"SF-689260\",\n",
      "    \"SF-911020\",\n",
      "    \"SF-168785\",\n",
      "    \"SF-302292\",\n",
      "    \"SF-157053\",\n",
      "    \"SF-155467\",\n",
      "    \"SF-291811\",\n",
      "    \"SF-595338\",\n",
      "    \"SF-861899\",\n",
      "    \"SF-458686\",\n",
      "    \"SF-651716\",\n",
      "    \"SF-915225\",\n",
      "    \"SF-573548\",\n",
      "    \"SF-437167\",\n",
      "    \"SF-600245\",\n",
      "    \"SF-885222\",\n",
      "    \"SF-163812\",\n",
      "    \"SF-458294\",\n",
      "    \"SF-475319\",\n",
      "    \"SF-630677\",\n",
      "    \"SF-814870\",\n",
      "    \"SF-606170\",\n",
      "    \"SF-568718\",\n",
      "    \"SF-393890\",\n",
      "    \"SF-237194\",\n",
      "    \"SF-389115\",\n",
      "    \"SF-576979\",\n",
      "    \"SF-413160\",\n",
      "    \"SF-666823\",\n",
      "    \"SF-807448\",\n",
      "    \"SF-371721\",\n",
      "    \"SF-520324\",\n",
      "    \"SF-676878\",\n",
      "    \"SF-305531\",\n",
      "    \"SF-781895\",\n",
      "    \"SF-370306\",\n",
      "    \"SF-428921\",\n",
      "    \"SF-653181\",\n",
      "    \"SF-929321\",\n",
      "    \"SF-652493\",\n",
      "    \"SF-695426\",\n",
      "    \"SF-236695\",\n",
      "    \"SF-883807\",\n",
      "    \"SF-212544\",\n",
      "    \"SF-518848\",\n",
      "    \"SF-631626\",\n",
      "    \"SF-323078\",\n",
      "    \"SF-350233\",\n",
      "    \"SF-400936\",\n",
      "    \"SF-282641\",\n",
      "    \"SF-242181\",\n",
      "    \"SF-758076\",\n",
      "    \"SF-942300\",\n",
      "    \"SF-273372\",\n",
      "    \"SF-660749\",\n",
      "    \"SF-939601\",\n",
      "    \"SF-389116\",\n",
      "    \"SF-660620\",\n",
      "    \"SF-955599\",\n",
      "    \"SF-369184\",\n",
      "    \"SF-807546\",\n",
      "    \"SF-584656\",\n",
      "    \"SF-609797\",\n",
      "    \"SF-372440\",\n",
      "    \"SF-313932\",\n",
      "    \"SF-993678\",\n",
      "    \"SF-348113\",\n",
      "    \"SF-455114\",\n",
      "    \"SF-416095\",\n",
      "    \"SF-539732\",\n",
      "    \"SF-550701\",\n",
      "    \"SF-853410\",\n",
      "    \"SF-463978\",\n",
      "    \"SF-428633\",\n",
      "    \"SF-426040\",\n",
      "    \"SF-739044\",\n",
      "    \"SF-309003\",\n",
      "    \"SF-878130\",\n",
      "    \"SF-756708\",\n",
      "    \"SF-849389\",\n",
      "    \"SF-685959\",\n",
      "    \"SF-514614\",\n",
      "    \"SF-519321\",\n",
      "    \"SF-942931\",\n",
      "    \"SF-992196\",\n",
      "    \"SF-409021\",\n",
      "    \"SF-984689\",\n",
      "    \"SF-382917\",\n",
      "    \"SF-852113\",\n",
      "    \"SF-864693\",\n",
      "    \"SF-355937\",\n",
      "    \"SF-148275\",\n",
      "    \"SF-421980\",\n",
      "    \"SF-411401\",\n",
      "    \"SF-742797\",\n",
      "    \"SF-204172\",\n",
      "    \"SF-975546\",\n",
      "    \"SF-238946\",\n",
      "    \"SF-415645\",\n",
      "    \"SF-818214\",\n",
      "    \"SF-657194\",\n",
      "    \"SF-643147\",\n",
      "    \"SF-645757\",\n",
      "    \"SF-462232\",\n",
      "    \"SF-212224\",\n",
      "    \"SF-860676\",\n",
      "    \"SF-100002\",\n",
      "    \"SF-294075\",\n",
      "    \"SF-993060\",\n",
      "    \"SF-569622\",\n",
      "    \"SF-832858\",\n",
      "    \"SF-775409\",\n",
      "    \"SF-378447\",\n",
      "    \"SF-360826\",\n",
      "    \"SF-762616\",\n",
      "    \"SF-485416\",\n",
      "    \"SF-766219\",\n",
      "    \"SF-129547\",\n",
      "    \"SF-272691\",\n",
      "    \"SF-771360\",\n",
      "    \"SF-866503\",\n",
      "    \"SF-794721\",\n",
      "    \"SF-960816\",\n",
      "    \"SF-148730\",\n",
      "    \"SF-957361\",\n",
      "    \"SF-947071\",\n",
      "    \"SF-769358\",\n",
      "    \"SF-612414\",\n",
      "    \"SF-953140\",\n",
      "    \"SF-829705\",\n",
      "    \"SF-852757\",\n",
      "    \"SF-894377\",\n",
      "    \"SF-556235\",\n",
      "    \"SF-648455\",\n",
      "    \"SF-278819\",\n",
      "    \"SF-273124\",\n",
      "    \"SF-228875\",\n",
      "    \"SF-847065\",\n",
      "    \"SF-796866\",\n",
      "    \"SF-633896\",\n",
      "    \"SF-748605\",\n",
      "    \"SF-470387\",\n",
      "    \"SF-519457\",\n",
      "    \"SF-329071\",\n",
      "    \"SF-637261\",\n",
      "    \"SF-834749\",\n",
      "    \"SF-960465\",\n",
      "    \"SF-144214\",\n",
      "    \"SF-870167\",\n",
      "    \"SF-275818\",\n",
      "    \"SF-475519\",\n",
      "    \"SF-970938\",\n",
      "    \"SF-851512\",\n",
      "    \"SF-990750\",\n",
      "    \"SF-229561\",\n",
      "    \"SF-269638\",\n",
      "    \"SF-265594\",\n",
      "    \"SF-951217\",\n",
      "    \"SF-518592\",\n",
      "    \"SF-322124\",\n",
      "    \"SF-185500\",\n",
      "    \"SF-231446\",\n",
      "    \"SF-569228\",\n",
      "    \"SF-659953\",\n",
      "    \"SF-717039\",\n",
      "    \"SF-229805\",\n",
      "    \"SF-299244\",\n",
      "    \"SF-394802\",\n",
      "    \"SF-913263\",\n",
      "    \"SF-910338\",\n",
      "    \"SF-613737\",\n",
      "    \"SF-159606\",\n",
      "    \"SF-370239\",\n",
      "    \"SF-523401\",\n",
      "    \"SF-595442\",\n",
      "    \"SF-919819\",\n",
      "    \"SF-406553\",\n",
      "    \"SF-935074\",\n",
      "    \"SF-231789\",\n",
      "    \"SF-275635\",\n",
      "    \"SF-974560\",\n",
      "    \"SF-110618\",\n",
      "    \"SF-819549\",\n",
      "    \"SF-411860\",\n",
      "    \"SF-174897\",\n",
      "    \"SF-892093\",\n",
      "    \"SF-109206\",\n",
      "    \"SF-725462\",\n",
      "    \"SF-374017\",\n",
      "    \"SF-705617\",\n",
      "    \"SF-240856\",\n",
      "    \"SF-748164\",\n",
      "    \"SF-226852\",\n",
      "    \"SF-868812\",\n",
      "    \"SF-857729\",\n",
      "    \"SF-189486\",\n",
      "    \"SF-585533\",\n",
      "    \"SF-651779\",\n",
      "    \"SF-208270\",\n",
      "    \"SF-273171\",\n",
      "    \"SF-763703\",\n",
      "    \"SF-722636\",\n",
      "    \"SF-963495\",\n",
      "    \"SF-797890\",\n",
      "    \"SF-198511\",\n",
      "    \"SF-495228\",\n",
      "    \"SF-583218\",\n",
      "    \"SF-538519\",\n",
      "    \"SF-775230\",\n",
      "    \"SF-230687\",\n",
      "    \"SF-231152\",\n",
      "    \"SF-556618\",\n",
      "    \"SF-669723\",\n",
      "    \"SF-169838\",\n",
      "    \"SF-159877\",\n",
      "    \"SF-788442\",\n",
      "    \"SF-946338\",\n",
      "    \"SF-881131\",\n",
      "    \"SF-664941\",\n",
      "    \"SF-492841\",\n",
      "    \"SF-652092\",\n",
      "    \"SF-358345\",\n",
      "    \"SF-245778\",\n",
      "    \"SF-630820\",\n",
      "    \"SF-873814\",\n",
      "    \"SF-542531\",\n",
      "    \"SF-651508\",\n",
      "    \"SF-779735\",\n",
      "    \"SF-513412\",\n",
      "    \"SF-234277\",\n",
      "    \"SF-157375\",\n",
      "    \"SF-681994\",\n",
      "    \"SF-277352\",\n",
      "    \"SF-540371\",\n",
      "    \"SF-419924\",\n",
      "    \"SF-257731\",\n",
      "    \"SF-278734\",\n",
      "    \"SF-838331\",\n",
      "    \"SF-681852\",\n",
      "    \"SF-703937\",\n",
      "    \"SF-955241\",\n",
      "    \"SF-302305\",\n",
      "    \"SF-294698\",\n",
      "    \"SF-305025\",\n",
      "    \"SF-406495\",\n",
      "    \"SF-309658\",\n",
      "    \"SF-847838\",\n",
      "    \"SF-626332\",\n",
      "    \"SF-108715\",\n",
      "    \"SF-425310\",\n",
      "    \"SF-536066\",\n",
      "    \"SF-158596\",\n",
      "    \"SF-406272\",\n",
      "    \"SF-335651\",\n",
      "    \"SF-342794\",\n",
      "    \"SF-684858\",\n",
      "    \"SF-440161\",\n",
      "    \"SF-740586\",\n",
      "    \"SF-473923\",\n",
      "    \"SF-719829\",\n",
      "    \"SF-327852\",\n",
      "    \"SF-471428\",\n",
      "    \"SF-302828\",\n",
      "    \"SF-400509\",\n",
      "    \"SF-606165\",\n",
      "    \"SF-184577\",\n",
      "    \"SF-988466\",\n",
      "    \"SF-424194\",\n",
      "    \"SF-815017\",\n",
      "    \"SF-409733\",\n",
      "    \"SF-915055\",\n",
      "    \"SF-379315\",\n",
      "    \"SF-232799\",\n",
      "    \"SF-616570\",\n",
      "    \"SF-444107\",\n",
      "    \"SF-399518\",\n",
      "    \"SF-825649\",\n",
      "    \"SF-203063\",\n",
      "    \"SF-617677\",\n",
      "    \"SF-399624\",\n",
      "    \"SF-184367\",\n",
      "    \"SF-488356\",\n",
      "    \"SF-308492\",\n",
      "    \"SF-574810\",\n",
      "    \"SF-365741\",\n",
      "    \"SF-659895\",\n",
      "    \"SF-422935\",\n",
      "    \"SF-122389\",\n",
      "    \"SF-770304\",\n",
      "    \"SF-470426\",\n",
      "    \"SF-421431\",\n",
      "    \"SF-957778\",\n",
      "    \"SF-705959\",\n",
      "    \"SF-891006\",\n",
      "    \"SF-120329\",\n",
      "    \"SF-588006\",\n",
      "    \"SF-246857\",\n",
      "    \"SF-191073\",\n",
      "    \"SF-678143\",\n",
      "    \"SF-482700\",\n",
      "    \"SF-902388\",\n",
      "    \"SF-350981\",\n",
      "    \"SF-897602\",\n",
      "    \"SF-204891\",\n",
      "    \"SF-594010\",\n",
      "    \"SF-748453\",\n",
      "    \"SF-800980\",\n",
      "    \"SF-306925\",\n",
      "    \"SF-998520\",\n",
      "    \"SF-540623\",\n",
      "    \"SF-771322\",\n",
      "    \"SF-785612\",\n",
      "    \"SF-181050\",\n",
      "    \"SF-589807\",\n",
      "    \"SF-240903\",\n",
      "    \"SF-106348\",\n",
      "    \"SF-428518\",\n",
      "    \"SF-134926\",\n",
      "    \"SF-860353\",\n",
      "    \"SF-669120\",\n",
      "    \"SF-616152\",\n",
      "    \"SF-340287\"\n",
      "  ],\n",
      "  \"grpo_ids\": [\n",
      "    \"SF-729479\",\n",
      "    \"SF-837068\",\n",
      "    \"SF-620359\",\n",
      "    \"SF-828548\",\n",
      "    \"SF-810251\",\n",
      "    \"SF-486495\",\n",
      "    \"SF-577519\",\n",
      "    \"SF-921659\",\n",
      "    \"SF-999146\",\n",
      "    \"SF-387083\",\n",
      "    \"SF-698995\",\n",
      "    \"SF-507012\",\n",
      "    \"SF-832989\",\n",
      "    \"SF-915678\",\n",
      "    \"SF-715260\",\n",
      "    \"SF-254805\",\n",
      "    \"SF-482947\",\n",
      "    \"SF-998847\",\n",
      "    \"SF-540283\",\n",
      "    \"SF-306623\",\n",
      "    \"SF-541015\",\n",
      "    \"SF-625099\",\n",
      "    \"SF-676348\",\n",
      "    \"SF-744057\",\n",
      "    \"SF-360010\",\n",
      "    \"SF-908693\",\n",
      "    \"SF-406567\",\n",
      "    \"SF-235614\",\n",
      "    \"SF-441515\",\n",
      "    \"SF-297947\",\n",
      "    \"SF-930937\",\n",
      "    \"SF-980763\",\n",
      "    \"SF-951232\",\n",
      "    \"SF-366204\",\n",
      "    \"SF-311381\",\n",
      "    \"SF-664234\",\n",
      "    \"SF-431495\",\n",
      "    \"SF-407094\",\n",
      "    \"SF-680003\",\n",
      "    \"SF-962495\",\n",
      "    \"SF-816846\",\n",
      "    \"SF-426839\",\n",
      "    \"SF-500406\",\n",
      "    \"SF-337591\",\n",
      "    \"SF-783565\",\n",
      "    \"SF-880157\",\n",
      "    \"SF-581781\",\n",
      "    \"SF-931691\"\n",
      "  ],\n",
      "  \"token_budgets\": {\n",
      "    \"warm\": {\n",
      "      \"max_prompt_tokens\": 217,\n",
      "      \"max_label_tokens\": 132\n",
      "    },\n",
      "    \"rollout\": {\n",
      "      \"max_prompt_tokens\": 216,\n",
      "      \"max_label_tokens\": 132\n",
      "    },\n",
      "    \"evaluation\": {\n",
      "      \"max_prompt_tokens\": 216,\n",
      "      \"max_label_tokens\": 0\n",
      "    }\n",
      "  },\n",
      "  \"t4_profile\": {\n",
      "    \"steps\": 1,\n",
      "    \"completions_sampled\": 4,\n",
      "    \"seconds\": 21.87776187899999,\n",
      "    \"peak_allocated_gib\": 4.756967544555664,\n",
      "    \"peak_reserved_gib\": 5.134765625,\n",
      "    \"max_prompt_tokens\": 216,\n",
      "    \"max_completion_tokens_observed\": 256,\n",
      "    \"free_before_gib\": 14.46075439453125,\n",
      "    \"total_gib\": 14.56317138671875,\n",
      "    \"allocated_before_gib\": 0.0,\n",
      "    \"allocated_after_gib\": 0.01605224609375,\n",
      "    \"passed\": true\n",
      "  },\n",
      "  \"mutation_invoice\": {\n",
      "    \"invoice\": \"SF-878544 / supplier Sample Supplier 5196\\nDate of issue 2026-06-08 / All amounts EUR\\nPacking insert: 247,97 each for 8 units\\nMeter label: 177,06 each for 1 units\\nRack inspection: 29,84 each for 7 units\\nNet 2.369,70\\nSales tax 308,06\\nPayable 2.677,76\",\n",
      "    \"expected\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "    \"mutations\": [\n",
      "      {\n",
      "        \"case\": \"correct\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 1.0,\n",
      "        \"fields\": 1.0,\n",
      "        \"rows\": 1.0,\n",
      "        \"natural_stop\": 1.0,\n",
      "        \"release_exact\": true\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"missing row\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 0.91,\n",
      "        \"fields\": 1.0,\n",
      "        \"rows\": 0.8,\n",
      "        \"natural_stop\": 1.0,\n",
      "        \"release_exact\": false\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"duplicate row\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984},{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 0.9357142857142856,\n",
      "        \"fields\": 1.0,\n",
      "        \"rows\": 0.8571428571428571,\n",
      "        \"natural_stop\": 1.0,\n",
      "        \"release_exact\": false\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"wrong currency\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"USD\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 0.9357142857142856,\n",
      "        \"fields\": 0.8571428571428571,\n",
      "        \"rows\": 1.0,\n",
      "        \"natural_stop\": 1.0,\n",
      "        \"release_exact\": false\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"reordered rows\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 1.0,\n",
      "        \"fields\": 1.0,\n",
      "        \"rows\": 1.0,\n",
      "        \"natural_stop\": 1.0,\n",
      "        \"release_exact\": false\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"missing EOS\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":267776}\",\n",
      "        \"format\": 1.0,\n",
      "        \"semantic\": 0.9,\n",
      "        \"fields\": 1.0,\n",
      "        \"rows\": 1.0,\n",
      "        \"natural_stop\": 0.0,\n",
      "        \"release_exact\": true\n",
      "      },\n",
      "      {\n",
      "        \"case\": \"truncated JSON\",\n",
      "        \"completion\": \"{\\\"invoice_id\\\":\\\"SF-878544\\\",\\\"issued_on\\\":\\\"2026-06-08\\\",\\\"supplier\\\":\\\"Sample Supplier 5196\\\",\\\"currency\\\":\\\"EUR\\\",\\\"line_items\\\":[{\\\"description\\\":\\\"Packing insert\\\",\\\"quantity\\\":8,\\\"unit_minor\\\":24797},{\\\"description\\\":\\\"Meter label\\\",\\\"quantity\\\":1,\\\"unit_minor\\\":17706},{\\\"description\\\":\\\"Rack inspection\\\",\\\"quantity\\\":7,\\\"unit_minor\\\":2984}],\\\"subtotal_minor\\\":236970,\\\"tax_minor\\\":30806,\\\"total_minor\\\":2\",\n",
      "        \"format\": 0.0,\n",
      "        \"semantic\": 0.0,\n",
      "        \"fields\": 0.0,\n",
      "        \"rows\": 0.0,\n",
      "        \"natural_stop\": 0.0,\n",
      "        \"release_exact\": false\n",
      "      }\n",
      "    ]\n",
      "  },\n",
      "  \"splits\": {\n",
      "    \"Prompted base\": {\n",
      "      \"familiar\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.0,\n",
      "        \"row_f1\": 0.0,\n",
      "        \"natural_completion\": 0.75,\n",
      "        \"mean_generated_tokens\": 206.27083333333334,\n",
      "        \"mean_ms_per_example_in_batch\": 989.0146598020812\n",
      "      },\n",
      "      \"novel\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.0,\n",
      "        \"row_f1\": 0.0,\n",
      "        \"natural_completion\": 0.6875,\n",
      "        \"mean_generated_tokens\": 208.47916666666666,\n",
      "        \"mean_ms_per_example_in_batch\": 1041.2453203437497\n",
      "      },\n",
      "      \"independent\": {\n",
      "        \"n\": 48,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.0,\n",
      "        \"row_f1\": 0.0,\n",
      "        \"natural_completion\": 0.7916666666666666,\n",
      "        \"mean_generated_tokens\": 203.875,\n",
      "        \"mean_ms_per_example_in_batch\": 1034.9121844374997\n",
      "      }\n",
      "    },\n",
      "    \"SFT anchor\": {\n",
      "      \"familiar\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.9895833333333334,\n",
      "        \"valid\": 1.0,\n",
      "        \"row_f1\": 1.0,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 114.3125,\n",
      "        \"mean_ms_per_example_in_batch\": 518.3095653645834\n",
      "      },\n",
      "      \"novel\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.53125,\n",
      "        \"valid\": 0.9375,\n",
      "        \"row_f1\": 0.7743055555555555,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 110.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 525.3591574479159\n",
      "      },\n",
      "      \"independent\": {\n",
      "        \"n\": 48,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.9791666666666666,\n",
      "        \"row_f1\": 0.8888888888888888,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 111.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 576.0579265208321\n",
      "      }\n",
      "    },\n",
      "    \"Format GRPO\": {\n",
      "      \"familiar\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.9895833333333334,\n",
      "        \"valid\": 1.0,\n",
      "        \"row_f1\": 1.0,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 114.3125,\n",
      "        \"mean_ms_per_example_in_batch\": 755.0138317187512\n",
      "      },\n",
      "      \"novel\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.53125,\n",
      "        \"valid\": 0.9375,\n",
      "        \"row_f1\": 0.7743055555555555,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 110.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 763.562244104166\n",
      "      },\n",
      "      \"independent\": {\n",
      "        \"n\": 48,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.9791666666666666,\n",
      "        \"row_f1\": 0.8888888888888888,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 111.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 733.0968653541655\n",
      "      }\n",
      "    },\n",
      "    \"Semantic GRPO\": {\n",
      "      \"familiar\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.9895833333333334,\n",
      "        \"valid\": 1.0,\n",
      "        \"row_f1\": 1.0,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 114.3125,\n",
      "        \"mean_ms_per_example_in_batch\": 750.2507697291682\n",
      "      },\n",
      "      \"novel\": {\n",
      "        \"n\": 96,\n",
      "        \"exact\": 0.53125,\n",
      "        \"valid\": 0.9375,\n",
      "        \"row_f1\": 0.7743055555555555,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 110.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 756.9401880416654\n",
      "      },\n",
      "      \"independent\": {\n",
      "        \"n\": 48,\n",
      "        \"exact\": 0.0,\n",
      "        \"valid\": 0.9791666666666666,\n",
      "        \"row_f1\": 0.8888888888888888,\n",
      "        \"natural_completion\": 1.0,\n",
      "        \"mean_generated_tokens\": 111.04166666666667,\n",
      "        \"mean_ms_per_example_in_batch\": 735.7892983125065\n",
      "      }\n",
      "    }\n",
      "  },\n",
      "  \"overall\": {\n",
      "    \"Prompted base\": {\n",
      "      \"n\": 240,\n",
      "      \"exact\": 0.0,\n",
      "      \"valid\": 0.0,\n",
      "      \"row_f1\": 0.0,\n",
      "      \"natural_completion\": 0.7333333333333333,\n",
      "      \"mean_generated_tokens\": 206.675,\n",
      "      \"mean_ms_per_example_in_batch\": 1019.0864289458324\n",
      "    },\n",
      "    \"SFT anchor\": {\n",
      "      \"n\": 240,\n",
      "      \"exact\": 0.6083333333333333,\n",
      "      \"valid\": 0.9708333333333333,\n",
      "      \"row_f1\": 0.8875,\n",
      "      \"natural_completion\": 1.0,\n",
      "      \"mean_generated_tokens\": 111.95,\n",
      "      \"mean_ms_per_example_in_batch\": 532.6790744291661\n",
      "    },\n",
      "    \"Format GRPO\": {\n",
      "      \"n\": 240,\n",
      "      \"exact\": 0.6083333333333333,\n",
      "      \"valid\": 0.9708333333333333,\n",
      "      \"row_f1\": 0.8875,\n",
      "      \"natural_completion\": 1.0,\n",
      "      \"mean_generated_tokens\": 111.95,\n",
      "      \"mean_ms_per_example_in_batch\": 754.0498034\n",
      "    },\n",
      "    \"Semantic GRPO\": {\n",
      "      \"n\": 240,\n",
      "      \"exact\": 0.6083333333333333,\n",
      "      \"valid\": 0.9708333333333333,\n",
      "      \"row_f1\": 0.8875,\n",
      "      \"natural_completion\": 1.0,\n",
      "      \"mean_generated_tokens\": 111.95,\n",
      "      \"mean_ms_per_example_in_batch\": 750.0342427708347\n",
      "    }\n",
      "  },\n",
      "  \"paired\": {\n",
      "    \"format minus warm\": {\n",
      "      \"delta\": 0.0,\n",
      "      \"n\": 240,\n",
      "      \"families\": 20,\n",
      "      \"improved\": 0,\n",
      "      \"regressed\": 0,\n",
      "      \"tied\": 240,\n",
      "      \"paired_family_bootstrap_95\": [\n",
      "        0.0,\n",
      "        0.0\n",
      "      ]\n",
      "    },\n",
      "    \"semantic minus warm\": {\n",
      "      \"delta\": 0.0,\n",
      "      \"n\": 240,\n",
      "      \"families\": 20,\n",
      "      \"improved\": 0,\n",
      "      \"regressed\": 0,\n",
      "      \"tied\": 240,\n",
      "      \"paired_family_bootstrap_95\": [\n",
      "        0.0,\n",
      "        0.0\n",
      "      ]\n",
      "    },\n",
      "    \"semantic minus format\": {\n",
      "      \"delta\": 0.0,\n",
      "      \"n\": 240,\n",
      "      \"families\": 20,\n",
      "      \"improved\": 0,\n",
      "      \"regressed\": 0,\n",
      "      \"tied\": 240,\n",
      "      \"paired_family_bootstrap_95\": [\n",
      "        0.0,\n",
      "        0.0\n",
      "      ]\n",
      "    }\n",
      "  },\n",
      "  \"training\": {\n",
      "    \"warm\": {\n",
      "      \"steps\": 32,\n",
      "      \"optimizer_updates\": 32,\n",
      "      \"seconds\": 25.35245966100001,\n",
      "      \"peak_allocated_gib\": 3.380072593688965,\n",
      "      \"peak_reserved_gib\": 4.78125,\n",
      "      \"log\": [\n",
      "        {\n",
      "          \"loss\": 0.1557,\n",
      "          \"grad_norm\": 0.5769922733306885,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 9835.0,\n",
      "          \"mean_token_accuracy\": 0.9605754613876343,\n",
      "          \"epoch\": 0.08333333333333333,\n",
      "          \"step\": 4\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0501,\n",
      "          \"grad_norm\": 0.8417161703109741,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 19193.0,\n",
      "          \"mean_token_accuracy\": 0.98722343146801,\n",
      "          \"epoch\": 0.16666666666666666,\n",
      "          \"step\": 8\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0344,\n",
      "          \"grad_norm\": 0.738369882106781,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 28814.0,\n",
      "          \"mean_token_accuracy\": 0.9917866736650467,\n",
      "          \"epoch\": 0.25,\n",
      "          \"step\": 12\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0168,\n",
      "          \"grad_norm\": 0.43655672669410706,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 38367.0,\n",
      "          \"mean_token_accuracy\": 0.9949130117893219,\n",
      "          \"epoch\": 0.3333333333333333,\n",
      "          \"step\": 16\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0136,\n",
      "          \"grad_norm\": 0.21139712631702423,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 47758.0,\n",
      "          \"mean_token_accuracy\": 0.9959283173084259,\n",
      "          \"epoch\": 0.4166666666666667,\n",
      "          \"step\": 20\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0049,\n",
      "          \"grad_norm\": 0.05521070212125778,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 57356.0,\n",
      "          \"mean_token_accuracy\": 0.9997178316116333,\n",
      "          \"epoch\": 0.5,\n",
      "          \"step\": 24\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0051,\n",
      "          \"grad_norm\": 0.05093804746866226,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 66887.0,\n",
      "          \"mean_token_accuracy\": 0.9994436651468277,\n",
      "          \"epoch\": 0.5833333333333334,\n",
      "          \"step\": 28\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0025,\n",
      "          \"grad_norm\": 0.01948654092848301,\n",
      "          \"learning_rate\": 0.0002,\n",
      "          \"num_tokens\": 76902.0,\n",
      "          \"mean_token_accuracy\": 0.9994606301188469,\n",
      "          \"epoch\": 0.6666666666666666,\n",
      "          \"step\": 32\n",
      "        },\n",
      "        {\n",
      "          \"train_runtime\": 24.7331,\n",
      "          \"train_samples_per_second\": 10.351,\n",
      "          \"train_steps_per_second\": 1.294,\n",
      "          \"total_flos\": 182944809326592.0,\n",
      "          \"train_loss\": 0.0353819839656353,\n",
      "          \"epoch\": 0.6666666666666666,\n",
      "          \"step\": 32\n",
      "        }\n",
      "      ],\n",
      "      \"max_prompt_tokens\": 217,\n",
      "      \"max_label_tokens\": 132,\n",
      "      \"examples\": 384,\n",
      "      \"learning_rate\": 0.0002,\n",
      "      \"roster_supervised_tokens\": 42274,\n",
      "      \"examples_per_update\": 8\n",
      "    },\n",
      "    \"format\": {\n",
      "      \"steps\": 10,\n",
      "      \"optimizer_updates\": 10,\n",
      "      \"seconds\": 58.19444232600006,\n",
      "      \"peak_allocated_gib\": 3.352623462677002,\n",
      "      \"peak_reserved_gib\": 5.6953125,\n",
      "      \"log\": [\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 1064.0,\n",
      "          \"completions/mean_length\": 91.0,\n",
      "          \"completions/min_length\": 91.0,\n",
      "          \"completions/max_length\": 91.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 91.0,\n",
      "          \"completions/min_terminated_length\": 91.0,\n",
      "          \"completions/max_terminated_length\": 91.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.020833333333333332,\n",
      "          \"step\": 1\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 2276.0,\n",
      "          \"completions/mean_length\": 108.0,\n",
      "          \"completions/min_length\": 108.0,\n",
      "          \"completions/max_length\": 108.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 108.0,\n",
      "          \"completions/min_terminated_length\": 108.0,\n",
      "          \"completions/max_terminated_length\": 108.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.041666666666666664,\n",
      "          \"step\": 2\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 3464.0,\n",
      "          \"completions/mean_length\": 111.0,\n",
      "          \"completions/min_length\": 111.0,\n",
      "          \"completions/max_length\": 111.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 111.0,\n",
      "          \"completions/min_terminated_length\": 111.0,\n",
      "          \"completions/max_terminated_length\": 111.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.0625,\n",
      "          \"step\": 3\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 4492.0,\n",
      "          \"completions/mean_length\": 90.0,\n",
      "          \"completions/min_length\": 90.0,\n",
      "          \"completions/max_length\": 90.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 90.0,\n",
      "          \"completions/min_terminated_length\": 90.0,\n",
      "          \"completions/max_terminated_length\": 90.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.08333333333333333,\n",
      "          \"step\": 4\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 5816.0,\n",
      "          \"completions/mean_length\": 129.0,\n",
      "          \"completions/min_length\": 129.0,\n",
      "          \"completions/max_length\": 129.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 129.0,\n",
      "          \"completions/min_terminated_length\": 129.0,\n",
      "          \"completions/max_terminated_length\": 129.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.10416666666666667,\n",
      "          \"step\": 5\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 6888.0,\n",
      "          \"completions/mean_length\": 93.0,\n",
      "          \"completions/min_length\": 93.0,\n",
      "          \"completions/max_length\": 93.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 93.0,\n",
      "          \"completions/min_terminated_length\": 93.0,\n",
      "          \"completions/max_terminated_length\": 93.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.125,\n",
      "          \"step\": 6\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 8256.0,\n",
      "          \"completions/mean_length\": 132.0,\n",
      "          \"completions/min_length\": 132.0,\n",
      "          \"completions/max_length\": 132.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 132.0,\n",
      "          \"completions/min_terminated_length\": 132.0,\n",
      "          \"completions/max_terminated_length\": 132.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.14583333333333334,\n",
      "          \"step\": 7\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 9452.0,\n",
      "          \"completions/mean_length\": 112.0,\n",
      "          \"completions/min_length\": 112.0,\n",
      "          \"completions/max_length\": 112.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 112.0,\n",
      "          \"completions/min_terminated_length\": 112.0,\n",
      "          \"completions/max_terminated_length\": 112.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.16666666666666666,\n",
      "          \"step\": 8\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 10652.0,\n",
      "          \"completions/mean_length\": 110.0,\n",
      "          \"completions/min_length\": 110.0,\n",
      "          \"completions/max_length\": 110.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 110.0,\n",
      "          \"completions/min_terminated_length\": 110.0,\n",
      "          \"completions/max_terminated_length\": 110.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.1875,\n",
      "          \"step\": 9\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 11988.0,\n",
      "          \"completions/mean_length\": 128.0,\n",
      "          \"completions/min_length\": 128.0,\n",
      "          \"completions/max_length\": 128.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 128.0,\n",
      "          \"completions/min_terminated_length\": 128.0,\n",
      "          \"completions/max_terminated_length\": 128.0,\n",
      "          \"rewards/format_reward/mean\": 1.0,\n",
      "          \"rewards/format_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.20833333333333334,\n",
      "          \"step\": 10\n",
      "        },\n",
      "        {\n",
      "          \"train_runtime\": 57.6827,\n",
      "          \"train_samples_per_second\": 0.693,\n",
      "          \"train_steps_per_second\": 0.173,\n",
      "          \"total_flos\": 0.0,\n",
      "          \"train_loss\": 0.0,\n",
      "          \"epoch\": 0.20833333333333334,\n",
      "          \"step\": 10\n",
      "        }\n",
      "      ],\n",
      "      \"max_prompt_tokens\": 216,\n",
      "      \"max_label_tokens\": 0,\n",
      "      \"reward_kind\": \"format\",\n",
      "      \"learning_rate\": 2e-05,\n",
      "      \"beta\": 0.04,\n",
      "      \"initial_adapter_sha256\": \"05c4f6b62233931f06fb7dbf3124c8651d1173c69738b2f9a9ce1fcefc057170\",\n",
      "      \"prompt_roster_sha256\": \"55649e3e5639ce7e2192ba33ad0bbabdc81216b1ee9bfb9cd707fea770b70794\",\n",
      "      \"prompt_ids_sha256\": \"140e2b1f407345b414d0ed85c8a159db7368ef91d74cd967927ed01879b2ea0f\",\n",
      "      \"generation_group_size\": 4,\n",
      "      \"audit\": [\n",
      "        {\n",
      "          \"rollout_group\": 1,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-577519\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 91.0,\n",
      "          \"max_tokens\": 91,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 2,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-482947\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 108.0,\n",
      "          \"max_tokens\": 108,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 3,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-620359\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 111.0,\n",
      "          \"max_tokens\": 111,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 4,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-921659\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 90.0,\n",
      "          \"max_tokens\": 90,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 5,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-729479\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 129.0,\n",
      "          \"max_tokens\": 129,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 6,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-486495\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 93.0,\n",
      "          \"max_tokens\": 93,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 7,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-581781\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 132.0,\n",
      "          \"max_tokens\": 132,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 8,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-311381\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 112.0,\n",
      "          \"max_tokens\": 112,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 9,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-680003\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 110.0,\n",
      "          \"max_tokens\": 110,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 10,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-297947\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 128.0,\n",
      "          \"max_tokens\": 128,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        }\n",
      "      ],\n",
      "      \"rollout_invoice_ids\": [\n",
      "        \"SF-577519\",\n",
      "        \"SF-482947\",\n",
      "        \"SF-620359\",\n",
      "        \"SF-921659\",\n",
      "        \"SF-729479\",\n",
      "        \"SF-486495\",\n",
      "        \"SF-581781\",\n",
      "        \"SF-311381\",\n",
      "        \"SF-680003\",\n",
      "        \"SF-297947\"\n",
      "      ],\n",
      "      \"completions_sampled\": 40,\n",
      "      \"generation_settings\": {\n",
      "        \"max_new_tokens\": 256,\n",
      "        \"do_sample\": true,\n",
      "        \"temperature\": 0.8,\n",
      "        \"top_k\": null,\n",
      "        \"pad_token_id\": 151643,\n",
      "        \"eos_token_id\": 151645,\n",
      "        \"transformers_version\": \"4.51.3\"\n",
      "      },\n",
      "      \"adapter_sha256\": \"bd71ef3a1ea6362c24e5374139a155701c84678e3c4a0c7650be0b6dccabd97b\"\n",
      "    },\n",
      "    \"semantic\": {\n",
      "      \"steps\": 10,\n",
      "      \"optimizer_updates\": 10,\n",
      "      \"seconds\": 61.96520033700017,\n",
      "      \"peak_allocated_gib\": 3.352623462677002,\n",
      "      \"peak_reserved_gib\": 5.6953125,\n",
      "      \"log\": [\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 1064.0,\n",
      "          \"completions/mean_length\": 91.0,\n",
      "          \"completions/min_length\": 91.0,\n",
      "          \"completions/max_length\": 91.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 91.0,\n",
      "          \"completions/min_terminated_length\": 91.0,\n",
      "          \"completions/max_terminated_length\": 91.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.020833333333333332,\n",
      "          \"step\": 1\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 2276.0,\n",
      "          \"completions/mean_length\": 108.0,\n",
      "          \"completions/min_length\": 108.0,\n",
      "          \"completions/max_length\": 108.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 108.0,\n",
      "          \"completions/min_terminated_length\": 108.0,\n",
      "          \"completions/max_terminated_length\": 108.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.041666666666666664,\n",
      "          \"step\": 2\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 3464.0,\n",
      "          \"completions/mean_length\": 111.0,\n",
      "          \"completions/min_length\": 111.0,\n",
      "          \"completions/max_length\": 111.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 111.0,\n",
      "          \"completions/min_terminated_length\": 111.0,\n",
      "          \"completions/max_terminated_length\": 111.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.0625,\n",
      "          \"step\": 3\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 4492.0,\n",
      "          \"completions/mean_length\": 90.0,\n",
      "          \"completions/min_length\": 90.0,\n",
      "          \"completions/max_length\": 90.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 90.0,\n",
      "          \"completions/min_terminated_length\": 90.0,\n",
      "          \"completions/max_terminated_length\": 90.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.08333333333333333,\n",
      "          \"step\": 4\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 5816.0,\n",
      "          \"completions/mean_length\": 129.0,\n",
      "          \"completions/min_length\": 129.0,\n",
      "          \"completions/max_length\": 129.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 129.0,\n",
      "          \"completions/min_terminated_length\": 129.0,\n",
      "          \"completions/max_terminated_length\": 129.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.10416666666666667,\n",
      "          \"step\": 5\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 6888.0,\n",
      "          \"completions/mean_length\": 93.0,\n",
      "          \"completions/min_length\": 93.0,\n",
      "          \"completions/max_length\": 93.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 93.0,\n",
      "          \"completions/min_terminated_length\": 93.0,\n",
      "          \"completions/max_terminated_length\": 93.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.125,\n",
      "          \"step\": 6\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 8256.0,\n",
      "          \"completions/mean_length\": 132.0,\n",
      "          \"completions/min_length\": 132.0,\n",
      "          \"completions/max_length\": 132.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 132.0,\n",
      "          \"completions/min_terminated_length\": 132.0,\n",
      "          \"completions/max_terminated_length\": 132.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.14583333333333334,\n",
      "          \"step\": 7\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 9452.0,\n",
      "          \"completions/mean_length\": 112.0,\n",
      "          \"completions/min_length\": 112.0,\n",
      "          \"completions/max_length\": 112.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 112.0,\n",
      "          \"completions/min_terminated_length\": 112.0,\n",
      "          \"completions/max_terminated_length\": 112.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.16666666666666666,\n",
      "          \"step\": 8\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 10652.0,\n",
      "          \"completions/mean_length\": 110.0,\n",
      "          \"completions/min_length\": 110.0,\n",
      "          \"completions/max_length\": 110.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 110.0,\n",
      "          \"completions/min_terminated_length\": 110.0,\n",
      "          \"completions/max_terminated_length\": 110.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.1875,\n",
      "          \"step\": 9\n",
      "        },\n",
      "        {\n",
      "          \"loss\": 0.0,\n",
      "          \"grad_norm\": 0.0,\n",
      "          \"learning_rate\": 2e-05,\n",
      "          \"num_tokens\": 11988.0,\n",
      "          \"completions/mean_length\": 128.0,\n",
      "          \"completions/min_length\": 128.0,\n",
      "          \"completions/max_length\": 128.0,\n",
      "          \"completions/clipped_ratio\": 0.0,\n",
      "          \"completions/mean_terminated_length\": 128.0,\n",
      "          \"completions/min_terminated_length\": 128.0,\n",
      "          \"completions/max_terminated_length\": 128.0,\n",
      "          \"rewards/semantic_reward/mean\": 1.0,\n",
      "          \"rewards/semantic_reward/std\": 0.0,\n",
      "          \"reward\": 1.0,\n",
      "          \"reward_std\": 0.0,\n",
      "          \"frac_reward_zero_std\": 1.0,\n",
      "          \"kl\": 0.0,\n",
      "          \"clip_ratio/low_mean\": 0.0,\n",
      "          \"clip_ratio/low_min\": 0.0,\n",
      "          \"clip_ratio/high_mean\": 0.0,\n",
      "          \"clip_ratio/high_max\": 0.0,\n",
      "          \"clip_ratio/region_mean\": 0.0,\n",
      "          \"epoch\": 0.20833333333333334,\n",
      "          \"step\": 10\n",
      "        },\n",
      "        {\n",
      "          \"train_runtime\": 61.4562,\n",
      "          \"train_samples_per_second\": 0.651,\n",
      "          \"train_steps_per_second\": 0.163,\n",
      "          \"total_flos\": 0.0,\n",
      "          \"train_loss\": 0.0,\n",
      "          \"epoch\": 0.20833333333333334,\n",
      "          \"step\": 10\n",
      "        }\n",
      "      ],\n",
      "      \"max_prompt_tokens\": 216,\n",
      "      \"max_label_tokens\": 0,\n",
      "      \"reward_kind\": \"semantic\",\n",
      "      \"learning_rate\": 2e-05,\n",
      "      \"beta\": 0.04,\n",
      "      \"initial_adapter_sha256\": \"05c4f6b62233931f06fb7dbf3124c8651d1173c69738b2f9a9ce1fcefc057170\",\n",
      "      \"prompt_roster_sha256\": \"55649e3e5639ce7e2192ba33ad0bbabdc81216b1ee9bfb9cd707fea770b70794\",\n",
      "      \"prompt_ids_sha256\": \"140e2b1f407345b414d0ed85c8a159db7368ef91d74cd967927ed01879b2ea0f\",\n",
      "      \"generation_group_size\": 4,\n",
      "      \"audit\": [\n",
      "        {\n",
      "          \"rollout_group\": 1,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-577519\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 91.0,\n",
      "          \"max_tokens\": 91,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 2,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-482947\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 108.0,\n",
      "          \"max_tokens\": 108,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 3,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-620359\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 111.0,\n",
      "          \"max_tokens\": 111,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 4,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-921659\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 90.0,\n",
      "          \"max_tokens\": 90,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 5,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-729479\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 129.0,\n",
      "          \"max_tokens\": 129,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 6,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-486495\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 93.0,\n",
      "          \"max_tokens\": 93,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 7,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-581781\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 132.0,\n",
      "          \"max_tokens\": 132,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 8,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-311381\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 112.0,\n",
      "          \"max_tokens\": 112,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 9,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-680003\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 110.0,\n",
      "          \"max_tokens\": 110,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        },\n",
      "        {\n",
      "          \"rollout_group\": 10,\n",
      "          \"rollout_invoice_ids\": [\n",
      "            \"SF-297947\"\n",
      "          ],\n",
      "          \"completions\": 4,\n",
      "          \"format_mean\": 1.0,\n",
      "          \"semantic_mean\": 1.0,\n",
      "          \"field_mean\": 1.0,\n",
      "          \"row_f1_mean\": 1.0,\n",
      "          \"completion_rate\": 1.0,\n",
      "          \"mean_tokens\": 128.0,\n",
      "          \"max_tokens\": 128,\n",
      "          \"cap_hits_without_eos\": 0,\n",
      "          \"zero_variance_group_share\": 1.0\n",
      "        }\n",
      "      ],\n",
      "      \"rollout_invoice_ids\": [\n",
      "        \"SF-577519\",\n",
      "        \"SF-482947\",\n",
      "        \"SF-620359\",\n",
      "        \"SF-921659\",\n",
      "        \"SF-729479\",\n",
      "        \"SF-486495\",\n",
      "        \"SF-581781\",\n",
      "        \"SF-311381\",\n",
      "        \"SF-680003\",\n",
      "        \"SF-297947\"\n",
      "      ],\n",
      "      \"completions_sampled\": 40,\n",
      "      \"generation_settings\": {\n",
      "        \"max_new_tokens\": 256,\n",
      "        \"do_sample\": true,\n",
      "        \"temperature\": 0.8,\n",
      "        \"top_k\": null,\n",
      "        \"pad_token_id\": 151643,\n",
      "        \"eos_token_id\": 151645,\n",
      "        \"transformers_version\": \"4.51.3\"\n",
      "      },\n",
      "      \"adapter_sha256\": \"bd71ef3a1ea6362c24e5374139a155701c84678e3c4a0c7650be0b6dccabd97b\"\n",
      "    }\n",
      "  },\n",
      "  \"rollout_diagnostics\": {\n",
      "    \"attempts\": 2,\n",
      "    \"groups\": 4,\n",
      "    \"zero_variance_groups\": 2\n",
      "  },\n",
      "  \"length_penalty_diagnostic\": [\n",
      "    {\n",
      "      \"completion_tokens\": 216,\n",
      "      \"soft_length_penalty\": 0.0\n",
      "    },\n",
      "    {\n",
      "      \"completion_tokens\": 224,\n",
      "      \"soft_length_penalty\": 0.0\n",
      "    },\n",
      "    {\n",
      "      \"completion_tokens\": 240,\n",
      "      \"soft_length_penalty\": -0.5\n",
      "    },\n",
      "    {\n",
      "      \"completion_tokens\": 256,\n",
      "      \"soft_length_penalty\": -1.0\n",
      "    }\n",
      "  ]\n",
      "}\n"
     ]
    }
   ],
   "source": [
    "paired_rows = list(zip(teaching, predictions[\"format\"], predictions[\"semantic\"], strict=True))\n",
    "examples = []\n",
    "for split in (\"familiar\", \"novel\", \"independent\"):\n",
    "    candidates = [row for row in paired_rows if row[0].split == split]\n",
    "    picked = min(candidates, key=lambda row: (row[1][\"exact\"] == row[2][\"exact\"], row[1][\"exact\"]))\n",
    "    item, format_row, semantic_row = picked\n",
    "    examples.append({\"key\": item.key, \"split\": split, \"invoice\": invoice_text(item),\n",
    "                     \"expected\": packed(invoice_record(item)), \"Format GRPO\": format_row[\"completion\"],\n",
    "                     \"Semantic GRPO\": semantic_row[\"completion\"],\n",
    "                     \"format_exact\": format_row[\"exact\"], \"semantic_exact\": semantic_row[\"exact\"]})\n",
    "for item in examples:\n",
    "    print(json.dumps(item, ensure_ascii=False, indent=2))\n",
    "write_report(\"04\", {\n",
    "    \"catalog_sha256\": manifest(catalog), \"merged_anchor_sha256\": anchor_digest,\n",
    "    \"evaluation_ids\": [item.key for item in teaching], \"sft_ids\": [item.key for item in warm_items],\n",
    "    \"grpo_ids\": [item.key for item in rl_items], \"token_budgets\": budgets, \"t4_profile\": profile,\n",
    "    \"mutation_invoice\": {\"invoice\": invoice_text(example), \"expected\": packed(invoice_record(example)),\n",
    "                         \"mutations\": replay},\n",
    "    \"splits\": slice_scores, \"overall\": summaries, \"paired\": changes,\n",
    "    \"training\": {\"warm\": warm_stats, **fits},\n",
    "    \"rollout_diagnostics\": diagnostics, \"length_penalty_diagnostic\": diagnostic_lengths,\n",
    "}, mutations=replay, examples=[{\"method\": method, **row} for method, rows in methods.items() for row in rows],\n",
    "   roster=[{\"key\": item.key, \"family\": item.family, \"split\": item.split, \"layout\": item.layout,\n",
    "            \"invoice\": invoice_text(item), \"expected\": packed(invoice_record(item))} for item in teaching],\n",
    "   rollouts=[{\"arm\": arm, **entry} for arm, fit in fits.items() for entry in fit[\"audit\"]],\n",
    "   worked_examples=examples)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a27767fc",
   "metadata": {},
   "source": [
    "## Sources\n",
    "\n",
    "    [DeepSeekMath](https://arxiv.org/html/2402.03300) \u00b7 [DAPO](https://arxiv.org/html/2503.14476) \u00b7\n",
    "    [TRL 0.19.1 GRPO implementation](https://github.com/huggingface/trl/blob/v0.19.1/trl/trainer/grpo_trainer.py) \u00b7\n",
    "    [Apache-licensed cookbook revision](https://github.com/togethercomputer/post-training-cookbook/tree/226e03ca225d6f13434047cf0f45ab3070a29801)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef2143af",
   "metadata": {},
   "source": [
    "## Read the result\n",
    "\n",
    "Use the mutation replay to decide what the verifier pays for. Use matched held-out invoices and the independent scorer to decide whether to adopt it.\n",
    "\n",
    "[Return to the lesson](https://docs.recohut.com/courses/advanced-llm-fine-tuning/2-compare-training-stages/04-design-verifiable-rewards)."
   ]
  }
 ],
 "metadata": {
  "accelerator": "GPU",
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.16"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "02d1c54addb44105b8a0087b665048c2": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_75abb4cef482466c894fa874d5e7655b",
       "max": 988097824.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_ee50d826023e44e6a9e8e916e9acd71b",
       "value": 988097824.0
      }
     },
     "03cfe78841004495a29b37b6b9c33c0d": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "073e0e857fca445ebc8255993dfa87e8": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_f7b9dc658e99467eb73c117c4cecf2b6",
       "max": 659.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_312231ff4f8d4039871b5cae3dd31082",
       "value": 659.0
      }
     },
     "07e70cefa59c47b0870f1266e6977ece": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "0a215879ce14407ca0ab012ebb2b4a71": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_c1337cd67ce545ab9f535699842b0d55",
        "IPY_MODEL_84439c076c4f402d8bc0707fcf500602",
        "IPY_MODEL_cc9d9648b81e4b21beca90185c5fcd0f"
       ],
       "layout": "IPY_MODEL_c77d0c81e51c43049960850c1149e562"
      }
     },
     "0a35077f44024f849e5045ce3c9db2c5": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "15dc6fd37c6a4bb6973d18205500c587": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "17d9864f128446029bfce2367c916a74": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "18e27560860145d3886ae1ec5fa6657a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_550d7da3f3cc49178f9a9c69b789dcd1",
        "IPY_MODEL_3b0a76c94ed24349a55adebec85e9b22",
        "IPY_MODEL_7f5302eebe5a497e9fd6a6563e41314b"
       ],
       "layout": "IPY_MODEL_28bbfcf4d24f468981eef20c7cf0f155"
      }
     },
     "1d158bd1d45d401b8da8a5d4a61452f9": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "1e7acbbff3394b79ba96b7daf6ec266f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "1f32309ca6504dcba5b8306735b69bce": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_eed4039c6e1044e38865960fe639f7da",
        "IPY_MODEL_4b619975536e4122a859ea5d51bac703",
        "IPY_MODEL_6b1ab77ec1c54320bac8bee0545bd556"
       ],
       "layout": "IPY_MODEL_6c98e56ce7734fb1ad78dafc70e617b0"
      }
     },
     "22cf2d066a4748ea8087fd6eabee416e": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "22e57b2097274b20b6c79329f4d2f6c4": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "270f310ba2cd4cfe98ea924ac289d262": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "28bbfcf4d24f468981eef20c7cf0f155": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "2948c35b6372414fa8859310f04a3986": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "2e22fcb38de6491a919fdb0cbe41a36f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_343faadbbcb84fe8a74ae6698ffe7dac",
        "IPY_MODEL_02d1c54addb44105b8a0087b665048c2",
        "IPY_MODEL_404ef5c1959d4ff1b6f83300d5f54d68"
       ],
       "layout": "IPY_MODEL_b9ded367f81348b09a953be389e5b6fe"
      }
     },
     "2f84b6be59134c7cba140186a333ab8c": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "312231ff4f8d4039871b5cae3dd31082": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "339b78d4451f4ff8b3002f929d229c7f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_1d158bd1d45d401b8da8a5d4a61452f9",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_89cd711bbb24481ba8c79cbb7c7b441b",
       "value": "Truncating\u2007train\u2007dataset:\u2007100%"
      }
     },
     "343faadbbcb84fe8a74ae6698ffe7dac": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_270f310ba2cd4cfe98ea924ac289d262",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_63103ef5636d47848f5c4f6d496c2d1f",
       "value": "model.safetensors:\u2007100%"
      }
     },
     "382d84513e554f488a0eb821f0b12552": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_b09b031feee2447db28ddbcaa180beee",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_f9a4f004546e43c3a4eaa0695fc55a60",
       "value": "\u20072.78M/?\u2007[00:00&lt;00:00,\u200774.7MB/s]"
      }
     },
     "3b0a76c94ed24349a55adebec85e9b22": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_77aff4c59a154d0c9f1c35ff4082b59f",
       "max": 1.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_d37474c61266492583c4f382ed5bccf1",
       "value": 1.0
      }
     },
     "404ef5c1959d4ff1b6f83300d5f54d68": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_d84368d1b9d4410f8a964d1553868f35",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_d62396979e994575a90cecd4143291e7",
       "value": "\u2007988M/988M\u2007[00:07&lt;00:00,\u2007182MB/s]"
      }
     },
     "411f2b1f8e0b4c088823fe785ca47aec": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "42fa550105cf4757ac187aa3920c7d3d": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "4692d121a9764ed9b8f47b752161edee": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "47a53d56db9640db9088f3e4acd8ded2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": "20px"
      }
     },
     "4b422351a2d849da8d2f179a736bf3e2": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "4b619975536e4122a859ea5d51bac703": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_cf4d0e50dec248bf9add5c02d7645027",
       "max": 1.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_15dc6fd37c6a4bb6973d18205500c587",
       "value": 1.0
      }
     },
     "4bba3005851e44b1a8f93e685c68ce77": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "550d7da3f3cc49178f9a9c69b789dcd1": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_dd5a145118814e589b9039dcbb411df7",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_ba8ab919354342c9a54a230309cec0da",
       "value": "tokenizer_config.json:\u2007"
      }
     },
     "56dfbfb351b34a78aaba3a2a40cee71f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "5c18ab2a1c7f4054a9fa46a0ddbab4cb": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "5c6fdb126fb04454b5602b6f4ebd6e4d": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_56dfbfb351b34a78aaba3a2a40cee71f",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_1e7acbbff3394b79ba96b7daf6ec266f",
       "value": "\u2007384/384\u2007[00:00&lt;00:00,\u20078885.21\u2007examples/s]"
      }
     },
     "63103ef5636d47848f5c4f6d496c2d1f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "65699a852e66406a98ee2867e5618557": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "69a1aad949964625a3952ff43fd0a6b6": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": "20px"
      }
     },
     "69d81f380a25496a8370c4fd419fb869": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "6b1ab77ec1c54320bac8bee0545bd556": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_22cf2d066a4748ea8087fd6eabee416e",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_ba187926b2984efda3dceaf806e96096",
       "value": "\u20071.67M/?\u2007[00:00&lt;00:00,\u200764.7MB/s]"
      }
     },
     "6c98e56ce7734fb1ad78dafc70e617b0": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "7061205219d143b281f0590c365d39c9": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_69a1aad949964625a3952ff43fd0a6b6",
       "max": 1.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_0a35077f44024f849e5045ce3c9db2c5",
       "value": 1.0
      }
     },
     "7544c8bba1ea428a940d9f1bcb880fe3": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_47a53d56db9640db9088f3e4acd8ded2",
       "max": 1.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_411f2b1f8e0b4c088823fe785ca47aec",
       "value": 1.0
      }
     },
     "75abb4cef482466c894fa874d5e7655b": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "77aff4c59a154d0c9f1c35ff4082b59f": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": "20px"
      }
     },
     "7e442190656f44f19133c51d1798b044": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_f426e50412c749bba98a05e9ec040ef4",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_80526b828716443bb48c0cea70ac0279",
       "value": "config.json:\u2007100%"
      }
     },
     "7f5302eebe5a497e9fd6a6563e41314b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_65699a852e66406a98ee2867e5618557",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_8ef16269eff64bf1b2733bcd56196411",
       "value": "\u20077.30k/?\u2007[00:00&lt;00:00,\u2007508kB/s]"
      }
     },
     "80526b828716443bb48c0cea70ac0279": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "84439c076c4f402d8bc0707fcf500602": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_07e70cefa59c47b0870f1266e6977ece",
       "max": 242.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_b8e93818c11c4a92923d66ab712ef72b",
       "value": 242.0
      }
     },
     "86634e69c7bd4b949e096dcb71b2fa62": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_f4b76409132e4e0cada5dbf7acd16141",
        "IPY_MODEL_7061205219d143b281f0590c365d39c9",
        "IPY_MODEL_c3e7c7a409b84a159d2fb6e92dedecf5"
       ],
       "layout": "IPY_MODEL_4692d121a9764ed9b8f47b752161edee"
      }
     },
     "89cd711bbb24481ba8c79cbb7c7b441b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "8ef16269eff64bf1b2733bcd56196411": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "90686334aee64cf68e879586f39403d7": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "FloatProgressModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "FloatProgressModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "ProgressView",
       "bar_style": "success",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_22e57b2097274b20b6c79329f4d2f6c4",
       "max": 384.0,
       "min": 0.0,
       "orientation": "horizontal",
       "style": "IPY_MODEL_17d9864f128446029bfce2367c916a74",
       "value": 384.0
      }
     },
     "982543a285704156b8a5bd985bac68e4": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_339b78d4451f4ff8b3002f929d229c7f",
        "IPY_MODEL_90686334aee64cf68e879586f39403d7",
        "IPY_MODEL_5c6fdb126fb04454b5602b6f4ebd6e4d"
       ],
       "layout": "IPY_MODEL_e8c4d4da4d4f4366ae0bcc71559d1807"
      }
     },
     "a57fc731b41041138b1fc580431f1a26": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "b09b031feee2447db28ddbcaa180beee": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "b6379f97b7a84ebeb1c1dc62e907b37a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_e13705001cb34262ac495147013352a9",
        "IPY_MODEL_7544c8bba1ea428a940d9f1bcb880fe3",
        "IPY_MODEL_382d84513e554f488a0eb821f0b12552"
       ],
       "layout": "IPY_MODEL_c5db0e2d44e04408b1d421140fcbdcdf"
      }
     },
     "b8e93818c11c4a92923d66ab712ef72b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "b9ded367f81348b09a953be389e5b6fe": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "ba187926b2984efda3dceaf806e96096": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "ba8ab919354342c9a54a230309cec0da": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "c1337cd67ce545ab9f535699842b0d55": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_4bba3005851e44b1a8f93e685c68ce77",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_f7edb0a4454b4711a167c2d2ba0dc163",
       "value": "generation_config.json:\u2007100%"
      }
     },
     "c3e7c7a409b84a159d2fb6e92dedecf5": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_5c18ab2a1c7f4054a9fa46a0ddbab4cb",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_cacf4f78b40448bbb655ecdc693dc21f",
       "value": "\u20077.03M/?\u2007[00:00&lt;00:00,\u2007142MB/s]"
      }
     },
     "c5db0e2d44e04408b1d421140fcbdcdf": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "c72ed5a8d56a4002aeb6f8fd263c8495": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "c77d0c81e51c43049960850c1149e562": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "c8122c408092434cb3c805c2821f628a": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HBoxModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HBoxModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HBoxView",
       "box_style": "",
       "children": [
        "IPY_MODEL_7e442190656f44f19133c51d1798b044",
        "IPY_MODEL_073e0e857fca445ebc8255993dfa87e8",
        "IPY_MODEL_f72f4f6647c0451197a1862704cffaca"
       ],
       "layout": "IPY_MODEL_4b422351a2d849da8d2f179a736bf3e2"
      }
     },
     "cacf4f78b40448bbb655ecdc693dc21f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "cc9d9648b81e4b21beca90185c5fcd0f": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_2f84b6be59134c7cba140186a333ab8c",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_f9d96496511d4066b878aee0f63595b8",
       "value": "\u2007242/242\u2007[00:00&lt;00:00,\u200722.5kB/s]"
      }
     },
     "cf4d0e50dec248bf9add5c02d7645027": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": "20px"
      }
     },
     "d37474c61266492583c4f382ed5bccf1": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "d62396979e994575a90cecd4143291e7": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "d84368d1b9d4410f8a964d1553868f35": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "dd5a145118814e589b9039dcbb411df7": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "e13705001cb34262ac495147013352a9": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_42fa550105cf4757ac187aa3920c7d3d",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_03cfe78841004495a29b37b6b9c33c0d",
       "value": "vocab.json:\u2007"
      }
     },
     "e195a35d4fd244b083956cc310ea94e7": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "e8c4d4da4d4f4366ae0bcc71559d1807": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "ee50d826023e44e6a9e8e916e9acd71b": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "ProgressStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "ProgressStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "bar_color": null,
       "description_width": ""
      }
     },
     "eed0c45be60a4773ada80ec92de5b4ed": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "eed4039c6e1044e38865960fe639f7da": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_a57fc731b41041138b1fc580431f1a26",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_e195a35d4fd244b083956cc310ea94e7",
       "value": "merges.txt:\u2007"
      }
     },
     "f426e50412c749bba98a05e9ec040ef4": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "f4b76409132e4e0cada5dbf7acd16141": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_eed0c45be60a4773ada80ec92de5b4ed",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_c72ed5a8d56a4002aeb6f8fd263c8495",
       "value": "tokenizer.json:\u2007"
      }
     },
     "f72f4f6647c0451197a1862704cffaca": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "HTMLModel",
      "state": {
       "_dom_classes": [],
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "HTMLModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/controls",
       "_view_module_version": "1.5.0",
       "_view_name": "HTMLView",
       "description": "",
       "description_tooltip": null,
       "layout": "IPY_MODEL_69d81f380a25496a8370c4fd419fb869",
       "placeholder": "\u200b",
       "style": "IPY_MODEL_2948c35b6372414fa8859310f04a3986",
       "value": "\u2007659/659\u2007[00:00&lt;00:00,\u200737.2kB/s]"
      }
     },
     "f7b9dc658e99467eb73c117c4cecf2b6": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "1.2.0",
      "model_name": "LayoutModel",
      "state": {
       "_model_module": "@jupyter-widgets/base",
       "_model_module_version": "1.2.0",
       "_model_name": "LayoutModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "LayoutView",
       "align_content": null,
       "align_items": null,
       "align_self": null,
       "border": null,
       "bottom": null,
       "display": null,
       "flex": null,
       "flex_flow": null,
       "grid_area": null,
       "grid_auto_columns": null,
       "grid_auto_flow": null,
       "grid_auto_rows": null,
       "grid_column": null,
       "grid_gap": null,
       "grid_row": null,
       "grid_template_areas": null,
       "grid_template_columns": null,
       "grid_template_rows": null,
       "height": null,
       "justify_content": null,
       "justify_items": null,
       "left": null,
       "margin": null,
       "max_height": null,
       "max_width": null,
       "min_height": null,
       "min_width": null,
       "object_fit": null,
       "object_position": null,
       "order": null,
       "overflow": null,
       "overflow_x": null,
       "overflow_y": null,
       "padding": null,
       "right": null,
       "top": null,
       "visibility": null,
       "width": null
      }
     },
     "f7edb0a4454b4711a167c2d2ba0dc163": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "f9a4f004546e43c3a4eaa0695fc55a60": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     },
     "f9d96496511d4066b878aee0f63595b8": {
      "model_module": "@jupyter-widgets/controls",
      "model_module_version": "1.5.0",
      "model_name": "DescriptionStyleModel",
      "state": {
       "_model_module": "@jupyter-widgets/controls",
       "_model_module_version": "1.5.0",
       "_model_name": "DescriptionStyleModel",
       "_view_count": null,
       "_view_module": "@jupyter-widgets/base",
       "_view_module_version": "1.2.0",
       "_view_name": "StyleView",
       "description_width": ""
      }
     }
    },
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
