Text Classification
Transformers
Safetensors
Laya
system-one
calibrated-decisions
rlcd
classification
routing
scoring
guardrails
moderation
reinforcement-learning
commercial-use
Instructions to use convaiinnovations/laya with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use convaiinnovations/laya with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="convaiinnovations/laya")# pip install -U transformers accelerate # Load model directly from transformers import LayaTypedDecisions model = LayaTypedDecisions.from_pretrained("convaiinnovations/laya", device_map="auto") - Laya
How to use convaiinnovations/laya with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
Card: how it decides, what laya 0.5 adds, continuous learning and the latest benchmarks
Browse files
README.md
CHANGED
|
@@ -28,6 +28,52 @@ tags: [laya, system-one, calibrated-decisions, rlcd, classification, routing, sc
|
|
| 28 |
|
| 29 |
**Multilingual, non-autoregressive System 1 decision model.** Give it a **state** (text, email, ticket, or JSON) and **typed questions**; it returns typed answers with mathematically calibrated probabilities in a single forward pass (~33 ms) across 100+ languages. Trained with reinforcement learning against strictly proper scoring rules (**RLCD**), so reporting honest probabilities is the only way to maximise reward. It never generates text, so there is nothing to parse and nothing to hallucinate.
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
> **Train your own decision engine at [studio.embedding.in](https://studio.embedding.in).** Studio, from Embedding Space, trains a System 1 decision engine from a description of your company: it writes the questions and the examples, fits and calibrates a vega model, and gives you a signed policy file that runs on your own machine with `vegaml` (also reachable as `laya.Agent(vegaml=True)`). No labelled data is needed to start, and a new workspace gets $10 of free credit.
|
| 32 |
|
| 33 |
## Installation
|
|
|
|
| 28 |
|
| 29 |
**Multilingual, non-autoregressive System 1 decision model.** Give it a **state** (text, email, ticket, or JSON) and **typed questions**; it returns typed answers with mathematically calibrated probabilities in a single forward pass (~33 ms) across 100+ languages. Trained with reinforcement learning against strictly proper scoring rules (**RLCD**), so reporting honest probabilities is the only way to maximise reward. It never generates text, so there is nothing to parse and nothing to hallucinate.
|
| 30 |
|
| 31 |
+
<p align="center"><img src="https://raw.githubusercontent.com/NandhaKishorM/vegaml/main/assets/vega-valleys.svg" width="900" alt="How it decides: a frozen LLM reads the message once, every answer is a valley, and a particle rolls and settles in one. Where it settles is the answer, with its probability, conformal set, abstain and unbound flags." /></p>
|
| 32 |
+
|
| 33 |
+
**New in 0.5: laya reads images, audio and video, takes 73k tokens, says when it should not decide, and keeps learning.** All open source under Apache 2.0 (`pip install -U laya`).
|
| 34 |
+
|
| 35 |
+
- **Text, images, audio and video.** `agent.predict(...)` with `image=`, `audio=` or `video=` gives the same typed answers as for text.
|
| 36 |
+
- **73,728 tokens of context.** Whole contracts, threads and logs in one read.
|
| 37 |
+
- **Abstain and unbound**, explained below.
|
| 38 |
+
- **Physics, not text generation.** Each candidate answer is a valley; the input is a particle that rolls and settles in one. Deterministic, constant cost, nothing generated.
|
| 39 |
+
- **Any LLM as the reader.** One small decision engine on top of a frozen reader, from 0.8B to 27B.
|
| 40 |
+
- **Continuous learning.** `from laya import Learner`: it answers from day one and learns from every answer your team confirms, on your own machine, in seconds on a CPU with no fine-tuning.
|
| 41 |
+
|
| 42 |
+
### How abstain and unbound work
|
| 43 |
+
|
| 44 |
+
The input is placed as a particle in a small decision space where every candidate answer is a valley. Where the particle settles, and how deep, is the answer and its probability.
|
| 45 |
+
|
| 46 |
+
- **`abstain`**: it declines to commit. The threshold is calibrated so that, among the answers it does give, the error rate stays under the configured risk (10% by default).
|
| 47 |
+
- **`prediction_set`**: the conformal set, every option the answer could still be at `alpha` 0.10. One option means it is sure; two or more means the input really is ambiguous.
|
| 48 |
+
- **`unbound`**: the particle settled far from every valley, so the input looks unlike anything it knows (likely off-distribution). It is reported on every answer but does not route on its own: measured, it also fired on 71% of normal banking77 rows, so it would have sent most good answers to review.
|
| 49 |
+
- **`route`**: what to do with it, `auto` or `review`. Without labels, `review` when it abstains or the set holds more than one option. With labels (`agent.fit` / `agent.calibrate`), a band placed where precision holds at 95% on your rows decides. Gate on `route`, never on a confidence number.
|
| 50 |
+
|
| 51 |
+
### Benchmarks at a glance
|
| 52 |
+
|
| 53 |
+
**Continuous learning.** 14 decision templates (31 questions), each starting from about 600 generated examples, then learning from confirmed answers; scored on 60 held-out rows per template.
|
| 54 |
+
|
| 55 |
+
| | day one | after 40 confirmed answers | after 120 |
|
| 56 |
+
|---|---|---|---|
|
| 57 |
+
| laya, `laya.Learner` | 84.7% | 91.6% | **96.0%** |
|
| 58 |
+
| Jev 1.14, confirmed answers written into its criteria | **89.5%** | 91.5% | 92.6% |
|
| 59 |
+
|
| 60 |
+
Jev leads on day one (23 of 31 questions); they are level at 40; laya leads at 120 (12 wins, 7 losses, 12 ties). Jev cannot be taught, only prompted, and is a hosted API (364 ms a request from India).
|
| 61 |
+
|
| 62 |
+
**What learning costs.** laya learns from 300 answers in 34 s on 8 CPU threads, with no GPU (0.72 s an answer, 6.4 GB of RAM; on a GPU 40 ms and 2 GB). Fine-tuning the classic encoder on the same 300 rows takes 89 s on a GPU with 9 GB and rewrites all 421M weights.
|
| 63 |
+
|
| 64 |
+
**Learning from a stream, November 2026** (4B reader, held-out rows):
|
| 65 |
+
|
| 66 |
+
| | laya | Jev 1.14 |
|
| 67 |
+
|---|---|---|
|
| 68 |
+
| banking77, 924 held out, after 4,928 rows | **87.5%**, ECE 0.028, 92.5% routed auto at 91.5% precision | 79.4% as shipped (ECE 0.078), 85.7% with examples |
|
| 69 |
+
| typed-decisions, 2,000 decisions, after 1,200 rows | 73.7%, ECE **0.031** | 74.7%, ECE 0.047 (level) |
|
| 70 |
+
|
| 71 |
+
**Across readers**, one byte-identical decision engine, 50,676 held-out records: 0.8B 76.5%, 4B 79.1%, 27B 81.1%, ECE 0.010 to 0.021.
|
| 72 |
+
|
| 73 |
+
**Where it loses.** Zero-shot on generic public suites a large hosted model leads. As a prompt-injection gate on real traffic (ToxicChat, 1.8% attacks), Jev untaught catches 79.1% at 0.3% refused against 73.0% at 0.7% for a fitted head. The benchmarks further down are for the classic encoder checkpoints.
|
| 74 |
+
|
| 75 |
+
<sub>Under the hood the new engine comes from [vegaml](https://github.com/NandhaKishorM/vegaml), installed with laya. For the classic encoder, name it (`laya.Agent("convaiinnovations/laya")`) or pass `vegaml=False`.</sub>
|
| 76 |
+
|
| 77 |
> **Train your own decision engine at [studio.embedding.in](https://studio.embedding.in).** Studio, from Embedding Space, trains a System 1 decision engine from a description of your company: it writes the questions and the examples, fits and calibrates a vega model, and gives you a signed policy file that runs on your own machine with `vegaml` (also reachable as `laya.Agent(vegaml=True)`). No labelled data is needed to start, and a new workspace gets $10 of free credit.
|
| 78 |
|
| 79 |
## Installation
|