# Qwenmark2-0.5B Fine-Tuned Model Overview This is a fine-tuned version of the Qwen2-0.5B model, a transformer-based language model developed by Alibaba Cloud. The model has been fine-tuned using **LoRA (Low-Rank Adaptation)** and **Unsupervised Parameter-Efficient Fine-Tuning (PFT)** to specialize in deep learning and machine learning educational tasks. --- ## ✅ Key Features - 🎯 **Specialization**: Deep learning & machine learning Q&A - 📘 **Educational Utility**: Enhanced explanation performance - ⚙️ **Efficient Deployment**: Optional 4-bit quantization - 💡 **Contextual Understanding**: Supports RAG-style inference --- ## 🧠 Model Details - **Base Model**: `Qwen/Qwen2-0.5B` - **Architecture**: Transformer-based Causal Language Model - **Parameters**: 0.5 Billion - **Tokenizer**: Qwen2 tokenizer (`left padding`, `eos_token` as `pad_token` if unspecified) - **Quantization**: Supports 4-bit via `BitsAndBytesConfig` - **Devices Supported**: CUDA-enabled GPUs / CPU --- ## 🔧 Fine-Tuning Method ### 1. LoRA Distillation - **Data**: DeepseekR1-generated answers to curated ML/DL questions - **Config**: `r=16`, `lora_alpha=32`, `target_modules=["q_proj", "v_proj"]` - **Training**: 3 epochs, batch size 2, grad_accum=4, lr=2e-4, FP16 - **Output**: `./lora_finetuned` ### 2. Unsupervised PFT - **Data**: Extracted text from `course_slides_text.txt` - **Training**: 1 epoch, batch size 2, grad_accum=4, lr=1e-5, FP16 - **Output**: `./LoRA&pft_finetuned` --- ## 🛠️ Installation Install required packages: ```bash pip install torch transformers peft datasets sentence-transformers pdf2image pytesseract