Views
No views yet
llama.cpp regarding the scoring_func for GLM models (which caused looping and poor output quality). While the base weights are functional, the GGUF files for this model are currently being re-generated to ensure full compatibility with the latest fixes.llama.cpp or Unsloth, please refer to the official Unsloth GLM-4.7-Flash documentation for the most stable configuration parameters.transformers and vLLM for immediate use.REAP Algorithm:
1. Forward pass calibration samples through model
2. Record which experts activate and their magnitudes
3. Compute saliency = router_weight × activation_norm
4. Prune lowest-saliency experts
Key Insight: Experts are TASK-SPECIFIC
├── Some experts specialize in natural language
├── Some experts specialize in code syntax
├── Some experts specialize in JSON/structured output
└── Some experts specialize in multi-turn context
If calibration lacks code → code-specialized experts appear "unused" → get pruned → model loses coding ability1vllm serve Akicou/GLM-4.7-Flash-REAP-19 \
2 --tensor-parallel-size 2 \
3 --trust-remote-code \
4 --dtype bfloat161import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model = AutoModelForCausalLM.from_pretrained(
5 "Akicou/GLM-4.7-Flash-REAP-19",
6 torch_dtype=torch.bfloat16,
7 device_map="auto",
8 trust_remote_code=True
9)
10tokenizer = AutoTokenizer.from_pretrained("Akicou/GLM-4.7-REAP-19", trust_remote_code=True)
11
12messages = [{"role": "user", "content": "Write a Python function to merge two sorted lists."}]
13inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
14outputs = model.generate(inputs.to(model.device), max_new_tokens=512, temperature=0.7)
15print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@article{lasby2025reap,
2 title={REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression},
3 author={Lasby, Mike and Lazarevich, Ivan and Sinnadurai, Nish and Lie, Sean and Ioannou, Yani and Thangarasa, Vithursan},
4 journal={arXiv preprint arXiv:2510.13999},
5 year={2025},
6 url={https://arxiv.org/abs/2510.13999}
7}