[KongchangAI]
· 2 min read· 1,449 words

KQuant Quantization: Drastically Lower KL Divergence, Smaller and Faster Qwen Models

KQuant Quantization: Drastically Lower KL Divergence, Smaller and Faster Qwen Models

KQuant uses activation-aware quantization to give Qwen models both higher precision and faster speed on Mac.

ML engineer Alish released KQuant, a quantization scheme for Qwen models in the MLX ecosystem. It uses real text data to search scaling and offset values for small weight groups, allocates extra bits to sensitive layers, performs the search in the cloud, and delivers standard MLX files. Measured by KL divergence, KQuant Q4 beats public 4-bit baselines across all tested models: Qwen3.8-Flash-Next improves 3.7x while being smaller, 9B at 2.6x, and 4B/27B/35B between 1.45–1.6x with similar size. On M5 Pro with Kapitsa and KFlash drafter, write speed is 6–15% faster. Free and open source on Hugging Face, with GGUF coming soon. The author notes KL divergence is not a task accuracy metric, so real-world performance needs verification.

The MLX ecosystem welcomes a new quantization solution. ML engineer Alish (from the Nace team, previously developer of the open-source decision model Drex) has released KQuant on Reddit—a quantization technique targeting the Qwen series models, claimed to significantly outperform public 4-bit quantization packages in terms of precision loss (measured by KL divergence), while maintaining or even reducing model size.

The Quantization Pain Point and the Birth of KQuant

Most Mac users run 4-bit quantized models because that's the limit 16GB or 32GB of memory can accommodate. But simple 4-bit quantization rounding discards more model information than necessary. After open-sourcing the fastest way to run 35B/27B models on Mac (Kapitsa), Alish's team decided to build a better quantization scheme themselves, and KQuant was born.

The core idea of KQuant is: use real text data to select scaling and offset values for small weight groups, and allocate extra bits to sensitive layers. The entire search process is completed on cloud GPU clusters before release; users download standard MLX files and need no custom kernels or special loaders.

KQuant released on Reddit

Scaling (scale) and offset (zero-point/offset) in weight quantization are two key parameters in affine quantization y = round(x/s + z): s determines the granularity with which floating-point values map to integers, and z determines how the representable value range is aligned. Traditional methods (such as simplified versions of GPTQ and AWQ) often set these two using heuristic rules or based only on the weights themselves—for example, by the min/max values within a weight group or based on activation statistics.

KQuant does it differently: it runs forward passes with real text data, observes the actual impact of each weight group on the output when activated, and then searches for the optimal s and z for small weight groups accordingly, allocating higher bits to "sensitive layers" (layers with large impact on output). This type of method belongs to the activation-aware quantization approach, consistent with AWQ's core insight—not all weights are equally important, and a few salient channels need finer representation. The cost is that the quantization process requires extensive forward computation, which is why the article mentions the search is completed on cloud GPU clusters and users only receive the final standard MLX files.

Measured Results: KL Divergence Leads Across the Board

The evaluation metric is KL divergence—measuring the difference between the next-token prediction distributions of the quantized model and the full-precision model; lower values indicate closer proximity to the original model. Below is the comparison between KQuant Q4 and public 4-bit baselines (mlx-community, with lmstudio-community for 4B models):

ModelKQuant Q4 KLPublic 4-bit KLImprovement FactorSize (GB) ours / public
Qwen3.5-4B0.0480.0701.45x2.37 / 2.37
Qwen3.5-9B0.0300.0812.6x5.29 / 5.04
Qwen3.8-27B0.0350.0541.5x15.13 / 15.13
Qwen3.6-35B-A3B0.0590.0961.6x19.51 / 19.51
Qwen3.8-Flash-Next0.0670.2493.7x (and smaller size)105.20 / 110.62

The most striking is Qwen3.8-Flash-Next: KQuant achieves a 3.7x improvement in KL divergence while being smaller in size. The 9B model also shows a significant 2.6x improvement. For the 27B and 35B models, improvements range between 1.5-1.6x, with essentially identical sizes.

The repositories for each model also provide a Q5 precision folder for users who need higher precision.

KL divergence (Kullback-Leibler divergence) is a metric in information theory for measuring the difference between two probability distributions, with the formula D_KL(P‖Q) = Σ P(x)·log(P(x)/Q(x)). In quantization evaluation, P typically refers to the full-precision model's next-token prediction distribution for each token, and Q refers to the corresponding distribution of the quantized model. It measures how much additional information (in bits) is lost when approximating P with Q. Lower values indicate the quantized model is closer to the original, with 0 meaning completely identical.

It's particularly important to note that KL divergence is an extremely quantization-sensitive metric: it performs a weighted sum of probability deviations across the entire vocabulary, so even if the quantized model still selects the correct token, KL will rise as long as the probability distribution shape deviates. Therefore, low KL divergence does not equate to high accuracy on downstream tasks (such as reasoning or code generation); it more reflects "model behavior fidelity." The industry commonly uses KL/perplexity as quick proxy metrics for quantization screening, but final validation on specific tasks is still required.

Speed Advantage: 6-15% Faster on M5 Pro

Another selling point of KQuant is speed. On M5 Pro, using Kapitsa 0.2.35 and its KFlash drafter, KQuant Q4 achieves write speeds about 6-15% faster than lmstudio-community's 4-bit quantization on the 4B, 9B, and 27B models; the 35B model, compared against Youssofal MTPLX 4-bit, is likewise faster on the same engine. These figures are averages of sampling decoding and greedy decoding.

![Write speed comparison between KQuant and public 4-bit packages on M5 Pro] (No specific chart provided in the original; text description only)

MLX is Apple's array computing and machine learning framework designed for Apple Silicon, leveraging the unified memory architecture so that CPU and GPU share the same physical memory, avoiding data copying. MLX-format quantized models (typically 4-bit group quantization) can be loaded directly by runtimes such as mlx-lm and Kapitsa without conversion to GGUF or other formats.

Kapitsa and KFlash drafter are the inference engine supporting this project: Kapitsa handles efficient loading and running of MLX models on Mac, while KFlash drafter employs speculative decoding—using a small draft model to quickly generate several candidate tokens first, then having the large model verify them in parallel, thereby improving generation speed without changing the output distribution. The difference in "write speed" (tokens/s) may come both from quantized weights better matching hardware memory access patterns and from co-optimization with the engine.

How to Use and Obtain

The KQuant quantization packages are freely open-sourced on Hugging Face, covering the 4B, 27B, 35B, and Flash-Next models in standard MLX format. They run just like ordinary MLX packages, and pairing with Kapitsa is recommended:

brew install nace-ai/tap/kapitsa
kapitsa serve 27b --private
kapitsa opencode # another terminal

A GGUF version is expected to be released the next day. In his post, Alish said that those who want to test the GGUF version early can contact him in the comments.

Technical Details and Community Interaction

Alish mentioned that KQuant's development leveraged the Fable 5.2 and Astra models, using 128 sub-agents for the search. He himself is an ML engineer who, after the CTO assigned the task of optimizing Qwen4 quantization, reached out to a professor at the University of Toronto to complete it together.

Users who want KQuant to support other models can leave a comment. Alish also conducted a brief AMA (Ask Me Anything) interaction in the post.

Overall, KQuant provides a higher-precision, faster quantization option for running local large models on Mac, with particularly notable results for large models like Flash-Next. However, KL divergence is not a task accuracy metric, and actual performance in real applications still requires users to verify themselves.

GGUF is a model file format widely used in the llama.cpp ecosystem, supporting multiple quantization types and running on Mac, Windows, Linux, and various CPU/GPU backends, compatible with tools such as Ollama and LM Studio. Unlike the MLX format, which is specifically optimized for Apple Silicon, GGUF offers stronger cross-platform capability but typically cannot fully exploit the performance of Apple's unified memory architecture. KQuant releasing the MLX version first and following up with GGUF indicates that its target users include both enthusiasts seeking ultimate Mac performance and the community needing to distribute models across multiple platforms.

One-line Summary

KQuant uses activation-aware quantization to give the Qwen series both higher precision and faster speed on Mac.

Paragraph Summary

ML engineer Alish has released KQuant, a quantization scheme for the Qwen series running in the MLX ecosystem. It uses real text data to search for scaling and offset values for small weight groups, allocates extra bits to sensitive layers, completes the search in the cloud, and delivers standard MLX files to users. Measured by KL divergence, KQuant Q4 outperforms public 4-bit baselines on all tested models: Qwen3.8-Flash-Next achieves a 3.7x improvement while being smaller, 9B reaches 2.6x, and 4B, 27B, and 35B range between 1.45–1.6x with essentially unchanged size. On M5 Pro paired with Kapitsa and KFlash drafter, write speeds are about 6–15% faster. The quantization packages are freely open-sourced on Hugging Face, with a GGUF version to follow. The author cautions that KL divergence is not a task accuracy metric, and actual results still require user verification.

#KQuant#MLX quantization#Qwen#KL divergence#Apple Silicon#local LLM#Kapitsa
Share:

Related articles