gitwtfhub

wtf is spinquant?

facebookresearch/spinquant — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2025-02-14

405PythonAudience · researcherComplexity · 4/5StaleSetup · hard

TL;DR

A technique that shrinks large language models to run faster and use less memory by rotating their data before compressing it to 4-bit numbers, with minimal accuracy loss.

Mindmap

mindmap
  root((repo))
    What it does
      Compresses LLM weights
      Rotates data first
      Learns best rotation
      Keeps accuracy high
    Tech stack
      Python
      PyTorch
      ExecuTorch export
    Use cases
      Mobile deployment
      Edge devices
      Data center serving
      Compression research
    Audience
      ML researchers
      Mobile app developers
      Infra engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Shrink a language model to 4-bit precision for faster, cheaper inference.

REASON 2

Deploy large language models on mobile or edge devices with limited memory.

REASON 3

Compare model compression methods against a state-of-the-art quantization baseline.

REASON 4

Export a quantized model to ExecuTorch for real-world deployment testing.

What's in the stack?

PythonPyTorchExecuTorch

How it stacks up

facebookresearch/spinquantscenemaai/scenema-audioflashml-org/flashlib
Stars405406408
LanguagePythonPythonPython
Last pushed2025-02-14
MaintenanceStale
Setup difficultyhardhardmoderate
Complexity4/54/54/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires GPU and running optimization scripts before models are usable.

Yoink these prompts

Prompt 1
Help me use SpinQuant to quantize a LLaMA-2 7B model to 4-bit precision.
Prompt 2
Walk me through running SpinQuant's rotation optimization scripts on my own model.
Prompt 3
Explain how SpinQuant's Cayley optimization learns rotations, using this repo's code as reference.
Prompt 4
Show me how to export a SpinQuant-quantized model to ExecuTorch for mobile deployment.
Prompt 5
Compare SpinQuant's accuracy results to SmoothQuant using the benchmarks in this repo.

Frequently asked questions

wtf is spinquant?

A technique that shrinks large language models to run faster and use less memory by rotating their data before compressing it to 4-bit numbers, with minimal accuracy loss.

What language is spinquant written in?

Mainly Python. The stack also includes Python, PyTorch, ExecuTorch.

Is spinquant actively maintained?

Stale — no commits in 1-2 years (last push 2025-02-14).

How hard is spinquant to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is spinquant for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.