LLM Kompressions-Demonstration

Live-Visualisierung von Pruning, Quantisierung, Distillation und Mixture of Experts Techniken zur Kompression von LLM-Gewichten

Neural Network Architektur

Input Neurons
Hidden Neurons
Output Neurons
Schwache Gewichte
Starke Gewichte

Architektur

Gewichts-Statistiken

Gesamt Gewichte: 4.8K
Aktive Verbindungen: 3.8K
Speicherbedarf: 19.2 KB
Parameter: 4.8K

Gewichtsverteilung

Negative Null Positive
45% 10% 45%

Quantisierung

Mathematische Grundlagen

Quantisierungsformel:
Q(w) = clip(round((w - w_min)/s), 0, 2^b-1)
w_rec = Q(w) × s + w_min
w = Original weight
s = Scale factor = (w_max - w_min) / (2^b - 1)
b = Bit precision
w_min, w_max = Weight range bounds
Live Berechnung:
Scale: 0.266667
Range: [-2, 2]
Levels: 16
Fehleranalyse:
MSE = E[(w - ŵ)²]
SQNR = 6.02b + 1.76 dB
ŵ = Dequantized weight
SQNR = Signal-to-Quantization-Noise Ratio
Aktuelle Fehler:
MSE: 0.0041
SQNR: 25.84 dB
Max Error: ±0.03125
AWQ
AQLM
QuIP#
SLIM
1 4 8

Interaktive Demonstration

Quantisiert:
12
Rekonstruiert:
1.2500
Absoluter Fehler: 0.0153
Relativer Fehler: 1.24%

Live-Metriken

4x
Kompression
2.3%
Accuracy Loss

Gewichtsverteilung

32bit
Original
4bit
Quantisiert

Quantisierungs-Algorithmus

1. Scale Berechnung: s = 4.0/15 = 0.267
2. Normalisierung: w/s = 1.235/0.267 = 4.6
3. Rundung: round(4.6) = 5
4. Rekonstruktion: 5 × 0.267 = 1.335

Leistungsvergleich

Kompression vs. Genauigkeit

Speicherbedarf

Inferenzgeschwindigkeit

Basierend auf Tests mit LLaMA-2-7B auf einer NVIDIA A100 GPU

Technik-Vergleich

Methode Technik Bit-Präzision Reduktion (%) Accuracy Loss (%) Speedup