Key Findings
  • Deep Compression (ICLR Best Paper) compressed VGG-16 by 49x using a three-step pipeline of "pruning, quantization, and encoding" -- proving that the combined effect of techniques is multiplicative, not additive
  • NVIDIA Minitron derived 8B/4B versions from a 15B model using "pruning + distillation," requiring only 1/40 of the training tokens -- industrial-scale compression has become a standard multi-technique practice
  • DeepSeek-V3 integrates efficient architecture (Multi-head Latent Attention), dynamic computation (MoE 671B/37B), and quantization (FP8 training) within a single model, completing training at less than 1/10 of GPT-4's estimated cost
  • Multi-technique fusion for image generation is already within reach: BK-SDM (pruning+distillation) + LCM-LoRA (distillation) + ToMe (dynamic computation) triple-stacking achieves 10x+ speedup on a free Colab T4

1. Why "One at a Time" Is Not Enough: The Multiplicative Effect of Five Techniques

In previous articles, we explored each of the five pillars of AI model efficiency in depth: pruning, distillation, quantization, dynamic computation, and efficient architecture design. Each technique individually delivers 2-5x efficiency gains. But enterprise AI teams face a hard reality: 2-5x is often not enough.

Harvard Business Review notes[1] that without optimization, AI could emit 24-44 million tons of CO2 annually by 2030, equivalent to adding 5-10 million cars to the road. Research from MIT Sloan[2] shows that organizations achieving large-scale returns from AI are all doing the same thing -- replacing bloated large systems with smaller, more efficient models.

The key insight is: the combined effect of efficiency techniques is multiplicative, not additive. Pruning makes models sparse (2x), quantization reduces precision per parameter (4x), distillation compresses model capacity (2x), dynamic computation skips unnecessary computations (2x) -- stacking all four yields a theoretical ceiling not of 2+4+2+2 = 10x, but 2x4x2x2 = 32x. Add an efficient architecture from the start, and the total end-to-end efficiency improvement can reach 10-100x.

This is not theoretical speculation. Every case study that follows -- from Deep Compression in 2016 to DeepSeek-V3 in 2024 -- is real-world proof of multi-technique synergy.

2. Five Pillars in Review: Each Technique in 30 Seconds

Before diving into combination strategies, let us quickly review the essence of the five core techniques. Each has its own in-depth article; here we capture only the core intuition:

TechniqueCore IntuitionTypical SpeedupFull Article
PruningRemove unimportant connections or neurons2-10x compressionPruning
DistillationTrain a small model to mimic a large model's outputs2-7x compressionDistillation
QuantizationReduce numerical precision (FP16 to INT4)2-4x compressionQuantization
Dynamic ComputationLet the model "allocate effort on demand"2-3x speedupDynamic Computation
Efficient ArchitectureDesign inherently efficient network structures5-13x compressionArchitecture Design

The most important property of these five techniques is: they are nearly completely orthogonal. Pruning operates on network topology (which connections exist), quantization on numerical representation (how many bits per number), distillation on knowledge transfer (who to learn from), dynamic computation on execution paths (which computations run), and efficient architecture on the network structure itself. Because they act on different dimensions, they can be freely stacked.

3. Classic Combination 1: Pruning x Quantization -- The Deep Compression Paradigm

In 2016, Song Han et al.'s Deep Compression[3] won the ICLR Best Paper Award -- not for inventing new techniques, but for being the first to systematically demonstrate the power of "technique combination."

Deep Compression's three-step pipeline is elegantly simple:

  1. Pruning: Remove 90% of weight connections, reducing model size by 9-13x
  2. Quantization: Compress remaining weights from 32-bit to 8-bit or lower, another 4x reduction
  3. Huffman Encoding: Losslessly compress the quantized sparse matrix, another 10-30% reduction

Final results: AlexNet compressed 35x (240MB to 6.9MB), VGG-16 compressed 49x (552MB to 11.3MB), with virtually no accuracy loss. This is not 9+4+1.3 = 14.3x, but 9x4x1.3 ~ 47x -- a classic demonstration of the multiplicative effect.

Deep Compression's influence persists today. SparseGPT[4] in 2023 brought this paradigm into the LLM era: one-shot pruning can achieve 60% sparsity on OPT-175B with nearly no accuracy loss. Combining SparseGPT-pruned models with AWQ[5] (MLSys 2024 Best Paper) for 4-bit quantization, the stacked effect can compress a 175B model that originally required 4 A100s down to 2 or even 1 A100.

4. Classic Combination 2: Pruning x Distillation -- Industrial-Scale Compression Pipelines

If Deep Compression is academia's classic, then NVIDIA's Minitron[6] is industry's best practice.

Minitron's process is equally simple yet strikingly effective:

  1. Structured Pruning: Remove entire attention heads and FFN dimensions from Nemotron-4 15B to obtain a smaller 8B or 4B model skeleton
  2. Knowledge Distillation: Use the original 15B model as teacher to retrain the pruned student model

Key data point: Minitron-8B used only 1/40 of the original training tokens to match the quality of training an 8B model from scratch. What does this mean? Training an 8B model from scratch might cost millions of dollars in compute; with the Minitron approach, you only need an already-trained 15B model plus tens of thousands of dollars in distillation costs.

The image generation domain tells the same story. SnapFusion[7] combined architecture pruning (streamlined U-Net) with step distillation (50 steps compressed to 8), enabling Stable Diffusion to generate 512x512 images on mobile devices in 2 seconds -- the result of architecture design x pruning x distillation working in concert.

5. Classic Combination 3: Efficient Architecture x Dynamic Computation -- The MoE Paradigm

Mixture of Experts (MoE) is the most perfect fusion of "efficient architecture design" and "dynamic computation."

Mixtral 8x7B[8] pushed this combination to the extreme: 8 expert networks share attention layers, with each token activating only 2 experts. The result is a model with 46.7B total parameters (architecture capacity), but actual computation per token equivalent to only a 12.9B parameter model (dynamic computation efficiency). Mixtral 8x7B's performance matched LLaMA-2 70B -- at less than 1/5 the inference computation.

DeepSeek-V3[9] is the ultimate culmination of multi-technique integration. It simultaneously employs:

DeepSeek-V3's training cost is estimated at less than 1/10 of GPT-4's, yet it demonstrates comparable capabilities across multiple benchmarks. This is the benchmark for "full-stack multi-technique integration from architecture to training to inference."

6. Full-Stack Optimization for Text Generation AI

For enterprises deploying LLMs, what is the most practical multi-technique combination path? Here are combination strategies ranked by priority:

Layer 1: Quantization x Fine-tuning -- QLoRA

QLoRA[10] (NeurIPS 2023 Oral) is the most elegant combination of quantization and parameter-efficient fine-tuning. Its core innovation: first quantize all frozen base model weights using NormalFloat 4-bit (NF4), then insert low-rank LoRA adapters on top of the quantized model for fine-tuning. The result is that a single 48GB GPU can fine-tune a 65B parameter model -- whereas full-precision fine-tuning of the same model requires at least 8 A100s.

QLoRA demonstrates a profound principle: quantization is not just an inference technique; it is also a training technique. When you can load a model at 4-bit precision, you can fine-tune on cheaper hardware, and fine-tuning itself is a lightweight form of knowledge distillation -- teaching a general model domain-specific knowledge.

Layer 2: Pruning x Quantization -- Sparse + Low Precision

SparseGPT[4]-pruned sparse models can be further quantized with AWQ[5] or GPTQ. The combination of 60% sparsity x 4-bit quantization can theoretically compress the effective parameter count to 60% x 25% = 15% of the original.

Layer 3: Dynamic Computation -- Real-time Acceleration at Inference

On top of already quantized (and possibly pruned) models, adding Speculative Decoding provides an additional 2-3x inference acceleration with zero change to the output distribution. Stacking all three layers -- pruning + quantization + speculative decoding -- can achieve 10x+ end-to-end efficiency improvement.

The Extreme Frontier: BitNet b1.58

While the above combinations optimize existing models, BitNet b1.58[11] demonstrates the extreme of "designing efficient models from scratch." Using ternary {-1, 0, +1} weights -- essentially an extreme fusion of architecture design and quantization -- it matches FP16 LLaMA quality at the 3B scale, running 2.71x faster with 3.55x less memory. BitNet heralds a future where architectures designed natively for low precision will fundamentally disrupt the traditional "train first, quantize later" workflow.

7. Multi-Technique Fusion for Image Generation AI

The diffusion model domain offers equally exciting technique integration, and one that is even easier to stack in practice.

BK-SDM: A Ready-to-Use Pruning x Distillation Solution

BK-SDM[12] (ECCV 2024) directly provides a "pre-pruned + pre-distilled" Stable Diffusion variant. It performs structured pruning on the U-Net (removing 30-51% of blocks), then uses the original SD 1.5 as a teacher for knowledge distillation -- the entire process requires only 13 A100-days, which is 1/460 of the original Stable Diffusion training cost. The BK-SDM series U-Net is 30-51% lighter than the original SD 1.5's 860M parameters (depending on the variant), with near-equivalent generation quality.

LCM-LoRA: An Ultra-Fast Distillation Adapter

LCM[13] (Latent Consistency Models) uses consistency distillation to compress diffusion models from 25-50 steps to 2-4 steps. LCM-LoRA packages this distillation result into a 67MB LoRA adapter that is entirely plug-and-play.

ToMe + DeepCache: Dual Dynamic Computation Acceleration

ToMe for Stable Diffusion[14] reduces attention computation by merging redundant visual tokens -- a single line of code, training-free, with up to 2x speedup. DeepCache[15] caches high-level U-Net features to skip redundant repeated computations, accelerating SD 1.5 by 2.3x.

Real-World Effects of Triple-Technique Stacking

Stacking these techniques together:

  1. Architecture level: Use BK-SDM-Small (pruning + distillation, 40% lighter than SD 1.5)
  2. Step level: Add LCM-LoRA (distillation, 25 steps to 4 steps)
  3. Computation level: Apply ToMe (dynamic computation, 50% token merging)

With all three stacked, end-to-end speedup on a free Colab T4 can reach over 10x. And none of this requires retraining any models -- it is all "plug-and-play" composition.

8. Hands-on Lab: Multi-Technique Integration in Practice

Theory covered, now let us get hands-on. The following three labs cover CV, LLM, and diffusion model scenarios, each demonstrating at least two techniques combined.

Lab 1: CV -- Pruning x Quantization Pipeline (CPU)

This lab stacks global pruning and INT8 dynamic quantization on MobileNetV2 (an efficient architecture), demonstrating the multiplicative effect of compression.

Open Google Colab (CPU is sufficient), create a new Notebook, and paste the following code sequentially:

1.1 Environment Setup and Baseline Measurement

import torch
import torch.nn as nn
import torch.nn.utils.prune as prune
import torchvision.models as models
import time, io, gzip

def measure_model(model, label):
    """Measure model size, compressed size, non-zero parameter ratio, and inference speed"""
    model.eval()

    # Non-zero parameter statistics
    total = sum(p.numel() for p in model.parameters())
    nonzero = sum((p != 0).sum().item() for p in model.parameters())
    sparsity = 1 - nonzero / total

    # Raw serialized size
    buf = io.BytesIO()
    torch.save(model.state_dict(), buf)
    raw_mb = buf.tell() / 1e6

    # gzip compressed size (zeros in sparse models compress significantly)
    buf.seek(0)
    compressed = gzip.compress(buf.read(), compresslevel=1)
    gz_mb = len(compressed) / 1e6

    # CPU inference latency
    x = torch.randn(1, 3, 224, 224)
    with torch.no_grad():
        for _ in range(5): model(x)  # warmup
        t0 = time.time()
        for _ in range(30): model(x)
        latency = (time.time() - t0) / 30 * 1000

    print(f"  {label}")
    print(f"    Params: {total/1e6:.2f}M (non-zero: {nonzero/1e6:.2f}M, sparsity: {sparsity:.1%})")
    print(f"    Raw size: {raw_mb:.1f}MB -> Compressed: {gz_mb:.1f}MB")
    print(f"    Inference latency: {latency:.1f}ms")
    return {'raw': raw_mb, 'gz': gz_mb, 'lat': latency, 'sparsity': sparsity}

# Baseline: MobileNetV2 (itself an efficient architecture -- depthwise separable convolutions)
print("=" * 60)
print("  MobileNetV2 -- Pruning x Quantization Multiplicative Effect Experiment")
print("=" * 60)

model_base = models.mobilenet_v2(weights='IMAGENET1K_V1').eval()
print("\n[A] Baseline (FP32)")
r_base = measure_model(model_base, "MobileNetV2 FP32")

1.2 Pruning: Global L1 Unstructured 60%

# Global L1 pruning: across all Conv2d + Linear layers, rank globally and remove the smallest 60%
model_pruned = models.mobilenet_v2(weights='IMAGENET1K_V1').eval()
params_to_prune = [
    (m, 'weight') for m in model_pruned.modules()
    if isinstance(m, (nn.Conv2d, nn.Linear))
]
prune.global_unstructured(
    params_to_prune,
    pruning_method=prune.L1Unstructured,
    amount=0.6  # Remove 60% of smallest weights
)
# Make pruning permanent (remove mask, write zeros directly into weights)
for m, name in params_to_prune:
    prune.remove(m, name)

print("\n[B] Pruned 60%")
r_pruned = measure_model(model_pruned, "MobileNetV2 Pruned 60%")

1.3 Quantization: INT8 Dynamic Quantization

# INT8 dynamic quantization (applied to Linear layers)
model_quant = torch.quantization.quantize_dynamic(
    models.mobilenet_v2(weights='IMAGENET1K_V1'),
    {nn.Linear},
    dtype=torch.qint8
).eval()

print("\n[C] INT8 Quantized")
r_quant = measure_model(model_quant, "MobileNetV2 INT8 Quantized")

1.4 Pruning + Quantization: Two Techniques Stacked

# Prune first, then quantize -- two compression techniques stacked
model_both = models.mobilenet_v2(weights='IMAGENET1K_V1').eval()
params_both = [
    (m, 'weight') for m in model_both.modules()
    if isinstance(m, (nn.Conv2d, nn.Linear))
]
prune.global_unstructured(
    params_both,
    pruning_method=prune.L1Unstructured,
    amount=0.6
)
for m, name in params_both:
    prune.remove(m, name)
model_both = torch.quantization.quantize_dynamic(
    model_both, {nn.Linear}, dtype=torch.qint8
).eval()

print("\n[D] Pruned 60% + INT8 Quantized")
r_both = measure_model(model_both, "MobileNetV2 Pruned+Quantized")

# Final comparison
print(f"\n{'=' * 60}")
print(f"  Compression Effect Comparison (compressed size = post-zero compression)")
print(f"{'=' * 60}")
print(f"  Baseline FP32:         {r_base['gz']:.1f}MB (1.0x)")
print(f"  Pruned 60%:            {r_pruned['gz']:.1f}MB ({r_base['gz']/r_pruned['gz']:.1f}x)")
print(f"  INT8 Quantized:        {r_quant['gz']:.1f}MB ({r_base['gz']/r_quant['gz']:.1f}x)")
print(f"  Pruned+Quantized:      {r_both['gz']:.1f}MB ({r_base['gz']/r_both['gz']:.1f}x)")
print(f"\n Key Observations:")
print(f"  - MobileNetV2 is already an efficient architecture (depthwise separable convolutions)")
print(f"  - Stacking pruning+quantization on an efficient architecture yields multiplicative compression")
print(f"  - Compressed size differences demonstrate the additional advantage of sparse zeros during compression")
print(f"  - This is the core insight of the Deep Compression paper")

Lab 2: LLM -- QLoRA Quantization x Fine-tuning (T4 GPU)

QLoRA[10] is currently the most practical multi-technique integration solution for LLMs: 4-bit quantization (compression) + LoRA (parameter-efficient fine-tuning). This lab demonstrates how to load and fine-tune a 1-billion parameter language model on a free Colab T4 (15GB VRAM).

Open Google Colab (select T4 GPU), create a new Notebook:

2.1 Installation and 4-bit Quantized Loading

!pip install transformers peft bitsandbytes accelerate -q

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import LoraConfig, get_peft_model

model_id = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"

# Step 1: FP16 Baseline -- memory usage
print("=== Step 1: FP16 Baseline ===")
model_fp16 = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.float16, device_map="auto"
)
fp16_mem = model_fp16.get_memory_footprint() / 1e9
fp16_params = sum(p.numel() for p in model_fp16.parameters()) / 1e6
print(f"  FP16 Memory: {fp16_mem:.2f} GB ({fp16_params:.0f}M params)")
del model_fp16
torch.cuda.empty_cache()

# Step 2: 4-bit NF4 Quantization (the quantization part of QLoRA)
print("\n=== Step 2: 4-bit NF4 Quantization ===")
bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",            # NormalFloat 4-bit
    bnb_4bit_compute_dtype=torch.float16,  # Compute in FP16
    bnb_4bit_use_double_quant=True,        # Double quantization for further memory savings
)
model_4bit = AutoModelForCausalLM.from_pretrained(
    model_id, quantization_config=bnb_config, device_map="auto"
)
q4_mem = model_4bit.get_memory_footprint() / 1e9
print(f"  4-bit NF4 Memory: {q4_mem:.2f} GB (saved {(1-q4_mem/fp16_mem)*100:.0f}%)")

2.2 Adding LoRA Adapters

# Step 3: Add LoRA on top of the 4-bit model -- this is QLoRA
print("\n=== Step 3: QLoRA = 4-bit + LoRA ===")
lora_config = LoraConfig(
    r=16,                          # LoRA rank
    lora_alpha=32,                 # Scaling factor
    target_modules=["q_proj", "v_proj"],  # Add LoRA only to Q/V projection matrices
    lora_dropout=0.05,
    bias="none",
    task_type="CAUSAL_LM",
)
model_qlora = get_peft_model(model_4bit, lora_config)

# Trainable parameter statistics
trainable = sum(p.numel() for p in model_qlora.parameters() if p.requires_grad)
total = sum(p.numel() for p in model_qlora.parameters())
qlora_mem = model_qlora.get_memory_footprint() / 1e9

print(f"  Trainable params: {trainable:,} / {total:,} ({trainable/total*100:.2f}%)")
print(f"  QLoRA Memory: {qlora_mem:.2f} GB")

2.3 Generation Test and Summary

# Step 4: Verify that the QLoRA model can still generate correctly
print("\n=== Step 4: Generation Test ===")
tokenizer = AutoTokenizer.from_pretrained(model_id)
prompts = [
    "Explain why combining pruning and quantization gives multiplicative compression:",
    "The three most important techniques for efficient AI deployment are",
]

model_qlora.eval()
for prompt in prompts:
    inputs = tokenizer(prompt, return_tensors="pt").to(model_qlora.device)
    with torch.no_grad():
        outputs = model_qlora.generate(
            **inputs, max_new_tokens=80,
            do_sample=True, temperature=0.7, top_p=0.9,
        )
    text = tokenizer.decode(outputs[0], skip_special_tokens=True)
    print(f"\n  Prompt: {prompt}")
    print(f"  Output: {text[:250]}...")

# Summary
print(f"\n{'=' * 60}")
print(f"  QLoRA Multi-Technique Integration Results")
print(f"{'=' * 60}")
print(f"  FP16 Full Precision:   {fp16_mem:.2f} GB, 100% params trainable")
print(f"  QLoRA (4bit+LoRA): {qlora_mem:.2f} GB, {trainable/total*100:.2f}% params trainable")
print(f"  Memory Savings: {(1-qlora_mem/fp16_mem)*100:.0f}%")
print(f"\n Key Observations:")
print(f"  - Quantization (4-bit NF4) compresses the base model -> reduces memory")
print(f"  - LoRA enables parameter-efficient fine-tuning -> trains only a tiny fraction of new params")
print(f"  - Combined = fine-tune models on T4 (15GB) that normally need A100 (80GB)")
print(f"  - The same approach scales to 65B+ models (the core contribution of the QLoRA paper)")

Lab 3: Diffusion Model -- LCM-LoRA x ToMe Distillation x Dynamic Computation (T4 GPU)

This lab demonstrates multi-technique stacking for image generation: first apply LCM-LoRA[13] (distillation: 25 steps to 4), then ToMe[14] (dynamic computation: 50% token merging), achieving significant speedup on a free T4.

Open Google Colab (select T4 GPU), create a new Notebook:

3.1 Installation and Baseline Measurement

!pip install diffusers transformers accelerate tomesd -q

import torch, time
from diffusers import (
    StableDiffusionPipeline,
    LCMScheduler,
    DPMSolverMultistepScheduler,
)

prompt = "a futuristic city at golden hour, detailed architecture, cinematic lighting, 8k"
device = "cuda"
dtype = torch.float16

def benchmark(pipe, label, steps=25, guidance=7.5, n=3):
    """Generate n images and measure average time"""
    with torch.no_grad():
        pipe(prompt, num_inference_steps=steps, guidance_scale=guidance)  # warmup
        t0 = time.time()
        for _ in range(n):
            pipe(
                prompt, num_inference_steps=steps, guidance_scale=guidance,
                generator=torch.Generator(device).manual_seed(42),
            )
        avg = (time.time() - t0) / n
    print(f"  {label}: {avg:.2f}s/image ({steps} steps)")
    return avg

# Config A: SD 1.5 Baseline (DPM++ 25 steps)
print("=== Config A: SD 1.5 Baseline (25 steps) ===")
pipe = StableDiffusionPipeline.from_pretrained(
    "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=dtype
).to(device)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
t_baseline = benchmark(pipe, "SD 1.5 DPM++ 25-step", steps=25)

3.2 Adding LCM-LoRA (Distillation: 25 Steps to 4)

# Config B: + LCM-LoRA (consistency distillation adapter)
#   LCM-LoRA is a 67MB LoRA adapter that distills SD 1.5 for 4-step generation
print("\n=== Config B: + LCM-LoRA (Distillation -> 4 steps) ===")
pipe.load_lora_weights("latent-consistency/lcm-lora-sdv1-5")
pipe.fuse_lora()  # Fuse into base weights to avoid inference overhead
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
t_lcm = benchmark(pipe, "SD 1.5 + LCM-LoRA 4-step", steps=4, guidance=1.0)

3.3 Stacking ToMe (Dynamic Computation: Token Merging)

# Config C: + ToMe (token merging, dynamically reduces attention computation)
#   tomesd automatically merges 50% of redundant tokens at each attention block
print("\n=== Config C: + ToMe (Dynamic Token Merging 50%) ===")
import tomesd
tomesd.apply_patch(pipe, ratio=0.5)  # Merge 50% of tokens
t_lcm_tome = benchmark(pipe, "SD 1.5 + LCM-LoRA + ToMe", steps=4, guidance=1.0)

3.4 Result Comparison and Visualization

# Generate comparison images
from diffusers import DPMSolverMultistepScheduler as DPMS

# Clean up and rebuild baseline pipe for comparison
tomesd.remove_patch(pipe)
del pipe
torch.cuda.empty_cache()

# Reload all configs and generate one image each
configs = []

# A: Baseline
pipe_a = StableDiffusionPipeline.from_pretrained(
    "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=dtype).to(device)
pipe_a.scheduler = DPMS.from_config(pipe_a.scheduler.config)
img_a = pipe_a(prompt, num_inference_steps=25, guidance_scale=7.5,
               generator=torch.Generator(device).manual_seed(42)).images[0]
del pipe_a; torch.cuda.empty_cache()

# B: LCM-LoRA
pipe_b = StableDiffusionPipeline.from_pretrained(
    "stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=dtype).to(device)
pipe_b.load_lora_weights("latent-consistency/lcm-lora-sdv1-5")
pipe_b.fuse_lora()
pipe_b.scheduler = LCMScheduler.from_config(pipe_b.scheduler.config)
img_b = pipe_b(prompt, num_inference_steps=4, guidance_scale=1.0,
               generator=torch.Generator(device).manual_seed(42)).images[0]

# C: LCM-LoRA + ToMe
tomesd.apply_patch(pipe_b, ratio=0.5)
img_c = pipe_b(prompt, num_inference_steps=4, guidance_scale=1.0,
               generator=torch.Generator(device).manual_seed(42)).images[0]
del pipe_b; torch.cuda.empty_cache()

# Side-by-side display
import matplotlib.pyplot as plt
fig, axes = plt.subplots(1, 3, figsize=(18, 6))
for ax, img, title, t in zip(
    axes, [img_a, img_b, img_c],
    [f"SD 1.5 Baseline\n25 steps, {t_baseline:.1f}s",
     f"+ LCM-LoRA\n4 steps, {t_lcm:.1f}s",
     f"+ LCM-LoRA + ToMe\n4 steps, {t_lcm_tome:.1f}s"],
    [t_baseline, t_lcm, t_lcm_tome]
):
    ax.imshow(img); ax.set_title(title, fontsize=12); ax.axis('off')
plt.suptitle("Distillation x Dynamic Computation -- Multi-Technique Stacking Effect", fontsize=14, fontweight='bold')
plt.tight_layout()
plt.savefig("comparison.png", dpi=150, bbox_inches='tight')
plt.show()

# Summary
print(f"\n{'=' * 60}")
print(f"  Diffusion Model Multi-Technique Stacking Results")
print(f"{'=' * 60}")
print(f"  SD 1.5 Baseline (25 steps):  {t_baseline:.2f}s  (1.0x)")
print(f"  + LCM-LoRA (4 steps):        {t_lcm:.2f}s  ({t_baseline/t_lcm:.1f}x faster)")
print(f"  + LCM-LoRA + ToMe:           {t_lcm_tome:.2f}s  ({t_baseline/t_lcm_tome:.1f}x faster)")
print(f"\n Technique Stacking Analysis:")
print(f"  - LCM-LoRA (distillation): 25->4 steps ~ 6x speedup")
print(f"  - ToMe (dynamic computation): 50% token merging ~ additional 1.3-1.8x")
print(f"  - Combined ~ {t_baseline/t_lcm_tome:.0f}x end-to-end speedup")
print(f"  - Further stacking possible: INT8 quantization / DeepCache / torch.compile")
print(f"  - This is the power of orthogonal stacking across five techniques")

9. Tools and Ecosystem: Power Tools for Multi-Technique Integration

Multi-technique integration does not need to start from scratch. The following tools have already packaged "combination punches" into easy-to-use APIs:

Unified Compression Platforms

LLM Quantization + Inference

Diffusion Model Multi-Technique Integration

Pruning + Distillation

10. From Technical Metrics to Business Impact

The impact of multi-technique integration on enterprise AI is exponential:

11. Adoption Path: A Three-Phase Strategy for Five-Dimensional Optimization

  1. Immediate wins -- "plug-and-play" combinations: Add 4-bit quantization to LLM inference (bitsandbytes load_in_4bit=True, one line of code). Add LCM-LoRA + ToMe to image generation (two adapters, no training). These combinations require no model modification and can be deployed in half a day
  2. Small-step validation -- QLoRA fine-tuning + dynamic computation: Use QLoRA to fine-tune domain knowledge on quantized models (quantization x fine-tuning). Add speculative decoding to accelerate inference (dynamic computation). Evaluate the Minitron approach -- whether your large model can be pruned + distilled into a smaller one (pruning x distillation)
  3. Full-stack optimization -- systematic integration of all five techniques: Choose an efficient base architecture (EfficientNet / LLaMA / Mamba rather than ResNet / GPT-3). Establish a complete pipeline of "architecture selection, pruning, distillation, quantization, dynamic inference." Evaluate unified compression platforms such as TorchAO / Intel Neural Compressor / TensorRT-LLM. Target: 10-100x efficiency improvement from original model to deployed version

The integration of five techniques is not the destination but the starting point. Every technique continues to evolve -- Mamba is challenging Transformer's quadratic complexity, BitNet is exploring the limits of 1-bit training, and MoE is pursuing finer-grained dynamic routing. The true competitive moat lies not in mastering any single technique, but in understanding their orthogonality and complementarity, and selecting the optimal combination for each specific scenario.

If your team is planning an AI model efficiency optimization strategy, or needs to upgrade from "single-point optimization" to "full-stack integration," we welcome an in-depth technical dialogue. Meta Intelligence's research team can accompany you through the complete journey from efficiency diagnosis, solution design, to production deployment.