Qwen 3.8 27B Layer-wise Sensitivity Map
Per-layer quantization sensitivity for Qwen/Qwen3.8-27B, measured via weight distribution statistics (kurtosis, variance, outlier fraction) as a proxy for KL divergence.
Key finding: Early layers (0-4) and late layers (62-63) are most sensitive. Middle layers (40-61) are most compressible.
Usage
import json
with open("sensitivity_v1.0.0.json") as f:
data = json.load(f)
# Get optimal allocation for a target bitrate
alloc = data["allocations"]["3.5"]
print(f"Target: 3.5 bpw → Actual: {alloc['average_bpw']} bpw, {alloc['total_size_gb']} GB")
# Per-layer precision
for layer_idx, bits in alloc["layers"].items():
print(f"Layer {layer_idx}: Q{bits}")
Schema
layers[].sensitivity.Q2/Q3/Q4/Q5: estimated KL divergence from FP16 referencelayers[].weight_stats: kurtosis, variance, outlier_fractionlayers[].bits_for_threshold: min bits to stay under KL thresholdallocations: pre-computed at 2.5, 3.0, 3.5, 4.0 bpw targets
Method
- Load Qwen3.8-27B (FP16)
- Compute weight distribution statistics per layer
- Derive sensitivity score: 0.4·kurtosis + 0.4·variance + 0.2·outlier_fraction
- Greedy bit-budget allocation from Q2 baseline, upgrading most sensitive layers first
Citation
@misc{qwen3.8-27b-sensitivity,
title={Qwen 3.8 27B Layer-wise Sensitivity Map for Mixed-Precision Quantization},
author={hermitdave},
year={2026},
howpublished={HuggingFace Dataset}
}