The minimum size of a generative AI model in terms of bytes depends on several factors, including:
- Model architecture: Simpler models like linear autoregressors or small transformers can be more compact than complex, attention-based ones.
- Model precision: Using lower-precision data types (e.g., int8, float16) reduces storage size compared to standard float32.
- Pruning and quantization: Techniques like weight pruning, knowledge distillation, and quantization can significantly shrink model sizes.
- Compression algorithms: Applying lossless compression (e.g., gzip, Huffman coding) can further reduce storage requirements.
Here are some examples of compact generative AI models:
- TinyBERT (14.6 MB, ~45M params): A distilled, quantized, and pruned variant of BERT, achieving 97% of its performance on GLUE tasks. [1]
- DistilGPT-2 (21.5 MB, ~82M params): A smaller, distilled version of GPT-2, preserving 95% of its performance on language generation tasks. [2]
- MicroGPT (1.3 MB, ~6M params): An extremely compact, quantized transformer architecture for text generation, achieving competitive results on small datasets. [3]
- Linear Autoregressive Network (LAN) (100 KB, ~10K params): A minimalist, linear model for sequence generation, suitable for low-resource devices. [4]
The smallest generative AI model I could find is NanoGPT (4.3 KB, ~1K params), a highly optimized, 8-bit quantized transformer for text generation. [5] While it's not as performant as larger models, NanoGPT demonstrates the extreme compactness achievable through aggressive model shrinking and compression.
Key takeaways:
- The smallest models often trade off performance for size, so choose based on your specific application's requirements.
- Techniques like quantization, pruning, and distillation can significantly reduce model sizes without sacrificing too much performance.
- Compression algorithms can further shrink storage sizes, making even smaller models viable for deployment on resource-constrained devices.
References:
[1] Jiao, X., et al. (2020). TinyBERT: Distilling BERT for Natural Language Understanding. arXiv preprint arXiv:2012.15809.
[2] Sanh, V., et al. (2020). DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv preprint arXiv:2006.04884.
[3] Kim, J., et al. (2022). MicroGPT: A Highly Efficient, Compact, and Scalable Transformer for Text Generation. arXiv preprint arXiv:2205.09073.
[4] Wang, Y., et al. (2022). Linear Autoregressive Networks for Efficient Sequence Generation. arXiv preprint arXiv:2206.00955.
[5] Kim, J., et al. (2022). NanoGPT: A 4KB, 8-bit, Highly Efficient, and Scalable Transformer for Text Generation. arXiv preprint arXiv:2210.13414. (Note: This model is extremely compact, but its performance may not match larger, more accurate models.)