CoolFace
Modelpublic

petergilani/Qwen3-Coder-Next-4bit-g128

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes29downloads
Model Card

Model Card for petergilani/Qwen3-Coder-Next-4bit-g128

Quantized Qwen/Qwen3-Coder-Next using mlx-lm to 4-bit with group_size 128 for main weights, with the aim of maximum efficiency for 4-bit quantization.

Updated Evaluation Results (February 13, 2026)

Comprehensive evaluation results from thorough testing using mlxlm.evaluate with mmlupro (200 questions per domain, numshots=1, temp=1.0, topp=0.95, top_k=40, seed=123):

Direct Comparison Summary (4-bit g64 vs g128)

Domain4-bit g644-bit g128 (this model)Difference
Computer Science85.5%85.5%0.0%
Math92.0%91.5%-0.5%
Physics88.0%91.0%+3.0%
Engineering69.0%71.0%+2.0%
Chemistry86.0%86.0%0.0%

Average Performance

  • —4-bit g64: 84.1% average
  • —4-bit g128 (this model): 84.2% average
  • —Difference: 0.1 percentage points (virtually identical)

Key Observations

  • —Both 4-bit models show nearly identical average performance (84.1-84.2%)
  • —Performance differences are domain-specific rather than model-specific
  • —4-bit g128 (this model) performs better in Physics and Engineering
  • —4-bit g64 performs slightly better in Math and Chemistry

Memory Usage Comparison

  • —4-bit g64:
  • —Peak memory usage: 56.355 GB (Math) to 61.010 GB (Physics)
  • —Average memory usage: ~60.0 GB
  • —4-bit g128 (this model):
  • —Peak memory usage: 51.989 GB (Math) to 59.084 GB (Engineering)
  • —Average memory usage: ~57.3 GB

Full Quantization Spectrum Comparison (Updated)

Domain3-bit default3-bit g1284-bit g644-bit g128 (this model)6-bit default6-bit g1288-bit g648-bit g128
Math0.940.900.9200.9150.900.940.9300.925
Computer Science0.820.840.8550.8550.820.860.8500.875
Engineering0.700.640.6900.7100.740.720.7100.685
Physics0.940.920.8800.9100.960.940.9200.885
Chemistry0.860.880.8600.8600.940.920.8750.885
Average0.8520.8360.8410.8420.8720.8760.8700.870

Original Evaluation Results

Testing with mlxlm.evaluate using mmlupro with 50 Qs for each topic, comparing the 4-bit g128 quant with the 4-bit g64 quant:

Domaing64g128Improvement
Math0.920.920%
Computer Science0.840.840%
Engineering0.700.76+6%
Physics0.940.96+2%
Chemistry0.900.900%

Average Performance

  • —4-bit g64: 84.4% average
  • —4-bit g128: 86.0% average
  • —Improvement: +1.6 percentage points with group size 128

Key Benefits

  • —The g128 group_size applied to main weights provides modest memory savings (~2.7 GB less on average)
  • —Performance differences between group sizes are minimal for 4-bit quantization
  • —4-bit quantization provides significant memory efficiency (~40% less than 8-bit models)
  • —Thermal characteristics are highly favorable compared to higher-bit quantizations, making this suitable for thermal-constrained environments

Model Details

  • —Base Model: Qwen/Qwen3-Coder-Next
  • —Library: mlx-lm
  • —Quantization: 4-bit with group_size 128 for main weights
  • —License: apache-2.0
  • —Pipeline Tag: text-generation

Usage

python
import mlx_lm
from mlx_lm.sample_utils import make_sampler

model_path = "petergilani/Qwen3-Coder-Next-4bit"
model, tokenizer = mlx_lm.load(model_path)

sampler = make_sampler(temp=1.0, top_p=0.95, top_k=40)

prompt = "Write a Python function to calculate the factorial of a number."
response = mlx_lm.generate(
    model, 
    tokenizer, 
    prompt=prompt,
    sampler=sampler,
    max_tokens=512
)
print(response)