<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Vej Journal</title><subtitle>New features, research notes and progress on Pea, Pepper and Pumpkin.</subtitle><id>https://itsvej.com/journal/</id><link href="https://itsvej.com/journal/" /><link rel="self" href="https://itsvej.com/journal/feed.xml" /><icon>https://itsvej.com/assets/brand/favicon.svg</icon><updated>2026-10-22T00:00:00Z</updated><entry xml:base="https://itsvej.com/journal/inference-cuda-rocm/"><title>Read once, ask independently: faster inference in Vej</title><link href="https://itsvej.com/journal/inference-cuda-rocm/" /><id>https://itsvej.com/journal/inference-cuda-rocm/</id><published>2026-10-22T00:00:00Z</published><updated>2026-10-22T00:00:00Z</updated><author><name>Lode Kennes</name></author><summary>Faster document extraction is live on CUDA and ROCm. Here is what changed, how we measured it, and what the quality checks found.</summary><content type="html">&lt;p&gt;&lt;img src="/journal/inference-cuda-rocm/cover.png" alt="Read once, ask independently. One document prefix branches into four separate field assessments." /&gt;&lt;/p&gt;&lt;p&gt;An invoice contains a supplier name, an invoice number, a date and a total. Extracting those four fields sounds like one task. Inside a model, it can become four separate passes over the same document.&lt;/p&gt;
&lt;p&gt;Add line items, payment terms and delivery details, and the repeated work grows. The model processes much of the same text again for each question.&lt;/p&gt;
&lt;p&gt;This repeated work was our largest chance to speed up inference: the work a model does to answer a request. The CUDA changes are now live. Through the public API, a sixteen-field extraction fell from &lt;strong&gt;1,885 to 228 milliseconds&lt;/strong&gt;. A longer example with mixed field types fell from &lt;strong&gt;3,247 to 304 ms&lt;/strong&gt;, about &lt;strong&gt;10.7× faster&lt;/strong&gt;. These are median times on test inputs we wrote, measured before and after the release.&lt;/p&gt;
&lt;p&gt;The gain depends on the request. A short, single-field example moved only from &lt;strong&gt;129 to 125 ms&lt;/strong&gt;. Long documents with many fields had more repeated work to remove.&lt;/p&gt;
&lt;h2 id="first-what-vej-does"&gt;First, what Vej does&lt;/h2&gt;
&lt;p&gt;Vej uses two related models for structured questions about text. Pea handles decisions: your application supplies the possible outcomes and receives a probability for each. Pod handles extraction, using named fields such as an invoice number or a total. They share a base model.&lt;/p&gt;
&lt;p&gt;Pod, served as &lt;code&gt;pea-pod-1&lt;/code&gt;, finds evidence in the original document. It estimates whether a field is present and points to the relevant text. Ordinary code then converts that text to the requested type. Pod can select the wrong evidence or miss a field, so its answers still need to be checked for each task.&lt;/p&gt;
&lt;p&gt;For example, a request might look like this:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;code class="language-text"&gt;Document
  Invoice INV-2291
  Date: 22 October 2026
  Currency: EUR
  Total due: €1,080.00

Fields to extract
  invoice_number · date · currency · total
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This example shows the input format. It is not a measured model result. Each field asks a different question about the same document.&lt;/p&gt;
&lt;p&gt;Vej uses prediction heads: small components that produce scores and evidence positions directly. It does not write an answer one token at a time. We focused on processing the input, running the model and reading the results.&lt;/p&gt;
&lt;h2 id="process-the-document-once-keep-the-questions-separate"&gt;Process the document once, keep the questions separate&lt;/h2&gt;
&lt;p&gt;The original extraction path paired the full document with each field’s instructions. This kept the fields separate, but processed the document again for each one.&lt;/p&gt;
&lt;p&gt;The new path processes the shared document text, or prefix, once. It saves the model’s state for that request. Each field starts from its own copy of that state and follows its own instructions.&lt;/p&gt;
&lt;p&gt;Each field needs a separate copy. Checking the invoice date must not change the starting state used to check the total. The saved document state is used only within that request.&lt;/p&gt;
&lt;style&gt;
.reuse-motion{margin:40px 0;padding:24px;border:1px solid var(--rule);background:var(--surface);border-radius:4px}.reuse-motion summary{cursor:pointer;font-weight:500;color:var(--text)}.reuse-motion summary:focus-visible{outline:2px solid var(--accent);outline-offset:6px}.reuse-motion svg{display:block;width:100%;height:auto;margin:24px 0 16px}.reuse-motion .diagram-label{font:16px "Vej Sans",sans-serif;fill:var(--text)}.reuse-motion .diagram-note{font:13px "Vej Mono",monospace;fill:var(--text-2)}.reuse-motion .diagram-line{fill:none;stroke:var(--rule);stroke-width:2}.reuse-motion .diagram-box{fill:var(--surface);stroke:var(--accent);stroke-width:1.5}.reuse-motion .diagram-dot{fill:var(--accent);opacity:0}.reuse-motion[open] .diagram-dot{animation:reuse-travel 4.8s linear infinite}.reuse-motion[open] .diagram-dot:nth-of-type(2){animation-delay:1.2s}.reuse-motion[open] .diagram-dot:nth-of-type(3){animation-delay:2.4s}.reuse-motion[open] .diagram-dot:nth-of-type(4){animation-delay:3.6s}.reuse-motion p{font-size:14px!important;line-height:1.6!important;margin:0}.reuse-still{display:none}@keyframes reuse-travel{0%{offset-distance:0%;opacity:0}8%{opacity:1}85%{opacity:1}100%{offset-distance:100%;opacity:0}}@media(prefers-reduced-motion:reduce){.reuse-motion[open] .diagram-dot{animation:none}.reuse-still{display:inline}}

.technical-appendix{margin:24px 0;padding:24px;border:1px solid var(--rule);background:var(--surface);border-radius:4px}.technical-appendix&gt;summary{font-weight:500;cursor:pointer;line-height:1.5}.technical-appendix&gt;summary:focus-visible{outline:2px solid var(--accent);outline-offset:6px}.technical-appendix h3{font-size:26px}.technical-appendix p,.technical-appendix li{font-size:16px;line-height:1.7}.technical-appendix table{font-size:13px;overflow-wrap:anywhere}.technical-appendix .post-figure{margin:28px 0}.technical-appendix .post-figure img{width:100%;height:auto}.technical-appendix [id]{scroll-margin-top:24px}@media(max-width:480px){.technical-appendix{padding:16px}}
&lt;/style&gt;
&lt;details class="reuse-motion" open&gt;
&lt;summary&gt;Animate the document-to-field path &lt;span class="reuse-still"&gt;(motion disabled)&lt;/span&gt;&lt;/summary&gt;
&lt;svg viewBox="0 0 600 310" role="img" aria-labelledby="reuse-title reuse-desc"&gt;
&lt;title id="reuse-title"&gt;One document prefix, independent field assessments&lt;/title&gt;
&lt;desc id="reuse-desc"&gt;The document is encoded once. Four branches each receive a separate copy of the saved document state before evaluating a field. All retained state ends with the request.&lt;/desc&gt;
&lt;path class="diagram-line" d="M135 150H235M235 150V43H365M235 150V115H365M235 150V187H365M235 150V259H365"/&gt;
&lt;rect class="diagram-box" x="4" y="110" width="150" height="80" rx="4"/&gt;
&lt;text class="diagram-label" x="79" y="142" text-anchor="middle"&gt;Document&lt;/text&gt;&lt;text class="diagram-note" x="79" y="168" text-anchor="middle"&gt;encode once&lt;/text&gt;
&lt;rect class="diagram-box" x="365" y="17" width="230" height="52" rx="4"/&gt;&lt;text class="diagram-label" x="480" y="49" text-anchor="middle"&gt;Field 1 · own state&lt;/text&gt;
&lt;rect class="diagram-box" x="365" y="89" width="230" height="52" rx="4"/&gt;&lt;text class="diagram-label" x="480" y="121" text-anchor="middle"&gt;Field 2 · own state&lt;/text&gt;
&lt;rect class="diagram-box" x="365" y="161" width="230" height="52" rx="4"/&gt;&lt;text class="diagram-label" x="480" y="193" text-anchor="middle"&gt;Field 3 · own state&lt;/text&gt;
&lt;rect class="diagram-box" x="365" y="233" width="230" height="52" rx="4"/&gt;&lt;text class="diagram-label" x="480" y="265" text-anchor="middle"&gt;Field 4 · own state&lt;/text&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M154 150H235V43H365')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M154 150H235V115H365')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M154 150H235V187H365')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M154 150H235V259H365')"/&gt;
&lt;/svg&gt;
&lt;p&gt;This shows how data moves, not how long it takes. The branches keep fields separate; they do not show fields running at the same time. Close this panel to stop the animation.&lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;Saving and copying state also takes time. For a short document, it can cost more than the work it saves. A rule based on document length and field count decides when to reuse the document state.&lt;/p&gt;
&lt;p&gt;Tests that got slower helped us set that rule. Forcing reuse on a short, four-field ROCm example made it slower: &lt;strong&gt;65 to 98 ms&lt;/strong&gt;. The automatic rule skipped reuse for that case. The rule is an estimate and can miss useful cases: one short CUDA example with sixteen fields would benefit from reuse but falls below the current threshold.&lt;/p&gt;
&lt;h2 id="what-changed-in-the-measurements"&gt;What changed in the measurements&lt;/h2&gt;
&lt;p&gt;We tested two GPU software stacks: &lt;strong&gt;CUDA&lt;/strong&gt;, used with NVIDIA GPUs, and &lt;strong&gt;ROCm&lt;/strong&gt;, used with AMD GPUs. We compared each version with its own baseline on the same stack. The figures do not rank CUDA against ROCm.&lt;/p&gt;
&lt;p&gt;The final CUDA test measures the live system through the public API, from sending the request to reading the full response. We ran the same eleven test cases before and after release. We cycled through the cases eight times in each period and kept the same secure connection open. The longest examples improved most: the 512-word, sixteen-field request fell from &lt;strong&gt;1,885 to 228 ms&lt;/strong&gt;; the 1,000-word, twelve-field request fell from &lt;strong&gt;3,247 to 304 ms&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="cuda-api.svg" alt="CUDA public-API deployment comparison: four fields on 32 words fell from 135 to 126 ms; six mixed fields on 128 words from 271 to 158 ms; eight mixed fields on 512 words from 1142 to 199 ms; sixteen fields on 512 words from 1885 to 228 ms; twelve mixed fields on 1000 words from 3247 to 304 ms." width="576" height="396" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;CUDA combined-release comparison through the public API. Eight repetitions per shape in each before/after window; rounded medians. A persistent TLS connection was reused. Five of eleven shapes are shown; the full table is in the technical notes. These probes do not estimate capacity or population-wide tail latency.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The release combines document reuse with changes to number precision, GPU operations, batching and setup. These gains belong to the whole release. Earlier tests measured document reuse on its own inside the prediction process. Those results and the wider 1,497-document check are retained in the technical notes. The API test timed responses but did not save field values. We checked output quality separately, as described below.&lt;/p&gt;
&lt;p&gt;With the ROCm release, a twenty-field, 1,200-word example fell from &lt;strong&gt;2.94 seconds to 317 milliseconds&lt;/strong&gt;, about &lt;strong&gt;9.3×&lt;/strong&gt;. This release combined document reuse with a ROCm/PyTorch runtime update. The gain belongs to both changes together. Each value is the median of five calls after warm-up.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="rocm-api.svg" alt="Recorded ROCm API comparison: seven fields on 320 words fell from 294.9 to 141.6 ms; thirteen fields on 800 words from 1279.4 to 226.7 ms; twenty fields on 1200 words from 2941.1 to 317.0 ms." width="576" height="396" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Recorded ROCm deployment comparison, including API overhead. Five warmed calls per version and shape. The update combined runtime changes and document reuse; these small samples do not estimate typical user response times or service-wide tail latency.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The seven-, thirteen- and twenty-field release examples returned the same extracted answers. Their probabilities changed. The larger validation checks also found changed values. We checked speed and output quality separately.&lt;/p&gt;
&lt;h2 id="smaller-changes-needed-their-own-experiments"&gt;Smaller changes needed their own experiments&lt;/h2&gt;
&lt;p&gt;Removing repeated document work had the largest effect on long extraction requests. Short requests exposed other costs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Choose the right GPU operations.&lt;/strong&gt; A kernel is a small program that runs on the GPU. We tested kernels designed for specific operations in place of more general code. One reduced time for the long CUDA examples by roughly 7–10%. Short examples saw almost no gain. We checked that the intended kernel ran.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Match batching to input length.&lt;/strong&gt; A batch processes several rows together. Increasing Pea’s candidate batch from four to eight helped a short eight-option decision: &lt;strong&gt;89 became 74 ms&lt;/strong&gt;. On a longer input, the same change made it slower: &lt;strong&gt;778 became 879 ms&lt;/strong&gt;. The release uses the larger batch only for short rows.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Check changes to number precision.&lt;/strong&gt; Pea’s adapters are small sets of learned adjustments attached to the shared base model. The extraction adapters used 32-bit arithmetic. The base model used BF16, a 16-bit number format called bfloat16. BF16 adapters took less time but changed outputs. We had to check them against labelled answers. Using the same model weights alone would not prove that the results matched.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remove repeated setup.&lt;/strong&gt; Setting the model’s mode and converting the same decision rows to tokens twice cost a few milliseconds per request. Removing this repeated work reduced a short CUDA decision example from &lt;strong&gt;36.8 to 32.7 ms&lt;/strong&gt;. This helps small requests, but cannot explain a tenfold gain on a long extraction.&lt;/p&gt;
&lt;p&gt;We also tested &lt;strong&gt;graph replay&lt;/strong&gt;. The CPU normally sends many separate operations to the GPU. A saved graph lets it send a prepared sequence again with less setup work. This helps only when the request’s execution shape matches the saved graph. The CUDA release leaves graph replay off until we know which shapes it covers. The diagram below explains the mechanism; its animation is not a timing measurement.&lt;/p&gt;
&lt;details class="reuse-motion" open&gt;
&lt;summary&gt;Animate eager launches and graph replay &lt;span class="reuse-still"&gt;(motion disabled)&lt;/span&gt;&lt;/summary&gt;
&lt;svg viewBox="0 0 600 320" role="img" aria-labelledby="launch-title launch-desc"&gt;
&lt;title id="launch-title"&gt;Graph replay reduces repeated CPU launch work&lt;/title&gt;
&lt;desc id="launch-desc"&gt;The eager example launches three GPU operations individually. The graph example submits a previously captured sequence with one replay. The same GPU operations remain.&lt;/desc&gt;
&lt;text class="diagram-label" x="4" y="23"&gt;Eager execution · separate CPU launches&lt;/text&gt;
&lt;text class="diagram-note" x="91" y="63" text-anchor="middle"&gt;launch&lt;/text&gt;&lt;text class="diagram-note" x="299" y="63" text-anchor="middle"&gt;launch&lt;/text&gt;&lt;text class="diagram-note" x="507" y="63" text-anchor="middle"&gt;launch&lt;/text&gt;
&lt;path class="diagram-line" d="M91 75V112M299 75V112M507 75V112M178 142H212M386 142H420"/&gt;
&lt;rect class="diagram-box" x="4" y="112" width="174" height="60" rx="4"/&gt;&lt;text class="diagram-label" x="91" y="148" text-anchor="middle"&gt;GPU operation A&lt;/text&gt;
&lt;rect class="diagram-box" x="212" y="112" width="174" height="60" rx="4"/&gt;&lt;text class="diagram-label" x="299" y="148" text-anchor="middle"&gt;GPU operation B&lt;/text&gt;
&lt;rect class="diagram-box" x="420" y="112" width="174" height="60" rx="4"/&gt;&lt;text class="diagram-label" x="507" y="148" text-anchor="middle"&gt;GPU operation C&lt;/text&gt;
&lt;text class="diagram-label" x="4" y="215"&gt;Graph execution · one replay submission&lt;/text&gt;
&lt;rect class="diagram-box" x="4" y="246" width="152" height="60" rx="4"/&gt;&lt;text class="diagram-label" x="80" y="282" text-anchor="middle"&gt;CPU · replay&lt;/text&gt;
&lt;path class="diagram-line" d="M156 276H244"/&gt;
&lt;rect class="diagram-box" x="244" y="246" width="350" height="60" rx="4"/&gt;&lt;text class="diagram-label" x="419" y="282" text-anchor="middle"&gt;GPU · operation A → B → C&lt;/text&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M91 75V112')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M299 75V112')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M507 75V112')"/&gt;
&lt;circle class="diagram-dot" r="5" style="offset-path:path('M156 276H244')"/&gt;
&lt;/svg&gt;
&lt;p&gt;This shows how the CPU sends work. The animation does not show measured times. The GPU still performs the same operations. Close this panel to stop the animation.&lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;These changes reduce different costs. Multiplying their separate speedups does not predict the final result.&lt;/p&gt;
&lt;h2 id="faster-results-still-need-to-be-useful"&gt;Faster results still need to be useful&lt;/h2&gt;
&lt;p&gt;Changing the order of work, the GPU code or the number format can change probabilities or which text is selected as evidence. The overall accuracy score can stay the same while individual answers change.&lt;/p&gt;
&lt;p&gt;Before release, we checked the combined CUDA version on &lt;strong&gt;1,016 decisions&lt;/strong&gt; and &lt;strong&gt;9,682 extraction fields&lt;/strong&gt;, using the existing calibration check data. Accuracy for deciding whether a field was present stayed at about &lt;strong&gt;95.77%&lt;/strong&gt;. Among fields known to be present, exact value match moved from &lt;strong&gt;69.22% to 69.14%&lt;/strong&gt;. Across all 9,682 fields, &lt;strong&gt;140 returned values changed&lt;/strong&gt;, about &lt;strong&gt;1.45%&lt;/strong&gt;. Four presence probabilities crossed the default decision threshold. These measures use different totals. A changed value does not always mean a new error.&lt;/p&gt;
&lt;p&gt;We also checked the probabilities. Calibration asks whether predicted probabilities agree with how often outcomes occur in the test data. A separate loss measure checks the probability assigned to the labelled answers. Its changes were small, and the uncertainty intervals included zero. This does not prove that the versions are equivalent or that accuracy improved. We kept the existing calibration for the tested mix of data. Confidence in the selected evidence remains a separate score that has not been calibrated.&lt;/p&gt;
&lt;p&gt;The detailed metrics, definitions and uncertainty calculation are in the optional notes below. Those notes also explain how repeated use of validation data limits the conclusions.&lt;/p&gt;
&lt;h2 id="the-first-request-is-a-different-problem"&gt;The first request is a different problem&lt;/h2&gt;
&lt;p&gt;Some GPU programs are compiled and tuned the first time they see a particular execution shape. A new process can therefore take longer than one that has handled similar requests.&lt;/p&gt;
&lt;p&gt;In the ROCm study, a first short Pea request took &lt;strong&gt;43.7 seconds&lt;/strong&gt;; its repeat took about &lt;strong&gt;70 ms&lt;/strong&gt;. Running synthetic requests before the service reported ready moved much of that cost into startup. After a &lt;strong&gt;72-second warm-up&lt;/strong&gt;, the first short request took about &lt;strong&gt;637 ms&lt;/strong&gt;, followed by about &lt;strong&gt;70 ms&lt;/strong&gt; on its repeat. Startup became longer, and some first-request overhead remained.&lt;/p&gt;
&lt;p&gt;The CUDA release now warms up extraction before reporting ready too. In one sequence from a new process per version, the slowest first-use test fell from &lt;strong&gt;8,789 to 756 ms&lt;/strong&gt;. This was the 512-word, sixteen-field request. Earlier cases in the sequence had already run, so this does not measure repeated, independent restarts. Both warm-up and faster model execution helped. Startup took longer: Pea warm-up took &lt;strong&gt;47 seconds&lt;/strong&gt; with no saved compiled code, followed by &lt;strong&gt;63 extraction warm-up calls in 10.6 seconds&lt;/strong&gt;. Some first-use delay remained.&lt;/p&gt;
&lt;p&gt;Network setup also affects response time. In a corrected client test, short extraction took about &lt;strong&gt;210 ms&lt;/strong&gt; with a new HTTPS connection and &lt;strong&gt;119 ms&lt;/strong&gt; when reusing the connection. This difference came from connection handling, not a model change. We keep these observations separate from the CUDA model measurements.&lt;/p&gt;
&lt;h2 id="what-this-means-for-applications"&gt;What this means for applications&lt;/h2&gt;
&lt;p&gt;Document reuse helped most on long inputs with many fields. Short inputs benefited from setup, batching and kernel changes. Warm-up reduced first-use delays. The gain depends on the work in each request.&lt;/p&gt;
&lt;p&gt;Short requests can also wait behind long ones. Pea decisions and extractions share access to the model. In the public-API test, we sent a short decision while a sixteen-field extraction ran repeatedly on another connection. The short decision’s median time fell from &lt;strong&gt;1,624 to 121 ms&lt;/strong&gt;. Tested alone in a separate ten-call run, it took &lt;strong&gt;114 ms before and 110 ms after&lt;/strong&gt;. We recorded twenty calls per version while extraction was running. Their observed 90th-percentile time fell from &lt;strong&gt;1,805 to 156 ms&lt;/strong&gt;. This small two-stream test does not measure the service’s overall tail latency or capacity.&lt;/p&gt;
&lt;p&gt;The results reported here come from &lt;strong&gt;21–22 October 2026&lt;/strong&gt;, including the completed CUDA deployment and public-API comparison. Both CUDA and ROCm changes are deployed. Their measurements use different workloads and baselines, so the numbers should be read within each comparison.&lt;/p&gt;
&lt;p&gt;We still need tests on representative customer inputs and sustained traffic with mixed request types. The released changes made these test requests much faster. Each application still needs to check how the changed outputs affect its own work.&lt;/p&gt;
&lt;h2 id="measurements-and-technical-notes"&gt;Measurements and technical notes&lt;/h2&gt;
&lt;p&gt;The results and chart data below can be read without Vej’s code or weights. The CSV contains chart and table summaries and first-use measurements. It excludes the individual eight-round timings and private validation inputs. You can use it to check the figures and arithmetic. Repeating the experiments requires the original code and evaluation inputs.&lt;/p&gt;
&lt;p&gt;&lt;a id="aggregate-data" download="vej-inference-aggregates.csv" href="/journal/data/inference-cuda-rocm.csv"&gt;Download the aggregate measurements (CSV)&lt;/a&gt;&lt;/p&gt;
&lt;details class="technical-appendix" id="methods-appendix"&gt;
&lt;summary&gt;How the experiments were run&lt;/summary&gt;
&lt;h3 id="how-the-reuse-policy-counts-work"&gt;How the reuse policy counts work&lt;/h3&gt;
&lt;p&gt;For F fields, a document prefix of P tokens and field suffixes of lengths Sᵢ, the reference processes about F·P + ΣSᵢ token positions. Reuse reduces this to P + ΣSᵢ, ignoring padding. This counts the work avoided. Model execution, copying and batching mean it cannot directly predict response time. The automatic reuse rule uses document length and field count. It is a heuristic, so it can miss useful cases. When reuse is selected, graph replay is skipped.&lt;/p&gt;
&lt;p&gt;We ran the studies on 21–22 October 2026. Each comparison keeps the execution environment fixed, except where we state that it measures a combined release. CUDA and ROCm use different workloads, token budgets and runtime versions. Their response times cannot be used to rank the backends.&lt;/p&gt;
&lt;p&gt;The CUDA test inputs repeat word patterns or invoice fragments we wrote. Word counts use spaces to separate words; they are not tokenizer token counts. “Mixed” means different field types. These inputs test specific request shapes, not a sample of customer documents.&lt;/p&gt;
&lt;p&gt;CUDA experiments used PyTorch 2.14.0+cu130, Transformers 5.17 and PEFT 0.21. The reference used a BF16 backbone, FP32 Pod adapters and FP32 native heads. ROCm’s isolated reuse experiment used PyTorch 2.14.0+rocm10.1.0, BF16 backbone execution and FP32 adapters/heads, with graphs disabled. The earlier ROCm graph experiment used the previous runtime and reference kernels.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Study&lt;/th&gt;
&lt;th&gt;Design and sampling&lt;/th&gt;
&lt;th&gt;Quantity measured&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CUDA reuse in isolation&lt;/td&gt;
&lt;td&gt;Two warm-ups per shape/version; twenty rounds, version order shuffled within each round&lt;/td&gt;
&lt;td&gt;Elapsed time for native &lt;code&gt;predict&lt;/code&gt;, including response readout; excludes HTTP/TLS/gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Other isolated CUDA tests&lt;/td&gt;
&lt;td&gt;GPU kernel: 25 rounds; candidate batch size: 30; CPU cleanup and graphs: 40; adapter precision/reuse: 20&lt;/td&gt;
&lt;td&gt;Same native timing boundary, with versions interleaved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CUDA deployed release&lt;/td&gt;
&lt;td&gt;Eight cycles through the shapes in each separate before/after period&lt;/td&gt;
&lt;td&gt;API elapsed time over a persistent verified TLS connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ROCm isolated reuse&lt;/td&gt;
&lt;td&gt;Five warmed calls per arm and synthetic shape; same runtime&lt;/td&gt;
&lt;td&gt;Extraction wall time without HTTP or graph replay&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ROCm deployed release&lt;/td&gt;
&lt;td&gt;Five warmed API calls per version/shape; consecutive before/after windows&lt;/td&gt;
&lt;td&gt;Combined ROCm-stack upgrade and reuse, including API overhead&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ROCm setup/graph in isolation&lt;/td&gt;
&lt;td&gt;Twenty-four trials per version; alternating order; waited for device completion&lt;/td&gt;
&lt;td&gt;Paired backend comparison, separate from deployment periods&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The CUDA benchmark ran in a separate process loaded in the same way as the service. Each isolated test used one process, not independent restarts. Test shapes stayed in a fixed order. Within each shape and round, version order was shuffled with seed 20261022. Serving counters recorded no production inference requests during these tests. The timer includes building and validating the input, running native prediction and reading the results to the host. It excludes choosing the version, loading the model and preparing the service. Ordinary calls did not explicitly wait for the device before and after timing. Reading the predictions brought the required outputs back to the host. Calls measured with a profiler were kept separate. CUDA work can run asynchronously, so time outside recorded GPU kernels cannot all be assigned to Python overhead.&lt;/p&gt;
&lt;p&gt;We report each version’s median time. Where available, we also report the median speedup across paired rounds. These are different calculations:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;code class="language-text"&gt;arm-median ratio = median(reference) / median(candidate)
paired speedup   = median(reference_round / candidate_round)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For the earlier controlled CUDA 512-word, sixteen-field case, the paired speedup is 10.23×. Dividing the unrounded version medians gives about 10.30×. Dividing the displayed, whole-millisecond medians gives about 10.28× because of rounding. The saved timing summaries do not include the original pairs. We therefore do not calculate new timing confidence intervals or significance tests. The five-call ROCm medians describe the measured samples.&lt;/p&gt;
&lt;h3 id="completed-cuda-deployment"&gt;Completed CUDA deployment&lt;/h3&gt;
&lt;p&gt;The faster release went live on 22 October 2026. The client opened a verified TLS connection to the API and kept it open. A health request established the connection before timing began. The timer ran from sending a request to reading the full response. It excluded decoding the response JSON and the measurement work between calls. This includes API and network work, but no new TLS handshake for each request. We ran eight rounds before deployment and eight after it. We did not alternate versions within a round. Shapes followed a fixed cycle. We retried rate-limited calls and timed only the successful attempt.&lt;/p&gt;
&lt;!-- ROLLOUT_TABLE_START --&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th style="text-align:right"&gt;Before (ms)&lt;/th&gt;
&lt;th style="text-align:right"&gt;After (ms)&lt;/th&gt;
&lt;th style="text-align:right"&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Decision, 32 words, 2 options&lt;/td&gt;
&lt;td style="text-align:right"&gt;135&lt;/td&gt;
&lt;td style="text-align:right"&gt;112&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.20×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decision, 32 words, 8 options&lt;/td&gt;
&lt;td style="text-align:right"&gt;162&lt;/td&gt;
&lt;td style="text-align:right"&gt;136&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.19×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Decision, 512 words, 8 options&lt;/td&gt;
&lt;td style="text-align:right"&gt;816&lt;/td&gt;
&lt;td style="text-align:right"&gt;711&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.15×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, 32 words, 1 field&lt;/td&gt;
&lt;td style="text-align:right"&gt;129&lt;/td&gt;
&lt;td style="text-align:right"&gt;125&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.03×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, 32 words, 4 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;135&lt;/td&gt;
&lt;td style="text-align:right"&gt;126&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.07×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, 32 words, 16 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;207&lt;/td&gt;
&lt;td style="text-align:right"&gt;178&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.16×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixed extraction, 128 words, 6 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;271&lt;/td&gt;
&lt;td style="text-align:right"&gt;158&lt;/td&gt;
&lt;td style="text-align:right"&gt;1.71×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, 512 words, 4 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;468&lt;/td&gt;
&lt;td style="text-align:right"&gt;176&lt;/td&gt;
&lt;td style="text-align:right"&gt;2.66×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixed extraction, 512 words, 8 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;1,142&lt;/td&gt;
&lt;td style="text-align:right"&gt;199&lt;/td&gt;
&lt;td style="text-align:right"&gt;5.73×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extraction, 512 words, 16 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;1,885&lt;/td&gt;
&lt;td style="text-align:right"&gt;228&lt;/td&gt;
&lt;td style="text-align:right"&gt;8.29×&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixed extraction, 1,000 words, 12 fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;3,247&lt;/td&gt;
&lt;td style="text-align:right"&gt;304&lt;/td&gt;
&lt;td style="text-align:right"&gt;10.69×&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;!-- ROLLOUT_TABLE_END --&gt;
&lt;p&gt;These speedups divide the unrounded version medians, then round the result. This differs from the paired calculation in the earlier controlled reuse study. We independently checked the eight accepted timings per shape and period and recalculated the medians. Process age, network conditions or background work may differ between the before and after periods. This release comparison cannot separate the effect of each change.&lt;/p&gt;
&lt;p&gt;The separate first-use test ran through eleven shapes after starting a new process. One extra round and another interference test followed. We did not combine these measurements with the eight-round release comparison. Earlier shapes can warm code used by later ones. These are therefore not eleven independent cold starts. The slowest time in the sequence is not a worst-case guarantee. The earlier controlled empty-cache test reached about 2.4 seconds with a longer warm-up. The deployed 756 ms result uses a different combination of changes and a different timing boundary.&lt;/p&gt;
&lt;p&gt;For each version, the interference test measured ten short decisions alone and twenty while a long extraction ran repeatedly on a second connection. To report p90, we sort the times and select index &lt;code&gt;round(0.9 × (n − 1))&lt;/code&gt;, counting from zero. For twenty calls, that is index 17. Calls in a sequence can affect each other. This describes interference in the test; it is not a significance test on independent samples or a percentile estimate for the public service.&lt;/p&gt;
&lt;h3 id="earlier-controlled-cuda-reuse-experiment"&gt;Earlier controlled CUDA reuse experiment&lt;/h3&gt;
&lt;p&gt;The isolated sixteen-field case fell from 1,880.8 to 182.6 ms, with a reported paired speedup of 10.23×. On the 1,000-word, twelve-field case, the stored output signature changed; its speedup does not establish exact outputs. Across 1,497 accepted validation documents, processing duration fell from 326.9 to 133.6 seconds (about 2.45×), including harness output. Three of 1,500 requested documents were skipped under the row limits in every arm. These are development checks, not population throughput estimates.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="cuda-reuse.svg" alt="CUDA controlled document-reuse experiment: six fields on 128 words fell from 201 to 71 ms; eight mixed fields on 512 words from 1107 to 152 ms; sixteen fields on 512 words from 1881 to 183 ms; twelve mixed fields on 1000 words from 3287 to 309 ms." width="576" height="396" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Earlier CUDA prediction-path medians, excluding HTTP. Twenty interleaved repetitions per setting and shape. These isolated reuse results are separate from the completed public-API release comparison.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h3 id="same-runtime-rocm-check"&gt;Same-runtime ROCm check&lt;/h3&gt;
&lt;p&gt;On the isolated ROCm reuse comparison, the 1,200-word, twenty-field request fell from 3,041.9 to 292.7 ms. Across 300 validation documents, total processing time fell from 67.5 to 37.8 seconds. This comparison holds the runtime fixed and excludes graphs; the main article’s API release comparison combines reuse with a runtime update.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="rocm-reuse.svg" alt="ROCm isolated reuse ablation: 300.7 to 101.0 ms for seven fields, 1307.4 to 177.4 for thirteen fields, and 3041.9 to 292.7 for twenty fields." width="576" height="396" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Same-runtime ROCm ablation, warmed medians of five calls per arm. Graph replay was disabled. These samples support descriptive comparisons; they do not provide a latency-distribution or capacity estimate.&lt;/figcaption&gt;&lt;/figure&gt;&lt;/details&gt;
&lt;details class="technical-appendix" id="quality-appendix"&gt;
&lt;summary&gt;Quality metrics, uncertainty and additional results&lt;/summary&gt;
&lt;p&gt;We ask three separate questions. Did the numerical outputs change? Did task scores change on labelled data? Did the probability checks still pass? Exact-response checks answer only the first question, for the cases tested. An unchanged overall score does not prove that individual fields or customer decision thresholds behave the same way.&lt;/p&gt;
&lt;p&gt;The ROCm reuse check used 300 validation documents and 1,729 fields. Value exact match was 79.76% with reuse off and with automatic reuse, but three presence statuses, twenty-four values and thirty spans differed. List F1 moved from 0.4504 to 0.4499. This was validation reuse, not an untouched final test.&lt;/p&gt;
&lt;p&gt;CUDA checks reused the fixed calibration data splits. Pea had 1,016 decisions across 333 source groups, kept separate from temperature fitting. Pod’s separate check split had 9,682 measured fields across 1,275 groups. Of those fields, 6,183 were labelled as present. This is the total used to calculate exact value match. We independently recounted the groups and present fields from the fixed evaluation input.&lt;/p&gt;
&lt;p&gt;Pea kept its previously fitted temperature. Pod kept its fitted presence calibrator. Confidence in the selected span remained uncalibrated. Pod used separate document groups to fit and check calibration. We have used these checks repeatedly during development. They are development evidence, even though the fitting and checking groups remain separate.&lt;/p&gt;
&lt;p&gt;The combined CUDA implementation produced these pre-release quality-check results:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th style="text-align:right"&gt;Reference&lt;/th&gt;
&lt;th style="text-align:right"&gt;Combined candidate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pea NLL&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.44132&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.44071&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pea top-1 accuracy&lt;/td&gt;
&lt;td style="text-align:right"&gt;81.693%&lt;/td&gt;
&lt;td style="text-align:right"&gt;81.890%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pea ECE, 15 bins&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.03952&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.03658&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod presence NLL&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.11834&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.11826&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod presence Brier score&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.03222&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.03217&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod presence ECE, 15 bins&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.00806&lt;/td&gt;
&lt;td style="text-align:right"&gt;0.00853&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod presence accuracy at 0.5&lt;/td&gt;
&lt;td style="text-align:right"&gt;95.765%&lt;/td&gt;
&lt;td style="text-align:right"&gt;95.765%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pod value exact match, gold-present fields&lt;/td&gt;
&lt;td style="text-align:right"&gt;69.222%&lt;/td&gt;
&lt;td style="text-align:right"&gt;69.141%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;NLL is the mean negative natural logarithm of the probability assigned to the labelled answer. Lower is better. Pod presence uses binary NLL. The Brier score is mean squared probability error. ECE groups predictions into fifteen equal-width probability ranges. Pea compares its top confidence with correctness. Pod compares presence probability with the present-or-absent label. These checks do not calibrate whether the selected evidence is correct. Exact value match counts only fields labelled as present. Presence accuracy counts both present and absent fields. These measures answer different questions.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="quality-intervals.svg" alt="Paired NLL differences for the combined CUDA candidate: Pea −0.00062 with 95% group-bootstrap interval −0.00147 to +0.00015; Pod presence −0.00008 with interval −0.00030 to +0.00014." width="576" height="331" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Candidate-minus-reference mean NLL differences and reported 95% group-bootstrap intervals. Negative values favour the candidate within each task. Both intervals include zero.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;The quality analysis first calculates the NLL difference for each paired observation. It then creates 1,000 bootstrap samples by drawing source groups with replacement, using seed 20261022. It takes the 2.5th and 97.5th percentiles of the resampled means. All observations in a sampled group stay together. Each resampled mean still weights observations equally. This keeps related fields in the same bootstrap unit. The intervals apply to NLL. No uncertainty intervals were reported for ECE or exact value match.&lt;/p&gt;
&lt;p&gt;The measured NLL differences favour the candidate, but both intervals cross zero. They do not establish improved NLL, equivalence or formal non-inferiority. The checks supported keeping the existing calibration on the tested mix of data. Pea’s earlier 0.01 NLL/ECE tolerance was a check for that task, not a general acceptance margin for Pod. Pod ECE increased slightly, and exact value match fell by 0.081 percentage points.&lt;/p&gt;
&lt;p&gt;Two Pea top answers changed. Across all 9,682 Pod fields, 140 values and 194 spans changed, with four presence-threshold flips. The changed-value fraction is approximately 1.45% of all fields; this differs from the gold-present denominator used for exact-match accuracy. The original Pod presence fit itself also traded improved aggregate probability scores for lower present recall and did not improve every field-type or source slice. Custom null thresholds therefore need their own recheck. Across ROCm process restarts, numerical drift was observed even on the reference path; retaining the autotune cache did not remove it. Same-process graph exactness does not establish cross-restart or cross-backend bit identity.&lt;/p&gt;
&lt;p&gt;In the combined pre-release quality checks, total processing time was 237 → 209 seconds for Pea and 327 → 121 seconds for Pod. These give approximately 1.13× and 2.70× by ratios of totals.&lt;/p&gt;
&lt;h3 id="additional-dispatch-and-decoder-measurements"&gt;Additional dispatch and decoder measurements&lt;/h3&gt;
&lt;p&gt;The earlier ROCm paired experiment separated setup cleanup from graph replay: 149.902 ms with original eager setup, 142.804 ms with startup-only setup, and 136.306 ms with startup-only setup plus graphs. The graph-only reduction was about 4.55%; the combined reduction was 9.07%. Twenty-four trials per arm alternated order, synchronized device completion and required exact full responses. These measurements preceded the later kernel and runtime updates.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="dispatch.svg" alt="ROCm setup and graph-replay medians: 149.902, 142.804 and 136.306 ms." width="576" height="346" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Twenty-four trials per arm; same-process comparison. Graph replay alone compares the final two bars. Other request shapes retained eager execution.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;A banded span decoder reduced scalar-span decoding from 1.834 to 0.669 ms on six rows of 2,048 tokens, with ten warmed samples per arm. Additional peak allocated memory fell from 40.03 to 3.77 MiB. Complete API measurements did not establish a corresponding latency improvement: sequential p50 was nearly unchanged and mixed-request p50 increased. This is a component result.&lt;/p&gt;
&lt;/details&gt;
&lt;script&gt;
(function () {
  function reveal(hash) {
    var target = document.getElementById(hash.slice(1));
    if (!target) return;
    var panel = target.closest("details");
    while (panel) {
      panel.open = true;
      panel = panel.parentElement &amp;&amp; panel.parentElement.closest("details");
    }
  }
  document.addEventListener("click", function (event) {
    if (!(event.target instanceof Element)) return;
    var link = event.target.closest('a[href^="#"]');
    if (link) reveal(link.hash);
  });
  window.addEventListener("hashchange", function () { reveal(location.hash); });
  reveal(location.hash);
})();
&lt;/script&gt;
</content></entry><entry xml:base="https://itsvej.com/journal/pea-extraction-beta/"><title>Pea extraction is now in hosted Beta</title><link href="https://itsvej.com/journal/pea-extraction-beta/" /><id>https://itsvej.com/journal/pea-extraction-beta/</id><published>2026-10-21T00:00:00Z</published><updated>2026-10-21T00:00:00Z</updated><author><name>Lode Kennes</name></author><summary>Pea now extracts typed fields from text by pointing directly to evidence spans, live on /v1beta/extract.</summary><content type="html">&lt;p&gt;&lt;img src="/journal/pea-extraction-beta/cover.png" alt="An invoice with its number, date and total highlighted, each linked to a typed field." /&gt;&lt;/p&gt;&lt;p&gt;Pea has a second capability. Alongside decisions, it now extracts structured data from text documents. You send a document and a schema of up to 64 typed fields. For each field, Pea points to a span of the original text as evidence, then code parses that span into a typed value. The span can still be the wrong one, so check it where it matters.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="spans.svg" alt="Pea extraction points each field at an exact span of the invoice text" width="1200" height="440" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Each field is evaluated in its own pass. Values come from the cited span; a field with no evidence returns null.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;h2 id="spans-not-generated-text"&gt;Spans, not generated text&lt;/h2&gt;
&lt;p&gt;Extraction runs strictly in prefill mode. Pea does not write out an answer. A presence head estimates whether the field appears in the document at all, and start and end heads point at the evidence. Offsets are half-open Unicode code point ranges, so &lt;code&gt;[8, 17)&lt;/code&gt; in the example above is exactly &lt;code&gt;2026-0412&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Typed parsing happens in ordinary code. Numbers, dates, times, durations and lists are read from the cited span, so a returned date always corresponds to text in the document. When a field is probably absent, or the evidence does not parse into the requested type, &lt;code&gt;value&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="try-it"&gt;Try it&lt;/h2&gt;
&lt;p&gt;Extraction is live in Beta on the hosted API with the model identifier &lt;code&gt;pea-pod-1&lt;/code&gt;. You need an API key with inference scope.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;code class="language-bash"&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-sS&lt;span class="w"&gt; &lt;/span&gt;https://api.itsvej.com/v1beta/extract&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$VEJ_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'{&lt;/span&gt;
&lt;span class="s1"&gt;    "model": "pea-pod-1",&lt;/span&gt;
&lt;span class="s1"&gt;    "state": "Invoice 2026-0412\nDate: 3 October 2026\nTotal due: €1,240.50",&lt;/span&gt;
&lt;span class="s1"&gt;    "fields": {&lt;/span&gt;
&lt;span class="s1"&gt;      "invoice_number": {"type": "text", "instructions": "The invoice number."},&lt;/span&gt;
&lt;span class="s1"&gt;      "total": {"type": "number", "decimals": 2, "instructions": "The total amount due."}&lt;/span&gt;
&lt;span class="s1"&gt;    }&lt;/span&gt;
&lt;span class="s1"&gt;  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;a href="/models/pea/extraction/"&gt;extraction documentation&lt;/a&gt; covers all seven field types, the full response and the limits.&lt;/p&gt;
&lt;h2 id="development-results"&gt;Development results&lt;/h2&gt;
&lt;p&gt;We measured extraction on 3,000 locked test documents during development.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Presence accuracy&lt;/td&gt;
&lt;td&gt;95.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Text exact match (rows with a gold span)&lt;/td&gt;
&lt;td&gt;80.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typed exact match (rows with a gold span)&lt;/td&gt;
&lt;td&gt;99.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;List F1&lt;/td&gt;
&lt;td&gt;0.399&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;These are development results, not a published evaluation. Lists and receipts remain weak, and real-world quality has not been measured. Extraction is text only; images are refused. Each document-plus-field row is limited to 2,048 tokens. The weights are private.&lt;/p&gt;
&lt;h2 id="getting-access"&gt;Getting access&lt;/h2&gt;
&lt;p&gt;Hosted access starts with a &lt;a href="https://app.itsvej.com/sign-up"&gt;console account&lt;/a&gt;. Every new account needs manual approval, and capacity is limited.&lt;/p&gt;
</content></entry><entry xml:base="https://itsvej.com/journal/pea-decisions-launch/"><title>Meet Pea: decisions as probabilities, not text</title><link href="https://itsvej.com/journal/pea-decisions-launch/" /><id>https://itsvej.com/journal/pea-decisions-launch/</id><published>2026-10-18T00:00:00Z</published><updated>2026-10-18T00:00:00Z</updated><author><name>Lode Kennes</name></author><summary>Pea is our 2B decision model. It returns a probability for every outcome you define. Hosted early access and Pea 1 weights open today, with 76.60% exact accuracy on 14,286 held-out decisions.</summary><content type="html">&lt;p&gt;&lt;img src="/journal/pea-decisions-launch/cover.png" alt="A routing question with three outcomes and Pea&amp;#x27;s probability for each, beside the line &amp;quot;State in, probabilities out.&amp;quot;" /&gt;&lt;/p&gt;&lt;p&gt;Pea is the first model in the Vej family: a 2B text model for decisions. You describe the state of a task and ask typed questions. Pea returns a probability for every outcome you defined. It never writes an answer for you to parse, and it never acts on its own. Your code reads the probabilities and decides what happens next.&lt;/p&gt;
&lt;h2 id="three-kinds-of-question"&gt;Three kinds of question&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choice&lt;/strong&gt; picks among named options. Each option has a name and a description.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Noul&lt;/strong&gt; assesses whether a statement about the state is true.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Score&lt;/strong&gt; rates a rubric with ordered levels. Your code computes the zero-based expectation from the level probabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every answer sums to one, and each question is scored independently of the others.&lt;/p&gt;
&lt;h2 id="how-it-works"&gt;How it works&lt;/h2&gt;
&lt;p&gt;Pea uses a pretrained 2B text backbone with its base parameters frozen. We train rank-16 LoRA adapters alongside a scalar decision head, about 16.82 million trainable parameters in total. The state, the question and one candidate outcome pass through the model together and come out as a single score. Pea normalises those scores across the outcomes of each question.&lt;/p&gt;
&lt;p&gt;There is no vocabulary projection head and no token generator. Answers cannot be malformed JSON or a label that was never offered, because Pea only ever scores the outcomes you supplied.&lt;/p&gt;
&lt;h2 id="try-it"&gt;Try it&lt;/h2&gt;
&lt;p&gt;The hosted API takes a state and a set of questions on &lt;code&gt;/v1/predict&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;code class="language-bash"&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-sS&lt;span class="w"&gt; &lt;/span&gt;https://api.itsvej.com/v1/predict&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$VEJ_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-H&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'{&lt;/span&gt;
&lt;span class="s1"&gt;    "state": {&lt;/span&gt;
&lt;span class="s1"&gt;      "message": "Please cancel my subscription. I have not provided an account ID.",&lt;/span&gt;
&lt;span class="s1"&gt;      "account_id": null,&lt;/span&gt;
&lt;span class="s1"&gt;      "account_verified": false&lt;/span&gt;
&lt;span class="s1"&gt;    },&lt;/span&gt;
&lt;span class="s1"&gt;    "questions": {&lt;/span&gt;
&lt;span class="s1"&gt;      "route": {&lt;/span&gt;
&lt;span class="s1"&gt;        "type": "choice",&lt;/span&gt;
&lt;span class="s1"&gt;        "question": "Which action best matches the request?",&lt;/span&gt;
&lt;span class="s1"&gt;        "options": {&lt;/span&gt;
&lt;span class="s1"&gt;          "cancel_subscription": "Cancel an existing subscription",&lt;/span&gt;
&lt;span class="s1"&gt;          "lookup_invoice": "Retrieve a billing invoice",&lt;/span&gt;
&lt;span class="s1"&gt;          "none": "Neither offered action applies"&lt;/span&gt;
&lt;span class="s1"&gt;        }&lt;/span&gt;
&lt;span class="s1"&gt;      },&lt;/span&gt;
&lt;span class="s1"&gt;      "can_execute": {&lt;/span&gt;
&lt;span class="s1"&gt;        "type": "noul",&lt;/span&gt;
&lt;span class="s1"&gt;        "statement": "The account is verified and its ID is available."&lt;/span&gt;
&lt;span class="s1"&gt;      }&lt;/span&gt;
&lt;span class="s1"&gt;    }&lt;/span&gt;
&lt;span class="s1"&gt;  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The response gives each question its own probabilities. In our illustrative example, &lt;code&gt;cancel_subscription&lt;/code&gt; gets 0.91 and the statement that the account can be acted on gets 0.02. A threshold in your code then decides whether to ask for the account ID first.&lt;/p&gt;
&lt;h2 id="evaluation"&gt;Evaluation&lt;/h2&gt;
&lt;p&gt;We evaluated Pea on 14,286 frozen test decisions on 26 September 2026. The checkpoint was chosen on validation loss, not on these rows.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="accuracy-by-type.svg" alt="Pea exact accuracy by question type" width="960" height="384" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Exact label accuracy at temperature 1. The dashed line is a post-hoc Score control that predicts the most common test label.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question type&lt;/th&gt;
&lt;th&gt;Test decisions&lt;/th&gt;
&lt;th&gt;Exact accuracy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Choice&lt;/td&gt;
&lt;td&gt;6,197&lt;/td&gt;
&lt;td&gt;89.22%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Noul&lt;/td&gt;
&lt;td&gt;3,089&lt;/td&gt;
&lt;td&gt;91.71%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Score (exact rubric level)&lt;/td&gt;
&lt;td&gt;5,000&lt;/td&gt;
&lt;td&gt;51.62%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overall&lt;/td&gt;
&lt;td&gt;14,286&lt;/td&gt;
&lt;td&gt;76.60%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Choice and Noul are strong. Score is the hard one: exact-level accuracy of 51.62% is only a few points above the 48.44% of a test-majority control that uses the test labels.&lt;/p&gt;
&lt;h3 id="the-same-rows-other-models"&gt;The same rows, other models&lt;/h3&gt;
&lt;p&gt;Jev is TypeSafe’s hosted decision model. Hosted Jev 1.13 scored the same rows with its documented rounding adjustment and reached 71.76%, 4.84 points below Pea. Pea led on Choice (+6.15) and Score (+7.42); Jev led on Noul (+1.94). This one test does not establish general superiority, broader transfer or statistical significance.&lt;/p&gt;
&lt;p&gt;We also prompted open instruct models of 2B, 4B and 9B parameters to answer the same 14,286 decisions. The comparison was pre-registered before those models ran. The 9B model ran with FP8 weights and is reported outside the pre-registered tests. Invalid answers count as wrong.&lt;/p&gt;
&lt;figure class="post-figure"&gt;&lt;img src="same-rows-comparison.svg" alt="Exact accuracy on the same 14,286 decisions" width="960" height="460" loading="lazy" decoding="async" /&gt;&lt;figcaption&gt;Exact accuracy on identical test rows. Pea is highlighted; comparison models are grey.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Exact accuracy&lt;/th&gt;
&lt;th&gt;NLL (lower is better)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pea · 2B&lt;/td&gt;
&lt;td&gt;76.60%&lt;/td&gt;
&lt;td&gt;0.589&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open instruct model · 9B · FP8&lt;/td&gt;
&lt;td&gt;62.30%&lt;/td&gt;
&lt;td&gt;1.003&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open instruct model · 2B&lt;/td&gt;
&lt;td&gt;55.38%&lt;/td&gt;
&lt;td&gt;1.134&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open instruct model · 4B&lt;/td&gt;
&lt;td&gt;50.31%&lt;/td&gt;
&lt;td&gt;1.237&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The full breakdown, including accuracy by input length, is on the &lt;a href="/evaluation/"&gt;evaluation page&lt;/a&gt;. The method is described in the &lt;a href="/paper/vej-native-candidate-probabilities.pdf"&gt;paper&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="reading-the-probabilities"&gt;Reading the probabilities&lt;/h3&gt;
&lt;p&gt;These results use temperature 1. The hosted API applies temperature 1.334, fitted on 2,026 held-out calibration decisions and checked on 1,016 further decisions. That scale does not make a stated probability a guaranteed frequency on a new workflow. Validate thresholds on your own data, and keep independent policy checks around consequential actions.&lt;/p&gt;
&lt;h2 id="getting-pea"&gt;Getting Pea&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hosted:&lt;/strong&gt; limited early access through a &lt;a href="https://app.itsvej.com/sign-up"&gt;console account&lt;/a&gt;. Every new account needs manual approval. Text only; capacity is limited, with no uptime guarantee yet.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weights:&lt;/strong&gt; &lt;a href="https://huggingface.co/ItsVej/pea-1"&gt;Pea 1 decision weights&lt;/a&gt; are on Hugging Face after an approved access request. Running them locally still needs the private Vej source.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Licences:&lt;/strong&gt; Vej code and model adaptations are Apache-2.0. The upstream base model and the training datasets keep their own terms; see &lt;a href="/licenses/"&gt;licences and attribution&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href="/models/pea/"&gt;Pea model page&lt;/a&gt; has the architecture details, local serving instructions and usage guidance.&lt;/p&gt;
</content></entry><entry xml:base="https://itsvej.com/journal/introducing-the-journal/"><title>Introducing the Vej Journal</title><link href="https://itsvej.com/journal/introducing-the-journal/" /><id>https://itsvej.com/journal/introducing-the-journal/</id><published>2026-10-15T00:00:00Z</published><updated>2026-10-15T00:00:00Z</updated><author><name>Lode Kennes</name></author><summary>A place for release notes, research updates and the reasoning behind what we build.</summary><content type="html">&lt;p&gt;Vej moves quickly. New capabilities reach the hosted API, evaluations get published and models move through development. Until now, most of those changes appeared quietly on the pages they touched. The Journal gives each one a dated write-up with a name attached.&lt;/p&gt;
&lt;h2 id="what-you-will-find-here"&gt;What you will find here&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Release notes&lt;/strong&gt; for new features on the hosted API, such as endpoints, field types and limits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Research updates&lt;/strong&gt; on Pea, Pepper and Pumpkin, with links to the published evidence where it exists.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Development notes&lt;/strong&gt; on decisions we made, including the ones we decided not to ship.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We hold every post to the same standard as the rest of the site. Measured results link to their evaluation. Development results are labelled as development results. Work that is still private stays private until there is something we can stand behind.&lt;/p&gt;
&lt;h2 id="following-along"&gt;Following along&lt;/h2&gt;
&lt;p&gt;Subscribe to the &lt;a href="/journal/feed.xml"&gt;RSS feed&lt;/a&gt; in any feed reader, or join the &lt;a href="/access/#newsletter"&gt;newsletter&lt;/a&gt; for occasional updates by email. Questions about a post are welcome through the &lt;a href="/contact/"&gt;contact form&lt;/a&gt;.&lt;/p&gt;
</content></entry></feed>
