跳到主内容
@wquguru
精选88Hacker News Best(web_list)模型发布/更新

Laya:开源非自回归决策模型,速度超Jev

Laya the open source version of Jev

原文
发到 X
推荐理由

非自回归决策模型是近期热点,Laya 提供了极具竞争力的开源替代方案,性能数据详实且工程落地性强,适合需要低延迟结构化输出的场景参考。

Everyone in AI right now is talking about a new kind of model: an architecture that is not autoregressive, does not generate text, and gives lightning-fast probability predictions over structured schemas.

如今,AI 领域的每个人都在谈论一种新型模型:一种非自回归、不生成文本、并能对结构化模式进行闪电般快速概率预测的架构。

Seeing the hype online feels both validating and deeply frustrating.

看到网上的炒作,既让人感到欣慰,又深感沮丧。

I worked on this literally one year back in March 2025. I spent months of hard work, sweat, and sleepless nights building it, published an arXiv paper (arXiv:2503.23303), released the model weights on Hugging Face (sales-conversion-model-reinf-learning), published the open dataset (saas-sales-conversations), built a PyPI package, and posted the whole approach on Reddit (r/LocalLLaMA discussion).

我早在 2025 年 3 月就着手研究这个课题了。我花了数月时间辛勤工作、挥洒汗水、熬过无数个不眠之夜来构建它,发表了 arXiv 论文(arXiv:2503.23303),在 Hugging Face 上发布了模型权重(sales-conversion-model-reinf-learning),公开了数据集(saas-sales-conversations),构建了 PyPI 包,并在 Reddit(r/LocalLLaMA 讨论区)分享了整个方法。

Then in September 2025, I published a second paper (arXiv:2510.01237), formalizing the framework for schema-based decisions guided by reinforcement learning. The guiding brain in my system was always reinforcement learning, not just an embedding model or an autoregressive LLM.

随后在 2025 年 9 月,我发表了第二篇论文(arXiv:2510.01237),形式化了由强化学习指导的模式化决策框架。我的系统中的核心引导机制始终是强化学习,而不仅仅是一个嵌入模型或一个自回归大语言模型。

And then 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 proposed the exact same non-autoregressive decision concept as if it was a brand-new scientific breakthrough. Except they launched without technical papers, without open weights, and with zero open training datasets.

接着在 2026 年 9 月,一家资金雄厚的前沿实验室 TypeSafe AI(由 ChatGPT 的共同发明人 Diogo Almeida 创立)推出了 Jev。他们提出了完全相同的非自回归决策概念,仿佛这是一项全新的科学突破。然而,他们没有发布技术论文,没有开放模型权重,也没有提供任何开源训练数据集。

My earlier model used PPO over sequence representations to output turn-by-turn conversion trajectories (probabilities from 0.0 to 1.0) in vertical sales 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 million input tokens with typical response times around 150 ms.

我早期的模型使用 PPO 处理序列表示,以输出垂直销售对话中逐步转化的轨迹(0.0 到 1.0 之间的概率)。Jev 则利用其所谓的 RLCD(用于校准决策的强化学习)推广并行采样,水平地输出置信度分布和模式选择,每百万输入 token 收费 $0.042,典型响应时间约为 150 毫秒。

Instead of staying bitter, I decided to take everything I learned, fix every architectural limitation of the old approach, and build a completely open, horizontal System 1 decision model family: Laya.

与其心存怨恨,我决定汲取所学教训,修复旧方法的每一项架构局限,并构建一个完全开源的水平式 System 1 决策模型家族:Laya。

And because we built it properly on bidirectional encoders, our models run in 32.8 milliseconds on a single GPU (7.2 ms/question batched), making it 6 to 8 times faster than Jev, with full support for over 100 languages, zero API subscription costs, and 100% open-source Apache 2.0 weights.

由于我们基于双向编码器正确构建了它,我们的模型在单张 GPU 上的运行速度为 32.8 毫秒(批处理下每个问题 7.2 毫秒),比 Jev 快 6 到 8 倍,全面支持超过 100 种语言,零 API 订阅费用,且拥有 100% 开源的 Apache 2.0 权重。

1. The Core Realization: System 1 vs System 2

1. 核心认知:System 1 与 System 2

Every modern AI pipeline has a giant bottleneck: we use generative LLMs for simple reflex decisions.

每个现代 AI 管道都存在一个巨大的瓶颈:我们使用生成式 LLM 来处理简单的反射性决策。

When a customer support ticket arrives, or an email hits your inbox, or a user submits a prompt to your API, you usually only need to answer simple, structured questions:

当客户支持工单到达、邮件进入收件箱,或用户向你的 API 提交提示词时,你通常只需要回答简单、结构化的问题:

  • Which department should this ticket route to?
  • Is this incoming email a phishing attack or spam?
  • Is this prompt trying to jailbreak or inject instructions?
  • How urgent is this issue on an ordinal rubric (0 to 3)?
  • Does this query require code execution or a simple factual reply?
  • 这个工单应该路由到哪个部门?
  • 这封 incoming 邮件是钓鱼攻击还是垃圾邮件?
  • 这个提示词是否试图进行越狱或注入指令?
  • 这个问题在序数量表(0 到 3)上的紧急程度如何?
  • 这个查询需要代码执行还是简单的 factual reply?

Calling an 8B, 70B, or frontier generative LLM for this is complete overkill. You wait 500 ms to 2,000 ms for tokens to stream out, spend real money on inference, and then have to write regex or JSON parsers to extract a clean label from free-form text. Worst of all, LLMs love to hallucinate and generate fake confidence. When an LLM outputs "confidence: 0.95", it is just predicting tokens that sound confident. There is zero mathematical calibration behind it.

为此调用 8B、70B 或前沿生成式 LLM 完全是杀鸡用牛刀。你需要等待 500 毫秒到 2,000 毫秒让 token 流式输出,花费真金白银进行推理,然后还得编写正则表达式或 JSON 解析器从自由文本中提取干净的标签。最糟糕的是,LLM 喜欢幻觉并生成虚假的置信度。当 LLM 输出“confidence: 0.95”时,它只是在预测听起来很有信心的 token。背后没有任何数学校准依据。

We needed a model that works like the human brain's System 1: instant reflex decisions with honest, calibrated probabilities, taking only 30 to 35 milliseconds on standard commodity hardware.

我们需要一个像人脑系统 1 那样工作的模型:即时反射决策,具有诚实且经过校准的概率,在标准商用硬件上仅需 30 到 35 毫秒。

2. The Three Decision Primitives

2. 三个决策原语

Laya evaluates typed questions over any state (raw text, email, ticket, or JSON document) in a single forward pass. It relies on three primitives:

Laya 在一次前向传递中评估任何状态(原始文本、邮件、工单或 JSON 文档)上的类型化问题。它依赖于三个原语:

  • choice: Pick one option from a dictionary of criteria. Returns the selected key, probability distribution across all options, and a calibrated confidence score.
  • score: Place the state on an ordinal rubric (levels 0, 1, 2, ...). Returns the expected level, the distribution over rubric ranks, and confidence.
  • noul: A direct boolean question returning calibrated probability P(true) from 0.0 to 1.0 (with P(false) = 1 - P(true) by construction).
  • choice:从标准字典中选择一个选项。返回选定的键、所有选项的概率分布以及经过校准的置信度分数。
  • score:将状态放置在序数量表上(等级 0、1、2、...)。返回预期等级、量表排名的分布以及置信度。
  • noul:一个直接的布尔问题,返回经过校准的概率 P(true),范围从 0.0 到 1.0(根据构造,P(false) = 1 - P(true))。

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

由于输出空间完全由概率和数字组成,该模型从不生成文本,无法产生幻觉,且模式违规或格式错误的 JSON 在物理上是不可能的。

3. The Three Checkpoints & Bundled Hub Architecture

3. 三个检查点与捆绑 Hub 架构

One model cannot be optimal for every task and language. We released three specialized checkpoints, now consolidated under a single repository hub on Hugging Face:

一个模型不可能在所有任务和语言上都达到最优。我们发布了三个专用检查点,现在已整合到 Hugging Face 上的单个仓库 hub 下:

CheckpointBackbone EncoderParamsContextPrimary Strength
convaiinnovations/layaModernBERT-large421M512English text classification, guardrails, email triage
convaiinnovations/laya-multilingualmmBERT-base (256k vocab)322M1024 (up to 8k)100+ languages, 2.2x faster, cross-lingual NLI
convaiinnovations/laya-typed-decisionsModernBERT-large421M1024Agent observability, customer service, invoice processing, security alerts (0.766 acc)
检查点主干编码器参数量上下文长度主要优势
convaiinnovations/layaModernBERT-large4.21亿512英文文本分类、安全护栏、邮件分拣
convaiinnovations/laya-multilingualmmBERT-base (256k词表)3.22亿1024 (最高8k)100多种语言,速度提升2.2倍,跨语言自然语言推理
convaiinnovations/laya-typed-decisionsModernBERT-large4.21亿1024智能体可观测性、客户服务、发票处理、安全告警(准确率0.766)

Selective Subfolder Downloads

选择性子文件夹下载

Rather than forcing users to manage three separate repositories or download 2.5 GB of combined weights, the main repository convaiinnovations/laya bundles all three. Using Hugging Face's allow_patterns, Laya's SDK downloads only the specific subfolder requested:

与其强迫用户管理三个独立的仓库或下载2.5 GB的合并权重,主仓库 convaiinnovations/laya 将三者打包在一起。利用 Hugging Face 的 allow_patterns,Laya 的 SDK 仅下载请求的特定子文件夹:

代码 · 4
# Downloads English model (~808 MB)
agent_en = laya.load("convaiinnovations/laya")
# Downloads ONLY the multilingual subfolder (~647 MB), not the entire 2.5 GB bundle
agent_ml = laya.load("convaiinnovations/laya", subfolder="multilingual")
代码 · 4
# Downloads English model (~808 MB)
agent_en = laya.load("convaiinnovations/laya")
# Downloads ONLY the multilingual subfolder (~647 MB), not the entire 2.5 GB bundle
agent_ml = laya.load("convaiinnovations/laya", subfolder="multilingual")

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

4. 为什么路由至关重要:多脚本的现实

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

我们在 MASSIVE 基准测试(20个选项,随机基线 = 0.050)中对51种语言进行的全面评估中,最令人震惊的发现之一是英语模型在非拉丁字母体系外的表现如何失败。

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

ModernBERT-large 的5万个令牌的英文 BPE 词表根本无法处理非拉丁字母:

  • Khmer: 0.000 accuracy at 0.952 mean confidence. Not one correct decision in 100 questions, while 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.
  • 高棉语:平均置信度0.952时准确率为0.000。在100个问题中没有做出一个正确决策,却报告了约95%的置信度。
  • 亚美尼亚语:置信度0.885时准确率为0.050(相当于精确的抛硬币随机水平)。
  • 希伯来语:置信度0.964时准确率为0.060。
  • 孟加拉语:置信度0.945时准确率为0.080。
  • 印地语:置信度0.941时准确率为0.100。

This is the crucial lesson: the model's own confidence gives no warning when it cannot read the input script. Across 51 languages, the English checkpoint's mean confidence never drops below 0.885, regardless of whether its accuracy is 82% or 0%.

这是至关重要的教训:当模型无法识别输入脚本时,其自身的置信度并未发出任何警告。在51种语言中,无论准确率是82%还是0%,该英语检查点的平均置信度从未低于0.885。

Therefore, confidence gating cannot protect you. The decision of which model to use must be made before the forward pass.

因此,置信度门控无法保护你。必须在前向传播之前决定使用哪个模型。

Sub-Millisecond Pure Python Routing

亚毫秒级纯Python路由

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

Laya 包含一个内置的路由器(Router),它会检查传入文本在22种字母体系(天城文、CJK汉字、西里尔字母、阿拉伯文、希伯来文、泰米尔文、泰文等)中的Unicode脚本,并分析拉丁停用词分布:

  • Standard English text: 0.09 ms detection overhead.
  • Devanagari / Indic text: 0.54 ms detection overhead.
  • Large 200-row nested JSON documents: 0.73 ms detection overhead.
  • 标准英文文本:检测开销为0.09毫秒。
  • 天城文/印度系文字:检测开销为0.54毫秒。
  • 大型200行嵌套JSON文档:检测开销为0.73毫秒。

Compared to a 33 ms forward pass, routing overhead is negligible (<2%). And with Router(preload=True), all required models stay resident in VRAM/RAM, completely eliminating the 7 to 10-second cold-swap penalty when traffic alternates between languages.

与33毫秒的前向传播相比,路由开销微不足道(<2%)。并且通过 Router(preload=True),所有必需的模型都驻留在VRAM/RAM中,完全消除了流量在语言间切换时产生的7到10秒冷启动惩罚。

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

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

5. 正面交锋:Laya(带路由)vs TypeSafe Jev

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件