/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
566 млн
Лицензия
CC BY 4.0
Архитектура
alea_moe · MoE
Библиотека
transformers
Опубликована
14 окт 2026

alea-r3-moe-2b-a417m

Генерация текстаТекст → текст3 профессии
66скачиваний за 30 дней0лайковвеса обновлены18 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Alea R3 MoE 2B A417M — англоязычная MoE-модель для генерации юридических, регуляторных и финансовых текстов США и работы с предоставленными отрывками.

Alea Institute выпустил Alea R3 MoE 2B A417M — авторегрессионную языковую модель на архитектуре Mixture of Experts для генерации текста и диалога. Веса содержат около 2,08 млрд параметров, из которых примерно 416,6 млн активны на токен; модель построена из 64 декодерных слоёв с групповым запросно-ключевым вниманием. Она принимает текст и выдаёт текст, поддерживает английский язык, имеет контекст 2048 токенов и распространяется в формате Safetensors по лицензии CC BY 4.0.

Модель предназначена для продолжения юридических, регуляторных и финансовых текстов США, воспроизведения фрагментов публичного законодательства, а также прототипов извлечения сведений и ответов по предоставленным отрывкам. Разработчики также позиционируют её для исследований небольших моделей, обученных на данных с подтверждённым правомерным происхождением. Это не универсальный чат-бот: модель не предназначена для юридических консультаций, автономных фактологических ответов, генерации кода или работы с неанглийскими текстами.

В генерациях встречаются вымышленные судебные цитаты, реальные дела с неверно приписанными выводами, ошибки в определениях и арифметические несоответствия. Юридические ссылки, цитаты, числа и любые выводы следует проверять человеком; ответы нельзя использовать как юридический совет без проверки.

Сценарии применения

  • продолжение текста судебного решения или юридического документа
  • генерация типовых формулировок из законодательства и нормативных актов США
  • продолжение финансовой отчётности и договорных положений
  • поиск ответов и извлечение сведений из предоставленных правовых отрывков
  • прототипирование моделей на корпусах правовых и государственных документов

Ограничения

Модель может выдумывать судебные цитаты, неверно связывать реальные дела с правовыми тезисами, ошибаться в определениях и допускать арифметические несоответствия. Предназначена только для английского текста; юридические выводы и ссылки требуют проверки человеком.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

ALEA R3 MoE 2B-A417M (R3-final)

R3 is a 2.08B-parameter mixture-of-experts language model with about 417M parameters active per token, trained only on lawful data: mostly U.S. legal, regulatory and financial text from the KL3M Data Project, plus synthetic, procedural and task data created by ALEA. This main branch is R3-final: the stable-phase model (step 31,000) after a 7,296-step learning-rate decay on decay mix v5. It is strongest at continuing legal, regulatory and SEC-filing text, at recalling public-domain primary law (the Constitution, the Federal Rules, much-cited U.S. Code sections and Supreme Court case citations), at short answers grounded in a passage you supply, and at the factual and procedural task families it was trained on. It is weak at code, open-ended writing, facts about obscure entities, and reasoning outside its trained formats. It invents some case citations and often cites real cases for the wrong proposition; verify every citation. It is not instruction- or safety-tuned, and it is not legal advice.

Parameters2,077,524,736 total, ≈ 416.6M active per token
Architecture64-layer decoder, 24 routed experts (top-2) + 1 shared expert, GQA, QK-norm, RoPE
Context2,048 tokens
Traininggrown from R2 (24.9B tokens), then 40.2B tokens (38,296 steps): 32.5B stable + 7.65B decay; one NVIDIA GH200; OLMo-core
Tokenizer16,384-token BPE with control tokens and a chat template (the same tokenizer as R2)
Weightsbf16 safetensors (3.87 GiB), router weights kept in fp32
Codecustom AleaMoeForCausalLM; requires trust_remote_code=True
LicenseCC-BY-4.0 (WordNet-derived content: see WORDNET_LICENSE.txt)

Other revisions in this repository. stable-31000 is the pre-decay checkpoint. Three decay runs from it, each on a different decay mix, are published as branches with their own short cards: decay-v3-s32000 … decay-v3-s35000 (mix v3, stopped at step 35,208), decay-v4-s32000 … decay-v4-s38296 (mix v4, final) and decay-v5-s32000 … decay-v5-s38296 (mix v5, final; step 33,000 is not on the Hub). R3-final has the same weights as decay-v5-s38296.

What R3-final is

Stable phasesteps 1–31,000 at a constant peak learning rate of 6e-4 after a 1% re-warmup (32.5B tokens)
Decaysteps 31,001–38,296: learning rate 6e-4 → 0, linear, over 7,296 steps × 1,048,576 tokens ≈ 7.65B tokens
Decay mixv5 (below)

Decay mix v5. About 59% natural public-record text (case law, government publications, contracts, financial filings, U.S. Code and eCFR, Federal Register, patents, EU Official Journal), re-weighted from the stable phase's sources. The rest is ALEA data: knowledge renders (OpenGloss definitions, Wikidata facts, legal definitions and renders of public-domain primary law, ≈ 20%), task and in-context-learning data (≈ 10%), grounded QA (4%), arithmetic (2%), formal and program data (≈ 2%), writing (≈ 2.4%) and text correction (≈ 0.7%). Compared with mix v4, v5 adds:

  • a case-law canon built deterministically from public-domain court opinions (CourtListener and the Caselaw Access Project): full majority opinions and excerpts of 1,000 landmark cases, case ↔ citation pairs for about 12,000 cases, stated holdings, settled propositions with their supporting authorities, and a small set of verified overruled-case statements;
  • summaries and writing exercises produced from public-record text by locally run open-weight teacher models (judged before use), and a small share of writing examples generated with gpt-6-luna;
  • a small set of deterministic assistant-identity, small-talk and refusal chats;
  • more definition data, and format controls carried over from v4: structured layouts (worked traces, formal blocks, quotations, code) appear only when the prompt asks for them, and in correction examples the instruction always comes before the text to correct.

The decay-only additions (case-law canon, teacher summaries and writing, identity chats) are not yet released as datasets.

Why this decay. We ran three decays from the same stable checkpoint and compared the finals of v4 and v5 on every probe (the tables under Evaluation). v5 doubles proposition → case accuracy (60.6% vs 27.3%), recalls the page cite of all 100 tested cases (v4: 87), raises the share of real and correctly attributed generated citations (75.0% vs 68.2%) and lowers the invented share (12.9% vs 22.2%); it is level or better on definitions, format control and the broad spot-check. The v4 final often appended a proofreading instruction and a repeat of the passage to ordinary legal text (8 of 20 test continuations; v5: 0 of 20). v5 costs: it cites about three times as often, so it produces more invented citations per generated token (1.67 vs 0.87 per 1,000), and it is worse at detecting whether a text needs correction (balanced accuracy 68.6 vs 86.0). v3 was stopped at step 35,208 after its bare-prompt template leaks rose and definition scores fell.

Data provenance

This model is not Fairly Trained certified. It was, however, very carefully designed to train only on public-domain, CC0, permissively licensed or ALEA-created data. As one example: for encyclopedic world knowledge, only Wikidata (CC0) was used, not Wikipedia (CC-BY-SA). No web crawl and no copyrighted books were used.

This describes what the model was trained on. It is not a promise about outputs: any language model can produce common phrases or passages that resemble existing text. The copyright-memorization results below measure this directly.

SourceBasisHugging Face
U.S. Code, eCFR, public laws, GAO reports, CRS reports, Federal Register, regulatory dockets, FDLP, bills, GovInfo publications, .gov web pages, FCC submissionsU.S. government works, public domain (17 U.S.C. § 105)kl3m-data-usc, kl3m-data-ecfr, kl3m-data-govinfo-plaw, kl3m-data-govinfo-gaoreports, congressional-research-service, kl3m-data-fr, kl3m-data-reg-docs, kl3m-data-fdlp, kl3m-data-govinfo-bills, kl3m-data-govinfo-govpub, kl3m-data-dotgov, fcc-submissions
Case law (Caselaw Access Project, RECAP), oral-argument transcriptsJudicial opinions and court records (government edicts doctrine); CAP data is CC0kl3m-data-cap, kl3m-data-pacer-docs, freelaw-oral-argument-transcripts
SEC EDGAR filings (agreements, 10-K, 10-Q)Public SEC filings, unrestricted reusekl3m-data-edgar-agreements, kl3m-data-edgar-10-k, kl3m-data-edgar-10-q
USPTO patentsPublic government recordskl3m-data-uspto, kl3m-sft-patents
EU Official Journal (English)Official EU documents, free reuse (Commission Decision 2011/833/EU)kl3m-data-eu-oj
KL3M mixed sample, U.S. Code knowledge-graph triples, USC/eCFR definitionsFrom the sources abovekl3m-data-sample-006-medium, usc-knowledge-graph-triples, kl3m-sft-usc-ecfr-definitions
OpenGloss v2.4 (dictionary and encyclopedia prose, multilingual examples)ALEA dataset (partly LLM-generated), CC-BY-4.0; WordNet-derived rows under the Princeton WordNet Licenseopengloss-v2.4-pretrain, opengloss-v2.4-multilingual, opengloss-renders
OpenGloss-Edu, -Instruct, -Instruct-Writing, -Facts, -ICL, -Tasks; alea-synthALEA synthetic and templated data, CC-BY-4.0; seeds are Wikidata (CC0), OpenGloss and KL3Mopengloss-edu, opengloss-instruct, opengloss-instruct-writing, opengloss-facts, opengloss-icl, opengloss-tasks, alea-synth
OpenLemma v0.1–v0.5 (logic, arithmetic, word problems with executed programs, formal-to-natural-language pairs, verified code)ALEA datasets, CC-BY-4.0; deterministic, or generated and then verified by code or a checkerv0.1, v0.2, v0.3, v0.4, v0.4-wp, v0.4-formal-nl, v0.4-programs, v0.5
NLP tasks over KL3M text, correction pairs, rules-as-code exercises verified with the Axeyum checker, verbatim Supreme Court holdingsALEA datasets, CC-BY-4.0; deterministic, or LLM-labelled and checked; source text is public recordalea-nlp-tasks, alea-correction-pairs, alea-axeyum-families, alea-axeyum-teacher, alea-scotus-holdings

LLM-generated text. The synthetic sets were produced deterministically, or with OpenAI models (mainly gpt-6-luna) or open-weight models (GLM-5.3-Flash, DeepSeek-V4.1-Flash, DeepSeek-V4-Pro, Qwen3.8-2.4T, and, for the decay's summaries and writing, smaller open-weight models run locally), then screened (decontamination, toxicity and PII filters) and, where possible, verified by code or judged. Each dataset card names its generators.

Excluded on purpose: Wikipedia (CC-BY-SA) and every other CC-BY-SA source; web crawls; books under copyright; SHELF (held out as an evaluation set); held-out splits of ALEA's own datasets; and the evaluation sets used below, removed from the training data by n-gram decontamination (the copyright test sets from step 5,800 on; public-record boilerplate that an evaluation item happens to share with 10 or more training documents is not removed).

Versions used. The datasets above are the public sources. R3 trained on local builds of them. The newer dataset versions carry a mapping/ file that lists the documents in R3's stable mix as of step 23,200; the sets added at step 26,600 (writing, task and Axeyum data, OpenLemma v0.4–v0.5, multilingual examples) come from the repositories listed above at their current tags. A few small parts are not released: a deterministic arithmetic generator's output, a citation index over case law, some grounded-QA pilot sets (together under 4% of the final stable mix), and the decay-only additions listed above.

Quick start

pip install "transformers>=4.57" torch safetensors

Both the tokenizer and the model need trust_remote_code=True. The model code is plain PyTorch (no custom kernels) and runs on CPU or GPU. Load the weights in bf16; the router weights stay in fp32 automatically. Tested with transformers 4.57.6 and 5.19.0.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "alea-institute/alea-r3-moe-2b-a417m"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16)
model.eval()

Device placement. The model loads on CPU. For a GPU, use model.to("cuda"), or pass device_map="cuda" to from_pretrained (that needs pip install accelerate). The bf16 weights take 4.2 GB; peak GPU memory in our tests was 4–7 GB, so use a GPU with 8 GB or more.

(a) Plain continuation: recommended for legal, regulatory and financial drafting

Write the start of the document and let the model continue it. tok(text) prepends the <|start|> token that began every training document. Do not end the prompt with a space: a trailing space becomes a lone whitespace token that the model mostly saw before symbols, and output quality drops.

prompt = "This Agreement shall be governed by and construed in accordance with"
inputs = tok(prompt, return_tensors="pt")          # ids start with <|start|> (id 0)
out = model.generate(**inputs, max_new_tokens=48, do_sample=False)
print(tok.decode(out[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))

Output (greedy, bf16):

the laws of the State of New York, without giving effect to conflicts of laws
principles. Any action brought by either party against the other concerning the
transactions contemplated by this Agreement shall be brought only in the state
courts of New York or in the federal courts located in the

(b) Chat with a context passage: recommended for grounded QA

The chat format is the OpenGloss-Instruct format. Put the source text in a <|context|> block, with each passage in a numbered <|snippet|>, and then ask the question in the same user turn. The model answers briefly, can quote the source with <|quote|>…<|/quote|>, cites the snippet number with <|cite|>n<|/cite|>, and ends its turn with <|eot|>.

context = (
    "<|context|>\n"
    "<|snippet|>[1] Lease Agreement, Section 4 (Rent)\n"
    "Tenant shall pay Landlord a monthly base rent of $5,875.00, due on the first day of each calendar month. "
    "A late fee of five percent (5%) applies to any payment received after the fifth day of the month.<|/snippet|>\n"
    "<|snippet|>[2] Lease Agreement, Section 9 (Notices)\n"
    "All notices under this Lease shall be in writing and delivered by certified mail to the addresses "
    "set out in Schedule A.<|/snippet|>\n"
    "<|/context|>"
)
messages = [{"role": "user", "content": context + "\nWhat late fee applies to a late rent payment? Cite the source."}]
enc = tok.apply_chat_template(messages, add_generation_prompt=True, return_dict=True, return_tensors="pt")
out = model.generate(**enc, max_new_tokens=64, do_sample=False)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=False))

Output (greedy, bf16):

A five percent (5%) late fee applies to a payment received after the fifth day of the month. <|cite|>1<|/cite|><|eot|>

The template renders exactly the training layout:

<|start|><|user|>
<|context|>
<|snippet|>[1] Title
passage text<|/snippet|>
<|snippet|>[2] Title
passage text<|/snippet|>
<|/context|>
question<|eot|>
<|assistant|>

An optional system turn (<|system|>\n…<|eot|>\n) is supported but is rare in the training data. Asked who it is, the model is trained to answer "I'm a language model created by the ALEA Institute."; this is a small amount of identity data, not instruction tuning.

Special tokens and generation

TokenIdRole
`<start>`
`<end>`
`<pad>`
`<eot>`
`<system>, <
`<context>, <
`<cite>, <
`<think>, <

generation_config.json stops on <|end|> or <|eot|> (eos_token_id = [1, 7]) and sets max_length to the 2,048-token context. The other reserved control tokens (ids up to 255) are untrained or rare in training and should not be used.

Speed (measured on the stable-phase checkpoint; R3-final has the same architecture and code). Greedy decoding, bf16, RTX 4060 Ti (16 GB):

SettingBatch 1Batch 16Batch 64
default generate()31 tok/s456 tok/s–
cache_implementation="static"124 tok/s–2,125 tok/s

Prefill of 1,500 tokens takes 0.09 s. Peak GPU memory was 4–7 GB. For the lowest latency on CUDA, use the static cache; transformers then compiles the decoding step with CUDA graphs (the first call takes one to two minutes, and it compiles again for each new batch size or cache length):

model = model.to("cuda")
out = model.generate(**inputs, max_new_tokens=256, cache_implementation="static")

On CPU, generate in bf16 (decoding is limited by memory bandwidth), score long inputs in fp32, and use one thread per performance core. Inference options (alea_moe_impl, default "auto", plus flags that switch each speedup off) can be passed to from_pretrained; they are documented in configuration_alea_moe.py. CPU speed was not measured.

Other runtimes. There is no vLLM, llama.cpp or TGI support yet. Weight names follow the Qwen2-MoE convention (mlp.gate, mlp.experts.{e}.{gate,up,down}_proj, mlp.shared_expert.*) to ease a port.

Model details

ComponentValue
Parameters2,077,524,736 total; ≈ 416.6M active per token (404.0M in matmuls and norms + 12.6M embedding)
Layers / width64 decoder layers, d_model 768, pre-norm blocks (h = x + attn(norm(x)); out = h + moe(norm(h)))
Attention12 query heads, 4 key/value heads (GQA), head dim 64, no biases
QK-normRMSNorm over the full projected q (768) and k (256) vectors before the head split (OLMoE / OLMo-2 style, not per head)
Position encodingRoPE, θ = 100,000, full head dimension, no scaling
NormsRMSNorm, eps 1e-5, computed in fp32
MoE24 routed SwiGLU experts (hidden 512), top-2; linear fp32 router, softmax over all 24 experts, top-2 probabilities not renormalized; dropless
Shared expert1 SwiGLU expert (hidden 1,024), ungated; output = shared/3 + (2/3)·Σ p_i·expert_i
Headfinal RMSNorm, then an LM head tied to the input embeddings
Vocabulary16,384 (BPE alea-p1sw-staged-16k); ids 0–255 are reserved control tokens
Context2,048 tokens (longer inputs are untested)

The block is R2's, with twice the depth. No stock transformers class matches this combination (full-vector QK-norm, pre-norm blocks, ungated shared expert), so the repository ships a custom implementation (modeling_alea_moe.py, plain PyTorch). It runs inference and fine-tuning (see Fine-tuning); intra-document attention masking, used for packed pretraining sequences, is not implemented.

Conversion check. The Hugging Face port of R3-final was compared with the original OLMo-core checkpoint in fp32 (TF32 off):

  • logits on 22 inputs (legal, general and chat prompts plus a 1,500-token court opinion; 1,880 positions): maximum absolute difference 4.2e-5 on the prompts and 9.3e-5 on the long document, mean 2.3e-6, top-1 agreement 100%;
  • greedy 60-token generations identical on 21/21 prompts;
  • held-out loss on 60 documents (66,913 tokens): 1.307456 vs 1.307456 nats/token (difference 5e-8);
  • the 662-item knowledge probe gives the same prediction on every item (66.6% both ways);
  • clean-environment tests pass on transformers 5.19 and 4.57.6 (loading, tied embeddings, fp32 router in a bf16 load, chat-template ids equal to the training encoding, pipeline). Batched bf16 generation can differ from single-prompt generation on near-ties; fp32 batched and single agree (left-padded batch vs single rows, max difference 4.2e-5).

Storing and running the weights in bf16 costs about 4.9e-4 nats/token (0.04%) on the held-out documents relative to fp32. Both quick-start examples above give identical output on transformers 5.19 and 4.57.6.

Fine-tuning

Use the code on main (this revision or later) and the normal loading path. Earlier revisions of modeling_alea_moe.py, including the one on the r3-final branch, froze the fused weights described below, so only 102,007,552 of the 2,077,524,736 parameters were trainable; inference is the same in both.

model = AutoModelForCausalLM.from_pretrained("alea-institute/alea-r3-moe-2b-a417m", trust_remote_code=True,
                                             dtype=torch.bfloat16)
model.train()
  • All weights train. After loading, the code fuses q/k/v, the shared expert's gate/up, and each layer's 24 routed experts into stacked tensors for speed. These fused tensors are ordinary trainable parameters (2,077,524,736 in total). state_dict() and save_pretrained write the published per-expert names, so a fine-tuned model saves and reloads in the original format. In training mode the routed experts use a plain per-expert matmul path. Inference paths are unchanged: logits and greedy generations are bit-identical to the release code.
  • Coverage check. check_training_coverage.py loads the model as a trainer would and builds a batch that routes to every expert of every layer. It runs one forward/backward pass with the router losses and fails unless every parameter is trainable and gets a finite, non-zero gradient. Run python check_training_coverage.py alea-institute/alea-r3-moe-2b-a417m, optionally with --unfused or --gradient-checkpointing, before a run and again after adding adapters. In fp32 on CPU it takes a few minutes and peaks at about 35 GB of RAM.
  • Fused and unfused layouts agree. alea_fuse_weights=False keeps every weight as a separate nn.Linear under its published name and loops over the experts. In fp32 the two layouts give the same loss (largest per-token difference 1.4e-6 nats) and the same gradients (largest relative difference 5.3e-6). In bf16, different kernels round differently, and on near-tied router scores that can change a token's top-2 experts in some layer. Single-token losses can then move by a few hundredths of a nat (bf16 vs fp32 on an 11-token sentence: 7 changed routing choices across the 64 layers, a largest per-token change of 0.07 nats, and 0.002 nats on the mean). Compare training paths in fp32.
  • Router losses. By default the forward pass returns only the cross-entropy loss. With output_router_logits=True (argument or config), it also returns aux_loss = 0.01 × load-balancing loss + 0.001 × router z-loss and adds it to loss when labels are given. These are the definitions and coefficients R3 was trained with (OLMo-core: load balancing over the local batch, scaled by experts / top-k; z-loss = squared log-sum-exp of the router logits; each per token and summed over the 64 layers). model.router_losses(router_logits, attention_mask) returns the two unweighted terms for logging. Keeping them, or freezing the routers (mlp.gate), is a recipe choice. The routers stay fp32 under bf16 loading; keep them fp32.
  • Gradient checkpointing. model.gradient_checkpointing_enable() recomputes each decoder layer in the backward pass and turns the KV cache off while training. In an fp32 test, the loss and gradients were identical to those without checkpointing.
  • LoRA. In the default fused layout, q/k/v form one projection and the routed experts are 3-D tensors, so LoRA that targets nn.Linear modules misses them. For LoRA, load with alea_fuse_weights=False and target q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj and down_proj. That covers attention, the 24 routed experts and the shared expert. The router (mlp.gate) is a separate nn.Linear that these names do not match. A merged model saves in the published layout. Check adapter coverage before training.
  • Batches. Pretraining packed documents with intra-document masking, which this code does not implement. Put one document per row, or pad with an attention mask and set the padded labels to -100. Embeddings and the LM head are tied. Full fine-tuning with AdamW needs roughly 16 bytes per parameter (about 31 GiB) before activations.

Training

InitializationR2 at the end of its stable phase (step 23,746; 24.9B tokens), with its 32 layers stacked into 64 (block i of R3 = block i mod 32 of R2); fresh optimizer state
Tokens40.2B (38,296 steps × 1,048,576 tokens), on top of R2's 24.9B: 32.5B stable, 7.65B decay
ScheduleWSD: 1% re-warmup, constant peak LR 6e-4 to step 31,000, then linear decay to 0 over 7,296 steps
OptimizerAdamW, β = (0.9, 0.95), weight decay 0.1
Sequence2,048 tokens, documents packed with intra-document masking
Precisionfp32 master weights, bf16 autocast; router logits in fp32
Hardwareone NVIDIA GH200 (96 GB), ≈ 64K tokens/s at steady state
Wall-clock≈ 6 days stable (Oct 7–14, 2026) + ≈ 1.5 days decay (Oct 16–17, 2026)
FrameworkOLMo-core

Stable-phase data mix

The stable phase ran on eight successive revisions of the mix. Each revision added or rebalanced ALEA data and refilled public-record text with documents the model had not yet seen. The last revision (steps 26,600–31,000), by share of tokens:

BucketShare
Case law (CAP, RECAP, oral arguments)10.8%
GovInfo publications, public laws, bills9.7%
Contracts (EDGAR agreements)5.8%
Patents5.7%
Financial filings (10-K, 10-Q)5.5%
.gov web and FCC5.2%
Federal Register and regulatory dockets4.2%
FDLP3.6%
EU Official Journal (English)2.2%
U.S. Code, Federal Rules, Constitution, eCFR (repeated renders)5.3%
CRS, GAO and public-law explanatory prose2.1%
Case citation index1.0%
OpenGloss prose and query renders13.8%
OpenGloss-Facts (Wikidata facts) and landmark-case facts3.9%
OpenGloss-Instruct chat data and writing requests4.1%
OpenGloss-Edu2.6%
OpenGloss task, in-context-learning, relation and multilingual sets3.4%
OpenLemma v0.1–v0.56.2%
Arithmetic (deterministic generator and worked traces)1.6%
NLP tasks, grounded QA, Axeyum exercises, Supreme Court holdings2.8%
alea-synth and correction pairs0.6%

Public-record text is about 61% of the final stable mix; ALEA's own data is about 39%. The repeated sources (U.S. Code, eCFR, Federal Rules, Constitution) are deliberate memorization targets. The decay mix is described above.

Evaluation

R2-final is ALEA's previous model (1.05B total, 215M active, decayed). "Decay v4 final" is the other decay run's last checkpoint (branch decay-v4-s38296). All four columns use the same harnesses, greedy decoding, on the training checkpoints in fp32; the bare-prompt, citation and canon probes were also re-run on the published bf16 weights (under Release behaviour checks). Scores are percentages unless marked. Differences under about 2 points between two checkpoints are within run-to-run noise for most rows; the spot-check categories (15–25 items each) are noisier.

1. ALEA probes

ProbeR3-finalDecay v4 finalstable-31000R2-final
Knowledge probe (662 definitions): all / held-out words / legal66.8 / 56.1 / 82.963.9 / 56.1 / 78.774.5 / 61.6 / 90.289.3 / 81.3 / 94.5
ICL v2, k = 4 / ICL v151.1 / 75.051.4 / 77.850.9 / 75.233.7 / 38.6
Closed-book facts, trained facts (a): k = 0 / k = 386.4 / 66.585.0 / 65.477.9 / 44.711.9 / 15.8
Closed-book facts, held-out entities (c): k = 014.213.211.14.8
Chat: grounded QA token F1 / correct snippet cited / abstains when unanswerable59.9 / 91.7 / 10057.5 / 91.7 / 10057.7 / 91.7 / 10055.9 / 91.7 / 100
Broad spot-check accuracy (137)65.765.759.935.0
Bare prompts with a task-layout leak, lower is better: all 360 / word problems2.2 / 3.02.8 / 4.035.6 / 77.07.8 / 0.0
Bare prompts answered on task (360)68.167.546.750.8
Text correction: exact fix of noisy inputs / detection balanced accuracy45.7 / 68.650.5 / 86.024.1 / 51.80.5 / 51.6

Reference base models on the same harnesses (knowledge probe all / ICL v2 k = 4 / closed-book (a) k = 0 / spot-check): Qwen3.5-2B-Base 92.5 / 68.8 / 28.5 / 73.7; Granite-3.1-1B-A400M-Base 93.8 / 52.4 / 33.1 / 81.8; Gemma-4-E2B – / 70.9 / 44.1 / 89.8. They trained on trillions of tokens; R3's lineage saw about 65B.

  • Knowledge probe: 662 four-way definition items (164 rare U.S. legal terms, 300 OpenGloss word senses whose headword was in training, 198 held-out headwords), scored by PMI; chance 25%. R3-final is below the stable-phase checkpoint and well below R2-final and every reference model; the decay lowered it, and the score moves by several points between neighbouring checkpoints.
  • ICL v2: 29 few-shot tasks × 60 items (binding, induction, logic, arithmetic, legal), k = 4 greedy exact match.
  • Closed-book facts (a) asks about Wikidata facts that are in R3's training data, with phrasings held out; it measures recall of trained facts, not general knowledge. (c) asks about held-out obscure entities: R3-final is at 14.2% and answers instead of abstaining on almost all of them (84% of its chat answers to these are wrong).
  • Chat probe: 64 held-out items of the trained chat families; it measures how well the format was learned.
  • Spot-check: 147 hand-written items (world knowledge, legal, finance, few-shot patterns, math, logic, code, writing), greedy, first answer only.
  • Bare prompts: 360 prompts with no instruction or frame (word problems, arithmetic phrases, spelled-out arithmetic, sentence starts, greetings, legal openers). A leak is a continuation that switches into a training-task layout (a code, formal-logic or worked-answer block) instead of plain text.
  • Text correction: fixing typos and OCR noise when asked, and detecting whether a passage needs fixing.

2. Legal citations

The citation probe has 565 items: the Supreme Court case that stands for a stated holding (55 cases × brief, question-answer and chat form), case → page cite and page cite → case (100 Supreme Court, federal appellate and state cases), and 100 brief and opinion openers continued greedily and with 3 samples at T = 0.7. Every citation the model generates is checked against a table of real cases (does it exist; does the name match the cite).

R3-finalDecay v4 finalstable-31000R2-final
Proposition → correct Supreme Court case (165)60.627.323.021.8
Answers citing a wrong case (165)38.860.658.829.1
Case → page cite, exact (100) / page cite → case (200)100 / 1.587 / 1.081 / 0.054 / 0.0
Generated citations per 1,000 generated tokens12.93.92.43.0
Generated citations: real and correctly named / nonexistent75.0 / 12.968.2 / 22.229.6 / 43.540.4 / 37.6
Invented citations per 1,000 generated tokens [95% CI]1.67 [1.20, 2.14]0.87 [0.60, 1.15]1.03 [0.74, 1.33]1.11 [0.81, 1.41]
Invented citations per generation (400 generations)0.12 (48)0.10 (39)0.12 (47)0.13 (53)
Authority-seeking openers continued without any citation14.367.785.178.4

R3-final cites far more often than any earlier checkpoint, and a larger share of what it cites is real and correctly named. Because it cites about three times as often and its continuations are shorter, it produces more invented citations per generated token than the v4 final; per generation the difference is small (48 vs 39 over the same 400 generations).

3. Legal canon knowledge

ALEA is trained to know the law: it recites public-domain primary law verbatim. The canon suite (2,239 items) covers the Constitution (every section and amendment), the Federal Rules of Civil Procedure and Evidence, 279 frequently cited U.S. Code sections, landmark Supreme Court holdings, case ↔ citation, and 23 doctrinal elements tests. Higher is better.

R3-finalDecay v4 finalstable-31000R2-finalQwen3.5-2B-Base
Canon index (mean of the suite)45.544.336.320.116.0
Constitution: clause recalled from its citation cue (74)73.067.663.52.737.8
Constitution / Federal Rules: 64-token verbatim recitation in training layout100 / 100100 / 100100 / 96.95.7 / 0.015.7 / 0.0
Federal Rules: famous sentence produced (39)92.382.084.617.92.6
U.S. Code: operative clause from its citation cue (279) / 64-token recitation46.6 / 91.447.7 / 90.313.3 / 13.613.6 / 16.50.4 / 1.1
Landmark holdings: key-term recall8.67.36.13.07.8
Case → page cite (288) / page cite → case (288)100 / 0.798.6 / 0.094.4 / 0.476.0 / 0.423.3 / 0.0
Elements tests: controlling case named (23 tests)25.420.615.915.925.4

A second suite built from the case-law canon (1,834 items) shows where the decay's case data helped: case → page cite on the 1,000 landmark cases 100% (v4 final 84.9), on 7,000 lightly covered authorities 92.0% (34.7), but on a control set of cases R3 never trained on as canon 18.8% (18.8), so the gain is trained recall, not general citation skill.

4. Not measured on R3-final

The arithmetic probe (720 items) and the KL3M paper's likelihood benchmarks (LegalBench, CaseHOLD, LEDGAR, Financial PhraseBank, a 10-task general mean) were not re-run on R3-final. The arithmetic results on the stable-31000 card describe the pre-decay checkpoint only.

Release behaviour checks

Run on the published bf16 weights before release; the suites run locally and only scores are published. The LLM-judge toxicity comparison was run after release, on the same published weights.

Copyright memorization (text not in the public domain). Sequences that Pythia memorized from the Pile and that overlap known in-copyright book text, prompted with 32 tokens and scored on the next 32 (Biderman et al. 2023), and excerpt sets from HELM, MUSE-Books, BookMIA and CoTaEval (50-token prefix and suffix).

SetR3-finalDecay v4 finalstable-31000R2-finalGPT-2 (never saw the Pile)Pythia-1B (Pile)
Pile-memorized book prose (59): greedy exact / exact-suffix probability ≥ 0.1%0 / 10 / 10 / 00 / 10 / 158 / 54
same, deduplicated-Pile split (63)0 / 00 / 00 / 00 / 00 / 030 / 46
Copyright-page boilerplate from the same books (350): exact0 (1 character-level only)0 (1 character-level only)000 (1 character-level only)328
HELM books, MUSE-Books, BookMIA, CoTaEval books and news, MUSE-News (1,520): exact / probability ≥ 0.1%0 / 00 / 00 / 00 / 00 / 00 / 0

The one character-level boilerplate match is a run of consecutive dates ("13-Jul-2016 14-Jul-2016 …") after a Bible verse, which GPT-2 also reproduces; it is not a token-exact reproduction.

The Pile book-overlap sets also contain public-domain texts that books quote (the Preamble to the U.S. Constitution, the Article II presidential oath, a line of the Declaration of Independence, and King James Bible verses; 214 sequences). These are excluded above. R3 recites the Constitution Preamble and the presidential oath that some books quote (9 of the 20 founding-document sequences exactly); see Legal canon knowledge.

Toxicity: LLM-judge protocol of the KL3M toxicity study (kl3m-toxicity).

  • Prompts: the study's three prompt sets, all 570 prompts:
    • 001: 20 prompts from or modelled on RealToxicityPrompts;
    • 002: 500 forum-style prompts generated in the TOXIGEN manner;
    • 003: 50 protected-group openers, scored separately for toxicity and for bias.
  • Generation: each model continues the raw prompt as plain text, without a chat template. Settings: one sampled continuation per prompt, temperature 0.5, at most 64 new tokens, a fixed seed per completion.
  • Judging: done afterwards, by a separate model.
    • Each (prompt, completion) pair is a separate, independent request.
    • The judge sees only the prompt and the completion, never the model's name.
    • Items are shuffled across models.
    • Each pair is judged three times, as three separate calls at temperature 0.5, with the study's scoring prompts unchanged. Each call returns a 0–10 score, a reason, the offending terms and whether the language is used or only referenced (quoted, reported or discussed). The instructions tell the judge to score the model's continuation, not the prompt.
  • Aggregation:
    • Per completion: the median of the three scores and the majority use/reference label.
    • Headline: the use-flag rate, the share of prompts whose continuation scores ≥ 5 and is labelled as use.
    • Uncertainty: 95% bootstrap intervals over prompts (10,000 resamples). Model differences are paired over the same prompts.
  • Judge: GPT-6-sol through the OpenAI API (temperature 0.5, not stored).
    • 8,550 codings, with no judge errors and no refusals.
    • All five models were judged in the same campaign by the same judge, at the pinned revisions; R3-final is this repository at r3-final.
  • Provisional: the judge has not yet been calibrated against human ratings, and the API model is not an immutable snapshot. Compare models within this table only, not with scores from other judges.
Model002: use-flag ≥ 5 [95% CI]002: score ≥ 7002: mean score001: use-flag ≥ 5003 toxicity: use-flag ≥ 5003 bias: use-flag ≥ 5
KL3M-003-1.7B11.6% [9.0, 14.4]7.8%1.280%8%18%
R3-final15.4% [12.4, 18.6]10.4%1.700%4%8%
Qwen3.5-2B-Base25.8% [22.0, 29.6]17.0%2.7410%2%4%
Comma-v0.1-2T29.4% [25.6, 33.4]20.8%3.025%12%16%
Granite-3.1-1B-A400M-Base35.0% [30.8, 39.2]23.8%3.2825%18%22%

Rates are shares of prompts: 500 prompts for 002, 20 for 001, 50 for 003. "Score ≥ 7" counts clearly toxic continuations labelled as use.

  • On set 002 (500 prompts, the set with enough items to separate models), R3-final's use-flag rate is lower than every general-web model we ran. Paired differences:

    • −10.4 points vs Qwen3.5-2B-Base [95% CI −15.0, −6.0];
    • −14.0 vs Comma-v0.1-2T [−18.4, −9.6];
    • −19.6 vs Granite-3.1-1B-A400M-Base [−24.4, −14.8].

    It is 3.8 points above KL3M-003-1.7B [−0.4, +7.8], a difference within noise.

  • Use vs. reference: 77 of R3-final's 79 flagged continuations on set 002 are used language, and 2 are references or quotations. Its flags are therefore not explained by quoted language from court records.

  • Sets 001 and 003 are too small to separate R3-final from Qwen3.5-2B-Base or KL3M-003-1.7B. R3-final is below Granite on both (003 toxicity −14 points [−24, −6]).

  • Repeat check: a second continuation on a matched subset of 96 prompts gives the same ordering on set 002: R3-final 13.1% [6.0, 20.2], KL3M-003-1.7B 8.3%, Qwen3.5-2B-Base 26.2%, Comma 22.6%, Granite 38.1%.

  • Not yet measured with the judge: the 1,000-prompt RealToxicityPrompts set, greedy continuations, a court-record quotation set, and earlier R3 checkpoints. Without the earlier checkpoints, this campaign cannot say whether the decay phase changed toxicity.

Secondary: classifier cross-check. The same 1,000 "challenging" RealToxicityPrompts prompts, greedy plus 5 samples (T = 1.0, top-p 0.9), scored by two local classifiers (s-nlp RoBERTa and unitary/toxic-bert). EMT is the expected maximum toxicity, with a 95% bootstrap interval. A classifier scores surface words and cannot tell use from quotation, so these figures are a cross-check only, not the toxicity result. Their levels are not comparable with Perspective-API figures.

Regurgitation and PII use the KL3M paper's prompts:

  • regurgitation: the share of continuations with a ≥ 50-character span copied from the source but not in the prompt, and the mean longest common substring (LCS);
  • PII: the share of 250 sampled continuations with an e-mail, phone, SSN, card or address pattern.
ModelClassifier EMT RoBERTa [95% CI]P(any ≥ 0.5)Greedy ≥ 0.5EMT toxic-bertBooks: novel % / LCSLyrics: novel % / LCSU.S. gov. text: % / LCS2023 books LCS (chance)PII any %SSN %
R3-final0.46 [0.43, 0.49]0.460.360.460 / 80 / 3762 / 997660.0
Decay v4 final0.46 [0.43, 0.49]0.460.340.48––––––
stable-310000.41 [0.38, 0.44]0.410.330.420 / 70 / 3846 / 687640.4
R2-final0.43 [0.40, 0.46]0.430.320.460 / 70 / 3846 / 607610.0
KL3M-003-1.7B0.24 [0.21, 0.26]0.230.220.280 / 80 / 3654 / 847760.0
Pleias-350m-Preview0.44 [0.41, 0.47]0.450.330.480 / 8–90 / 43–4838–697–862–670.0–0.4
Qwen3.5-2B-Base0.72 [0.69, 0.75]0.730.390.72––––––
Granite-3.1-1B-A400M-Base0.87 [0.84, 0.88]0.870.560.85––––––
  • Classifier cross-check:

    • R3-final's classifier EMT is 0.46 [0.43, 0.49], against 0.41 [0.38, 0.44] at the stable-phase checkpoint (step 31,000), so the classifier score rose during the decay.
    • On the classifier, R3-final is level with Pleias-350m and below Qwen3.5-2B-Base and Granite, but about twice KL3M-003-1.7B.
    • Whether that rise is used or quoted language has not yet been judged.
  • Regurgitation: no novel ≥ 50-character span from copyrighted books or lyrics (lyrics LCS comes from repeating the chorus already in the prompt); book LCS is at the level of the post-cutoff 2023 control. U.S. government text, which is public domain and in the training data, is continued verbatim more often than before the decay (62% vs 46%).

  • PII: contact-block e-mail and phone patterns at the KL3M level; no SSN-shaped number in 250 sampled continuations. Treat any personal-looking detail in output as unverified.

Bare-prompt, citation and canon probes on the published weights. Re-run on the published bf16 weights, the probes match the training checkpoint within noise: bare-prompt leak 2.2% (360 prompts; 3% of bare word problems), on task 69.2%; proposition → case 60.0%, answers citing a wrong case 39.4%, case → page 100%; generated citations 75.3% real and correct, 12.6% nonexistent, 1.59 invented per 1,000 generated tokens (47 in 400 generations); canon index 45.5.

Intended use

  • Research on small models trained only on lawful data, including data-provenance, memorization, MoE, model-growth and decay-mix studies (the decay branches in this repository).
  • Continuation of U.S. legal, regulatory and financial text (clauses, statutory and regulatory language, filing boilerplate, opinion prose), with human review.
  • Recall of public-domain primary law (Constitution, Federal Rules, U.S. Code) and case citations, with verification.
  • Prototypes of grounded QA and extraction over passages you supply, in the chat format above.

Out of scope: legal advice or any use where output is relied on without verification; unsupervised factual QA (closed-book); code generation; general-purpose assistant chat; non-English text.

Limitations and risks

Excerpts below are outputs of R3-final (greedy unless marked).

  • Invented citations. R3-final cites case law readily, and some of those citations do not exist: 12.9% of the citations it generates in brief and opinion continuations are nonexistent, which is 1.67 invented citations per 1,000 generated tokens (95% CI 1.20–2.14), or on average one invented citation per eight generations (48 in 400). That rate per token is higher than the v4 final (0.87) and R2-final (1.11), because R3-final cites about three times as often. Example (greedy, an opener from the citation probe): The defendant moved to suppress his statements to the police, arguing that → their admission violated his Fifth Amendment privilege against self-incrimination. The District Court denied the motion, and the Court of Appeals for the Second Circuit affirmed. 426 F. 2d 1044 (1970)., a reporter citation that is not in the table of real cases. Always verify citations, quotations and numbers.
  • Real cases cited for the wrong proposition. More often than inventing a case, R3-final names a real case that does not stand for the point: 38.8% of its answers to "which Supreme Court case holds …" cite a wrong case, and in free text it attaches real, correctly cited cases to propositions they do not support. In chat: Which U.S. Supreme Court case is the leading authority for the proposition that the Fourth Amendment protects people, not places, and reaches a conversation in which a person has a reasonable expectation of privacy? Give the case name and citation. → That is Rakas v. Illinois, 439 U.S. 128 (1978). (the answer is Katz v. United States, 389 U.S. 347). It almost never recovers a case from a bare page cite (1.5%). Answers about whether a case has been overruled can contradict themselves; verify any treatment statement.
  • Definitions. Definition knowledge is well below the stable-phase checkpoint and R2-final (knowledge probe 66.8 vs 74.5 and 89.3; legal terms 82.9 vs 90.2 and 94.5). Definition cues can also open with stray symbols or degenerate: estoppel (noun): → ~ and then a correct definition (greedy), while a sampled continuation of the same cue repeated .1 lines until the length limit.
  • Text correction. R3-final fixes noisy text when asked (45.7% exact) but is poor at telling whether a passage needs fixing (balanced accuracy 68.6, against 86.0 for the v4 final).
  • Arithmetic in prose. Numbers inside generated filing text are often inconsistent: For the fiscal year ended December 31, 2023, the Company's revenue → was $1,072,000. The Company's operating expenses … were $1,072,000, a decrease of $1,072,000 or 100% from $2,144,000.
  • Bare prompts. The decay removed most task-layout continuations of prompts with no instruction (2.2% of 360 bare prompts, against 35.6% before the decay; 3% of bare word problems), but some remain: A farmer picked 22 eggs and 20 were cracked. How many eggs were not cracked? → Can you check it with Python? followed by a Python block that computes the wrong quantity and answers That is 20%. Only about two-thirds of bare word problems are answered correctly, and a third of arithmetic with spelled-out operands.
  • Canon gaps. Recall is strong for text the model saw many times and weak elsewhere: only 46.6% of U.S. Code sections are recalled from their citation alone, landmark holdings are rarely stated in their key terms (8.6%), and a page cite almost never leads back to its case.
  • Closed-book knowledge. Facts outside the trained Wikidata set are weak, and the model rarely abstains on entities it does not know.
  • No instruction or safety tuning. R3-final has a small amount of identity, small-talk and refusal data, but it has not been instruction-tuned, red-teamed or aligned. It inherits the content of public legal and government records, which include descriptions of crimes, litigation and personal details in court records.
  • Code. Weak (6 of 15 simple function stubs pass their unit tests in the spot-check).
  • Trailing whitespace. End prompts without a trailing space (see Quick start).
  • Not legal advice. Output is not reviewed by a lawyer and may be wrong on the law in fluent, confident prose.
  • 2,048-token context. Longer inputs are untested.
  • English-centric and U.S.-legal-centric. The EU Official Journal (English) is the only non-U.S. legal source.

Citation

@misc{alea_r3_moe_2026,
  title        = {{ALEA} {R3} {MoE} 2B-A417M: a small mixture-of-experts model trained on lawful data},
  author       = {{ALEA Institute} and Bommarito, Michael J., II},
  year         = {2026},
  howpublished = {Hugging Face model repository},
  url          = {https://huggingface.co/alea-institute/alea-r3-moe-2b-a417m},
  note         = {R3-final: step 38,296, after a learning-rate decay on decay mix v5}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
AleaMoeForCausalLM
Ревизия весов
29462b7

0 моделей