LFM2.5-8B-A1B-REAP-50-AWQ-INT4

Model Description

This is the REAP-pruned + AWQ INT4-quantized variant of LiquidAI/LFM2.5-8B-A1B, representing the full compression pipeline:

  1. REAP pruning (50% experts removed) → konic-labs/LFM2.5-8B-A1B-REAP-50
  2. AWQ INT4 quantization (W4A16_ASYM, group_size=128) → this model
  • Base: 8.47B params, 16.94 GB (bf16)
  • This model: 2.79 GB on disk (83.5% total compression)
  • Quant format: compressed-tensors pack-quantized (INT4 weights, bf16 activations, asymmetric, group_size=128)
  • Runtime VRAM: ~8.6 GB (weights decompress to bf16 in memory)
  • 1,122 weight tensors quantized; routers, layer norms, embeddings, and Conv1d internals left unquantized

⚠️ Loading Requires a Small Patch

The compressed-tensors pack-quantized format has two bugs in current transformers that prevent loading asymmetric-quantized MoE expert weights. A self-contained patch is included in patches/apply_int4_patch.py.

Upstream status: These bugs are fixed upstream in PR huggingface/transformers#47430. The fix is general for any MoE model with fused expert nn.Parameter weights (LFM2.5, Qwen2-MoE family) quantized with an asymmetric compressed-tensors scheme. Once merged, this patch script becomes unnecessary — re-run it only until your installed transformers release includes the fix.

# Apply the patch (creates .orig backups, idempotent, --check to verify)
python patches/apply_int4_patch.py
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "konic-labs/LFM2.5-8B-A1B-REAP-50-AWQ-INT4",
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(
    "konic-labs/LFM2.5-8B-A1B-REAP-50-AWQ-INT4", trust_remote_code=True
)

Re-run the patch after every pip install -U transformers. See patches/README.md for details and how to decompress to a vLLM-compatible bf16 checkpoint if you need vLLM inference (the INT4 pack-quantized format is not yet loadable by vLLM directly).

AWQ Quantization Details

  • Method: AWQ (Activation-aware Weight Quantization) via llm-compressor
  • Scheme: W4A16_ASYM (4-bit weights, 16-bit activations, asymmetric, group_size=128)
  • Calibration: 256 samples from evol-codealpaca-v1/train.jsonl
  • Custom LFM2.5 AWQ mappings: operator_norm → attention q/k/v projections, ffn_norm → MoE expert w1/w3 projections (LFM2.5 uses non-standard layer-norm names). v_proj→out_proj and conv.in_proj→conv.out_proj were skipped due to GQA dimension mismatch and Conv1d intermediary respectively.
  • Average AWQ smoothing error: ~5-7 × 10⁻⁴ (well-converged)

Benchmark Results

Benchmark Base (published) REAP-50 (pruned) This model (REAP+AWQ-INT4) Retention
MATH500 88.76% 77.0% 72.0% 81.1%
BFCLv3 (single-turn) 64.79% 59.07% 57.36% 88.5%

MATH500 per-difficulty (this model)

Level Accuracy
L1 90.7%
L2 84.4%
L3 81.9%
L4 72.7%
L5 49.3%

BFCLv3 per-category (this model)

Category Accuracy
simple_python 69.25%
simple_java 44.00%
simple_javascript 38.00%
multiple 79.00%
parallel 69.50%
parallel_multiple 66.00%
irrelevance 83.75%
live_simple 51.94%
live_multiple 48.24%
live_parallel 12.50%
live_parallel_multiple 45.83%
live_irrelevance 75.57%
live_relevance 50.00%

Key finding: Quantization adds only ~5pp MATH500 and ~1.7pp BFCLv3 degradation beyond pruning alone, while delivering a 67% disk-size reduction on top of REAP. L1-L3 math is completely unaffected; advanced/competition math (L4-L5) bears the cost.

Throughput (vLLM, NVIDIA L4)

Concurrency Tokens/sec
64 2,227
128 3,334
256 4,809 (sweetspot)
384 4,287
512 4,273

(Measured on the AWQ-scaled bf16 decompressed variant, which is functionally identical to this INT4 model at runtime.)

Intended Use

Research and deployment of compressed MoE models. This is the full-pipeline output of REAP pruning + AWQ INT4 quantization — the smallest deployable variant.

Citation

@software{reap-cuda,
  title  = {REAP: Ranking and Eliminating Experts via Activation Patterns},
  author = {Konic Labs},
  url    = {https://github.com/egesabanci/reap-cuda}
}

License

Apache-2.0 (inherited from base model).

Downloads last month
61
Safetensors
Model size
5B params
Tensor type
I64
·
F32
·
I32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for konic-labs/LFM2.5-8B-A1B-REAP-50-AWQ-INT4

Quantized
(59)
this model