ModernBERT and mmBERT in Laya

Laya is not a generative LLM. Each checkpoint is an encoder model, ModernBERT-large for English or mmBERT-base for 100+ languages, with a small decision head on top. The encoder explains most of Laya's speed, its token limits and where it falls short.

417 projects

Y

laya-typed-decisions

yashchouhann

Fine-tunes Laya on a typed-decisions benchmark and reports comparative results

1·HF model
B

laya-android

ByunByun

Fine-tunes Laya for selecting and grounding Android GUI actions from accessibility trees

1·HF model
M

laya-en-fp16

marrviin

FP16 ONNX export of the English Laya checkpoint (no model card)

1·HF model
W

laya-browser

wuyuanpei

Fine-tunes Laya as a browser-agent decision head compatible with jev-ultrafast

1·HF model
R

laya-typed-decisions-ov-int8

rupeshs

Provides an int8 OpenVINO conversion of Laya fine-tuned for typed-decision workflows

1·HF model
J

laya-fullft-typed-decisions

jjshin

Fine-tunes Laya with pure PyTorch RLCD for typed decisions and jailbreak detection

1·HF model
X

laya-vulnerabilit

xiahao90

An experimental Laya checkpoint adapted for vulnerability detection

1·HF model

laya-plays-doom

shantanugoel

Trains Laya with reinforcement learning to play Doom through ViZDoom

1·GitHub repo

laya-plays-mario

DavidDevGt

Fine-tunes Laya as a control policy for playing Super Mario Bros

1·GitHub repo

SmartMom

clydechen0228

Uses Laya for edge classification and training within a smart-factory operations platform

1·GitHub repo

laya-learning-demo

Daryl9441

A runnable tutorial teaches Laya decision primitives, routing, fine-tuning, and comparison with Jev

1·GitHub repo

second-thought

KNambiarDJsc

Measures decision calibration, prioritizes human review, and builds fine-tuning datasets

1·GitHub repo

hd5-antigravity-jev

alpaslan-exe

A workshop teaching developers to build projects with Antigravity and locally run Laya decisions

1·GitHub repo

building-with-laya-skill

MIt9

An agent skill teaches developers to build typed-decision programs with Laya and laya-cli

1·GitHub repo

laya-lab

Alevsk

Runs Laya locally with reproducible scenarios that explore its capabilities on Apple Silicon

1·GitHub repo

laya-ko-decision-onnx

2nugu

Fine-tunes Laya for Korean decisions and provides PyTorch training and ONNX export scripts

1·GitHub repo

Laya-Finetune

zamax14

Fine-tunes and evaluates multilingual Laya for support-ticket classification

1·GitHub repo

seems-laya

ericmjl

Runs natural-language judgments in the Seems programming language using the local Laya decision model

1·GitHub repo

laya-ignite

sirgio03

Bootstraps specialized, calibrated Laya decision heads from zero-shot criteria

1·GitHub repo

laya-eval

yliuai

Fine-tunes Laya to play Snake on a Mac and measures base vs fine-tuned decision accuracy

1·GitHub repo

chong-laya

cloudwallker

Provides a local interface for inspecting Laya shopping decisions, probabilities, latency, and raw responses

1·GitHub repo

laya-finetune

lucianfialho

Fine-tunes Laya using Jev distillation and pilot datasets

1·GitHub repo

sample.laya

hamedhajiloo

Demonstrates C# workflows for Laya typed decisions, including triage and prompt-injection screening

1·GitHub repo

Laya_test_bench

francismdpro

Provides command-line and web tools for experimenting with Laya's typed decision questions

1·GitHub repo

ModernBERT

ModernBERT is a bidirectional, encoder-only Transformer in the BERT style, made by Answer.AI, LightOn and collaborators and released in December 2024 (arXiv 2412.13663). From the ModernBERT-large model card:

  • Two sizes: ModernBERT-base (22 layers, 149M parameters) and ModernBERT-large (28 layers, 395M).
  • Trained on 2 trillion tokens of English and code.
  • Native context of up to 8,192 tokens, using rotary position embeddings and alternating local and global attention.
  • Apache 2.0 licence.

It is a masked language model. The card says to fine-tune it with standard BERT recipes for classification, retrieval or QA, which is what Laya does.

mmBERT

mmBERT is a multilingual encoder on the ModernBERT architecture from the Center for Language and Speech Processing at Johns Hopkins University. The paper, "mmBERT: A Modern Multilingual Encoder with Annealed Language Learning" (arXiv 2509.06888), was published in September 2025. From the mmBERT-base model card:

  • mmBERT-small has 140M parameters and mmBERT-base 307M.
  • Trained on more than 3T tokens across 1,800+ languages.
  • Maximum sequence length of 8,192 tokens.
  • MIT licence.

How Laya builds on them

From the Laya model card:

checkpoint encoder total params default context
laya ModernBERT-large 421M 512
laya-multilingual mmBERT-base 322M 1,024 (up to 8,192)
laya-typed-decisions ModernBERT-large 421M 1,024

The encoder is fully fine-tuned. On top sits a decision head trained from scratch: two transformer layers, an option-marker scorer and an act/escalate head. Every option is scored at its own [MASK] token and then softmaxed over that question's options. The answer space is therefore defined in the request, and new label sets need no retraining. Training uses what the card calls RLCD, reinforcement learning against strictly proper scoring rules, so that reporting honest probabilities earns the highest reward.

Why an encoder

A generative model writes its answer token by token, and you parse the text. An encoder reads the whole input once and returns scores. For Laya that means:

  • One forward pass. All questions in a call are answered in the same pass. The card reports 39.5 ms for one question with laya and 32.8 ms with laya-multilingual on a Tesla T4.
  • A probability for every option. You set the threshold in code instead of in a prompt.
  • Only your labels. The model scores the options you wrote, so it cannot answer with a label you did not define. It can still pick the wrong one.

Limits that come from the encoder

  • Short default context. laya reads 512 tokens per question, with 192 reserved for the options (head_max_len), which leaves about 320 for the state. The other two checkpoints default to 1,024 with 256 for options. Depending on the runtime, longer input is cut off or rejected: laya.cpp rejects it unless you pass --allow-truncation.
  • Long documents. Only the multilingual checkpoint reads up to 8,192 tokens, with max_len=8192. The card reports 16 to 18 of 20 requests correct with up to about 4,000 tokens, and 8 to 17 of 20 beyond that.
  • Languages. ModernBERT was trained on English and code. The card reports that the English checkpoint scores 0.000 on Khmer at 0.952 confidence, which is why the Router sends non-English text to the mmBERT checkpoint.
  • Knowledge and reasoning. A 400M encoder knows far less than a decision model built on a multi-billion-parameter LLM. In akitaonrails' benchmark of Jev-like models, Laya scored 42.9% on the compact set against a chance level of about 31%. The 4B to 27B decision models in the same table scored between 74.4% and 99.4%, and Laya was among the fastest at 41 ms median.

Fine-tuning is cheap

The small encoder is also why fine-tuning is practical. The card's fine-tuning notebook runs on Kaggle's free 2x T4 GPUs, and the resulting laya-typed-decisions checkpoint scores 0.766 on the typed-decisions benchmark against 0.362 for the base English model. Other encoder decision models follow the same pattern: Supersonic Labs' Julia-1 is a 144M model on mmBERT-small. See Laya alternatives for more.

Related pages

More ways to use Laya