Laya · evidence-first contribution · generated 2026-11-28

What we did in Laya lab, PR #1538 merged in v0.5.6, and what's next

A complete, mobile-optimized explanation of the research programme, the merged pull request, the measured result, the honest abstention finding, the current state of Laya/Vega, and a ranked list of what else can be contributed.

PR #1538 · MERGED Laya v0.5.6 3 files · +4,971 / −0 No library code No claimed peer review

One-paragraph summary

You started with a rigorous, mostly unsubmitted research programme in laya-lab. Only two pieces were ever packaged upstream at first: PR #696 (a state-budget docs + test correction, merged in v0.3.22 and now in CI) and PR #697 (a position-sensitivity benchmark for the classic encoder, merged in v0.3.22 and a headline finding). The rest — a powered n=200 baseline, the mechanism probe, the frozen-encoder head fine-tune, the cross-attention negative, the refuted interventions, and a launch audit — remains a research portfolio. We then packaged the one piece that answers a current question in the new engine: PR #1538, a three-file research PR measuring the default Vega engine's accuracy against evidence position at fixed document length, on the same 20-item construction as #697. It was audited independently, every prediction was committed, only four pre-specified paired tests were reported, and it is merged into Laya v0.5.6.

Maintainer, on merging #1538: “Merged in 0.5.6, thank you. A careful study, and an honest reading of the abstain rate. The C++ ONNX failures were the ONNX Runtime outage, fixed by #1541.”

— NandhaKishorM, github.com/NandhaKishorM/laya/pull/1538

Current situation analysis

State as of 2026-11-28, retrieved from GitHub APIs and the upstream repo. “Retrieved” means read from a page/API this session; “claimed” means asserted by a doc or maintainer, not independently verified.

Laya / Vega

Latest release
Laya v0.5.6 (2026-11-27). Previous: v0.5.5, v0.5.4, v0.5.3. retrieved
Default engine
Since v0.5.0 (2026-11-19), laya.Agent() loads Vega: a frozen 0.8B reader (nandakishorm/vega-U) + the vegaml decision engine. retrieved
Classic encoder
Not deprecated; a stable maintenance/compatibility path. Name a checkpoint or pass vegaml=False. Frozen weights. The long-context benchmarks are labelled “for the classic encoder.” retrieved
vegaml
Separate Apache-2.0 engine repo; vegaml>=0.18.0 is a core dependency; installed 0.19.0. Frozen LLM reader + 14.3M-parameter physics head; 73,728-token context; conformal sets, abstain, unbound, route; optional continuous learning. retrieved
Scale
~35.9k stars, ~3.2k forks, 1,035+ merged PRs, 53 open issues + 52 open PRs, release every ~17h; ~252k PyPI downloads/month. retrieved
Commercial
Open core. Vega Proxy + Studio on platform.embedding.in; not required for this contribution. retrieved

Your three merged contributions

All merged by NandhaKishorM. Source: GitHub PR pages + release notes.
PRWhat it didShipped
#696Corrected the state budget to max_len − head_len − 1; added tests/test_state_budget.py; wired CI + release. Later extended three times; now in scripts/test_suites.py. README text survives verbatim.v0.3.22
#697Added bench_position_sensitivity.py, a committed n=20 JSON, and a README section. Result is a headline finding in research/README.md.v0.3.22
#1538Added bench_vega_position.py, a 240-prediction JSON, and a README finding. First independent position × length curve for the default Vega engine; honest abstention finding. No library change.v0.5.6

CI / merge status now

Your lab, beyond the PRs

The laya-lab repo is a 100-commit, pre-registered research programme (78 commits authored by you, 18 by an engineer session, 4 by a launch audit). It contains 13 findings, 16 experiment directories, 68 ledger claims, a 2,000-row powered baseline, a 600-item extension, and an independent re-derivation. PR-PLAN called it “the safe subset”; the rest was never packaged. The public repo’s launch README/audit is still unpushed (4 commits ahead), and a separate laya-contributions explainer site is deployed locally. Those are public-credibility tasks, not upstream PRs.

What exactly we did

  1. Audit first. An independent subagent audited the proposed PR before any code. Verdict: GO WITH CHANGES. It verified the Vega API, the construction, the novelty/collision map, the 8 GB feasibility, and the PR shape; it caught three issues we fixed.
  2. The fixes. Load one arm at a time and free it before the next; report exactly four pre-specified paired tests (not 14); honest top-cell labelling; and document the OOM.
  3. Isolated branch. Fresh worktree from current upstream/main (v0.5.3 → merged onto v0.5.6), branch pr/vega-position-sensitivity. No laya/ or vegaml/ code change.
  4. Fresh environment. Python 3.12 venv, torch 2.11.0+cu128, transformers 5.24.0, vegaml 0.19.0, editable laya 0.5.3, plus flash-linear-attention. The old lab venv (transformers 4.57.6) could not run Vega.
  5. Smoke test. Single 72k-nominal call. It OOM'd on the 8 GB card even with fla; 48k-nominal passed (46,954 prompt tokens, no truncation, ~4.7 s/call). The reference gated-delta-rule fallback OOMs even at 48k without fla.
  6. Full grid. Vega at 7k / 32k / 48k × start / middle / end + classic laya-multilingual at 7k × start / middle / end. 20 requests/cell. 240 predictions. GPU lock used. One arm at a time.
  7. Artifacts. Script + committed JSON + README finding. Every number re-derivable from committed rows with --analyse (no model). No fabricated numbers; local gates passed.
  8. Opened + merged. Commit 73fc8409 → PR #1538 → merged e4d81b0c → v0.5.6.

The experiment, precisely

Construction reused from #697. Every cell: n=20, balanced construction, one filler, one question, one machine.
TaskNeedle-in-haystack choice. A short labelled request (billing/technical/sales/other) embedded in domain-matched repeating filler at a known fraction of a fixed-length document.
20 requestsSame 20 requests in 8 languages as bench_position_sensitivity.py; 9 billing / 7 technical / 4 sales / 0 other → majority floor 0.45.
Questiondepartment choice, 4 options, identical wording as #697.
Constructionplace(reps, frac, request); same FILLER, same "\n\nActual request: "; frac=1.0 byte-identical to #697; classic 7k reproduces #697's cells exactly.
Vega armlaya.Agent(vegaml=True, device="cuda"); predict_long(state, questions); nandakishorm/vega-U; max_len=73,728; one read, no windowing.
Classic armlaya.load("convaiinnovations/laya", subfolder="multilingual"); predict(..., max_len=8192); 7k, below the state room.
LengthsFiller tokens under the classic tokenizer; report the reader's own usage["input_tokens"]. Vega lengths 7k/32k/48k; classic 7k.
Positions0.00 start / 0.50 middle / 1.00 end. Position 0.0 places the request right after the options; 1.0 at the end.
MetricsForced-choice accuracy choice == gold; Wilson 95% CI; majority floor 0.45; per-class recall; modal share; abstain rate; route=review rate; truncated count; latency; exact McNemar.
Truncationusage["truncated"] + input_tokens per case. No cell truncated. The 72k attempt OOM'd; that is hardware, not accuracy.

The result

Accuracy

Forced-choice accuracy, positions start / middle / end:

Engine7k32k48k
Vega 0.8B · start0.7500.5500.450
Vega 0.8B · middle0.4500.4000.350
Vega 0.8B · end0.7500.7500.750
classic multilingual · 7k0.8500.5000.400

Classic row is start / middle / end at 7k. Classic has no abstain/route. Majority floor 0.45; random 0.25. Wilson CIs in the committed JSON.

The four pre-specified paired tests

Exact two-sided McNemar on the same 20 items. Only these four; everything else is descriptive. With n=20, testing every pair would be 14 comparisons and would not survive multiplicity correction.

TestDiscordantp
Vega · 48k · start vs middle2 / 00.50
Vega · 48k · middle vs end0 / 80.0078
Vega · end · 7k vs 32k0 / 01.0
Vega · end · 32k vs 48k0 / 01.0

The abstention finding — the honest headline

Vega abstains and routes to review on 17–20 of 20 items in every cell (0.85–1.00).

The accuracy above is forced-choice, not auto-route accuracy. The engine reports abstain, unbound, prediction_set, answer_confidence, route, and route_reason; on this synthetic, repetitive construction it mostly says “review.” The auto-routed subset is 0–3 items, too small to score. The classic encoder has no abstain/route; it answers all 20, often confidently wrong.

This is not “Vega is worse.” It is the opposite: the engine flags a hard, OOD construction instead of pretending to answer. The maintainer explicitly called it “an honest reading of the abstain rate.”

Interior collapse

At 32k/48k, interior cells collapse toward a constant answer (modal prediction share 0.90–1.00 at the 32k middle, 48k start, and 48k middle cells); the end cell is not. The start falls with length (0.75 → 0.55 → 0.45); the middle falls (0.45 → 0.40 → 0.35); the end is flat at 15/20.

Power/caveats

What it means — and what it doesn’t

It means

  • First independent position × length curve for the default Vega engine.
  • Vega forced-choice is end-best at 7k/32k/48k; classic at 7k is start-best. Prompt layouts differ; it is a measurement, not a mechanism.
  • Length at the end position is flat; interior falls with length.
  • The engine abstains/routes to review on most of this synthetic construction. That is a real, useful output.
  • 72k is not runnable on 8 GB even with fla; 48k is the measured top cell here.
  • This is not a router change, a library change, or a “Vega vs classic” ranking; the classic 7k cell is a construction control.

It doesn’t mean

  • “Vega is worse.” It routes most items to review.
  • “The 0.831 longctx claim is false.” Different construction; not a replication.
  • “It is definitive.” n=20, synthetic, OOD filler, one filler/question, one machine.
  • “The cross-attention work in the lab should be submitted.” It is inference-inert; see the portfolio.
  • “All lab claims are proven.” The ledger has 32 candidate + 15 reproduced; P1b is still candidate; arm2 is unconverged.

Your full lab portfolio (not just PRs)

The user’s point is correct: the lab is much bigger than #1538 or even #696/#697. Not all of it should be a PR.

The scientific arc

  1. Reproduce upstream exactly on upstream’s own texts; then a balanced n=200/cell synthetic harness with paired tests.
  2. Two regimes: truncation at 1,024 (request tokens kept = 0.00) vs partial use at 8,192 (request present, accuracy still falls 0.840 → 0.420).
  3. Position: n=20 merged (#697); n=200 U-shaped 0.580/0.295/0.335/0.280/0.415 in the lab; merged result later extended to Vega (#1538).
  4. Mechanism: marker features carry the label at 0.820 on held-out templates while the shipped head returns 0.300; random_pos control 0.44. The encoder is not the bottleneck; extraction is. candidate
  5. Positive: fine-tune the shipped head with the encoder frozen → +9.5pp at the primary cell across three seeds (+15–19pp mid-document on larger seed ranges); not converged; arm2_random_init never run. lab artifact
  6. Negative architecture: init-fair cross-attention is inference-inert — 0.472 vs 0.472, 8/600 flips, 4/4 symmetric at n=600. measured
  7. Refuted: RoPE scaling (identity in-window), sliding-window widening (reverses at n=120), all-layers-global (0.000 at pad=1000), bf16=fp16=fp32. measured
  8. Audit: independent re-derivation, drift gate, red-team, 18 stated limitations; corrected its own overwritten seed artifact, wrong n, stale PR status, etc. measured

What is verified vs not

What else can we contribute?

The PR is merged; here is a ranked, realistic shortlist. Signal first for a new research PR. Avoid #1452/#1266/#1267 unless coordinating. Do not submit the cross-attention head. No router tuning; the maintainer has declined that framing.

1. Follow-up research PR: auto-route accuracy + calibration for Vega at long context highest value

Your merged finding is that forced-choice ≠ auto-route. The natural next measurement: among route="auto", what is accuracy and coverage? ECE / reliability of answer_confidence, prediction_set, unbound? And does agent.fit(...) on a small number of items reduce the 85–100% review rate and improve accuracy on this construction, at 7k/32k/48k?

2. Power + natural-text arm of your own result

n=20 → n=200 balanced 4-class; replace repetitive filler with natural text; test whether abstention drops and accuracy stabilizes; test 72k on a larger GPU; paired classic-vs-Vega on identical items.

3. Small docs follow-up on your merged work

A tiny docs PR qualifying the main README’s “with vegaml=True… 73,728 tokens whole” with the measured 48k/8 GB limit and abstention rate, linking research/results/vega_position_sensitivity.json. Highest merge probability; lowest value.

4. #1452 paired predict/predict_long evaluation — offer, don’t take

The cleanest unclaimed measurement ask, but it is owned by xinpingzh and has had maintainer silence. Comment offering your paired-test harness; don’t implement unilaterally. Note default Vega predict_long is read-whole, not windowed; #1452 is about classic predict_long. #1266/#1267 is claimed/stale; don’t duplicate.

5. P1 sliding-mask perf benchmark, re-measured on current main

Your earlier finding (all 22 layers receive dense 7069×7069 masks; ~4.40 GB masks; sliding ≈ global in SDPA; CPU already windows; TileLang fast=True already windows on GPU) was on v0.3.20 and not re-measured on v0.5.6. Benchmark-first; no accuracy claim; now that CI ONNX is fixed. Lower strategic value since Vega is the default.

6. Publish the lab (not an upstream PR)

7. Write up the mechanism + negatives (not a code PR)

P1b + arm2 + H5 + the audit is a coherent story: the encoder carries the information, the head does not use it, fine-tuning recovers part, and the architectural fix is inference-inert. Better as a long-form post or preprint; this PR-page is the same idea applied to Vega.

8. Contribute to vegaml separately (optional)

The engine repo is younger and very active; your measurement harness could target engine-specific issues. The user’s goal is Laya contribution; this is optional.

What not to submit

Concrete next steps

  1. Confirm the merged PR at github.com/NandhaKishorM/laya/pull/1538 and the v0.5.6 release note.
  2. Re-derive the table locally, no model: python research/scripts/bench_vega_position.py --analyse research/results/vega_position_sensitivity.json.
  3. Pick contribution #1 (auto-route accuracy + fitted-vs-zero-shot for Vega at long context) or #3 (tiny docs follow-up). Open a short issue signalling; research is first-class.
  4. Push the lab launch branch and fix stale docs.
  5. Use this page as the reference; it is a snapshot, not a live dashboard.

One-paragraph description you can reuse

With PR #1538 merged in Laya v0.5.6, I have three upstream contributions. #696 corrected the state budget and added a CI test. #697 measured the classic encoder’s evidence-position sensitivity. #1538 added the first independent position × length curve for Laya’s default Vega engine, on the same 20-item construction as #697. On this synthetic stress test, Vega’s forced-choice accuracy is end-best (0.75 at 7k/32k/48k) versus start-best for the classic encoder (0.85/0.50/0.40 at 7k); only middle-vs-end at 48k is significant (0/8, p=0.0078); length at the end is flat. The honest headline is that Vega abstains and routes to review on 85–100% of the items, so accuracy is forced-choice, not auto-route; the maintainer called it “a careful study, and an honest reading of the abstain rate.” It is a three-file research PR with no library change, every prediction committed, four pre-specified tests, and documented limits (n=20, synthetic, 48k top cell on 8 GB, 72k OOM even with flash-linear-attention).

Provenance, tags, and limits

measured = re-derived this session or in the committed artifact. retrieved = read from GitHub/HF/PyPI this session. claimed = asserted by a doc/maintainer, not independently verified. No number is invented; where the lab itself marks a claim candidate or unconverged, this page says so.

Environment (measured on the committed run)

Commands

# re-derive, no model
python research/scripts/bench_vega_position.py --analyse \
  research/results/vega_position_sensitivity.json

# run the grid (8 GB; install flash-linear-attention first)
python research/scripts/bench_vega_position.py --device cuda \
  --lengths 7000,32000,48000 --classic-lengths 7000 \
  --positions 0.0,0.5,1.0 --arms vega,classic \
  --out research/results/vega_position_sensitivity.json

# upstream gates
ruff check laya/ --select=E9,F63,F7,F82,F401,F811 --line-length=120
python -m compileall -q laya/ tests/

Links