Bonsai: prune large language models using only forward passes to cut memory needs and keep accuracy

February 8, 20248 min

Overview

Decision SnapshotReady For Pilot

Bonsai is practical: it reduces memory needs and yields competitive quality after short adaptation; quality improves with more perturbations and PPA, so budget-quality tradeoffs are explicit.

Citations6

Evidence Strength0.80

Confidence0.85

Risk Signals10

Trust Signals

Findings with numeric evidence: 6/6

Findings with evidence refs: 6/6

Results with explicit delta: 5/5

Reproducibility

Status: Partial assets available

Open source: Unknown

At A Glance

Cost impact: 85%

Production readiness: 75%

Novelty: 70%

Authors

Steven Kolawole, Lucio Dery, Jean-François Kagy, Virginia Smith, Graham Neubig, Ameet Talwalkar

Links

Abstract / PDF / Data

Why It Matters For Business

Bonsai makes structured LLM compression feasible on commodity GPUs, cutting memory needs and producing faster models so teams can reduce inference cost and enable on-device fine-tuning without enterprise hardware.

Who Should Care

Summary TLDR

Bonsai is a structured pruning method that uses only forward passes and a regression on perturbations to rank and remove modules (attention heads, MLP dims). It reduces pruning memory by >2× (can run on ≈20GB), produces faster models (e.g., 1.58× inference speed) and competitive accuracy after lightweight post-pruning adaptation (PPA). Bonsai beats other forward-only methods (FLAP, Wanda variant) and matches or improves on some gradient-based methods while enabling pruning of 7–8B models on a single A6000 GPU.

Problem Statement

Structured pruning for LLMs usually needs gradients and lots of GPU memory. That makes pruning impractical for many users. The paper asks: can we pick which modules to remove using only inference (forward passes) to save memory while keeping accuracy and speed?

Main Contribution

Bonsai: a forward-pass-only structured pruning algorithm that estimates global module importance via regression on perturbative sub-model evaluations.

Informative-prior sampling: bias sub-model sampling with cheap forward-pass signals (Wanda, activation magnitude, fluctuation) to reduce evaluations.

Key Findings

Bonsai cuts pruning memory requirements to inference-only levels, enabling pruning on ≈20GB devices instead of 80–160GB.

Numberspruning memory ≈20GB vs 80–160GB for gradient methods

Practical UseIf you have a single consumer GPU (~20–48GB) you can run Bonsai instead of needing multi-A100-class memory for structured pruning.

Evidence RefTable 2; Introduction

At 50% sparsity Bonsai yields lower perplexity than FLAP on Wikitext-2.

NumbersLLaMA-2@50% PPL: Bonsai 12.38 vs FLAP 14.49

Practical UseChoose Bonsai over FLAP for better quality when you must avoid gradients.

Evidence RefTable 6

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Pruning memory requirement≈20GB (forward-only Bonsai)80–160GB (gradient-based structured pruning)≈4× lowerBonsai only needs inference memory; gradient methods need gradients and optimizer statesTable 2; Introduction
Wikitext-2 perplexity at 50% sparsity (LLaMA-2 7B)12.38 (Bonsai)14.49 (FLAP), base 0% = 5.11−2.11 vs FLAPWikitext-2Perplexity numbers compared at 50% structured sparsityTable 6

What To Try In 7 Days

Run Bonsai to prune a 7B model to ~50% on a single 48GB-class GPU to validate memory and latency benefits.

After pruning, run lightweight fine-tuning (PPA) on the same GPU to recover accuracy cheaply.

Compare latency and perplexity vs an off-the-shelf 3B model to evaluate replacement vs buy-an-existing-model tradeoff.

Optimization Features

Infra Optimization
Supports pruning on single A6000 / ≈20–48GB GPUsAvoids need for multi-A100-class setups
Model Optimization
Structured pruning of attention heads and MLP dimsGlobal module importance ranking via regression on perturbations
System Optimization
Forward-pass-only pruning to avoid backward memory overheadConfigurable runtime-quality tradeoff (15 min → 4 hr)
Training Optimization
Enables post-pruning fine-tuning on same hardware (PPA)Uses cached logits for distillation to avoid extra memory
Inference Optimization
Produces smaller models with real latency speedups (e.g., 1.58×)Removes whole modules to shrink tensor dimensions (not just sparsify)

Reproducibility

Code AvailableNo
Data AvailableYes
Open Source StatusUnknown
LicenseUnknown

Data URLs

Wikitext-2 (public)C4 (public)GSM8K (public)

Risks & Boundaries

Limitations

Longer runtime for best quality: optimal configs need ≈4 hours vs some baselines ≈1 hour.

Pruning can hurt specialized reasoning tasks (e.g., GSM8K) unless you include task data in PPA.

When Not To Use

If you have abundant multi-GPU memory and prefer gradient-based, jointly optimized pruning during training.

When you need the absolute highest out-of-the-box reasoning performance without any fine-tuning.

Failure Modes

Too few perturbation samples can produce NaNs or catastrophic degradation in FP16 (observed with ns=50).

Overly aggressive per-iteration pruning (large p_iter) damages model irrecoverably.

Core Entities

Models

LLaMA-1 7BLLaMA-2 7BLLaMA-3 8BPhi-2 3BMistral-7B

Metrics

perplexityinference speedup (×)memory during pruning (GB)

Datasets

Wikitext-2C4GSM8K

Benchmarks

Eleuther LLM Evaluation HarnessHuggingFace OpenLLM leaderboard

Context Entities

Models

Phi-1.5Sheared LlaMA

Metrics

Kendall rank correlation (used for cross-val)sample variance / fluctuation metrics (FLAP)

Datasets

Wikitext-2 training/validationC4 subsets used for pruning signal and PPA

Benchmarks

Wikitext-2 validationGSM8KARC, Winogrande, HellaSwag, TruthfulQA, MMLU (via Eleuther harness)