Skip to content

Laya: A Non-Autoregressive Decision Engine for Agent Workflows

AINewss Editorial

Laya is an open-source System 1 decision engine that returns typed choices, scores and yes/no probabilities in one forward pass instead of generating text. This guide explains the classic encoder and the newer default engine, the three decision types, abstain and unbound flags, setup code, vendor benchmarks and honest limits.

View 2 references
0 views 0 likes

Allow the functional cookie to save your likes. Privacy details

A flow diagram showing text input splitting into typed decision outputs with probability bars.

What is Laya?

Laya is an open-source, non-autoregressive "System 1" decision engine that returns typed decisions — choice, score and yes/no — in a single forward pass instead of generating tokens. It is designed for classification, routing and scoring inside agent workflows where latency and deterministic output matter more than prose.

The project README on GitHub is the primary source. It is Apache-2.0 licensed and, at the time of reading on 2026-12-02, showed roughly 36k stars.

What are the three decision primitives?

A choice question picks one candidate from a labelled set and returns probabilities for each. A score question places the input on an ordered scale. A noul question answers yes/no with a probability. All three are declared in a questions dictionary and answered together.

import laya

agent = laya.Agent()
questions = {
    "department": {"type": "choice", "instructions": "Which team should handle this?",
                   "criteria": {"billing": "invoices, refunds",
                                "technical": "bugs, outages"}},
    "urgency": {"type": "score", "instructions": "How urgent?",
                "criteria": ["not urgent", "soon", "blocking"]},
    "churn_risk": {"type": "noul", "instructions": "Does the user threaten to cancel?"},
}
out = agent.predict("We were billed twice. Refund today or we cancel.", questions)

The result carries choice, probabilities, a prediction_set, abstain, unbound and a route value.

Is the 33 ms encoder still the default?

No. Since version 0.5.0, laya.Agent() loads a newer engine built on a frozen 0.8B reader plus a small physics-based decision layer. The classic encoder — the 100+ language, roughly 33 ms model — is still available by naming it explicitly as laya.Agent("convaiinnovations/laya").

What you call What you get
laya.Agent() New vega-based engine, 73,728-token context
laya.Agent("convaiinnovations/laya") Classic English encoder, ~33 ms
laya.Agent("convaiinnovations/laya-multilingual") Classic multilingual encoder

This distinction is the most common source of confusion in third-party tutorials, many of which still describe only the classic model.

What do abstain, unbound and route mean?

abstain means the engine declines to commit, with a threshold calibrated so that the error rate among answered items stays under a configured risk (10% by default). prediction_set is the conformal set of options still plausible at alpha 0.10. unbound reports inputs unlike anything the model knows, and route is auto or review.

The README warns that unbound fired on 71% of normal banking77 rows in measurement, so it should be reported but not used alone to route. Gate on route, not on a raw confidence number.

Can it handle images, audio and long documents?

Yes on the newer engine. predict() accepts image=, audio= or video= with the same question shape; audio is resampled to 16 kHz and transcribed in 30-second windows, and a silent video can be decided on four sampled frames. The documented context is 73,728 tokens.

The classic multilingual encoder is smaller: up to 8,192 tokens with max_len=8192. Optional extras cover vision, audio, HTTP server, MCP, LangChain and ONNX.

How do the probabilities stay calibrated?

The classic approach trained with reinforcement learning against strictly proper scoring rules, called RLCD in the project. The newer engine uses conformal prediction sets and reports Expected Calibration Error (ECE) on held-out rows. The README shows, for example, banking77 at 87.5% accuracy with ECE 0.028 after learning from a stream, compared with Jev 1.14 at 79.4% as shipped.

These are vendor-reported results on specified splits. They are not a guarantee for your domain, and the README itself lists cases where a large hosted model wins zero-shot.

Where does Laya lose?

On generic public zero-shot suites, a large hosted model still leads. As a prompt-injection gate on real traffic, the README reports Jev untaught catching 79.1% of attacks versus 73.0% for a fitted Laya head at the stated refusal rates. Release velocity also makes pinned versions important.

There is also a moving-target problem: the default engine changed at 0.5.0 and releases continue. Pin a version before benchmarking, and re-read the README when you upgrade.

Frequently asked questions

These answers reflect the current README as of December 2026. Because the default engine changed at version 0.5.0, older tutorials may describe behaviour that no longer applies; check the version you actually install and pin it in production. Re-read it after each upgrade.

Is Laya a chat model?

No. It does not generate prose; it returns typed answers and probabilities.

Does it need a GPU?

The classic encoder is designed to run on ordinary hardware; the project describes CPU and small-model operation. Check current extras for GPU builds.

Can I train it on my own labels?

Yes. agent.fit() accepts CSV or JSONL rows and holds out data for calibration; the README documents a 60-row example.

What licence is it?

Apache-2.0.

How do I choose between the engine and the encoder?

Use the classic encoder for short English text when a 33 ms decision matters, and the newer default engine for long documents, images, audio or anything needing a conformal set. The router can split between them automatically. Test both on your traffic.

The documented rule is ordered: image or audio goes to the newer engine; text beyond the fast model's context goes there too; so does non-English or non-Latin text, a question with a fitted head, and everything else of that kind. You can force either side explicitly. If your traffic is mostly short English messages, keeping the encoder in front saves reader cost; if you need auditable abstention, the newer engine's prediction set is the stronger choice.

Bottom line

Laya is a strong fit when an agent needs fast, structured, auditable judgments — routing, triage, risk scoring — and a poor fit for open-ended generation. Pin the version, choose deliberately between the new default engine and the classic encoder, and gate automation on route rather than on a confidence number.

References

  1. NandhaKishorM/laya — non-autoregressive System 1 decision engine (README)github.com
  2. laya README (raw)raw.githubusercontent.com