<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mo Al Mamun (Mamun)</title>
    <description>The latest articles on DEV Community by Mo Al Mamun (Mamun) (@md_almamunmamun_857ec).</description>
    <link>https://dev.to/md_almamunmamun_857ec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4187573%2Ffdf3d6c2-ca25-414c-94f2-8d6dea2dbed8.jpg</url>
      <title>DEV Community: Mo Al Mamun (Mamun)</title>
      <link>https://dev.to/md_almamunmamun_857ec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/md_almamunmamun_857ec"/>
    <language>en</language>
    <item>
      <title>Before attributing multilingual quantization loss, validate the likelihood path</title>
      <dc:creator>Mo Al Mamun (Mamun)</dc:creator>
      <pubDate>Sun, 25 Oct 2026 15:13:26 +0000</pubDate>
      <link>https://dev.to/md_almamunmamun_857ec/before-attributing-multilingual-quantization-loss-validate-the-likelihood-path-5a25</link>
      <guid>https://dev.to/md_almamunmamun_857ec/before-attributing-multilingual-quantization-loss-validate-the-likelihood-path-5a25</guid>
      <description>&lt;p&gt;My long-term goal is to make capable multilingual models practical on personal devices while preserving their usefulness across languages. I want to measure what compression changes, identify which parts of a model need more precision, and test whether allocating that precision differently can preserve quality within the same deployment size budget. Bangla is the language I want to investigate most deeply, with comparisons across other languages to keep the conclusions honest. The eventual test is both linguistic and practical: what can people do with the model, and what does it cost to run on a real device?&lt;/p&gt;

&lt;p&gt;The starting point is personal. As a Canadian, I feel a particular connection to Cohere and want to explore what can be built with its multilingual models. This is independent work, not a claim of Cohere affiliation or endorsement. As a Bangla speaker, I also want this work to address a language I use and care about. Choosing Cohere's Tiny Aya and making Bangla the focus brings those interests together. That motivation determines where I start; it does not determine what the results should say.&lt;/p&gt;

&lt;p&gt;The path through this article is: the model architecture, three runtime failures, probability validation, position sensitivity, fresh paired baselines, historical comparisons, and the limits of this checkpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Establish what the evaluation measures
&lt;/h2&gt;

&lt;p&gt;This article documents an early step toward that larger goal. Before testing a precision-allocation strategy, I needed to establish what the evaluation was actually measuring. The contribution here is a validated measurement procedure and fresh baselines. A sensitivity map, controlled precision-allocation experiments, broader language evaluation and real-device measurements remain later stages, each requiring its own evidence.&lt;/p&gt;

&lt;p&gt;A multilingual quantization experiment can produce plausible accuracy numbers while measuring more than compression. The tokenizer, detokenizer, prompt format, request history and answer selection rule all sit between the model weights and the final table. A difference at any of those boundaries can look like a model capability difference.&lt;/p&gt;

&lt;p&gt;This project began with a deployment question: how does compression affect Tiny Aya across languages, and could a later precision allocation recover quality at a fixed size budget? Before making that intervention claim, I needed a credible measurement path. That work encountered three distinct failures in the pinned local stack, then led to a fresh paired baseline. The result is an engineering checkpoint: a narrower, auditable comparison, with uncertainty and historical differences retained.&lt;/p&gt;

&lt;p&gt;The model is &lt;code&gt;CohereLabs/tiny-aya-global&lt;/code&gt;, a 3.35B Cohere2 model at revision &lt;code&gt;af89d219b53ed9b13b8a4645f9c8028973510324&lt;/code&gt;. The comparison here uses a BF16 GGUF control and local Q4_K_M built from that pinned BF16 artifact without an importance matrix. It is not a survey of four-bit methods. The original BF16 vLLM reference remains a separately identified experiment.&lt;/p&gt;

&lt;p&gt;The task is original-order multiple-choice reading comprehension from the &lt;a href="https://huggingface.co/datasets/facebook/belebele" rel="noopener noreferrer"&gt;Belebele&lt;/a&gt; benchmark (&lt;code&gt;facebook/belebele&lt;/code&gt;, revision &lt;code&gt;7899cdfa4e1e0d733fd77c848e2c273cb1d32be2&lt;/code&gt;, CC-BY-SA 4.0) in English, Bangla and Hindi. The model is released under CC-BY-NC 4.0 for non-commercial use. The final fresh comparison uses the same 300 development questions per language in both arms. No held-out evaluation, human semantic annotation, generation experiment or phone-performance result is included.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The architecture defines candidate precision tests
&lt;/h2&gt;

&lt;p&gt;The pinned model inspection records 36 decoder layers, hidden width 2,048, MLP width 11,008, 16 query heads and 4 key/value heads with head dimension 128, and a vocabulary of 262,144. Three sliding-attention layers with a 4,096-token window followed by one full-attention layer repeat nine times; the configured maximum is 8,192 positions. These are architecture facts, not measured sensitivity results. Source: &lt;a href="https://github.com/grinder81/tiny-aya-edge/blob/8a0d922ef40f86ba3ea11e0b4a2656d25d4bcea4/reports/stage1-downloaded/inspection.json" rel="noopener noreferrer"&gt;pinned model inspection&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Each block normalizes the residual input once, sends that normalized input through attention and a gated SiLU MLP in parallel, then adds both outputs to the residual. After the decoder stack, a final LayerNorm feeds the output head, which shares weights with the token embedding. The &lt;a href="https://github.com/huggingface/transformers/blob/v4.51.3/src/transformers/models/cohere2/modeling_cohere2.py" rel="noopener noreferrer"&gt;Cohere2 implementation&lt;/a&gt; makes this parallel computation explicit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw95djheyjwshv6b27czw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw95djheyjwshv6b27czw.png" alt="Tiny Aya architecture: 36 sequential decoder blocks; each block combines parallel attention and gated MLP branches with the original residual input. Future precision targets are hypotheses." width="800" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The full model path is shown above a close-up of one decoder block. Teal attention and violet gated MLP branches share normalized input and join the original residual. Amber marks future precision tests; sensitivity and recovery remain unmeasured.&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Candidate target&lt;/th&gt;
&lt;th&gt;Hypothesis to test&lt;/th&gt;
&lt;th&gt;Controlled test&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Shared embedding/output head&lt;/td&gt;
&lt;td&gt;Its precision may affect lexical representation and output scores.&lt;/td&gt;
&lt;td&gt;Change the shared tensor allocation while accounting for tied weights and shipped bytes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attention Q/K/V/O projections&lt;/td&gt;
&lt;td&gt;Attention projections may differ in sensitivity.&lt;/td&gt;
&lt;td&gt;Compare projection groups under the same size budget.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MLP gate/up/down projections&lt;/td&gt;
&lt;td&gt;Gating and expansion/reduction projections may differ in sensitivity.&lt;/td&gt;
&lt;td&gt;Compare projection groups with real quantizer rounding.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Layer depth and local versus full attention&lt;/td&gt;
&lt;td&gt;Sensitivity may vary by depth or attention type.&lt;/td&gt;
&lt;td&gt;Compare depth/type allocations against uniform and random allocations.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are hypotheses for recovering quality toward the BF16 comparator within a fixed size budget; they do not promise improvement above BF16. Allocation tests need matched shipped bytes, uniform and random controls, and actual quantizer rounding rather than nominal bit arithmetic alone. Accuracy and changed decisions must be assessed in English alongside Bangla and Hindi. Latency and memory effects require device profiling. KV-cache changes are a distinct runtime optimization and are not validated by these weight-precision tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Three failures, with different exposure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Native tokenization: changed input IDs
&lt;/h3&gt;

&lt;p&gt;The first failure was in native tokenization. A minimal mismatch involved two spaces followed by &lt;code&gt;46&lt;/code&gt;: the pinned native Tiny Aya path did not preserve the reference digit splitting. Prefix-isolation and word-boundary/join controls distinguished the tokenizer behavior from an accidental interaction with surrounding text. In the selected parity probe, 5 of 150 contexts differed and only 580 of 600 complete candidate inputs matched; the patched path matched 600 of 600. These are scoped probe counts, not population prevalence. Expanded checking then found a join-control boundary case; the final correction matched 900 contexts and 3,600 candidate sequences, preserving the earlier patch as a distinct identity.&lt;/p&gt;

&lt;p&gt;This is a token-identity issue: it changes what reaches the model before likelihood scoring starts. It should not be collapsed into the later Python decoding failure or used to label every historical result invalid. The &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/docs/tokenizer-investigation.md" rel="noopener noreferrer"&gt;pinned tokenizer investigation&lt;/a&gt; retains the controls and affected artifacts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Python detokenization: a truncated round trip
&lt;/h3&gt;

&lt;p&gt;The second failure was in the Python wrapper's detokenizer. A fixed 32-byte buffer was too small for some Bangla token pieces. The native API signaled the required larger buffer with a negative return value, but the wrapper did not correctly resize and retry. A reproduced prompt shrank from 899 to 851 characters on the broken round trip. The failed pilot stopped after completing 24 of 40 candidates; that is a progress count, not 24 affected cases. These are diagnostic and failed-pilot observations, not an estimate of population prevalence or evidence that every completed baseline contained that corruption.&lt;/p&gt;

&lt;p&gt;The repair respects the native API contract: allocate the requested capacity, retry, and fail explicitly if decoding still fails. This was a local reproduction, not a claim of novel discovery: an earlier upstream report and proposed fix already existed (&lt;a href="https://github.com/abetlen/llama-cpp-python/issues/2362" rel="noopener noreferrer"&gt;issue 2362&lt;/a&gt; and &lt;a href="https://github.com/abetlen/llama-cpp-python/pull/2363" rel="noopener noreferrer"&gt;PR 2363&lt;/a&gt;). My later &lt;a href="https://github.com/abetlen/llama-cpp-python/pull/2388" rel="noopener noreferrer"&gt;PR 2388&lt;/a&gt; remains a separate, overlapping proposal; coordination is pending. The &lt;a href="https://github.com/grinder81/tiny-aya-edge/blob/8a0d922ef40f86ba3ea11e0b4a2656d25d4bcea4/reports/python-decode-buffer.md" rel="noopener noreferrer"&gt;recorded buffer investigation&lt;/a&gt; preserves the local reproducer and repair.&lt;/p&gt;

&lt;p&gt;Byte-exact round-trip checks matter here. A visually plausible prompt, a successful HTTP response and a finite likelihood are insufficient evidence that the text survived the path unchanged.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prefix reuse: request history changed likelihoods
&lt;/h3&gt;

&lt;p&gt;The third failure emerged later, after strings and token counts were already matching. Echoed likelihoods depended on reused-prefix execution history. In the failed A3 validation, independent cold forwards disagreed with supplied-prompt log probabilities by as much as 0.18238 nats; tested chat continuation differences reached 0.02854 nats. A fresh-server request permutation also changed likelihoods. That made request order part of the measurement.&lt;/p&gt;

&lt;p&gt;This dependence was observed in the llama-cpp-python server path used for scoring; it was not reproduced against native &lt;code&gt;llama-server&lt;/code&gt;, so it is routed to the wrapper integration first rather than claimed as a core llama.cpp defect.&lt;/p&gt;

&lt;p&gt;Instead of relaxing the numerical tolerance, I preserved the failed output and changed the diagnostic. Seven same-order wrapper completions were checked against an independent full-vocabulary float64 log-softmax of the raw logits. They matched the preserved HTTP arrays within 9.3e-7 nats. This bounded result helped separate execution-history effects from a parser or echo-alignment error. It was not a complete correctness gate.&lt;/p&gt;

&lt;p&gt;The patched llama-cpp-python scoring wrapper subsequently forces cold prefill for echoed likelihood requests and bypasses cache restoration for that branch. It does not establish that caching is generally unsafe or that all nonscoring generation paths have been validated. A separate exact top-one ranking optimization removed a CPU bottleneck while preserving the tested ranking and tie behavior; its microbenchmark is not model throughput.&lt;/p&gt;

&lt;p&gt;These failures have different exposure histories. A tokenizer discrepancy changes input IDs; a failed detokenization round trip corrupts the text interface; prefix reuse changes numerical execution for otherwise matching requests. The preserved evidence distinguishes diagnostic reproducers, failed pilots, historical completed runs and the fresh validated identities. That separation is necessary before claiming that a particular defect caused an accuracy change.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Validate probabilities before collecting another accuracy table
&lt;/h2&gt;

&lt;p&gt;The final A3 runtime gate covered 192 candidates in 48 contexts per precision arm, followed by 36 candidates in a separate reversed-order check. The contexts covered all three languages, scoring variants and rotations, with longest-input and continuation cases. The independent reference used raw logits, rather than trusting the same HTTP response that the client parsed.&lt;/p&gt;

&lt;p&gt;Validation required exact token IDs, one automatic BOS, matching echo strings and counts, and the expected single generated suffix. Numerical tolerance never excused token misalignment. Both the 0.0002-nat per-token limit and the summed continuation limit, &lt;code&gt;max(0.001, continuation_tokens × 0.0002)&lt;/code&gt; nats, applied. The parser had its own 1e-8 agreement check against the supplied echo slice. Both arms passed, with no correctness failures or winner inversions in that coverage.&lt;/p&gt;

&lt;p&gt;The later T1 baseline had its own, smaller T1-specific gate: 12 fixed contexts and all four candidates per arm (48 candidates), covering indices 0, 100, 299 and the longest input in each language, plus the same 48 candidates in reversed request order. All candidate continuations were independently checked to be single model tokens. These are bounded correctness checks, not a proof about arbitrary future prompts or implementations.&lt;/p&gt;

&lt;p&gt;The evaluation path stayed on the supported upstream configurable task and likelihood scorer. I did not introduce a custom scoring adapter to make the probabilities agree. Runtime sources, native library, tokenizer, model bytes, commands and gate artifacts were hash-pinned. Resumption revalidated saved shards against the same identity rather than silently mixing environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Position sensitivity survives the runtime control
&lt;/h2&gt;

&lt;p&gt;A2 had already shown substantial option-position sensitivity. Its historical runtime identity remains attached to those observations; the cache finding is an additional possible confound, not a retrospective explanation of every A2 flip.&lt;/p&gt;

&lt;p&gt;A3 repeated the format question under the cold runtime. It used 100 questions per language, four cyclic option orders, and three variants: plain prompt with letter completion, tokenizer chat template with letter completion, and plain prompt with full option-text completion. Rotations and variants are repeated measurements of the same questions, not extra independent samples.&lt;/p&gt;

&lt;p&gt;Under plain-letter scoring, all-four content consistency was 67%/65% in English, 43%/44% in Bangla and 52%/46% in Hindi for BF16/Q4. Consistency means selecting the same original answer content in all four orders, whether correct or wrong. Position sensitivity therefore remained in both precisions after the runtime control. It cannot be described as a quantization-only failure.&lt;/p&gt;

&lt;p&gt;The same cold-runtime A3 plain-letter cells show the displayed-letter imbalance:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;BF16 predicted A/B/C/D&lt;/th&gt;
&lt;th&gt;Q4 predicted A/B/C/D&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;td&gt;141/89/90/80&lt;/td&gt;
&lt;td&gt;147/87/85/81&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bangla&lt;/td&gt;
&lt;td&gt;194/70/72/64&lt;/td&gt;
&lt;td&gt;180/77/71/72&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hindi&lt;/td&gt;
&lt;td&gt;169/69/83/79&lt;/td&gt;
&lt;td&gt;185/65/75/75&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each cell contains 400 predictions across four rotations, with exactly 100 gold answers in each displayed position. These are A3 rotation histograms; T1's original-order gold distribution is different. The counts describe position sensitivity, not an internal defect or a validated correction.&lt;/p&gt;

&lt;p&gt;The formats also changed measured performance. &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/results/a3-scoring-variants/README.md" rel="noopener noreferrer"&gt;A3's complete results&lt;/a&gt; show exploratory chat-letter Q4−BF16 rotation-mean accuracy differences of −3.50 percentage points in English, with a 95% interval of [−5.95, −1.25], and −3.00 points in Bangla [−5.93, −0.25]. Those intervals exclude zero. All raw English-relative compression interaction intervals included zero, however. The evidence does not establish a Bangla-specific mechanism, and the many exploratory endpoints were not multiplicity adjusted.&lt;/p&gt;

&lt;p&gt;Full option-text completion performed substantially worse here. Dividing its summed likelihood by displayed-choice Unicode character count changed results again. That normalization excludes the added ASCII-space delimiter; it is neither token nor byte normalization. For letter choices, normalization changes nothing because every displayed choice has one character. None of these diagnostics justified choosing an endpoint after seeing which one made compression look best.&lt;/p&gt;

&lt;p&gt;The accepted downstream contract remained plain-letter summed continuation likelihood: one ASCII-space delimiter, no appended EOS, one automatic BOS, and the first displayed maximum on an exact tie. The next requirement was fresh full development comparators under that contract, not relabeling the 100-question rotation diagnostic as a 300-question baseline.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Fresh T1: small net differences, appreciable churn
&lt;/h2&gt;

&lt;p&gt;Both fresh arms completed 180 five-question shards: 900 original-order questions and 3,600 candidate scores per arm. Every shard passed complete-membership, request, target, finite-score and provenance validation. The conditional overlap with A3 covered 300 original-order requests per arm; all 2,400 candidate comparisons across both arms matched without failures or winner inversions. Those rows were freshly collected, not copied from A3.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;BF16 GGUF correct /300&lt;/th&gt;
&lt;th&gt;Q4_K_M correct /300&lt;/th&gt;
&lt;th&gt;Q4−BF16, pp [95% interval]&lt;/th&gt;
&lt;th&gt;Delta minus English, pp [95% interval]&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;td&gt;230 (76.67%)&lt;/td&gt;
&lt;td&gt;229 (76.33%)&lt;/td&gt;
&lt;td&gt;−0.33 [−3.03, +2.36]&lt;/td&gt;
&lt;td&gt;Reference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bangla&lt;/td&gt;
&lt;td&gt;187 (62.33%)&lt;/td&gt;
&lt;td&gt;190 (63.33%)&lt;/td&gt;
&lt;td&gt;+1.00 [−2.01, +4.15]&lt;/td&gt;
&lt;td&gt;+1.33 [−2.63, +5.37]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hindi&lt;/td&gt;
&lt;td&gt;184 (61.33%)&lt;/td&gt;
&lt;td&gt;180 (60.00%)&lt;/td&gt;
&lt;td&gt;−1.33 [−4.70, +2.03]&lt;/td&gt;
&lt;td&gt;−1.00 [−4.93, +2.97]&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The intervals use 10,000 jointly resampled source-cluster draws, with 250 source clusters and seed 42. The same source draw is used across languages and paired arms. Questions sharing a source are not treated as independent, and the bootstrap denominator follows the sampled question count. The English-relative endpoint tests a difference in compression deltas, rather than confusing lower absolute Bangla or Hindi accuracy with extra compression damage.&lt;/p&gt;

&lt;p&gt;All three fresh accuracy-difference intervals and both nontrivial English-relative intervals include zero. That is uncertainty, not equivalence or proof of no harm. The BF16 GGUF control already scores lower in Bangla and Hindi than English. This is a pre-quantization accuracy gap in this evaluation, not a comparison against a separate “base” model or evidence identifying its cause.&lt;/p&gt;

&lt;p&gt;Net accuracy also hides changed decisions:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Changed choices&lt;/th&gt;
&lt;th&gt;Right→wrong&lt;/th&gt;
&lt;th&gt;Wrong→right&lt;/th&gt;
&lt;th&gt;Wrong→wrong&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;English&lt;/td&gt;
&lt;td&gt;21/300 (7.00%)&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bangla&lt;/td&gt;
&lt;td&gt;33/300 (11.00%)&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hindi&lt;/td&gt;
&lt;td&gt;34/300 (11.33%)&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Bangla churn is about 1.57 times English churn here, not doubled.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A small net delta can coexist with both regressions and improvements, and two wrong answers can still differ.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These counts motivate inspecting decisions; they do not by themselves identify a language-specific internal defect.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F39jwn1wtve4ryv17g7k8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F39jwn1wtve4ryv17g7k8.png" alt="Fresh paired accuracy differences and English-relative interactions; 95% source-bootstrap intervals" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Original-order T1, 300 questions per language; BF16 GGUF control, not the separate vLLM reference. Intervals jointly resample 250 source clusters.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Historical results are preserved, not silently repaired
&lt;/h2&gt;

&lt;p&gt;The fresh run was joined to historical A1 by exact source/question identity, targets and request/candidate bytes, with matching model artifacts. Within-arm historical-to-fresh changed predictions were 0/1/0 for BF16 and 7/12/10 for Q4 in English/Bangla/Hindi. Fresh Q4 correct counts rose from 226/189/176 to 229/190/180; BF16 moved from 230/188/184 to 230/187/184.&lt;/p&gt;

&lt;p&gt;The score changes were larger than the earlier selected bridge might suggest. Across 1,200 paired candidate scores per language, maximum absolute Q4 changes were 0.89890 nats in English, 1.33790 in Bangla and 0.79041 in Hindi. The earlier 15-context bridge maximum was 0.42425 nats. Its smaller coverage never supplied a uniform bound on future score changes or accuracy.&lt;/p&gt;

&lt;p&gt;These are combined observed runtime/settings transitions. They do not isolate a patch's causal effect. Keeping old results under their original identities, and publishing the score and margin distributions beside the fresh runs, is more informative than replacing the historical table with a corrected-looking number.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqyxzeu7c24zsousio25v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqyxzeu7c24zsousio25v.png" alt="Historical-to-fresh score and decision differences, separated by model arm" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Historical and fresh identities remain distinct. These observed changes combine recorded runtime/settings differences; they are not isolated patch effects or universal error bounds.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Margins suggest a next analysis, not an explanation
&lt;/h2&gt;

&lt;p&gt;The fresh BF16 top-two summed-score margin provides an exploratory view of the flips. English had 38 questions below one nat, with 15 flips; Bangla had 82, with 28 flips; Hindi had 83, with 29 flips. Above or equal to one nat, flips still occurred: 6/262, 5/218 and 5/217 respectively.&lt;/p&gt;

&lt;p&gt;Lower-margin cases had more flips descriptively. The binning existed before this collection, but these counts have no source-cluster intervals or language-adjusted causal analysis. They do not show that margin explains away language, localize a damaged tensor, or select a precision repair. They establish a question for later controlled work.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. What this checkpoint supports
&lt;/h2&gt;

&lt;p&gt;The useful deliverable is a reproducible measurement contract and a fresh paired comparator, not a claim that multilingual compression is solved. The &lt;a href="https://github.com/grinder81/polyglot-quant-eval/tree/88adfa3437f49ab2b40c851ba1d52401bae3057d/results/t1-cold-baselines" rel="noopener noreferrer"&gt;T1 evidence package&lt;/a&gt; preserves the complete report, raw shards, identities and validation evidence. Its report SHA-256 is &lt;code&gt;c1ffee6b6030b1d5beb6c6afe3d855c1e1703df3e2fd6329270b06d55a1941a1&lt;/code&gt;. Independent internal checks reconstructed all 1,800 rows and recomputed the fresh source-bootstrap endpoints. That is an audit of this evidence, not external peer review.&lt;/p&gt;

&lt;p&gt;Future work still needs human Bangla labels before the gated sweep, real-build and matched-byte controls before allocation claims, and a separate generation protocol. The recorded EOS 6 versus older EOS 3 discrepancy remains unresolved for generation; no-EOS likelihood candidates do not ratify a generation setting. Device latency, memory and energy require device measurements. The protected holdout was not used for selection or scoring.&lt;/p&gt;

&lt;p&gt;For engineers building the same kind of evaluation, the transferable practice is concrete: verify bytes and token boundaries, compare parsed probabilities to independent logits, perturb request order, retain failures, and create new identities when the measurement path changes. Only then does the compression delta have a sufficiently clear meaning to guide the next experiment.&lt;/p&gt;

&lt;p&gt;Sources and reproducibility: &lt;a href="https://github.com/grinder81/tiny-aya-edge/blob/8d3a4a84f357f656bf3bd9bbddbca7706a6b065e/results/a3-live-validation/README.md" rel="noopener noreferrer"&gt;runtime validation and preserved failed probes&lt;/a&gt;, &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/results/stage2/rotation-control/README.md" rel="noopener noreferrer"&gt;A2 historical rotations&lt;/a&gt;, &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/results/a3-scoring-variants/README.md" rel="noopener noreferrer"&gt;A3 cold-runtime format results&lt;/a&gt;, &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/docs/scoring-contract-a3.md" rel="noopener noreferrer"&gt;accepted scoring contract&lt;/a&gt;, and &lt;a href="https://github.com/grinder81/polyglot-quant-eval/blob/88adfa3437f49ab2b40c851ba1d52401bae3057d/results/t1-cold-baselines/README.md" rel="noopener noreferrer"&gt;fresh T1 report and reproducible archives&lt;/a&gt;. Dataset: the &lt;a href="https://huggingface.co/datasets/facebook/belebele" rel="noopener noreferrer"&gt;Belebele dataset card&lt;/a&gt;, revision &lt;code&gt;7899cdfa4e1e0d733fd77c848e2c273cb1d32be2&lt;/code&gt;, CC-BY-SA 4.0.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>nlp</category>
    </item>
    <item>
      <title>Can a Decision Model Replace Hand-Written Routing Rules? A 3,080-Message Experiment</title>
      <dc:creator>Mo Al Mamun (Mamun)</dc:creator>
      <pubDate>Sat, 17 Oct 2026 16:45:02 +0000</pubDate>
      <link>https://dev.to/md_almamunmamun_857ec/can-a-decision-model-replace-hand-written-routing-rules-a-3080-message-experiment-1mnd</link>
      <guid>https://dev.to/md_almamunmamun_857ec/can-a-decision-model-replace-hand-written-routing-rules-a-3080-message-experiment-1mnd</guid>
      <description>&lt;p&gt;A customer writes, “My card still hasn't arrived.” Somewhere in the backend, that sentence has to become a concrete choice: track an existing delivery, explain delivery times, or order another card.&lt;/p&gt;

&lt;p&gt;I wanted to test whether a decision model could replace the hand-written logic that makes that choice.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;switchless&lt;/strong&gt;: a fictional banking backend with 77 actions, four interchangeable dispatchers, and an evaluation on the 3,080-message Banking77 test set.&lt;/p&gt;

&lt;p&gt;The result was useful, but less tidy than the original hypothesis. &lt;strong&gt;JEV beat our rules and answered about nine times faster than the LLM. The LLM was cheaper. At the same number of referrals, combining rules and JEV produced fewer incorrect automatic selections in an exploratory comparison, but still left roughly one wrong choice in eleven.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: This is an independent experiment. I have no relationship with TypeSafe and received no credits, funding, or other support from them for this work.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The part of the backend I wanted to replace
&lt;/h2&gt;

&lt;p&gt;This experiment is about interpreting language into an action. It isn't about replacing a gateway's endpoint table, authentication checks, permissions, or load balancing.&lt;/p&gt;

&lt;p&gt;For an explicit request such as &lt;code&gt;POST /cards/123/freeze&lt;/code&gt;, the destination is already known. For “I can't find my card,” the application has to interpret the request first.&lt;/p&gt;

&lt;p&gt;The fictional product, Kestrel Bank, has 11 service modules and 77 implemented handlers. Some return information; others change an in-memory bank's state. They run inside one application, rather than as independently deployed microservices.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Customer message
      |
      v
POST /help
      |
      v
Interchangeable dispatcher
      |
      +--&amp;gt; Selected action --&amp;gt; Existing handler
      |
      +--&amp;gt; Abstain --&amp;gt; Escalation response / suggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keeping the handlers and gateway shared let us change the selector without rebuilding the rest of the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four ways to make the same choice
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rules:&lt;/strong&gt; an ordered keyword-and-regex dispatcher, developed in eight stages. It abstains when no rule matches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JEV:&lt;/strong&gt; TypeSafe's &lt;code&gt;jev-1.13.0&lt;/code&gt;, asked to choose among the 77 action IDs and their one-line descriptions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM:&lt;/strong&gt; OpenAI &lt;code&gt;gpt-6-luna&lt;/code&gt;, given the same catalogue and customer message, with structured output and reasoning disabled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hybrid:&lt;/strong&gt; run both rules and JEV. Accept their selection when they agree. When they disagree, accept JEV only if its confidence is at least 0.9; otherwise abstain.&lt;/p&gt;

&lt;p&gt;The two model routers received no example messages in their requests. Here, “zero-shot” describes that setup; it doesn't establish whether either provider's training data included this public benchmark.&lt;/p&gt;

&lt;p&gt;The rules were written by an AI coding assistant and reviewed as part of the project. That matters: this is a comparison against one disclosed implementation, not the best rule system a specialist team could build.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the experiment was measured
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://huggingface.co/datasets/PolyAI/banking77" rel="noopener noreferrer"&gt;Banking77&lt;/a&gt; contains short banking-support messages labelled with 77 intents. Each intent maps to one action in Kestrel Bank.&lt;/p&gt;

&lt;p&gt;We reserved 1,000 training messages as a held-out measurement sample and used the other 9,003 for rule development. A different 1,000-message sample, drawn from the rule-development pool, was used to choose the hybrid strategy and threshold. It was disjoint from the held-out measurement sample, but overlapped the data available for rule development. The final test evaluation used all 3,080 test messages. Rules, JEV, and hybrid settings were frozen before it; the LLM was added afterward in a separate run without retuning those systems.&lt;/p&gt;

&lt;p&gt;The main metric was exact-action accuracy. Sending a message to the right service but choosing the wrong handler did not count as correct. Abstentions count as misses in overall accuracy and are reported separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Rules&lt;/th&gt;
&lt;th&gt;JEV&lt;/th&gt;
&lt;th&gt;LLM&lt;/th&gt;
&lt;th&gt;Hybrid&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exact-action accuracy&lt;/td&gt;
&lt;td&gt;65.5%&lt;/td&gt;
&lt;td&gt;80.9%&lt;/td&gt;
&lt;td&gt;81.5%&lt;/td&gt;
&lt;td&gt;74.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Referred / abstained&lt;/td&gt;
&lt;td&gt;17.0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;18.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accuracy on answered messages&lt;/td&gt;
&lt;td&gt;78.9%&lt;/td&gt;
&lt;td&gt;80.9%&lt;/td&gt;
&lt;td&gt;81.5%&lt;/td&gt;
&lt;td&gt;90.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Median decision time&lt;/td&gt;
&lt;td&gt;0.29 ms&lt;/td&gt;
&lt;td&gt;111 ms&lt;/td&gt;
&lt;td&gt;975 ms&lt;/td&gt;
&lt;td&gt;112 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API cost per 1,000&lt;/td&gt;
&lt;td&gt;$0&lt;/td&gt;
&lt;td&gt;$0.083&lt;/td&gt;
&lt;td&gt;$0.028&lt;/td&gt;
&lt;td&gt;$0.083&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Router implementation lines&lt;/td&gt;
&lt;td&gt;772&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;888&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are recorded-run measurements. API cost excludes infrastructure and human work. The hybrid's line count includes both underlying routers and its combining logic; the model integrations don't include provider-side model complexity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpvce62051c02j8qblxkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpvce62051c02j8qblxkn.png" alt="Exact-action accuracy by service module: JEV versus rules" width="800" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JEV outperformed this rules implementation in each of the 11 service modules.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  More rules helped, until the gains became small
&lt;/h3&gt;

&lt;p&gt;On the 1,000-message held-out sample, the first 137 lines reached 39.4% accuracy. At 380 lines, accuracy was 55.2%. The final 772-line version reached 63.0%.&lt;/p&gt;

&lt;p&gt;Later stages often repaired earlier rules. A concrete example: a pattern for &lt;code&gt;cheque|check&lt;/code&gt; also caught the verb “check,” confusing a request about checking card status with a cheque-related intent.&lt;/p&gt;

&lt;p&gt;The append-only development policy made the history inspectable, but it also inflated the accumulated code compared with normal maintenance, where an engineer could edit or remove an old rule. The curve describes this development process, not a universal ceiling for rules.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4474apsvcnr9k22l1f7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4474apsvcnr9k22l1f7x.png" alt="Rules accuracy across eight development stages compared with JEV" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The effort curve uses the separate 1,000-message held-out sample. Lines measure local implementation size, not engineering hours or provider-side model complexity.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  JEV was faster, while the LLM was cheaper
&lt;/h3&gt;

&lt;p&gt;JEV's median decision took 111 ms, compared with 975 ms for Luna: about an 8.8-fold difference in these runs.&lt;/p&gt;

&lt;p&gt;Accuracy was close. The LLM's observed advantage was &lt;strong&gt;0.65 percentage points&lt;/strong&gt;, with a paired 95% confidence interval from &lt;strong&gt;−0.38 to +1.68 points&lt;/strong&gt;. No difference was detected on this test split; that does not prove equivalence. On the separate 1,000-message held-out sample, the LLM led by 2.20 points, with an interval from +0.19 to +4.21.&lt;/p&gt;

&lt;p&gt;The price result contradicted the original expectation. The LLM cost about a third as much. Its repeated action catalogue benefited from cached-input pricing. Cheap classification isn't automatically cheaper than a low-cost generative model under a particular workload.&lt;/p&gt;

&lt;p&gt;JEV was pinned to &lt;code&gt;jev-1.13.0&lt;/code&gt;; the LLM had no pinned snapshot and was run once per evaluation split. On a fixed 200-message test subset, two repeat JEV runs changed 2.0% and 0.5% of selections relative to the original run; reversing the option order changed 5.0%.&lt;/p&gt;

&lt;p&gt;The intervals describe uncertainty over messages. They don't cover model drift, different network conditions, or variation across repeated API runs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqo58ts03iik1mtb3tzbt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqo58ts03iik1mtb3tzbt.png" alt="Exact-action accuracy versus median decision latency for rules, JEV, and Luna" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Latency uses a logarithmic scale. The observed JEV–LLM accuracy difference was within the paired 95% confidence interval.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What the hybrid actually buys
&lt;/h2&gt;

&lt;p&gt;The hybrid answered 2,516 messages and referred 564. Of the answered messages, 233 were incorrect: &lt;strong&gt;90.7% accuracy at 81.7% coverage&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To put that beside the single-model routers, the analysis also referred each model's 564 least-confident messages. Confidence ties were broken by dataset index, with a sensitivity calculation for other tie orders.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Policy&lt;/th&gt;
&lt;th&gt;Referrals&lt;/th&gt;
&lt;th&gt;Accuracy on answered (95% CI)&lt;/th&gt;
&lt;th&gt;Incorrect automatic selections&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hybrid&lt;/td&gt;
&lt;td&gt;564&lt;/td&gt;
&lt;td&gt;90.7% (89.5–91.8)&lt;/td&gt;
&lt;td&gt;233&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JEV, confidence-gated&lt;/td&gt;
&lt;td&gt;564&lt;/td&gt;
&lt;td&gt;88.8% (87.5–90.0)&lt;/td&gt;
&lt;td&gt;282&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LLM, confidence-gated&lt;/td&gt;
&lt;td&gt;564&lt;/td&gt;
&lt;td&gt;87.7% (86.3–88.9)&lt;/td&gt;
&lt;td&gt;310&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Intervals are 95% Wilson intervals for each policy’s answered accuracy, conditional on the selected messages; they do not account for selecting cutoffs on the test set. They are not intervals for the differences between policies.&lt;/p&gt;

&lt;p&gt;This is an &lt;strong&gt;exploratory comparison at equal referral volume&lt;/strong&gt;. The model cutoffs were selected on the test set to match the count, while the hybrid threshold was fixed beforehand. These policies refer different messages, which may require different amounts of human effort. Reordering boundary ties moved the LLM's answered accuracy between 87.3% and 88.1%; it did not reverse the observed ordering.&lt;/p&gt;

&lt;p&gt;The hybrid made fewer incorrect automatic selections in this comparison; this observed difference does not establish superiority on future traffic. It also retained all the rules and called JEV on every message. That is a tradeoff, not a free improvement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs5qp5dr4s8oe09cvuz5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs5qp5dr4s8oe09cvuz5w.png" alt="Answered accuracy versus referral rate for rules, hybrid, and JEV thresholds" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JEV’s threshold sweep is exploratory and uses the test split. Referrals are abstentions; human resolution and actual review effort were not measured.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Correct selection and safe execution are different questions
&lt;/h2&gt;

&lt;p&gt;The gateway executes its selected handler immediately. Twenty handlers can change bank state, including blocking a card, opening a claim, or cancelling a pending transfer.&lt;/p&gt;

&lt;p&gt;Of the hybrid's 233 incorrect selections, &lt;strong&gt;32 selected a handler capable of changing state&lt;/strong&gt;. These are not 32 observed harmful actions: whether a handler changes anything depends on the customer's account state, and the evaluation logs record predictions rather than real customer outcomes.&lt;/p&gt;

&lt;p&gt;Likewise, an abstention only produces an escalation response or suggestions. We did not measure a human successfully resolving it.&lt;/p&gt;

&lt;p&gt;This distinction changed how I describe the project. The results support replacing some hand-written intent-selection logic. They do not establish that the resulting actions are safe to execute without further checks or confirmation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F38q098292h0liqctlw77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F38q098292h0liqctlw77.png" alt="JEV confidence compared with observed exact-action accuracy" width="800" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Higher confidence corresponded to higher accuracy, but did not guarantee correctness. Bins include at least 20 messages; calibration of intent selection does not establish safety of execution.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this fits with other work
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.glean.com/blog/jev-zero-shot-classifier" rel="noopener noreferrer"&gt;Glean's JEV evaluation&lt;/a&gt; helped motivate this experiment. On 40 cases with positive expert transfers, it reported a median per-entry speedup of 8.1× over its existing LLM path. Results across its other tasks were mixed: JEV did not replace Glean’s production reranker. The speedup is supporting context from a different task and a small latency sample.&lt;/p&gt;

&lt;p&gt;The closest comparison I found is &lt;a href="https://www.lyzr.ai/blog/jev-as-an-ai-router-and-controller/" rel="noopener noreferrer"&gt;Lyzr's Banking77 evaluation&lt;/a&gt;: it reports 80.1% zero-shot JEV accuracy on 770 messages, close to our 80.9%. It also reports 87.5% for an embedding classifier with ten labelled examples per intent and 93.9% for logistic regression trained on the full labelled set. Those aren't directly interchangeable measurements, but they expose an important gap in this project: &lt;strong&gt;we did not test a trained-classifier or embedding baseline.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This study therefore compares four implementations, rather than identifying the best available Banking77 classifier. A trained baseline is a useful next experiment, alongside adding new actions and measuring regressions in the original catalogue.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would test next: learning from corrections
&lt;/h2&gt;

&lt;p&gt;The next question is whether reviewed mistakes can improve the selector without rebuilding the backend. My hypothesis is that a small domain-specific model, or better context for JEV, could help with recurring confusions. &lt;strong&gt;These are proposed experiments, not measured improvements in this study.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I would begin with supervised learning from corrected labels. Calling that reinforcement learning would be premature: we already have a direct target—the intended action. Learning a routing policy from delayed outcome rewards would be a separate experiment, with a harder problem of defining and attributing success.&lt;/p&gt;

&lt;p&gt;There are three paths worth comparing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Improve the information JEV receives.&lt;/strong&gt; Clarify overlapping action descriptions and boundary cases, or retrieve a few relevant, human-reviewed examples into the request. &lt;a href="https://docs.typesafe.ai/models#customizing-jev" rel="noopener noreferrer"&gt;TypeSafe’s customization documentation&lt;/a&gt; says customer fine-tuning and LoRA adapters are not supported; customization happens through state, instructions, criteria, and decomposed questions. Retrieved examples would make this a new, example-assisted configuration, not the zero-shot setup reported above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Train a small local classifier.&lt;/strong&gt; Start with embeddings plus logistic regression, trained on representative banking messages and reviewed corrections. Include ordinary successful cases as well as failures, so the training distribution is not dominated by exceptional cases. Evaluate this model on its own before deciding it belongs in a fallback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test a learned fallback or combining model.&lt;/strong&gt; Use validation data to learn when the local classifier should override JEV, using signals such as disagreement, probability margins, or recurring intent confusions. A low-confidence trigger alone will miss confidently wrong selections. Another candidate is a model trained on probabilities from several narrow JEV questions, an approach also described in TypeSafe’s documentation. Unresolved cases would still abstain.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The evaluation matters as much as the mechanism. I would log both errors corrected and previously correct decisions broken, then compare overall accuracy, accuracy at equal referral volume, latency, cost, and incorrect selections of state-changing handlers. Better calibration alone would not demonstrate better classification or safe execution.&lt;/p&gt;

&lt;p&gt;Corrections and threshold selection must use development data. The existing test set has already informed this analysis; if its failures guide changes, it becomes a regression set rather than an untouched final test. A new locked evaluation set—ideally from a later, representative workload—would be needed to support a fresh improvement claim. Any learned combining model should also use out-of-fold development predictions to avoid training on unrealistically easy, in-sample outputs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect the evidence
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/grinder81/switchless" rel="noopener noreferrer"&gt;switchless repository&lt;/a&gt; contains the TypeScript application, decision log, rules development history, tests, and all 16 original prediction files with SHA-256 hashes.&lt;/p&gt;

&lt;p&gt;With Node 22+ and pnpm, the analysis can be regenerated without model API calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/grinder81/switchless.git
&lt;span class="nb"&gt;cd &lt;/span&gt;switchless
pnpm &lt;span class="nb"&gt;install
&lt;/span&gt;pnpm analyze
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://github.com/grinder81/switchless/blob/main/results/analysis.md" rel="noopener noreferrer"&gt;generated analysis&lt;/a&gt; includes confidence intervals, paired comparisons, referral tie sensitivity, and the state-changing-handler breakdown. The &lt;a href="https://github.com/grinder81/switchless/blob/main/results/raw/README.md" rel="noopener noreferrer"&gt;raw-run notes&lt;/a&gt; distinguish runtime records from reconstructed values and project-log provenance. Original token counts were not retained; the cost values were calculated at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I worked with AI
&lt;/h2&gt;

&lt;p&gt;I framed and directed the experiment, chose the dataset and implementation constraints, required the product and a rules baseline, and reviewed the phase PRs. Claude wrote most of the implementation, rules, and measurement code. A subsequent review challenged the claims and led to preserved raw evidence, reproducible statistical analysis, and narrower conclusions. This article was also prepared with AI assistance and is being reviewed by me.&lt;/p&gt;

&lt;p&gt;My practical conclusion is that a decision model can be a useful replacement for a hand-written language selector. In this experiment it improved accuracy and reduced local selection code, while the surrounding application remained essential. Choosing whether to execute a selected action needs its own evidence and controls.&lt;/p&gt;

&lt;p&gt;If you maintain a similar dispatcher, what would determine your choice: labelled-data availability, latency, the cost of a wrong selection, or the effort of adding new actions?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>architecture</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
