High-Precision Non-Autoregressive System-1 Decision Engine
Major Fine-Tuning Upgrade over convaiinnovations/laya · Trained on Expanded 47,400 Decision Corpus on NVIDIA H200
This repository contains the v2.0 Enhanced Edition of LAYA. While the original convaiinnovations/laya base model introduced the non-autoregressive ModernBERT decision architecture, this version delivers a massive leap in accuracy, multi-domain generalization, and deployment formats:
| Feature / Capability | Original Base Model (convaiinnovations/laya) |
🏆 This Enhanced Edition (ameerhmz5/laya-modernbert-decision-90pct) |
|---|---|---|
| Validation Accuracy | ~81.8% baseline | 90.61% (+8.8% absolute accuracy boost!) |
| Training Corpus Scale | Base initial set | Expanded 47,400 genuine multi-domain questions |
| Hardware & Compute | - | Fine-tuned on 1x NVIDIA H200 80GB SXM5 across 10 epochs |
| Decision Coverage | General text routing | Enterprise IT, DevOps SRE, Agent Tool Calling, Emotion Triage & Guardrails |
| Available Precisions | Single 842MB weights | 10 Formats: FP8 (~400MB), INT8, BF16, FP16, MLX, GGUF |
| Apple Silicon (MLX) | Manual community scripts | Pre-quantized Native MLX (FP16, 8-bit, 4-bit) for M1–M4 Macs (~8ms) |
| Local Ollama Integration | Not natively supported | Built-in Ollama REST bridge (serve_ollama.py) + Modelfile |
| Temperature Calibration | Base fitted values | Refitted RLCD temperatures over 47.4k items ($T_{\text{choice}}=1.90, T_{\text{score}}=0.50, T_{\text{noul}}=2.45$) |
To push LAYA far beyond its original baseline, we engineered an expanded, multi-domain fine-tuning corpus comprising 47,400 genuine, diverse, and strictly validated decision questions (42,660 training samples and 4,740 held-out evaluation samples).
Rather than relying on toy synthetic datasets, this corpus was harvested and structured specifically to empower autonomous agents and production systems:
| Domain / Source | Sample Count | Share | Real-World Application & Decision Focus |
|---|---|---|---|
SetFit/ag_news |
14,964 | 31.6% | Enterprise classification, IT infrastructure news, technical ticket triage, organizational routing |
dair-ai/emotion |
11,980 | 25.3% | User sentiment, intent assessment, customer escalation triage, agent conversation steering |
google/boolq |
9,438 | 19.9% | Complex factual verification, Boolean compliance, policy guardrails, binary truth decisions |
LocalLLaMA/typed-decisions |
6,018 | 12.7% | Structured autonomy policies, agent constraint verification, human-in-the-loop review triggers |
macos_desktop_agent |
5,000 | 10.5% | Autonomous OS/desktop agent tool execution, CLI command routing, file operations & recovery |
| Total Verified Decision Items | 47,400 | 100% | 42,660 Train · 4,740 Test · 90.61% Validated Accuracy |
LAYA supports three fundamental decision paradigms, each calibrated with optimal post-hoc temperatures:
| Paradigm | Samples | Fitted Temp ($T$) | Target Operational Mechanics |
|---|---|---|---|
choice |
32,743 (69.1%) | 1.90 | Multi-Alternative Routing: Picks the optimal action among 2 to 20 candidate criteria (e.g. "Purge logs", "Scale database", "Alert engineer"). |
noul |
12,236 (25.8%) | 2.45 | Boolean & Binary Verification: High-precision truth scoring (true vs. false), guardrails filtering, and security policy compliance. |
score |
2,421 (5.1%) | 0.50 | Ordinal Severity & Priority: Strict monotonic ranking (e.g. Severity 1 to 5, risk levels, satisfaction grades). |
Starting from the base weights at Epoch 1 (81.86%), the expanded 47,400-question corpus drove continuous, monotonic improvement across all 10 epochs, culminating in 90.61% test accuracy:
| Epoch | Train Loss | Dec Loss | Learning Rate | Test Accuracy (4,740 items) | Progression & Gain |
|---|---|---|---|---|---|
| 1 / 10 | 0.9035 | 0.7611 | 3.48e-05 | 81.86% (3,880 / 4,740) | Initial base baseline |
| 2 / 10 | 0.2867 | 0.2777 | 3.29e-05 | 86.79% (4,114 / 4,740) | +4.93% rapid alignment |
| 3 / 10 | 0.2415 | 0.2390 | 2.85e-05 | 87.95% (4,169 / 4,740) | +1.16% |
| 4 / 10 | 0.2104 | 0.2081 | 2.40e-05 | 88.82% (4,210 / 4,740) | +0.87% |
| 5 / 10 | 0.1855 | 0.1798 | 1.94e-05 | 89.24% (4,230 / 4,740) | +0.42% |
| 6 / 10 | 0.1620 | 0.1580 | 1.48e-05 | 89.56% (4,245 / 4,740) | +0.32% |
| 7 / 10 | 0.1410 | 0.1382 | 1.05e-05 | 90.11% (4,271 / 4,740) | Crosses 90% threshold |
| 8 / 10 | 0.1250 | 0.1221 | 6.80e-06 | 90.38% (4,284 / 4,740) | Fine-grained decision tuning |
| 9 / 10 | 0.1120 | 0.1105 | 3.40e-06 | 90.55% (4,292 / 4,740) | Loss stabilizes |
| 10 / 10 | 0.1042 | 0.1031 | 0.00e+00 | 90.61% (4,295 / 4,740) | 🏆 +8.75% Absolute Gain |
Most developers deploy giant generative LLMs (GPT-4o, Claude 3.5, Llama 3) for simple routing, classification, tool selection, and guardrail decisions. This introduces massive latency, high costs, and parsing failures.
┌──────────────────────────────────────────────────────────────────────────────────┐
│ Traditional Generative LLM (Autoregressive Token Generation) │
│ Context ──> 28 Layers ──> Generate Token 1 ──> Token 2 ... ──> Token 150 │
│ ⏱️ 800 - 2,500 ms | 💸 $5.00 / 1M tokens | ⚠️ Hallucinations / JSON breaks │
├──────────────────────────────────────────────────────────────────────────────────┤
│ LAYA Decision Engine (Non-Autoregressive System-1 Bidirectional Attention) │
│ Context + Options ──> ModernBERT Backbone ──> Direct Mask Scoring Head │
│ ⚡ 8 - 18 ms | 🆓 Free / Zero API cost | ✅ 100% Valid Math Probabilities │
└──────────────────────────────────────────────────────────────────────────────────┘
{"action": "restart"}. LAYA processes the entire state and all candidate options in one single forward pass, achieving ~8 ms inference on Apple Silicon (MLX) and <5 ms on modern GPUs.LAYA is distributed in all major industry precision formats, from full 16-bit to ultra-fast 8-bit (~400MB) and 4-bit edge weights:
| Format / File | Precision / Quant | Size | Recommended Target Hardware & Runtime |
|---|---|---|---|
model.safetensors |
FP16 / BF16 | 842 MB | Universal Default (PyTorch, Transformers, CUDA, MLX) |
model.bf16.safetensors |
Bfloat16 | 842 MB | Modern NVIDIA GPUs (Ampere, Hopper H100/H200, Blackwell, TPU) |
model.fp16.safetensors |
Float16 | 842 MB | Standard CUDA (T4, V100, RTX 30/40), MPS, DirectML |
model.fp8.safetensors |
FP8 (e4m3fn) |
421 MB | Cutting-Edge FP8 for H100, H200, RTX 4090, Blackwell (~400MB) |
model.int8.safetensors |
INT8 (per-channel) | 422 MB | Ultra-Compact INT8 for CPU servers & memory-constrained edge (~400MB) |
laya.f16.gguf |
GGUF F16 | 842 MB | llama.cpp, Ollama, local C++ / edge runtimes |
laya.q8_0.gguf |
GGUF Q8_0 | 496 MB | Quantized llama.cpp & Ollama execution |
mlx/ |
Apple Silicon FP16 | 842 MB | macOS Unified Memory (M1/M2/M3/M4) (~8ms latency) |
mlx-8bit/ |
Apple Silicon INT8 | 496 MB | Memory-efficient macOS local deployment |
mlx-4bit/ |
Apple Silicon INT4 | 311 MB | Minimal footprint (~300MB) for MacBook Air / Mac mini |
Why ~840 MB vs ~400 MB?
ModernBERT-large contains 421,293,830 parameters (~421M).
- At 16-bit precision (FP16/BF16): 421M params * 2 bytes = 842.6 MB (Upstream standard matching
convaiinnovations/laya).- At 8-bit precision (FP8/INT8): 421M params * 1 byte = 421.4 MB (The ultra-compact ~400MB formats).
- At 4-bit precision (INT4/MLX-4bit): 311.6 MB.
from rl_agent_api import RLAgent
agent = RLAgent("ameerhmz5/laya-modernbert-decision-90pct")
# Instant triage in <10ms
decision = agent.system_one(
state="Alert: PostgreSQL primary connection pool exhausted. 120 client queries queued waiting for locks.",
questions={
"triage": {
"type": "choice",
"instructions": "Select the immediate automated remediation procedure:",
"criteria": {
"kill_idle": "Terminate idle-in-transaction client connections",
"pool_expand": "Temporarily increase PgBouncer pool limits by 50%",
"failover": "Trigger automatic failover to read-replica",
"escalate": "Page primary on-call SRE engineer"
}
}
}
)
result = decision["triage"]
print(f"Decision: {result[decision]} (Confidence: {result[probabilities][result[decision]]:.1%})")
import mlx.core as mx
from huggingface_hub import snapshot_download
path = snapshot_download("ameerhmz5/laya-modernbert-decision-90pct", allow_patterns=["mlx/*"])
weights = mx.load(f"{path}/mlx/model.safetensors")
print("MLX weights loaded in Apple Silicon unified memory!")
import safetensors.torch
from huggingface_hub import hf_hub_download
# Download 421 MB FP8 weights
path = hf_hub_download("ameerhmz5/laya-modernbert-decision-90pct", filename="model.fp8.safetensors")
weights_fp8 = safetensors.torch.load_file(path)
print("Loaded FP8 weights in 421 MB!")
Run the local Ollama server bridge:
python3 serve_ollama.py --port 11435
Query via standard cURL or Open-WebUI:
curl http://localhost:11435/api/generate -d '{
"model": "laya",
"prompt": "Context: Disk at 98%. Options: 1. Purge logs. 2. Ignore.",
"stream": false
}'
model.bf16.safetensors 843 MBmodel.fp16.safetensors 843 MBmodel.safetensors 843 MBmlx/model.safetensors 843 MBmlx-8bit/model.safetensors 496 MBmodel.int8.safetensors 422 MBmodel.fp8.safetensors 421 MBmlx-4bit/model.safetensors 312 MBconvaiinnovations/laya