CoolFace
Modelpublic

zhangsq-nju/Qwen3-1.7B-EdgeRazor-1.88bit

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
2likes38downloads
Model Card

<div align="center"> <br/> <img src="./asset/Logo-HF.png" alt="EdgeRazor Logo" width="60%"> <h3> EdgeRazor for Lightweight LLMs </h3>

<p> <a href="https://arxiv.org/abs/2605.04062" target="blank"> <img src="https://img.shields.io/badge/arXiv-EdgeRazor-b31b1b?style=flat&logo=arxiv" alt="arXiv EdgeRazor"> </a> <a href="https://github.com/zhangsq-nju/EdgeRazor" target="blank"> <img src="https://img.shields.io/badge/GitHub-EdgeRazor-blue?style=flat&logo=github" alt="GitHub EdgeRazor"> </a> <a href="https://pypi.org/project/edgerazor/" target="blank"> <img src="https://img.shields.io/pypi/v/edgerazor?style=flat&logo=pypi" alt="PyPI EdgeRazor"> </a> </p>

</div>

<h1>Qwen3-1.7B-EdgeRazor-1.88bit</h1>

Contents

Model Overview

Model Bit-Widths

Mixed-Precision RecipeBit-WidthThis Repo
100% 4-bit + 0% 1.58-bit4
50% 4-bit + 50% 1.58-bit2.79
12.5% 4-bit + 87.5% 1.58-bit1.88✔️
0% 4-bit + 100% 1.58-bit1.58

Model Performance

ModelsW-A-KVARC-eARC-cHellaS.BoolQPIQAWinoG.SIQAOBQATr.QA2EthicsMMLUIFEvalGSM8KHumanE.Average (↑)
Qwen3-1.7B16-16-1669.8742.8360.4077.7772.5860.8545.1937.4045.9749.6355.4967.1068.7667.0758.64
EdgeRazor4-16-1670.6644.8057.5180.0972.3160.1444.0638.4048.4164.0254.7058.9668.3957.3258.56
EdgeRazor2.79-16-1663.4738.5749.4878.7868.2355.6443.9133.4045.4260.8146.2554.7154.2853.6653.33
EdgeRazor1.88-16-1659.6034.0440.9472.1165.2354.3841.7629.8046.0957.3038.9343.8136.3939.6347.14
EdgeRazor1.58-16-1655.6031.0639.5370.9563.6053.2841.9731.6040.1655.8935.0032.7229.4933.5443.89
EdgeRazor4-8-870.1644.4557.5279.8272.5859.6743.4538.2048.3763.5654.2960.2668.5459.1558.57
EdgeRazor2.79-8-862.7938.3149.5378.3868.7256.0443.6533.4045.5760.7246.2754.3453.6850.6153.00
EdgeRazor1.88-8-859.0933.5340.8572.1465.1853.9941.7629.0046.1857.3339.0341.9637.5340.8547.03
EdgeRazor1.58-8-855.6431.4839.6870.7064.2553.9141.7631.6040.1556.2635.0732.3528.9632.9343.91

Quickstart

It is recommended to ensure that EdgeRazor is installed in advance for weight-activation quantization. The provided weights are already quantized (quantizedweights*scalingbf16); to enable activation and KV cache quantization, set trust_remote_code=True in the model configuration.

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "zhangsq-nju/Qwen3-1.7B-EdgeRazor-1.88bit"

# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True,
)

# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=False # For EdgeRazor-nbit, we only train the instruct mode.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

# conduct text completion
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() 

# parsing thinking content
try:
    # rindex finding 151668 (</think>)
    index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
    index = 0

thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")

print("thinking content:", thinking_content)
print("content:", content)

Citation

If you find our project useful in your research, please consider kindly citing our papers ✏️:

@article{zhangsh-edgerazor,
  title={{EdgeRazor}: A Lightweight Framework for Large Language Models via Mixed-Precision Quantization-Aware Distillation},
  author={Shu-Hao Zhang and Le-Tong Huang and Xiang-Sheng Deng and Xin-Yi Zou and Chen Wu and Nan Li and Shao-Qun Zhang},
  year={2026},
  journal={arXiv preprint arXiv:2605.04062}
}