Laya the open origin type of Jev

Hacker News by 9 min read 544x views
Laya the open origin type of Jev

Share Post

Everyone in AI correct now is talking concerning a new benevolent of model: an architecture that is not autoregressive, does not create text, and gives lightning-fast probability predictions complete organized schemas.

Seeing the hype online feels the two validating and deeply frustrating.

I worked on this exactly one twelvemonth rear in March 2025. I spent months of difficult work, sweat, and sleepless nights construction it, published an arXiv document (arXiv:2503.23303), released the example weights on Hugging Face (sales-conversion-model-reinf-learning), published the open dataset (saas-sales-conversations), built a PyPI package, and posted the entire method on Reddit (r/LocalLLaMA discussion).

Then in September 2025, I published a second document (arXiv:2510.01237), formalizing the example for schema-based decisions guided by reinforcement learning. The directing brain in my scheme was continually reinforcement learning, not fair an embedding example or an autoregressive LLM.

And afterward in September 2026, a well-funded frontier lab called TypeSafe AI (founded by Diogo Almeida, a co-inventor of ChatGPT at OpenAI) launched Jev. They projected the exact identical non-autoregressive decision idea as if it was a brand-new specialized breakthrough. Except they launched without specialized papers, without open weights, and alongside zero open training datasets.

My before example used PPO complete sequence representations to output turn-by-turn conversion trajectories (probabilities from 0.0 to 1.0) in vertical revenue conversations. Jev generalized parallel sampling using what they called RLCD (Reinforcement Learning for Calibrated Decisions) to output confidence distributions and schema choices horizontally, charging $0.042 per myriad input tokens alongside representative reply times about 150 ms.

Instead of staying bitter, I decided to obtain everything I learned, fix all architectural limitation of the old approach, and build a entirely open, horizontal System 1 decision example family: Laya.

And since we built it correctly on bidirectional encoders, our models run in 32.8 milliseconds on a sole GPU (7.2 ms/question batched), making it 6 to 8 times faster than Jev, alongside complete assistance for complete 100 languages, zero API subscription costs, and 100% open-source Apache 2.0 weights.


1. The Core Realization: System 1 vs System 2

Every contemporary AI pipeline has a elephantine bottleneck: we use generative LLMs for uncomplicated reflex decisions.

When a client assistance ticket arrives, or an email hits your inbox, or a person submits a immediate to your API, you normally lone need to answer simple, organized questions:

  • Which division should this ticket path to?
  • Is this incoming email a phishing assault or spam?
  • Is this immediate trying to jailbreak or inject instructions?
  • How urgent is this matter on an ordinal rubric (0 to 3)?
  • Does this query necessitate code implementation or a uncomplicated actual reply?

Calling an 8B, 70B, or frontier generative LLM for this is complete overkill. You delay 500 ms to 2,000 ms for tokens to stream out, expend genuine prosperity on inference, and afterward have to compose regex or JSON parsers to extract a spotless tag from free-form text. Worst of all, LLMs affection to hallucinate and create counterfeit confidence. When an LLM outputs "confidence: 0.95", it is fair predicting tokens that audio confident. There is zero mathematical calibration rearward it.

We needed a example that plant akin the individual brain's System 1: instant reflex decisions alongside honest, calibrated probabilities, taking lone 30 to 35 milliseconds on norm commodity hardware.


2. The Three Decision Primitives

Laya evaluates typed questions complete any province (raw text, email, ticket, or JSON document) in a sole onward pass. It relies on three primitives:

  1. choice: Pick one choice from a dictionary of criteria. Returns the selected key, probability allocation throughout all options, and a calibrated confidence score.
  2. score: Place the province on an ordinal rubric (levels 0, 1, 2, ...). Returns the expected level, the allocation complete rubric ranks, and confidence.
  3. noul: A straightforward boolean inquiry returning calibrated probability P(true) from 0.0 to 1.0 (with P(false) = 1 - P(true) by construction).

Because the output area consists purely of probabilities and numbers, the example never generates text, cannot hallucinate, and schema violations or malformed JSON are physically impossible.


3. The Three Checkpoints & Bundled Hub Architecture

One example cannot be optimal for all project and language. We released three specialized checkpoints, now consolidated under a sole repository hub on Hugging Face:

Selective Subfolder Downloads

Rather than forcing users to oversee three distinct repositories or download 2.5 GB of blended weights, the chief repository convaiinnovations/laya bundles all three. Using Hugging Face's allow_patterns, Laya's SDK downloads lone the particular subfolder requested:

# Downloads English example (~808 MB) agent_en = laya.load("convaiinnovations/laya") # Downloads ONLY the multilingual subfolder (~647 MB), not the complete 2.5 GB bundle agent_ml = laya.load("convaiinnovations/laya", subfolder="multilingual")

4. Why Routing Is Essential: The Multi-Script Reality

One of the most eye-opening findings from our 51-language clear on the MASSIVE benchmark (20 options, random baseline = 0.050) was how English models neglect exterior Latin script.

ModernBERT-large's 50,000-token English BPE vocabulary merely shreds non-Latin alphabets:

  • Khmer: 0.000 accuracy at 0.952 average confidence. Not one accurate decision in 100 questions, during reporting ~95% confidence.
  • Armenian: 0.050 accuracy (exact coin-flip random) at 0.885 confidence.
  • Hebrew: 0.060 accuracy at 0.964 confidence.
  • Bengali: 0.080 accuracy at 0.945 confidence.
  • Hindi: 0.100 accuracy at 0.941 confidence.

This is the crucial lesson: the model's own confidence gives no alert whenever it cannot peruse the input script. Across 51 languages, the English checkpoint's average confidence never drops below 0.885, despite of whether its accuracy is 82% or 0%.

Therefore, confidence gating cannot defend you. The decision of which example to use must be made before the onward pass.

Sub-Millisecond Pure Python Routing

Laya includes a built-in Router that inspects the Unicode scripts of incoming content throughout 22 alphabets (Devanagari, CJK Han, Cyrillic, Arabic, Hebrew, Tamil, Thai, etc.) and analyzes Latin stopword distributions:

  • Standard English text: 0.09 ms finding overhead.
  • Devanagari / Indic text: 0.54 ms finding overhead.
  • Large 200-row nested JSON documents: 0.73 ms finding overhead.

Compared to a 33 ms onward pass, routing overhead is negligible (<2%). And alongside Router(preload=True), all required models remain inhabitant in VRAM/RAM, entirely eliminating the 7 to 10-second cold-swap penalty whenever traffic alternates between languages.

from laya import Router # Preload checkpoints into recollection for instant sub-35ms routing router = Router(preload=True) # English -> automatically routed to ModernBERT-large res_en = router.predict({"body": "I was charged twice, delight refund."}, questions) # Hindi -> automatically routed to mmBERT-base (100+ languages) res_hi = router.predict({"body": "मुझसे दो बार शुल्क लिया गया, कृपया पैसे वापस करें।"}, questions) # Explicit override whenever you already cognize the domain res_spec = router.predict(state, questions, model="typed-decisions")

5. Head-to-Head: Laya (with Routing) vs TypeSafe Jev

We benchmarked Laya immediately against TypeSafe Jev throughout community datasets and norm benchmarks. Every Laya figure is measured; Jev numbers are published by third-party autonomous studies (AbdelStark, nibzard) and TypeSafe AI.

Benchmark / MetricTypeSafe Jev 1.13.0Laya (Routed)Advantage / Delta
typed-decisions (2,000 decisions)0.7270.766+3.9% (beats 0.735 instructor ceiling)
AG News (4 labels)0.9100.950+4.0% higher accuracy
DAIR Emotion (6 labels)0.480 (Brier 0.846)0.595+11.5% higher (Jev had 16% zero prob)
Calibration Error (ECE)0.2460.0813x improved probability calibration
Latency P50 (1 Question)236 – 276 ms32.8 ms7.8x faster execution
Latency P50 (10 Questions Batched)~1,500 ms (serial)72.3 ms (7.2 ms/q)20x faster on batched calls
Usable Languages (> 3x random)No published benchmark45 of 51 languagesGlobal tongue coverage
Cost per 1M tokens$0.042 (metered API)$0.00 (self-hosted)100% liberated Apache 2.0
Model Weights & CodeClosed proprietary APIOpen-source safetensorsAir-gapped & on-premise capable

Real-World Application Workflows

Across 9 evaluated endeavor workflows, Laya demonstrates production-ready decision quality:

  • Email Spam Filtering (Enron): 0.993 accuracy, 0.993 F1, 0.013 ECE.
  • Phishing Detection: 0.980 accuracy, 0.979 F1, 0.012 ECE.
  • LLM Guardrails & Jailbreaking (held-out ToxicChat): 0.755 – 0.762 accuracy. At 50% selective coverage, accuracy reaches 0.931.
  • RAG Passage Relevance Filtering: 0.657 accuracy in sole onward pass.
  • Support Ticket Queue Routing (10-way): 0.522 accuracy.

6. Honest Limitations: Where Laya Has Ceilings

Too many AI announcements conceal their weaknesses. We accept in engineering honesty:

  1. Choice questions degrade alongside >20 options: In our emphasis test on Banking77 (77 labels), Laya scored 0.425 against Jev's 0.870. This is an architectural prosperity constraint: options portion a 192-256 token head_max_len budget, leaving lone ~3-4 tokens per applicant at 77 options. Recommendation: Keep choice schemas under 20 options, or use a two-step coarse-to-fine hierarchy.
  2. Zero-shot vs. Fine-tuning: Out-of-the-box basis models mark ~0.35 on the typed-decisions benchmark (near random). The 0.766 mark is achieved by fine-tuning on the benchmark's train split. Treat Laya as a accelerated basis example to specialize, not as an prudent zero-shot oracle.
  3. Temperature Calibration: Base weights container alongside raw heat logits. Fitting a sole scalar heat per inquiry category on your domain allocation cuts expected calibration error from 0.466 to 0.081.

7. Quickstart: Running Laya in 30 Seconds

pip instal laya>=0.3.3

Here is a complete example operating multi-schema decisions alongside automatic tongue routing:

import laya from laya import Router # Initialize router alongside preloading (avoids toggle delay) router = Router(preload=True) # Define complex state ticket = { "ticket_id": "TCK-8821", "customer": "enterprise_user", "subject": "System downtime and billing dispute", "body": "Our manufacturing API has been failing since 6 AM. We misplaced crucial transactions. We petition an contiguous SLA refund." } # Define multiple questions of distinct primitives questions = { "queue": { "type": "choice", "instructions": "Which engineering queue owns this ticket?", "criteria": { "infrastructure": "server outages, network downtime, repository failures", "billing": "refunds, SLA credits, invoice disputes", "security": "breaches, exposure reports", "support": "general client inquiries" } }, "urgency": { "type": "score", "instructions": "How urgent is this ticket?", "criteria": ["low priority", "medium", "high priority", "critical blocker"] }, "churn_risk": { "type": "noul", "instructions": "Does the client endanger to cancel or province serious churn intent?" } } # Single onward pass: evaluates all questions simultaneously res = router.predict(ticket, questions) print("Routing Decision :", res["routing"]["model"]) # -> english print("Assigned Queue :", res["answers"]["queue"]["choice"]) # -> infrastructure (confidence: 0.96) print("Urgency Score :", res["answers"]["urgency"]["score"]) # -> 2.87 / 3.0 print("Churn Risk :", f"{res['answers']['churn_risk']['noul']:.1%}") # -> 91.4%

8. Resources & Community


Conclusion

It took a twelvemonth of research, from our March 2025 arXiv document to today, but the center realization remains: not all AI issue requires an autoregressive chatbot.

For high-volume classification, guardrails, routing, and triage, a sub-35ms bidirectional decision example trained alongside RLCD delivers 7.8x faster implementation than proprietary alternatives, zero hallucinations, earth tongue routing, and honest confidence scores you can really branch on in manufacturing code.

And finest of all, it is 100% open-source for the complete community.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads