Views
No views yet
Akicou/ream — a REAM/REAP-style Mixture-of-Experts compression framework.S[i] = mean(||h_i(x)|| × p_i(x)) over tokens routed to expert i.--fast-merge).| Metric | Original (LLaDA2.2-flash) | REAM-50B | Change |
|---|---|---|---|
| Routed Experts/Layer | 256 | 128 | -128 (-50%) |
| MoE Layers | 31 (layer 0 is dense) | 31 | — |
| Top-k per token | 8 | 8 | — |
| Calibration | 100 samples, hardcoded prompts | — | — |
| Merge Method | Saliency-weighted avg (--fast-merge) | — | — |
| Grouping | REAM pseudo-group (group_size=16) | — | — |
expert_bias vector (analogous to DeepSeek's e_score_correction_bias) is correctly shrunk alongside the router weights on every layer.1python examples/compress_sequential.py \
2 --model inclusionAI/LLaDA2.2-flash \
3 --output ./LLaDA2.2-Flash-REAM-50B \
4 --target-ratio 0.5 \
5 --samples 100 \
6 --max-seq-len 512 \
7 --batch-size 4 \
8 --max-tokens 2048 \
9 --cpu-merge \
10 --fast-merge \
11 --seed 42trust_remote_code=True (same as the base LLaDA2.2-flash).expert_bias is correctly shrunk (256 → 128) alongside mlp.gate.weight.generate() is a non-autoregressive, block-wise iterative refinement loop and targets transformers==5.2.0 (the base model's version); on newer transformers (≥ 5.3) the refactored GenerationMixin breaks it, so pin that version for inference. The forward / loss path works on the current stack, so the checkpoint is fine-tune ready regardless.tokenizer.save_pretrained() was found to re-serialize the fast tokenizer incorrectly, producing byte-level fallback; the original tokenizer.json / tokenizer_config.json / chat_template.jinja / custom tokenization_llada2.py are used as-is).transformers==5.2.0, temperature=0.0, block_length=32, gen_length=512, threshold=0.5, eos_early_stop=True). Note: like the base model, inputs must satisfy num_tokens % block_size(32) == 0.The term "Heyting Algebra thingamajig" appears to be a fictional or made-up term, possibly derived from a combination of words such as "Heyting" and "Algebra" along with "thingamajig."This is a calibrated-merge release: a 50%-compressed checkpoint with no fine-tuning yet. Generation is coherent but visibly lower-quality / more literal than the 256-expert base (which gives a full intuitionistic-logic explanation). Fine-tuning is expected to recover quality. Forward + cross-entropy loss verified (loss ≈ 0.19 on a sample sentence).
model.config.num_experts == 128, num_experts_per_tok == 8.mlp.gate.weight (128, 4096) and mlp.gate.expert_bias (128,) confirmed per layer; shared experts present; lm_head.weight preserved (tie_word_embeddings=False).apply_chat_template → 19 tokens for the smoke-test prompt, matching the base).1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_id = "Akicou/LLaDA2.2-Flash-REAM-50B"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 dtype=torch.bfloat16,
10 device_map="auto",
11 trust_remote_code=True,
12)
13
14# NOTE: block-diffusion models require token length to be a multiple of block_size (32).
15text = "The quick brown fox jumps over the lazy dog. " * 3
16inputs = tokenizer(text, return_tensors="pt").to(model.device)
17
18outputs = model(**inputs, labels=inputs.input_ids)
19print("loss:", float(outputs.loss))temperature=0.0, block_length=32, threshold=0.5, editing_threshold=0.0, gen_length=512, eos_early_stop=True) with a compatible transformers version.1@article{jha2026ream,
2 title={REAM: Merging Improves Pruning of Experts in LLMs},
3 author={Jha, Saurav and Hashemzadeh, Maryam and Pasand, Ali Saheb and Parviz, Ali and Lee, Min-Joong and Knyazev, Boris},
4 journal={arXiv preprint arXiv:2604.04356},
5 year={2026}
6}
7
8@misc{llada2,
9 title={LLaDA2.2-flash},
10 author={inclusionAI},
11 year={2026},
12 url={https://huggingface.co/inclusionAI/LLaDA2.2-flash}
13}