CoolFace
Modelpublic

EchoLabs33/clip-vit-large-patch14-hxq

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes9downloads
Model Card

CLIP-ViT-L/14-HXQ

3.6x smaller from FP32. CIFAR-100 Top-1 72.8%. First vision model compressed with HXQ. CLIP ViT-Large/14 (text + vision dual encoder) compressed from 1.6 GB to 447 MB. Zero-shot classification accuracy matches the dense baseline. No calibration data. Same codec that compresses Transformers, SSMs, Hybrids, and MoEs.

Install and Run

bash
pip install "helix-substrate[hf]"
python
import helix_substrate  # registers the HXQ quantizer with HuggingFace
from transformers import CLIPModel, CLIPProcessor
from PIL import Image

model = CLIPModel.from_pretrained("EchoLabs33/clip-vit-large-patch14-helix")
processor = CLIPProcessor.from_pretrained("EchoLabs33/clip-vit-large-patch14-helix")

image = Image.open("photo.jpg")
inputs = processor(
    text=["a photo of a cat", "a photo of a dog", "a photo of a car"],
    images=image,
    return_tensors="pt",
    padding=True,
)
outputs = model(**inputs)
probs = outputs.logits_per_image.softmax(dim=-1)
print(probs)  # [cat_prob, dog_prob, car_prob]

Downstream Benchmarks

Zero-shot CIFAR-100 classification (10,000 test images, 100 classes, prompt: "a photo of a {class}"):

MetricDenseHXQ (3.6x)Delta
Top-1 Accuracy72.48%72.75%+0.27%
Top-5 Accuracy91.41%91.64%+0.23%

All deltas within noise. Task performance preserved after 3.6x compression.

Compression Benchmark

Dense (FP32)HXQ
Size1.6 GB447 MB
Compression ratio--3.6x
VRAM (eval)3,412 MB2,266 MB
Compressed modules--218 HelixLinear layers
ArchitectureCLIP (ViT-L/14 + Text Transformer)unchanged

Verification Status

  • —Compression receipt: PASS -- 218 compressed, 374 exact, mean cosine 0.9997
  • —Conversion receipt: PASS (Gate 1 + Gate 2)
  • —Downstream eval: PASS -- paired dense/HXQ on CIFAR-100 zero-shot

Good to Know

  • —GPU and CPU supported -- runs on any CUDA GPU or CPU.
  • —Fine-tunable via LoRA — compressed weights remain frozen, but LoRA adapters attach to each HelixLinear layer via HelixLinearSTE. See helix-substrate for training infrastructure.
  • —Requires `helix-substrate` -- you need pip install "helix-substrate[hf]".
  • —Embeddings stored exact -- token, position, and patch embeddings are at full precision. Only the 218 attention + MLP linear layers are compressed.

What is HelixCode?

HelixCode is a universal weight compression codec based on vector quantization:

  • —Each weight matrix is replaced by a 256-entry codebook (float32) + uint8 index matrix + optional sidecar corrections for outlier values
  • —The compressed form is the executable -- no decompression step
  • —Works on any nn.Linear regardless of architecture
  • —No calibration data required -- codebooks are fit from the weights alone

Architecture Details

CLIP ViT-Large/14 is a dual-encoder multimodal model:

  • —Vision encoder: 24-layer ViT-Large, hiddensize=1024, 16 attention heads, patchsize=14
  • —Text encoder: 12-layer Transformer, hidden_size=768, 12 attention heads
  • —Cross-modal projections: visualprojection (1024->768) + textprojection (768->768)

All 218 linear layers across both encoders are compressed. Embedding layers (token, position, patch), layer norms, and biases are stored at full precision.

Why This Matters

CLIP is the first vision model compressed with HXQ. The same codec now covers:

FamilyModelsEval
TransformerTinyLlama, Qwen 1.5B-14BPPL within noise
Pure SSMMamba 130m, Mamba2 1.3BPPL receipted
HybridZamba2 1.2B, 2.7BPPL receipted
MoEOLMoE 1B/7BHellaSwag -0.16%
Vision+TextCLIP ViT-L/14Top-1 +0.27%

Five architecture families. One codec. One pip install.

Companion Models

ModelArchitectureRatioEval Delta
clip-vit-large-patch14-helixVision+Text (CLIP)3.6x+0.27% Top-1
olmoe-1b-7b-instruct-helixMoE (64 experts)1.9x-0.16% HellaSwag
zamba2-2.7b-instruct-helixHybrid (Mamba2+Transformer)1.8x+6.59% PPL
zamba2-1.2b-helixHybrid (Mamba2+Transformer)1.7x+2.90% PPL
qwen2.5-14b-instruct-helixTransformer3.4xpending
qwen2.5-3b-instruct-helixTransformer1.6x+0.69% PPL
tinyllama-1.1b-helixTransformer4.0x+0.78% PPL
mamba2-1.3b-helixPure SSM (Mamba2)2.1x+8.0% PPL
mamba-130m-helixPure SSM3.8x+18.4% PPL

Citation

bibtex
@software{helix_substrate_2026,
  title={Helix Substrate: Universal Weight Compression via HelixCode},
  author={EchoLabs},
  year={2026},
  url={https://github.com/echo313unfolding/helix-substrate}
}

License

Apache 2.0 (inherited from openai/clip-vit-large-patch14).