🎧 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)
Metadata
Release files for ctt-compression 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ctt_compression-0.1.0.tar.gz | 3.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ctt_compression-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / ctt_compression-0.1.0.tar.gz
| Download URL | ctt_compression-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec934758c47c38d3f246185ffdae20f59615d0d592a5fc09d74143005a3766f2
|
|
BLAKE2b-256 checksum How to use checksums |
f88392350a350f5c8bb78a524508dc9838dd022784bb614104ed03dc8458be68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / ctt_compression-0.1.0-py3-none-any.whl
| Download URL | ctt_compression-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17b474774e9eb87c25d4096b95527787acd80abc31b1d623fe054cc5f810ea2b
|
|
BLAKE2b-256 checksum How to use checksums |
99dbc01334626c3102a3420c739ef4fac609b7b264df35272082575633c3c72f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for ctt-compression 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.