🎧 CTT: Compressed Tensor/Transform
CTT is an ultra-lightweight, zero-retraining post-training model compression framework. It achieves extreme model reduction (~30x compression ratios) while preserving structural layer integrity and offering instantaneous compression and decompression.
Unlike traditional post-training quantization (PTQ) techniques that require heavy calibration datasets or cause catastrophic accuracy drops, CTT treats weights as an information-theoretic signal payload—combining percentile outlier shielding, dense sub-byte bit-packing, and entropy coding.
📊 Benchmark Results
Evaluated out-of-the-box on standard torchvision pre-trained models:
| Architecture | Original Size | Compressed Size | Compression Ratio | Avg. Correlation | Compress / Decompress |
|---|---|---|---|---|---|
| ResNet-18 | 44.63 MB | 1.47 MB | 30.33x | 0.7326 | 0.82s / 0.28s |
| ResNet-50 | 97.70 MB | 3.49 MB | 28.01x | 0.7105 | 1.37s / 0.59s |
| MobileNet-V2 | 13.50 MB | 0.59 MB | 22.91x | 0.7526 | 0.22s / 0.13s |
🚀 How It Works
- Percentile Outlier Shielding: Automatically clips extreme weight spikes using the 99.9th absolute percentile, stabilizing the distribution map.
- 2-Bit Non-Uniform Quantization: Maps continuous weights precisely into a 4-level discrete space over $[-1, 1]$.
- Dense Bit-Packing: Shifting math packs four distinct 2-bit values into a single physical byte, bypassing standard hardware memory bloat.
- Entropy Encoding: Passes the packed stream through level-9
zlibcompression to crush redundant patterns.
📦 Quick Start
import torch
import torchvision.models as models
from ctt_compressor import CTTCompressor
# Load a pretrained model
model = models.resnet18(weights=models.ResNet18_Weights.DEFAULT)
compressor = CTTCompressor(target_bits=2)
# Compress a layer tensor
tensor_data = model.conv1.weight.detach().cpu().numpy()
compressed_payload = compressor.compress(tensor_data)
# Decompress back to float32 tensor
reconstructed_data = compressor.decompress(compressed_payload)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ctt_compression-0.1.0.tar.gz.
File metadata
- Download URL: ctt_compression-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec934758c47c38d3f246185ffdae20f59615d0d592a5fc09d74143005a3766f2
|
|
| MD5 |
f8c1a460d0daa3d94e4705c06135fad2
|
|
| BLAKE2b-256 |
f88392350a350f5c8bb78a524508dc9838dd022784bb614104ed03dc8458be68
|
File details
Details for the file ctt_compression-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ctt_compression-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b474774e9eb87c25d4096b95527787acd80abc31b1d623fe054cc5f810ea2b
|
|
| MD5 |
7b950c4138b8b11eee73cd166ea4b196
|
|
| BLAKE2b-256 |
99dbc01334626c3102a3420c739ef4fac609b7b264df35272082575633c3c72f
|