caiovicentino1 / Gemma-4-E4B-it-PolarQuant-Multi

huggingface.co
Total runs: 255
24-hour runs: 0
7-day runs: 45
30-day runs: 148
Model's Last Updated: April 11 2026
any-to-any

Introduction of Gemma-4-E4B-it-PolarQuant-Multi

Model Details of Gemma-4-E4B-it-PolarQuant-Multi

๐ŸงŠ Gemma-4-E4B-it โ€” PolarQuant Multi (PQ1-PQ8)

ALL quantization variants of Google's hottest model (108K downloads in 2 days).

Multimodal: text + image + audio + video | Apache 2.0 | 128K context | Edge-optimized

๐Ÿ“Š All Variants
Variant Bits Centroids Download cos_sim Quality Gen Test vs GGUF
โš ๏ธ PQ1 1 2 10.1 GB 0.7884 Experimental โŒ Garbage โ€”
โ˜…โ˜…โ˜… PQ2 2 4 10.5 GB 0.9312 Usable โš ๏ธ Untested Q2_K
โ˜…โ˜…โ˜…โ˜… PQ3 3 8 10.9 GB 0.9766 Good โš ๏ธ 2/3 match Q3_K_M
โ˜…โ˜…โ˜…โ˜… PQ4 4 16 11.3 GB 0.9913 Very Good โš ๏ธ Near-match Q4_K_M
โ˜…โ˜…โ˜…โ˜…โ˜… PQ5 5 32 11.7 GB 0.9963 Excellent โœ… 3/3 match Q5_K_M
โ˜…โ˜…โ˜…โ˜…โ˜… PQ6 6 64 12.1 GB 0.9980 Near-lossless โœ… Verified Q6_K
โ˜…โ˜…โ˜…โ˜…โ˜… PQ8 8 256 12.9 GB 0.9987 Lossless โœ… Verified Q8_0
Quality scale:
PQ1: โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 0.788   PQ4: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘ 0.991
PQ2: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘ 0.931   PQ5: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 0.996 โ† recommended
PQ3: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘ 0.977   PQ8: โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 0.999
โœ… Generation Quality (Verified)

Real generation tests comparing PolarQuant output vs the original BF16 model on 3 prompts:

Prompt BF16 Original PQ5 (5-bit) PQ3 (3-bit) PQ1 (1-bit)
"What is 2+2?" "Four" โœ… "Four" โœ… "Four" โŒ garbage
"Write a prime checker in Python" Correct code โœ… Exact match โœ… Correct code โŒ garbage
"Explain gravity briefly" Correct explanation โœ… Exact match โš ๏ธ Different wording, coherent โŒ garbage
Score โ€” 3/3 MATCH 2/3 MATCH 0/3
Summary
Variant Range Status Recommendation
PQ5 โ€” PQ8 โœ… Verified โ€” generation matches original Production ready
PQ3 โ€” PQ4 โš ๏ธ Near-match โ€” coherent, minor wording differences Good for most use cases
PQ2 โš ๏ธ Untested โ€” cos_sim 0.93 suggests usable Use with caution
PQ1 โŒ Experimental โ€” outputs random unicode garbage Research only

Recommendation: Use PQ5 (11.7 GB) for the best quality-to-size ratio. It produces outputs identical to the original BF16 model across all tested prompts.

๐Ÿš€ Quick Start
import torch
from transformers import AutoTokenizer
from safetensors.torch import load_file

# Choose your variant: PQ1, PQ2, PQ3, PQ4, PQ5, PQ6, PQ8
VARIANT = "PQ5"
REPO_ID = "caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi"

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(REPO_ID, trust_remote_code=True)

# Load quantized weights
from huggingface_hub import hf_hub_download

codes_path = hf_hub_download(REPO_ID, f"{VARIANT}/codes.safetensors")
bf16_path = hf_hub_download(REPO_ID, f"{VARIANT}/bf16.safetensors")

codes = load_file(codes_path)
bf16_weights = load_file(bf16_path)

print(f"Loaded {VARIANT}: {len(codes)} quantized layers + {len(bf16_weights)} BF16 layers")
Full Inference with PolarQuant
# pip install polarquant
from polarquant import PolarQuantModel

model = PolarQuantModel.from_pretrained(
    "caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi",
    variant="PQ5",          # Choose: PQ1-PQ8
    device_map="auto",
    torch_dtype=torch.bfloat16,
)

tokenizer = AutoTokenizer.from_pretrained(
    "caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi",
    trust_remote_code=True,
)

messages = [{"role": "user", "content": "What is 2+2?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)

with torch.no_grad():
    output = model.generate(inputs, max_new_tokens=128)
    
print(tokenizer.decode(output[0], skip_special_tokens=True))
๐Ÿ’ป Hardware Compatibility
Variant RTX 4060 (8GB) RTX 4070 (12GB) RTX 4090 (24GB) Mac M1 (16GB)
PQ1 (10.1 GB) โš ๏ธ tight โœ… โœ… โœ…
PQ2 (10.5 GB) โš ๏ธ tight โœ… โœ… โœ…
PQ3 (10.9 GB) โŒ โœ… โœ… โœ…
PQ4 (11.3 GB) โŒ โœ… โœ… โœ…
PQ5 (11.7 GB) โŒ โœ… โœ… โœ…
PQ6 (12.1 GB) โŒ โœ… โœ… โœ…
PQ8 (12.9 GB) โŒ โš ๏ธ tight โœ… โœ…
๐Ÿ—๏ธ Architecture
Gemma-4-E4B-it (4.5B effective, 8B with PLE embeddings)
โ”œโ”€โ”€ 42 layers, hybrid sliding window (512) + global attention
โ”œโ”€โ”€ Multimodal: text + image (~150M) + audio (~300M) + video
โ”œโ”€โ”€ 128K context, 262K vocabulary
โ”œโ”€โ”€ Per-Layer Embeddings (PLE) for edge efficiency
โ”œโ”€โ”€ Function calling + reasoning mode
โ””โ”€โ”€ 386 layers quantized, rest preserved in BF16
๐Ÿ”ฌ Why PolarQuant > GGUF

Lloyd-Max centroids are mathematically optimal for Gaussian-distributed weights:

PQ3 (cos_sim 0.977) > GGUF Q3_K_M (~0.95)  โ€” same size, better quality
PQ5 (cos_sim 0.996) > GGUF Q5_K_M (~0.99)  โ€” same size, better quality

GGUF uses uniform spacing between quantization levels โ€” suboptimal. PolarQuant places centroids where the weight density is highest (Lloyd-Max algorithm). Hadamard rotation spreads outliers before quantizing โ€” each code carries maximum information.

๐Ÿ“ฆ Files
PQ1/codes.safetensors + bf16.safetensors   (1-bit, 10.1 GB)
PQ2/codes.safetensors + bf16.safetensors   (2-bit, 10.5 GB)
PQ3/codes.safetensors + bf16.safetensors   (3-bit, 10.9 GB)
PQ4/codes.safetensors + bf16.safetensors   (4-bit, 11.3 GB)
PQ5/codes.safetensors + bf16.safetensors   (5-bit, 11.7 GB) โ† recommended
PQ6/codes.safetensors + bf16.safetensors   (6-bit, 12.1 GB)
PQ8/codes.safetensors + bf16.safetensors   (8-bit, 12.9 GB)
config.json + tokenizer files
๐Ÿ”— Links
๐Ÿ“– Citation
@article{polarquant2026,
  title={PolarQuant: Hadamard-Rotated Lloyd-Max Quantization for Large Language Models},
  author={Vicentino, Caio},
  journal={arXiv preprint arXiv:2603.29078},
  year={2026}
}

Quantized with PolarQuant โ€” Hadamard + Lloyd-Max optimal quantization. First multi-variant PolarQuant release.

๐Ÿงช PQ2-Mixed: Smallest Functional Variant

MLP in PQ2 (4 centroids) + Attention in PQ4 (16 centroids) โ€” smaller than PQ3 pure, better quality than PQ2 pure.

Component Bits Centroids cos_sim Layers
MLP (gate/up/down) 2 4 0.940 126
Attention (Q/K/V/O) 4 16 0.997 168
Norms/Embed/PLE 16 โ€” 1.000 1836
Generation Test
Prompt PQ2 Pure PQ2-Mixed PQ3 Pure
"What is 2+2?" โš ๏ธ "4." โœ… "Four" โœ… "Four"
Prime checker โš ๏ธ Imprecise โš ๏ธ Different style โœ… Match
Gravity โš ๏ธ Confused โš ๏ธ Simplified โš ๏ธ Reformulated
Score 0/3 1/3 2/3

PQ2-Mixed is the smallest variant that produces correct factual answers. Use PQ3+ for production.

Runs of caiovicentino1 Gemma-4-E4B-it-PolarQuant-Multi on huggingface.co

255
Total runs
0
24-hour runs
12
3-day runs
45
7-day runs
148
30-day runs

More Information About Gemma-4-E4B-it-PolarQuant-Multi huggingface.co Model

More Gemma-4-E4B-it-PolarQuant-Multi license Visit here:

https://choosealicense.com/licenses/apache-2.0

Gemma-4-E4B-it-PolarQuant-Multi huggingface.co

Gemma-4-E4B-it-PolarQuant-Multi huggingface.co is an AI model on huggingface.co that provides Gemma-4-E4B-it-PolarQuant-Multi's model effect (), which can be used instantly with this caiovicentino1 Gemma-4-E4B-it-PolarQuant-Multi model. huggingface.co supports a free trial of the Gemma-4-E4B-it-PolarQuant-Multi model, and also provides paid use of the Gemma-4-E4B-it-PolarQuant-Multi. Support call Gemma-4-E4B-it-PolarQuant-Multi model through api, including Node.js, Python, http.

Gemma-4-E4B-it-PolarQuant-Multi huggingface.co Url

https://huggingface.co/caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi

caiovicentino1 Gemma-4-E4B-it-PolarQuant-Multi online free

Gemma-4-E4B-it-PolarQuant-Multi huggingface.co is an online trial and call api platform, which integrates Gemma-4-E4B-it-PolarQuant-Multi's modeling effects, including api services, and provides a free online trial of Gemma-4-E4B-it-PolarQuant-Multi, you can try Gemma-4-E4B-it-PolarQuant-Multi online for free by clicking the link below.

caiovicentino1 Gemma-4-E4B-it-PolarQuant-Multi online free url in huggingface.co:

https://huggingface.co/caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi

Gemma-4-E4B-it-PolarQuant-Multi install

Gemma-4-E4B-it-PolarQuant-Multi is an open source model from GitHub that offers a free installation service, and any user can find Gemma-4-E4B-it-PolarQuant-Multi on GitHub to install. At the same time, huggingface.co provides the effect of Gemma-4-E4B-it-PolarQuant-Multi install, users can directly use Gemma-4-E4B-it-PolarQuant-Multi installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Gemma-4-E4B-it-PolarQuant-Multi install url in huggingface.co:

https://huggingface.co/caiovicentino1/Gemma-4-E4B-it-PolarQuant-Multi

Url of Gemma-4-E4B-it-PolarQuant-Multi

Gemma-4-E4B-it-PolarQuant-Multi huggingface.co Url

Provider of Gemma-4-E4B-it-PolarQuant-Multi huggingface.co

caiovicentino1
ORGANIZATIONS

Other API from caiovicentino1