How samsunglabs/littlebit works
LittleBit is a sub-1-bit language-model compression and evaluation project. Its main workflow prepares tokenized training data, loads student and teacher models, applies factorized quantization, trains with quantization-aware and teacher-student losses, then saves a checkpoint for evaluation or Hub use. The graph also preserves model loading, packed binary weights, Phi attention handling, and Hub integration. Some orchestration details are unsampled; links for those steps are marked unverified rather than inferred from imports alone.
Main entry points: main.py Training entrypoint · quant_util.py Model patching · eval.py Checkpoint evaluation · littlebit.py Factorized linear
Components 15
Training and evaluation
- Training entrypoint
main.py - Checkpoint evaluation
eval.py
Quantization runtime
- Factorized linear
quantization/modules/littlebit.py - Binary quantizers
quantization/functions/binary.py - Weight packing
quantization/utils/binary_packer.py - Phi attention split
quantization/modules/attention.py
Model integration
- Model patching
quantization/utils/quant_util.py - Hub model support
quantization/hub.py
Data and training support
- Dataset preparation
utils/datautils.py - Distillation trainer
utils/kd_utils.py - Training utilities
utils/utils.py
Other components
- Model engineer
- Dataset sources
- Hugging Face Hub
- Saved checkpoint
Connections 17
- Model engineer → Training entrypoint: starts training
README.md - Training entrypoint → Dataset preparation: prepares data
main.py - Dataset preparation → Dataset sources: loads corpora
utils/datautils.py - Training entrypoint → Distillation trainer: sets up trainer
main.py - Training entrypoint → Training utilities: uses utilities
main.py - Training entrypoint → Model patching: patches model
- Model patching → Factorized linear: installs module
quantization/utils/quant_util.py - Model patching → Phi attention split: maps attention
quantization/utils/quant_util.py - Factorized linear → Weight packing: packs weights
quantization/modules/littlebit.py - Factorized linear → Binary quantizers: quantizes factors
- Training entrypoint → Saved checkpoint: saves model
main.py - Model engineer → Checkpoint evaluation: starts evaluation
README.md - Checkpoint evaluation → Model patching: loads quantized model
- Checkpoint evaluation → Saved checkpoint: reads checkpoint
README.md - Hub model support → Hugging Face Hub: downloads or publishes
quantization/hub.py - Model engineer → Hub model support: loads or publishes
quantization/hub.py - Hub model support → Model patching: uses quantized loading
quantization/hub.py