Laya v0.3.5 released: Adds support for high-count multiple-choice questions and fixes routing and thread safety issues.

Laya v0.3.5 released: Adds support for high-count multiple-choice questions and fixes routing and thread safety issues.

1 month ago
duguying
21 views
Source: GitHub Releases

Laya, an open-source engine for performing structured decision-making in a single forward pass of 33ms, releases version 0.3.5: This release includes several community contributions, including the addition of a "predict_shortlist" feature for embedding high-number multiple-choice questions, and fixes for 11 pull requests related to Armenian language routing recognition, thread safety within the model lifecycle, and single-option crashes. The Python version now requires at least 3.10.

Related tags

#Laya#决策引擎#机器学习#开源软件#Router#NLP

Laya v0.3.5 Release: Embedding shortlist to support high-cardinality questions, routing and thread safety fixes

11 PRs, contributions from multiple first-time contributors: Laya, an open-source decision engine with a single forward pass of 33ms to generate structured decisions, releases v0.3.5, adding the ability to embed shortlist for high-cardinality questions, and fixing multiple production-level issues such as Armenian language recognition, thread safety, and email disclaimer misinterpretation.

Release Overview

Laya is a multi-lingual, non-autoregressive System 1 decision engine: It does not generate text, but directly outputs structured decisions with types in a single forward pass – 33ms per question in single-shot mode, and only 7.2ms per question in batch mode (T4 measured). The model is trained using reinforcement learning against strict truth value scoring rules (RLCD), which ensures the confidence score has statistical significance.

v0.3.5 was released on September 21, 2026, and includes 11 PRs, with 10 contributors being first-time participants, representing a typical community-driven stability iteration.

Key Features

1. Embedding shortlist for high-cardinality questions (New Feature)

Laya's option prompting and document state sharing use a fixed head_max_len token budget, which limits the number of tags that can be assigned to each label in scenarios like Banking77 with 77 options – accuracy will significantly decrease. v0.3.5 introduces optional shortlist embedding (predict_shortlist): First, use the embedding function provided by the caller to filter out the top-k tags, and then perform a forward pass on the short list. Community feedback shows that the top-20 zero-shot shortlist has improved the accuracy of a Banking77 run from 54.3% to 60.8%.

2. Routing and language recognition fixes

  • Armenian language recognition (#23): Fixes the issue where the Router cannot recognize Armenian text during routing requests. The Router performs pure Python detection of the text system at sub-millisecond speed before forward propagation, ensuring high confidence even when the model is in an incorrect language (e.g., Korean with 0.000 accuracy and 0.952 confidence). Routing decisions must be made before inference.
  • No longer assumes that unrecognized Latin languages are English (#42): The temperature parameter is clamped to avoid misrouting.
  • Email disclaimer footer (#94): Requests are no longer dropped when the disclaimer and body share a single paragraph.

3. Stability and packaging fixes

  • Model lifecycle thread safety (#100): Fixes the model lifecycle competition issue in the Router (corresponding to issue #95), preventing crashes in multi-threaded service scenarios.
  • Choice crash when only one option is present (#103): Fixes a crash in DecisionModel.forward when there is only one option.
  • On-demand checkpoint download (#98): Now, only the runtime files for the selected checkpoint are downloaded, reducing bandwidth and disk usage.
  • Python version minimum increased to 3.10 (#46): huggingface_hub 1.x, transformers 5.x, and torch 2.14 all require 3.10, and outdated metadata copies have been cleaned up.

4. Benchmark infrastructure (14)

The author has submitted the benchmark harness and original results. All numbers can be reproduced on T4 in notebooks/laya_benchmark_colab.ipynb.

Why it's worth paying attention to: A single forward decision model

Laya has three checkpoints and the built-in Router form a complete decision stack:

checkpoint encoder parameter size context applicable
laya ModernBERT-large 421M 512 English
laya-multilingual mmBERT-base 322M 1024 100+ languages, 2x faster
laya-typed-decisions ModernBERT-large 421M 1024 typed-decisions workflow

It provides three decision primitives:

  • choice: Category routing, intent classification, outputting the probability and confidence for each option;
  • score: Ordinal scoring (urgency, severity), output distribution;
  • noul: Calibrate P(true) for fishing detection, spam filtering, jailbreaking detection, churn risk.

On the 17,416 question shared benchmark, the Router routing mode achieves both English tasks with 0.783 (MASSIVE intent) / 0.860 (XNLI), and other languages with 0.451/0.731, making it available for 45 out of 51 languages, with a single question latency of 32.8ms. The recommended production deployment is Router(preload=True) to preload all checkpoints, otherwise language switching will trigger a model reload of 7~10 seconds.

Due to the use of strict truth value scoring rules for training the probabilities, the confidence score can be directly used for automated gating – high confidence automatically executes, low confidence upgrades to manual intervention. The project also includes four pre-set workflows: model routing, prompt shielding (jailbreaking/injection/disclosure), content review, and task triage.

Honest Limitations

The author explicitly lists the limitations in the README: the base checkpoint has a near-random accuracy of 0.36 in typed-decisions zero-shot, the 0.766 score comes from fine-tuned checkpoints – Laya's positioning is to be a "fast specialization base" rather than a zero-shot decision engine; the ordinal score is the weakest primitive (SST-5 0.372); for single questions with more than 50 options, you need to increase head_max_len or use shortlist.

Installation and Upgrade

pip install laya   # Python 3.10+

Model weights and fine-tuning notebook (free 2xT4 on Kaggle, approximately 4~5 hours for 4 epochs) are all available on Hugging Face, with an Apache 2.0 license.

More News

Want to see more quality content?

Browse all news