Qwen3-4B 后训练三值化:能力、有效比特预算、存储压缩与部署
文章背景与核心概要
本文研究了针对指令微调的 40 亿参数语言模型 Qwen3-4B 的端到端后训练转换(三值化)。尽管超低比特模型(通常被贴上“1.58比特”的标签)承诺能够减小内存占用,但本研究表明,名义上的比特标签无法准确反映真实的存储表示、保留的能力以及运行时行为。
通过结合 KOTMS 旋转、E2M-ATQ 三值化以及 GPTQ 风格误差补偿的纯权重量化流水线,作者评估了有效比特预算、任务性能衰减、困惑度变化以及部署挑战。研究结果表明,在存储大小显著减小的同时,任务能力保留不均,且存在明显的硬件执行开销。
📌 执行摘要 (Executive Summary)
本文研究了针对指令微调的 40 亿参数语言模型 Qwen3-4B 的端到端后训练转换(三值化)。尽管超低比特模型(通常被贴上“1.58比特”的标签)承诺能够减小内存占用,但本研究表明,名义上的比特标签无法准确反映真实的存储表示、保留的能力以及运行时行为。
This paper investigates the end-to-end post-training conversion (ternarization) of Qwen3-4B, an instruction-tuned 4-billion-parameter language model. While ultra-low-bit models (often labeled as "1.58-bit") promise reduced memory footprints, this research demonstrates that nominal bit labels fail to capture the true stored representation, retained capability, and runtime behaviors.
通过结合 KOTMS 旋转、E2M-ATQ 三值化以及 GPTQ 风格误差补偿的纯权重量化流水线,作者评估了有效比特预算、任务性能衰减、困惑度变化以及部署挑战。研究结果表明,在存储大小显著减小的同时,任务能力保留不均,且存在明显的硬件执行开销。
Through a weight-only quantization pipeline utilizing KOTMS rotation, E2M-ATQ ternarization, and GPTQ-style error compensation, the authors evaluate the effective bit budget, task performance degradation, perplexity changes, and deployment challenges. The findings reveal a significant reduction in storage size alongside uneven task capability retention and notable hardware execution overheads.
🔬 方法与实现 (Methodology & Implementation)
- 基础模型: Qwen3-4B(经过指令微调,4B 参数)。
- 量化方法: 纯权重后训练转换。
- 核心技术:
- 用于权重变换的 KOTMS 旋转。
- 用于三值化的 E2M-ATQ。
- 改编自 TWLA 的 GPTQ 风格误差补偿。
- 精度设置: 激活值保持 16 位精度(省略了 ILA-AMP)。
- 目标参数: 模型总参数的 81.62% 被纳入量化目标,最终量化线性权重的有效比特预算为每权重 1.641 比特。
- Base Model: Qwen3-4B (Instruction-tuned, 4B parameters).
- Quantization Approach: Weight-only post-training conversion.
- Core Techniques:
- KOTMS Rotation for weight transformation.
- E2M-ATQ for ternarization.
- GPTQ-style Error Compensation adapted from TWLA.
- Precision Settings: Activations are kept at 16-bit precision (ILA-AMP is omitted).
- Target Parameters: 81.62% of the model's total parameters are targeted for quantization, resulting in an effective bit budget of 1.641 bits per weight for the quantized linear weights.
📊 评估与结果 (Evaluation & Results)
1. 任务能力与准确率
在十个基准能力对比中,模型的整体准确率从 64.5% 下降至 54.7%。 * 衰减不均: 性能损失在各个任务之间差异很大。例如,BoolQ 保留了其经机遇修正后教师性能的 84.6%,而 ARC-Challenge 仅保留了 43.8%。
1. Task Capability & Accuracy
Across ten benchmarked capability comparisons, the model's overall accuracy dropped from 64.5% to 54.7%. * Uneven Degradation: Performance loss varies heavily across tasks. For instance, BoolQ retains 84.6% of its chance-corrected teacher performance, whereas ARC-Challenge retains only 43.8%.
2. 困惑度指标
在标准语料库上,困惑度呈现中等程度的上升:
* WikiText-2: 从 13.639 上升至 18.748。
* PTB (Penn Treebank): 从 24.700 上升至 31.992。
* C4: 从 19.831 上升至 28.966。
2. Perplexity Metrics
Perplexity increases moderately across standard corpora: * WikiText-2: Rises from
13.639to18.748. * PTB (Penn Treebank): Rises from24.700to31.992. * C4: Rises from19.831to28.966.
3. 存储压缩
- 目标打包运行成功保留了三值平面和缩放因子。
- 模型大小缩减: 从 8.29 GiB 降至 3.96 GiB,且困惑度几乎保持不变。
- (注:另一次第三方打包尝试是有损的,未计入主要构件声明中。)
3. Storage Compression
- A targeted packing run successfully preserves the ternary planes and scaling factors.
- Model Size Reduction: Decreases from 8.29 GiB down to 3.96 GiB with virtually unchanged perplexity.
- (Note: A separate third-party packing attempt was lossy and excluded from the primary artifact claims).
⚙️ 部署与硬件见解 (Deployment & Hardware Insights)
- 吞吐量与延迟注意事项: 打包后的构件尚未进行端到端的任务生成吞吐量基准测试。
- 微基准测试结果: 初步的 Triton GEMV(通用矩阵-向量乘法)微基准测试在测试形状下的运行速度比 FP16 cuBLAS 慢 4.6 倍。
- 关于推理速度的结论: 作者强调,如果没有优化的硬件内核,单纯的压缩并不能自动带来更快的推理速度。
- Throughput & Latency Caveats: The packed artifact has not yet undergone end-to-end benchmarking for task generation throughput.
- Microbenchmark Results: A preliminary Triton GEMV (General Matrix-Vector multiplication) microbenchmark ran 4.6x slower than FP16 cuBLAS on a tested shape.
- Conclusion on Inference Speed: The authors emphasize that compression alone does not automatically yield faster inference without optimized hardware kernels.
🔗 参考链接 (Reference Links)
