--- title: Formula Engine Chatbot emoji: 🧮 colorFrom: purple colorTo: blue sdk: gradio sdk_version: 5.32.0 app_file: app.py pinned: false license: apache-2.0 tags: - ml-intern --- # 🧮 Formula Engine Chatbot ## AI-Powered Weight Compression: Qwen 0.5B from Mathematical Formulas This Space demonstrates the **Formula Engine** concept: - Instead of storing the full **942 MB** Qwen 0.5B model - We store **compact mathematical formulas** (~474 MB) that reconstruct the weights on-the-fly - **49.7% disk space saved** while maintaining 99.99% accuracy ### How it works: 1. **Formula Discovery**: Analyzes each weight matrix to find the most compact representation 2. **4-bit Quantization**: `W ≈ scale × W_q + zero_point` (75% compression per layer) 3. **SVD Factorization**: `W ≈ U_r × S_r × V_r^T` (for rectangular matrices) 4. **On-the-fly Reconstruction**: Formulas regenerate weights at startup ### Links: - 📦 [Formula Weights Repository](https://huggingface.co/arudradey/qwen-formula-engine) - 🤖 [Base Model: Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) ### Note This Space requires ~2GB RAM to reconstruct and run the model. It uses CPU inference.