LittleBit README

The project's README from github.com/SamsungLabs/LittleBit. As one markdown file: README.md.

The LittleBit Project

Sub-1-Bit LLM Compression via Latent Factorization

Official implementation of LittleBit (NeurIPS 2025) and LittleBit-2 (ICML 2026).


Papers

LittleBit-2: Maximizing the Spectral Energy Gain in Sub-1-Bit LLMs via Latent Geometry Alignment (ICML 2026)
Banseok Lee, Youngmin Kim
arXiv ICML

LittleBit: Ultra Low-Bit Quantization via Latent Factorization (NeurIPS 2025)
Banseok Lee*, Dongkyu Kim*, Youngcheon You, Youngmin Kim
arXiv NeurIPS


Abstract

LittleBit compresses large language models into the sub-1-bit regime by factorizing each dense weight matrix into low-rank latent factors, binarizing those factors, and restoring magnitude information through lightweight learned scales. This enables extreme compression, including the 0.1 bits-per-weight setting, while preserving the original model architecture at inference time.

LittleBit-2 improves this recipe by addressing latent geometry misalignment in the initialization stage. It applies Internal Latent Rotation with Joint Iterative Quantization (Joint-ITQ), aligning the SVD-derived latent factors with the binary hypercube before QAT. LittleBit-2 initialization is available as an opt-in (--use_itq) and produces no additional inference overhead.


Highlights

Supported Models

The codebase currently supports:


Installation

We recommend Python 3.12.

conda create -n littlebit python=3.12
conda activate littlebit

# Install CUDA toolkit. Adjust the CUDA version if needed.
conda install nvidia/label/cuda-12.4.1::cuda-toolkit -c nvidia/label/cuda-12.4.1

# Install PyTorch.
pip install torch==2.8.0+cu124 torchvision==0.23.0+cu124 torchaudio==2.8.0+cu124 --index-url https://download.pytorch.org/whl/cu124

# Install dependencies.
pip install -r requirements.txt

[!IMPORTANT] For reproducing the paper results, use transformers 4.51.x. Newer transformers releases may change model internals or evaluation behavior.

pip install "transformers==4.51.*"

Usage

Training

Train a model with Quantization-Aware Training. By default, LittleBitLinear uses the original SVD-only initialization. To enable LittleBit-2 (Joint-ITQ), pass --use_itq True.

Single GPU

CUDA_VISIBLE_DEVICES=0 python -m main \
    --model_id meta-llama/Llama-2-7b-hf \
    --dataset c4_wiki \
    --save_dir ./outputs/Llama-2-7b-LittleBit-2 \
    --num_train_epochs 5.0 \
    --per_device_train_batch_size 4 \
    --lr 4e-05 \
    --warmup_ratio 0.02 \
    --report wandb \
    --quant_func SmoothSign \
    --quant_mod LittleBitLinear \
    --residual True \
    --eff_bit 1.0 \
    --kv_factor 1.0 \
    --min_split_dim 8 \
    --l2l_loss_scale 10.0

# Opt-in to LittleBit-2 initialization
# --use_itq True

Multi-GPU with DeepSpeed

deepspeed --num_gpus=4 main.py \
    --model_id meta-llama/Llama-2-7b-hf \
    --dataset c4_wiki \
    --save_dir ./outputs/Llama-2-7b-LittleBit-2 \
    --ds_config_path configs/zero3.json \
    --num_train_epochs 5.0 \
    --per_device_train_batch_size 4 \
    --lr 4e-05 \
    --report wandb \
    --quant_func SmoothSign \
    --quant_mod LittleBitLinear \
    --residual True \
    --eff_bit 1.0 \
    --kv_factor 1.0 \
    --min_split_dim 8

Evaluation

Evaluate a local checkpoint or a model hosted on the Hugging Face Hub.

# From a local directory
CUDA_VISIBLE_DEVICES=0 python eval.py \
    --model_id ./outputs/Llama-2-7b-LittleBit-2 \
    --seqlen 2048 \
    --ppl_task wikitext2,c4 \
    --zeroshot_task boolq,piqa,hellaswag,winogrande,arc_easy,arc_challenge,openbookqa

# From the Hugging Face Hub
CUDA_VISIBLE_DEVICES=0 python eval.py \
    --model_id username/littlebit-llama-7b-0.1bpw \
    --seqlen 2048 \
    --ppl_task wikitext2

Legacy Checkpoints

Older checkpoints may not include littlebit_config.json. In that case, pass the quantization arguments explicitly:

CUDA_VISIBLE_DEVICES=0 python eval.py \
    --model_id ./outputs/Legacy-Llama-2-7b \
    --quant_func SmoothSign \
    --quant_mod LittleBitLinear \
    --split_dim 1024

Parameter loading priority:

  1. Explicit CLI arguments
  2. littlebit_config.json in the model directory
  3. config.json fallback for older checkpoints

Citation

If you find this work useful, please cite:

@inproceedings{lee2026littlebit2,
  title={LittleBit-2: Maximizing the Spectral Energy Gain in Sub-1-Bit LLMs via Latent Geometry Alignment},
  author={Lee, Banseok and Kim, Youngmin},
  booktitle={Proceedings of the 43rd International Conference on Machine Learning},
  year={2026}
}
@inproceedings{lee2025littlebit,
  title={LittleBit: Ultra Low-Bit Quantization via Latent Factorization},
  author={Lee, Banseok and Kim, Dongkyu and You, Youngcheon and Kim, Youngmin},
  booktitle={Advances in Neural Information Processing Systems},
  year={2025}
}

License

This project is licensed under the CC BY-NC 4.0 license.

LittleBit (SamsungLabs/LittleBit)

Searching Database…

这是什么?LittleBit 是官方研究代码,通过把每个权重矩阵分解为低秩潜因子并二值化、再经学习到的缩放因子恢复幅值,将大语言模型压缩到低于 1 比特的精度(每权重低至 0.1 比特)。它还包括后续工作 LittleBit-2,通过潜空间几何对齐改进初始化。
这是开箱即用的工具,还是需要我自己运行的研究代码?它是一个研究代码库(训练和评估脚本),不是可以 pip 安装到产品里的成品应用或库;你需要克隆仓库,直接在支持的模型系列上运行训练/评估脚本。
怎么用它训练模型?在单张 GPU 上或用 DeepSpeed 跨多张 GPU 运行量化感知训练(QAT)脚本;默认使用仅 SVD 的初始化,传入 --useitq True 则改用 LittleBit-2 的 Joint-ITQ 初始化。
要复现论文结果需要什么软件版本?推荐 Python 3.12;要精确复现论文结果,必须使用 transformers 4.51.x 版本,因为更新的版本可能改变模型内部实现或评估行为。
LittleBit-2 会改变压缩模型在推理时的运行方式吗?不会——LittleBit-2 的 Joint-ITQ 只影响 QAT 之前的初始化阶段;部署的分解层结构和推理行为与标准 LittleBit 完全相同。
它支持哪些模型系列?OPT、Llama(以及 Llama 2/3)、Phi-4、Qwen2.5、QwQ、Gemma 2 和 Gemma 3,以及 Qwen3。
我可以商用吗?不可以——尽管 GitHub 上未标注许可证,README 说明本项目采用 CC BY-NC 4.0 许可,仅限非商业用途。
怎么评估一个已训练好的检查点?可以用评估脚本直接评估本地检查点或托管在 Hugging Face Hub 上的模型。
如果检查点缺少 littlebitconfig.json 会怎样?对于没有这个文件的旧检查点,必须在命令行上显式传入量化参数;否则加载器会回退到 config.json,其中命令行参数优先级最高。
LittleBit 和 LittleBit-2 有什么区别?LittleBit 只做 SVD 潜因子分解和二值化;LittleBit-2 增加了可选的 Joint-ITQ 步骤,在训练前把潜因子与二值超立方体对齐,在不增加任何推理成本的情况下提升谱能量保留。
这项研究是谁发表的?LittleBit 发表于 NeurIPS 2025,LittleBit-2 发表于 ICML 2026,作者为 Banseok Lee、Dongkyu Kim、Youngcheon You 和 Youngmin Kim。
Size
<0.1 MB
Stars
283
Updated
CommitOct 08
Age
10mo
Commits · 90 Days