Skip to main content

🎧 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

  1. Percentile Outlier Shielding: Automatically clips extreme weight spikes using the 99.9th absolute percentile, stabilizing the distribution map.
  2. 2-Bit Non-Uniform Quantization: Maps continuous weights precisely into a 4-level discrete space over $[-1, 1]$.
  3. Dense Bit-Packing: Shifting math packs four distinct 2-bit values into a single physical byte, bypassing standard hardware memory bloat.
  4. Entropy Encoding: Passes the packed stream through level-9 zlib compression 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

ctt_compression-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctt_compression-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for ctt_compression-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ec934758c47c38d3f246185ffdae20f59615d0d592a5fc09d74143005a3766f2
MD5 f8c1a460d0daa3d94e4705c06135fad2
BLAKE2b-256 f88392350a350f5c8bb78a524508dc9838dd022784bb614104ed03dc8458be68

See more details on using hashes here.

File details

Details for the file ctt_compression-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ctt_compression-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17b474774e9eb87c25d4096b95527787acd80abc31b1d623fe054cc5f810ea2b
MD5 7b950c4138b8b11eee73cd166ea4b196
BLAKE2b-256 99dbc01334626c3102a3420c739ef4fac609b7b264df35272082575633c3c72f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page