macintosh.world | Log In | Register

Today | News | Books | Recipes
Notes | QuickTake | Wiki | Browse
Maps | Reference | Reddit | YouTube
Chat | Games | About

GitHub - ShinMegamiBoson/lookatmyquant: A quantization compiler that delivers 12× lower KL than Q4_K_M at the same file size · GitHub

Open Original Page

GitHub - ShinMegamiBoson/lookatmyquant: A quantization compiler that delivers 12× lower KL than Q4_K_M at the same file size · GitHub

Products Platform GitHubRepository hosting, code review, and collaboration

CopilotAI coding agent for tasks, projects, and automated work

Build & Ship ActionsCI/CD and automation

Code QualityQuality analysis, fixes, and enforcement

CodespacesCloud development environments

Secure Code SecurityVulnerability detection and remediation

Secret ProtectionSecret scanning and leak prevention

Developers LearnDocumentation

BuildBuild with Copilot

ExploreTrending repos

Changelog Changelog Your source for the latest features, improvements, and fixes across GitHub products, all in one place.

Businesses By StageEnterprises

By IndustryHealthcare

Evaluate GitHubWhy GitHub

Add-ons GitHub Advanced SecurityEnterprise-grade code security

Copilot for businessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Resources Learn & ConnectDocumentation

SupportCustomer support

GitHub Universe GitHub Universe The event for developers, by developers - talks, workshops, and what's next for GitHub.

Sign up Appearance settings





You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.

Repository navigation

Security and quality

NotificationsYou must be signed in to change notification settings

Star673 (673)You must be signed in to star a repository

A quantization compiler that delivers 12× lower KL than Q4_K_M at the same file size

lookatmyquant.pages.dev

Code Open more actions menu

NameNameLast commit message

checked_solutions.py

checked_solutions.py

compiler_artifact.py

compiler_artifact.py

Repository files navigation

LookAtMyQuant is a quantization compiler. It measures how much each stored piece of a model hurts the output when compressed. It then picks a code for each piece so the whole model fits a size budget with the least damage.

On Gemma 4 E2B, its GGUF has 12× lower KL than Q4_K_M at the same file size. The method and every result are on the site.

The code is under the MIT license.

LookAtMyQuant 2: Qwen3.5-4B in 1.2 GB

LookAtMyQuant 2 takes Qwen3.5-4B to 1.23 GB, 2.3 bits per weight. The file solves 330 of 540 exact-answer math problems. Prism ML's Bonsai 2 Ternary 4B solves 328 at 1.20 GB, and the original solves 359. Its KL from the original on held-out text is 0.45 nats, against 0.59 for Bonsai.

The recipe is post-training quantization with trellis codes, calibrated on the model's own worked math solutions with digit tokens weighted 10×, and with bits allocated per row by Fisher information. 4,000 steps of distillation follow, in which every layer is re-quantized once from the original weights. The page has the findings, the full recipe and its cost, about $34 of GPU time.

The recipe's code is here, and the next section runs it. The 1.23 GB file itself is the lm2-qwen35-4b-1.2gb release, packed for the Apple Silicon runtime.

Qwen3.8-27B in 7.2 GB

The same recipe takes Qwen3.8-27B from 53.7 GB to 7.2 GB, 2.1 bits per weight, calibrated and distilled on English prose and chat, code and math. The file solves 401 of the 540 math problems, as many as the original, and Unsloth's UD-IQ2_XXS GGUF of the same size solves 348. It also scores above that GGUF on HumanEval (73.8% against 67.1%), MMLU (78.8% against 75.0%) and GSM8K (94.5% against 92.7%).

Beside it sits a 4-bit DSpine drafter (1.02 GB, converted from tencent/Qwen3.8-27B-DSpine-b16 with runtime_mlx/convert_dspine.py and packed with pack_drafter.py), which roughly doubles decode speed on math and code on Apple silicon.

Inkling-2-Mini in 3.9 GB, 4.7 GB, 5.4 GB, 8.9 GB, 11.2 GB, and 12.8 GB

Extended to a 26.4B physical / 5.4B active 3×-looped MoE (L6-17 looped 3× = 48 logical visits, 128 experts top-8), the compiler and full-MoE proximal fine-tuning (SQYFR / SQYFR v3 / SQYFR v4) compress thinkingmachines/Inkling-2-Mini from 18.89 GB of text weights into six Apple Silicon MLX builds spanning 8 GB iPhones up to lossless teacher parity: 3.85 GB (1.18 bpp), 4.72 GB (1.45 bpp), 5.38 GB (1.65 bpp), 8.87 GB (2.72 bpp), 11.18 GB (3.43 bpp), and 12.76 GB (3.92 bpp) - combining 4 KB SRAM hashed block-vector trellis codes (ht2/ht3), row trellis codes (rtr1/rtr4), surgical 128-row-group Fisher outlier allocation (gu_rg_map/dn_rg_map), dedicated attention projection floors, a tr2 floor on the tail lm_head bucket (head.7), and exact native NVFP4 passthrough (69/192 and 109/192 highest-sensitivity expert buckets kept at 0.0 error in the 11.2 GB and 12.8 GB builds).

Evaluated untruncated (max_new_tokens = 1,536, greedy, reasoning_effort="none") on the same BF16 teacher, openai/gsm8k (test[:200]), all 164 executable openai/openai_humaneval problems (strict <|content_text|> execution across every build), 4 Vision VQA tests (with the untouched 637 MB BF16 vision tower), and 16+13-language TextMix windows:

Model
Text GB
Text bpp
free_KL (en/chat/code)
all13_KL
GSM8K (200)
HumanEval Strict (164)
Vision (4)
3-Task Mean vs Teacher

Original BF16 Teacher
18.89
5.80
0.0000
0.0000
193 / 200 (96.5%)
152 / 164 (92.7%)
4 / 4
100.0%

LookAtMyQuant 12.8 GB (NVFP4 + Trellis)
12.76
3.92
0.0070
0.0268
193 / 200 (96.5%)
152 / 164 (92.7%)
4 / 4
100.0%

LookAtMyQuant 11.2 GB (NVFP4 + Trellis)
11.18
3.43
0.0115
0.0400
190 / 200 (95.0%)
151 / 164 (92.1%)
4 / 4
99.3% (98.9% pooled)

LookAtMyQuant 8.9 GB (SQYFR)
8.87
2.72
0.0208
0.0571
192 / 200 (96.0%)
149 / 164 (90.9%)
4 / 4
99.2% (98.9% pooled)

LookAtMyQuant 5.4 GB (SQYFR v4)
5.38
1.65
0.0853
0.2667
185 / 200 (92.5%)
130 / 164 (79.3%)
4 / 4
93.8% (91.4% pooled)

LookAtMyQuant 4.7 GB (SQYFR v3, 12 GB iPhone)
4.72
1.45
0.1162
0.3724
188 / 200 (94.0%)
113 / 164 (68.9%)
4 / 4
90.6% (87.4% pooled)

LookAtMyQuant 3.9 GB (SQYFR v3, 8 GB iPhone)
3.85
1.18
0.2161
0.6037
179 / 200 (89.5%)
97 / 164 (59.1%)
4 / 4
85.5% (80.2% pooled)

At < 2 bpp, most remaining HumanEval misses occur when a long <|content_thinking|> trace consumes the 1,536-token budget before opening <|content_text|>. Passing --max-thinking-tokens 960 (max_thinking_tokens=960 in Python, lossless across serial and DSpark speculative decode) deterministically transitions out of <|content_thinking|> at a sentence/newline boundary near 960 thinking tokens so the model always emits a complete <|content_text|> answer (evaluated on the identical 1,536-token harness across all four models):

Model
Text GB (bpp)
Unmodified GSM8K / HumanEval (Mean)
--max-thinking-tokens 960 GSM8K / HumanEval (Mean)

Original BF16 Teacher
18.89 (5.80)
188 / 200 (94.0%) · 147 / 164 (89.6%) (91.8%)
189 / 200 (94.5%) · 159 / 164 (97.0%) (95.7%)

Links

Open - Skip to content
Open - Sign in
Open - GitHubRepository hosting, code review, and collaboration
Open - CopilotAI coding agent for tasks, projects, and automated work
Open - ActionsCI/CD and automation
Open - Code QualityQuality analysis, fixes, and enforcement
Open - CodespacesCloud development environments
Open - Code SecurityVulnerability detection and remediation
Open - Secret ProtectionSecret scanning and leak prevention
Open - All Features

Browse another page:

URL