Repository navigation
Description
⛔ CLOSED — superseded by measurement, not implemented
Final verdict: do not adopt Laya for any of the three decisions. The body below is the original spike record and remains accurate as of when it was written; what changed is the system underneath it. Read this header first — several conclusions below were overtaken by the entity-resolution tier (#2841 / #2856).
What changed. The spike's central finding was that the
noulhead reads mood, not semantics: declarative state-changes scored 2/14, and that was named as the residual judgment a decision model would address. Entity grounding shipped afterwards and fixed that failure — the decision eval now passes declarative state-changes 3/3, deterministically, with no model added.What is left is the mirror image. The agent's remaining failures are over-action: calling
search_nodeson a declarative that requests nothing (0/3), andcreate_nodeon an entity the turn already resolved (0/3, tracked as #2855). Neither is a selection error — the tool surface and the resolved entity were correct in both.Would
noulfix the over-action case? Probably yes for that one scenario, and for a reason that disqualifies it as evidence. The head is biased toward "no" (10 of 14 values below 0.5), so it would likely classify a fact-report correctly — but the spike's own conclusion is that "at the default 0.5 threshold, noul earns nothing over always answering 'not a write'." A constant "no" passes that scenario too. And the same bias is what produced 2/14 on declarative state-changes — the case Gemma now handles reliably. Adopting it would trade a solved failure for an unsolved one. One of the three highest-confidence answers in the spike was also confidently wrong (a state-change at 0.1412), so the calibration would not reliably say when to trust it.An earlier closing comment on this issue said
noul's bias "points the wrong way" for over-action. That was backwards — under-acting is the right bias for a scenario whose answer is "don't act". The conclusion stands; that particular reasoning does not.What actually fixed the motivating failure: a deterministic FTS5 lookup at ~0.12 ms — four orders of magnitude cheaper than the generative turn it informs, and ~200x cheaper than the fastest decision-model option measured here. The premise the investigation started from (typed decisions should not be made inside a generative pass) held; the mechanism turned out to be an index, not a model.
Still true and unaffected by any of the above: operations are a regression (62.5% vs Gemma's 0 off-menu in 40) with a structural cause — Laya's ~20-token-per-candidate budget cannot hold production's ~150-word tool descriptions. Schema selection measured well (40/40) but the eval shows it is not where the agent fails.
If reopened: the corpus would need to over-sample over-action cases — declaratives requesting nothing, references to entities that already exist — not the declarative state-changes this spike targeted. Those are handled. Environment and raw results remain in
nodespace-experiment-nlp.
Overview
A bounded Python spike evaluated Laya (Apache-2.0, 421M ModernBERT-large, laya-typed-decisions) as a non-autoregressive decision layer for the local agent — the idea being to take typed judgments (which schema, which operation, act-vs-clarify) out of Gemma's generative pass.
Verdict: NEEDS-FINETUNING. Do not port to Rust yet. One slice — schema selection — looks deployable on its own and is separable from the rest.
Two rounds ran, both zero-shot with no prompt iteration by design. Full report and raw JSON: LAYA_SPIKE_RESULTS.md in the local nodespace-experiment-nlp scratch folder (not a repo, so this issue is the durable record).
Why this was worth measuring
The local agent currently makes schema and operation selection implicitly inside generation. Stage-1 routing — a 3-way structural choice (route_query / route_clarify / route_multi) — costs ~1.48s of autoregressive decode per turn, measured in-process. A single encoder forward pass is the obvious cheaper shape for a decision that is definitionally not generative.
Results
Measured on an M4 Pro (14 cores, 48GB), torch 2.14.0. Latency is warm inference: model loaded once, 10 warmup iterations discarded, 40-60 timed reps.
Cost — no longer the open question
| Stage-1 today | Laya MPS fp32 | |
|---|---|---|
| one 3-way structural choice | 1.48s | 25.1ms (~59x) |
| three decisions bundled (act+schema+op) | — | 97.2ms (~15x) |
MPS is ~3.6-4x faster than CPU (CPU bundle 350ms). Two independent runs agree within ~2%.
fp16 halves memory and buys zero speed. 1.6852 GB → 0.8956 GB (−46.9%), load ~21s either way, latency delta 1.4% (noise) — at batch 1-3 the forward is dispatch-bound, not bandwidth-bound. The memory number matters under ADR-062 (context windows are budgeted against total RAM minus weights); the speed number should not be cited, because it is not real. Prefer fp16 over bf16: same memory, same speed, 6x less numeric drift, zero argmax flips.
Casting the whole model to fp16/bf16 on MPS aborts the process with SIGABRT (Destination NDArray and Accumulator NDArray cannot have different datatype), root-caused to laya's Python common.py hardcoding .float() and then feeding fp32 activations to fp16 heads. Encoder-only cast works. This is a laya-Python limitation; a Rust port controls its own forward and would not inherit it.
Accuracy
| Probe | n | Result | 95% Wilson CI |
|---|---|---|---|
| schema selection | 40 | 40/40 (100%) | [91.2%, 100%] |
| operation selection | 40 | 25/40 (62.5%) | [47.0%, 75.8%] |
| noul act-vs-clarify @ t=0.5 | 46 | 31/46 (67.4%) | [53.0%, 79.1%] |
Device/dtype parity confirmed: MPS fp32 is bit-identical to CPU fp32 across all 34 Round-1 calls; fp16 max drift 0.0007 with zero argmax changes.
The central finding: the noul head reads MOOD, not SEMANTICS
| AUC | |
|---|---|
| imperative-act vs question | 0.9744 |
| declarative-act vs question | 0.7024 |
Medians: imperative 0.5460, declarative 0.2628, question 0.1660 — declarative state-changes sit nearer to questions than to imperatives. Declarative-act scores 2/14 (14.3%). Even a perfect threshold caps declarative-vs-question at 24/32.
One mechanism explains three previously-separate observations:
- The agent's open
op-read-then-writefailure — "The website redesign work is finished now" is declarative - A 2025 in-repo experiment's fine-tuned Gemma 3 12B ambiguity result (2/7)
- Laya's zero-shot behaviour now
A declarative state-change is surface-identical to a fact-report, and every model tested treats it as one. This is not a Laya weakness; it is the problem itself, and it specifies any future corpus precisely — imperatives are near-solved and would be wasted labelling effort.
Retraction from Round 1
The motivating case "Northwind Trading has moved their booking to April" scored 0.5011 (cpu-fp32), 0.5011 (mps-fp32), 0.5009 (fp16), 0.4967 (bf16) — it crosses the decision boundary under bf16 purely because it sits 0.0011 from the threshold. Round 1 scored this as a pass on what is numerically coin-flip noise. The widened set confirms it: its whole class scores 2/14.
The second failure axis: instance vs type
Operation errors are the consequential kind, and they cluster on a distinction that is conceptually harder than the tool descriptions imply.
Per-gold accuracy: create_node 1/4, get_node 1/4, update_node 2/4, update_schema 2/4, route_clarify 2/4 — against create_schema 4/4 and search_nodes 4/4.
Both instance→type confusions are on messages explicitly about one named entity:
- "Add Northwind Trading as a new company" → predicted
create_schema(goldcreate_node) - "Store a new company called Tailspin Toys" → predicted
create_schema(goldcreate_node)
A schema IS a node — SchemaNode, node_type: "schema", same table, same semantic_search_nodes_of_type index. So create_node vs create_schema is not "what kind of thing gets created"; both create nodes. It is what level of abstraction the new node sits at — an instance vs a type definition. The criteria given to the model stated this plainly ("Store a new record of an existing entity type" vs "Define a brand new entity type that does not exist yet") and it still failed, which means the criteria wording is not the fix.
This is a distinct failure axis from declarative-vs-imperative, and it carries larger blast radius: a spurious type definition is worse than a spurious record. It is also not Laya-specific — Gemma made the same error during this work, routing "Set up a way to track pieces of delivery work" to Node Creation instead of Schema Creation, reading a type request as an instance request. Both models blur the same boundary in both directions.
Also observed: one read-predicted-as-write ("Open the record for Contoso Ltd" → update_node), and search_nodes over-predicted 12/40 against a true prevalence of 4/40.
Caveat: every operation probe item was unambiguous about instance-vs-type. The genuinely hard cases ("Add a venue" — one venue, or the venue type?) were not tested, so 1/4 is measured on the easy version of this distinction.
Threshold and operating point
- Overall AUC 0.8393 at n=46 (0.857 at n=11 — holds).
- Round 1's t=0.20, applied unchanged to the wide set, scores 37/46 (80.4%) — identical to that set's own in-sample optimum, so it generalised.
- Split-fitted (200 stratified 50/50 splits, fit and eval on separate halves): held-out mean 0.746, median 0.739, p05/p95 0.652/0.870. So recalibration is worth ~74.6%, not 80.4%.
| Threshold | TP | FP | FN | TN | Precision | Recall |
|---|---|---|---|---|---|---|
| default 0.5 | 13 | 0 | 15 | 18 | 1.000 | 0.464 |
| fitted 0.194 | 23 | 4 | 5 | 14 | 0.852 | 0.821 |
At the default the head has perfect precision and 0.464 recall — it will not corrupt data, but it constantly asks instead of acting. That is the reluctance failure this spike set out to fix, reproduced. FP (writing unrequested data) and FN (a needless question) are not symmetric costs, which argues for a threshold nearer the default than the accuracy-optimal 0.194 — i.e. accepting worse than 74.6% in production.
Separately, 7 of 8 unscored ambiguous cases land above 0.194, including a bare entity name ("Northwind" at 0.2882), so a recalibrated threshold would act on near-empty input. A real abstain band is needed; noul alone does not provide one.
Note a calibration defect in the checkpoint itself: it ships an out-of-range temperature (0.1006) for the choice:11+ bucket, flagged by the vendor's own load-time warning. Past 10 options mean confidence triples while accuracy falls — confidence becomes anti-correlated with correctness. Our surfaces fit under that (~10 tools, ≤5 schemas), but a gate tuned at ≤10 options would silently invert if the tool surface grew.
What this does and does not support
Does not support replacing operation selection. 62.5% is a straight regression against the current path, where the tool surface is scoped by routing::stage2_tools and llama.cpp's grammar constrains the call envelope to a registered tool name — measured at 0 off-menu in 40 rounds. There is nothing to win here.
Does support schema selection as a narrow, separable adoption. 40/40 with CI [91.2%, 100%], 26/26 on field-discriminated cases. And the one schema failure observed on Gemma during this work was a format error (delivery job vs the registered delivery_job) — structurally impossible for choice, which returns a key from a supplied dict rather than generating a string.
Blocks act-vs-clarify on one identified deficiency rather than on vague accuracy: declarative state-changes.
Recommended next step (cheap, no training)
Run the existing zero-shot noul head over a few hundred real recorded turns and measure AUC on live traffic. No corpus, no fine-tune, no Rust. If AUC holds near 0.84, threshold recalibration alone may recover most of the benefit. If it collapses, that is a clean NO-GO and the corpus was never built.
Report imperative and declarative phrasings separately — an aggregate AUC hides the entire central finding.
This depends on recorded per-turn decisions, which is what #2802 produces.
Gate for revisiting a fine-tune (all four)
- 300-500 labelled turns, over-sampling declarative state-changes
- noul ≥90% held-out at a threshold fitted on a separate split
- operation ≥95%, else keep Gemma for operations and use Laya only for noul+schema
- calibration re-verified at the deployed option count
Caveats binding on all of the above
n=40-46 per probe type, single seed, one machine, zero-shot with no prompt iteration. Enough to rule out GO and to justify NEEDS-FINETUNING; not enough to claim Laya is accurate at schema selection in general. Probe-difficulty was audited against Round 1 (schema 10/10 → new 30/30; operation 60.0% → 63.3%; noul 63.6% → 68.6%) and no item was added, reworded, or dropped after seeing a prediction.
Related
- Make schema and operation selection explicit, recorded decision points with a measured Gemma baseline #2802 — records the per-turn decisions the live-traffic measurement needs
- Integrate DiffusionGemma via llama.cpp when block-diffusion PRs land #1451 — DiffusionGemma tracking. Not a stepping stone for this: both are non-autoregressive, but DiffusionGemma is still a generative model needing a new sampling loop (llama.cpp PRs #24423/#24427 both still open and unmerged), whereas Laya is an encoder producing a typed decision from one forward pass. Different integration problems; noted only so the two are not conflated.
- ADR-062 — the memory budget the fp16 figure feeds
- ADR-038 — two independently-sourced gates, and its warning against "inventing a third number"
Activity
malibio commentedon Sep 22, 2026
Correction: the two instance-vs-type failures are at different layers, not one shared mechanism
The issue body says Laya's
create_node/create_schemaconfusion is "not Laya-specific — Gemma made the same error during this work" and treats both as one blurred boundary. That framing is too tidy and the code does not support it. The two failures happen at different layers, for different reasons, and conflating them would send anyone investigating this to the wrong place.What production actually gives Gemma
The tool descriptions already state the boundary explicitly, from both sides (
packages/agent/src/local_agent/tools.rs):create_node(:885) — "Create one new record of a type that already exists. Use for a single instance, never to define a new kind of record."create_schema(:1273) — "Define a new entity type with its fields. Use when the user describes a kind of record the workspace does not track yet, not a single instance of an existing kind."Each rules out the other's case by name. This is ADR-064 rule 2 ("tool descriptions own tool selection") done properly.
create_node's description alone runs ~150 words including a worked example.Why Laya could not have used them
Laya's
choicecandidates share a fixed 192-256 token budget across all options. Ten production-length tool descriptions would blow that budget and force truncation — which is the documented mechanism behind its degradation past ~20 options (Banking77: 0.425 vs Jev's 0.870, ~3-4 tokens per candidate).So the terse criteria the spike used ("Store a new record of an existing entity type" / "Define a brand new entity type that does not exist yet") were not a shortcut that handicapped the model — they are the format's constraint. Gemma reads ~150 words of disambiguating prose per tool; Laya gets ~20 tokens per candidate and cannot be given more.
This is a structural limitation of the approach that the issue body did not state, and it is more consequential than the 62.5% number alone. Any
choicecall over NodeSpace's tool surface is permanently working from criteria an order of magnitude thinner than what the generative path already has. That is an argument against operation selection viachoiceindependent of accuracy measurement.Where Gemma's failure actually was
Gemma's observed error — "Set up a way to track pieces of delivery work, each with a name, a target finish date and a status" routing to Node Creation rather than Schema Creation — happened at Stage 1 skill routing, which matches an embedding of the user's message against skill
descriptionproperties (ADR-064 rule 3: those are retrieval index keys, not documentation). Tool descriptions were not consulted at that point; by the time they matter, the whitelist has already been scoped byrouting::stage2_tools.Both skill descriptions do encode the distinction (
packages/agent/src/skill_pipeline.rs):And retrieval still put Node Creation first for a type-definition request. So the failure is embedding similarity, not instruction quality: "track pieces of delivery work, each with a name, a date and a status" embeds near Node Creation's vocabulary (create, record, item, entry) despite being a type request. This is the same class ADR-038 Finding 4 records — indirect phrasing defeating raw-message semantic push — and the same class #1980 is open against.
Corrected reading
descriptionchoice's budgetThey are not one mechanism. The instance-vs-type boundary is genuinely hard in both places, but a fix for one does nothing for the other.
What stands unchanged
create_node1/4, and the two confusions being on explicitly-single-entity messages ("Add Northwind Trading as a new company", "Store a new company called Tailspin Toys")What changes
The declarative-vs-imperative finding remains the one genuinely shared mechanism across Gemma, the 2025 fine-tuned Gemma 3 12B result, and Laya. Instance-vs-type does not belong in that category and should not be cited as a second cross-model finding.
malibio commentedon Sep 22, 2026
Correction: the recommended next step is not runnable as written
This issue's "Recommended next step" says to run the zero-shot
noulhead over "a few hundred real recorded turns," and points at #2802's per-turn decisions as the source. That is wrong, for the same reason the equivalent step on #2841 was wrong — see that issue's corpus-correction comment. Recording it here so the defect is not rediscovered a third time.Why it does not work
1. #2802 records fixture prompts, not real messages. The eval's prompts — across
decisions.ts,routing.tsandagent-matrix.ts— are hand-authored to exercise routing, andguidance_is_not_contaminated_by_eval_promptsexists specifically to keep them synthetic and independent of guidance wording. They are not traffic.2. No corpus exists on disk.
eval:decisionswrites results to/tmp/decisions-<label>-<ts>.jsonby default and nothing is committed. The 3-rep baseline recorded on #2802 is already gone.3. The failure mode is inverted, not merely weak. The entity names in those fixtures (Northwind, Contoso) are absent from the graph by design, so a
noulpass over them would mostly measure a shape real traffic does not have.Since the AUC figure is the GO/NO-GO input for the act-vs-clarify question, a number from that corpus would be worse than no number — it would be cited as evidence. ADR-056 makes exactly this complaint about its own matrix scores ("describe the harness as much as the model"). Authoring a corpus ourselves fails the same way one layer down: we would be choosing the answer.
Revised status of the three sub-decisions
noul)The
noulquestion is also gated on #2841, independently of the corpus. Today's decision-eval baseline shows the agent failing because it cannot resolve a named entity to a node — it calls no tool and asks for a node ID. If entity-grounded routing removes that, a large share of what currently reads as "should I act or clarify?" stops being ambiguous at all: the model is not weighing a judgment, it is missing a fact. Measuringnoulbefore #2841 lands would measure a baseline about to change.Note this can resolve in either direction. If #2841 removes most act-vs-clarify ambiguity, Laya's remaining role shrinks, possibly to nothing. If #2841's eventual prevalence figure shows resolvable entities are a minority of messages, most turns stay genuinely ambiguous and the role grows.
On adopting schema selection now
It is the one slice needing no corpus — 40/40, CI [91.2%, 100%], separable from both operations and act-vs-clarify, and it eliminates a failure class structurally (
choicereturns a key from a supplied dict, so thedelivery job/delivery_jobformat error Gemma produced is impossible).But it should be filed and left unscheduled rather than picked up. The same eval shows the agent failing upstream of schema selection — it never reaches the choice. Adopting it now would optimise a decision that is not currently being made. #2841 is the prerequisite for that slice mattering.
What this issue is
A durable findings record (
questionlabel), not an implementation issue. It should stay that way. The follow-on work it implies belongs in separate issues:noulAUC measurement — file as blocked, with the corpus prerequisite named explicitly, not as ready-to-start. Must report imperative and declarative phrasings separately; an aggregate AUC hides the central finding (imperative-vs-question AUC 0.974, declarative-vs-question 0.702, declaratives 2/14).The general rule worth carrying
Fixture prompts are not a substitute for real messages, and no committed corpus of real messages exists. This defect has now appeared in two issues (#2841 and this one), both times because "use #2802's recorded decisions" was written without checking what those decisions contain. Any future measurement that says "run X over real messages" needs its corpus identified before the step is treated as actionable.
malibio commentedon Sep 22, 2026
One gate cleared, one remains — and the measurement itself has changed shape
#2841's entity-resolution tier landed in #2856 (
d4eaf894). That resolves half of what this issue was waiting on, and changes what the remaining measurement should actually measure.Gate status
The first gate is genuinely gone. The concern was that measuring
noulbefore entity grounding would measure a baseline about to be superseded — the model was declining to act because it could not resolve a name, not because it was weighing a judgment. That change has now happened.The corpus gate is untouched.
eval:decisionsstill writes to/tmpwith nothing committed, and the eval's prompts remain hand-authored fixtures. Checked directly: #2856 added no entity field toTurnRecord, so the harness does not capture resolution outcomes per turn either.The measurement is no longer the one this issue describes
This matters more than the gate change. With the tier shipped, the right question is act-vs-clarify on turns where the entity resolved.
Turns that stalled for want of an entity — the ones that produced "I need a Node ID to update the capacity for Northwind Trading" — are no longer the interesting case. They are fixed. Measuring
noulacross all turns would now average a solved failure together with the residual judgment, and report something about neither.So the recommended next step should read:
The imperative/declarative split remains essential — an aggregate AUC hides the central finding (imperative-vs-question 0.974, declarative-vs-question 0.702, declaratives 2/14).
An open sub-question this raises: does entity grounding change the declarative problem at all? A declarative state-change ("Northwind has moved their booking to April") is surface-identical to a fact-report whether or not the entity resolves. The tier tells the model which node is meant; it does not tell it that a change is being requested. So the 2/14 declarative result may be entirely unaffected — which, if true, makes this the clearest remaining case for a decision model and is worth establishing before anything else.
Unchanged
The other two sub-decisions stand, independent of all the above:
What this issue is waiting for
Real usage producing real messages. That is a product-maturity gate rather than an engineering one — there is no task anyone can pick up to accelerate it, short of shipping and using the product.
malibio commentedon Sep 22, 2026
Measured: entity grounding fixed the declarative failure this issue predicted — and the residual is its mirror image
Ran
eval:decisions3 reps against6bc23eb0(entity tier + the declarative pair), purged database between reps,gemma-4-e4b-q4km. 9 of 11 scenarios pass, zero variance — every scenario passed 3/3 or failed 0/3.The declarative pair split, deterministically
declarative-state-change-resolved— "Northwind Trading signed on a different date — it was the 20th of March."update_nodedeclarative-fact-report-resolved— "Northwind Trading has been a customer of ours for a long time."search_nodes, expected no tool callThis inverts the spike's prediction. The Laya spike measured declarative-act at 2/14 and diagnosed the model as failing to recognise a declarative sentence as a change request — imperative-vs-question AUC 0.974 against declarative-vs-question 0.702. That failure appears fixed: with the entity resolved, the model acts on a declarative state-change reliably, 3/3.
What is left is the opposite failure: acting on a declarative that is not a request at all.
The other failure is the same shape
schema-on-menu-company— "Add Northwind Trading to the companies we sell to", where Northwind now already exists — fails 0/3 by callingcreate_node, duplicating the entity the turn just resolved. That is #2855 reproduced in the eval.So both remaining failures are over-action:
Neither is a selection error. The tool surface was correct in both cases, the entity resolved correctly in both, and the model chose to act when the right answer was to act differently or not at all.
What this means for the act-vs-clarify sub-decision
The question this issue holds open was framed as "should I act or clarify?", and
noulwas the proposed instrument. The measured residual is "should I act at all?" — a related but different question, and the spike's own numbers point the wrong way for it:A gate that under-acts does not help an agent that over-acts. At the default operating point
noulis reluctant to say "yes, act", which is precisely the wrong bias for these two failures. The threshold could be moved, but the spike measured that recalibration is worth ~74.6% held-out — and moving the threshold toward acting makes the over-action worse, not better.So the case for a
noulgate as scoped in this issue is weaker after this measurement, not stronger. Whatever addresses over-action is a different mechanism than the one the spike evaluated.Unchanged
schema-on-menu-company's failure is not a schema-selection error; the schema resolved fine and the model then created a duplicate. Laya'schoicewould not have prevented it.Also recorded
entity-no-match-is-a-createat 3/3.malibio commentedon Sep 23, 2026
Closing: the question was overtaken by measurement rather than answered
All three sub-decisions are now settled, none of them in favour of adopting Laya. Closing this as a durable findings record rather than leaving it open to imply work the evidence no longer supports.
Final disposition
schema-on-menu-company) fails by creating a duplicate after resolving the schema correctly, whichchoicewould not have prevented.Why the act-vs-clarify case did not survive
This issue's recommended next step was to measure
noulon real turns, on the theory that declarative state-changes were the residual judgment. The spike measured declarative-act at 2/14 and diagnosed the model as failing to recognise a declarative sentence as a change request.Measured after the entity tier shipped (3 reps, zero variance):
Entity grounding fixed the predicted failure. The residual is its mirror image — acting on a declarative that requests nothing — and the spike's own operating point points the wrong way for it:
A gate that under-acts does not correct an agent that over-acts, and moving the threshold toward acting makes it worse. The mechanism that would address the observed residual is not the one this issue proposed.
What actually fixed the motivating failure
Not a decision model. A deterministic index lookup at ~0.12 ms — four orders of magnitude cheaper than the generative turn it informs, and roughly 200x cheaper than the fastest decision-model option measured here.
The investigation's premise was sound and is worth keeping: typed decisions should not be made inside a generative pass. The conclusion is narrower than expected — for the decisions this agent actually gets wrong, the alternative to generation turned out to be a lookup, not a second model.
Carried forward
create_nodeduplicates an already-resolved entity. Reproduced in the eval at 0/3, and it is the same over-action shape as the remaining declarative failure. This is where the residual work is.nodespace-experiment-nlpscratch folder, with full results inLAYA_SPIKE_RESULTS.md, should any of this need revisiting.If this is ever reopened
The gate stated earlier still applies, with one correction: the corpus would need to over-sample over-action cases (declaratives requesting nothing, references to entities that already exist), not the declarative state-changes the original spike targeted. Those are now handled.
malibio commentedon Sep 23, 2026
Round 3: Stage-1 routing measured — NO-GO, and it closes the last untested decision
The one decision Rounds 1-2 never measured was Stage-1 routing — the 3-way
route_query/route_clarify/route_multistructural choice. It was the best remaining fit for Laya's envelope on paper: only 3 candidates, short criteria, and the most expensive non-generative decision in the pipeline (2063-2486 ms of autoregressive decode per turn).Measured now. It does not work, and the failure is not a threshold problem.
Laya never chose
route_clarifyonce, across 66 calls in three configurationsroute_query(constant)Both variants score below a constant function. Clarify recall 0/4 in both; the
route_clarifycolumn of the confusion matrix is empty. A binary control (route_multi removed, nothing truncated) still produced 0 clarify predictions and scored exactly the constant baseline.p(route_clarify)carries no rank signal: AUC 0.36-0.57 against chance 0.50.Why this is NO-GO rather than NEEDS-MORE-DATA
Round 1 rescued the
noulhead because AUC 0.857 meant the ordering was right and only the threshold was misplaced — recalibration had something to operate on. Here there is nothing to recalibrate: Laya is a constant function on this input. No threshold moves a signal that is not there.Consistent with Round 2's mood-not-semantics mechanism: "organize my client contacts" is a well-formed imperative, ambiguous only in reference — a property of the knowledge base, not of the sentence surface. Laya reads surface form.
Two corrections that supersede earlier rounds
1. Latency is ~52 ms, not the ~25 ms carried over from Round 2.
Driven by sequence length (Stage 1's system prompt is 269 tokens), not option count. Against Gemma's 2063-2486 ms that is 40-52x, saving ~2.0-2.4 s/turn — still large, but the ~80-100x figure used when scoping this probe was wrong and should not be requoted.
2. Round 2's "192-256 shared token budget" framing was mis-scoped, and this matters for any future Laya use anywhere.
Reading
laya/common.py:68: each option is hard-capped at 48 tokens, beforehead_max_len=256is consulted at line 70. For a small option set the binding constraint is 48 per option, not the shared 256.Verbose truncation, decoded:
route_query98→48 tokens,route_multi85→48. Every dropped half was the negative/guard clause —route_multilost its entire "Do NOT use this for a single intent" guard, which predicts the observed failure exactly (3 query-gold→multi errors in verbose, falling to 1 in terse).But terse is fully intact and still below the constant baseline with 0 clarify predictions. So the token budget was a real defect and not the limiting factor. The verbose→terse gain is not significant (exact McNemar p=0.50; ~366 items/arm needed for 80% power).
Confidence still does not separate correct from incorrect
AUC(confidence → correctness) = 0.407 verbose / 0.438 terse — at or below chance, with mean confidence marginally higher when wrong. This refutes the hypothesis that 3 options would land in the well-calibrated band: this is the valid
choice:3-5bucket (temperature 1.7602) and confidence fails anyway. Mean top-1 probability is only 1.22-1.30x above uniform, versus 2.25x on Round 1's 10-option task — typical output isquery 0.40 / multi 0.37 / clarify 0.21, with query and multi near-tied on nearly every item.What would change the verdict
Fine-tuning only, with AUC as the cheap early gate: if a fine-tune does not move
p(clarify)AUC decisively above 0.5, stop there — no threshold work will help. The corpus would need to teach referential ambiguity: vague imperatives labelled clarify against near-identical well-formed ones labelled query. Rounds 2 and 3 jointly identify that as the single blind spot.Net effect on this issue
Rounds 1-2 verdicts stand undisturbed, and the last open question is now closed:
The boundary Round 3 draws is sharper than a flat rejection: Laya is plausible at closed-set selection among well-described alternatives, and measurably not viable at judging whether a request is answerable at all.
Full results in
LAYA_SPIKE_RESULTS.md(Round 3 section; Rounds 1-2 verified byte-identical). Environment and scripts remain in the session scratchpad.Filed separately, independent of Laya
Round 3 surfaced two defects in the shipped routing eval that would matter if Laya had never existed — no
route_multicoverage, and two arguable scenario labels. Tracked in their own issue rather than here.