--- library_name: transformers license: llama3.2 metrics: - accuracy - perplexity base_model: - meta-llama/Llama-3.2-1B --- # Model Card for oopere/pruned40-llama-1b This model is a pruned version of the Llama-3.2 architecture, with a parameter reduction of 40% in the MLP Layers. The pruning process aims to enhance computational efficiency while maintaining acceptable performance across specific tasks. This model is not intended to be used directly, but rather to be fine-tuned for specific tasks where it can achieve equal or superior performance compared to fine-tuning the base model for the same task. ## Model Details - **Model Type:** Pruned version of LLaMA-1.2B using structured pruning - **Original Model:** meta-llama/Llama-3.2-1B - **Pruning Method:** Structured pruning of MLP layers using importance scores based on absolute maximum weights - **Size Reduction:** 26.3% (from 1.24B to 914M parameters) - **Architecture:** Same as original LLaMA but with reduced MLP layer sizes - **Language(s):** Same as original model - **License:** Same as original model - **Developed by:** [Pere Martra](https://huggingface.co/oopere) ### Performance on Standard Benchmarks | Benchmark | Original Model | Pruned Model | Relative Change | | ---- | ---- | ---- | ---- | | ARC-Easy | 65.19% | 40.19% | -38.7% | | BoolQ | 64.16% | 62.11% | -3.2% | | LAMBADA-OpenAI | 62.20% | 29.85% | -52.0% | | LAMBADA-Standard | 53.46% | 24.78% | -53.6% | ### Key Findings - Remarkably maintains strong performance on binary classification tasks (BoolQ) - Significant degradation on reasoning tasks (ARC-Easy) - Substantial impact on long-range comprehension (LAMBADA) - Notable increase in perplexity for language modeling tasks ### Limitations - Considerable reduction in performance on complex language understanding tasks - Significant degradation in long-range dependency handling - May not be suitable for applications requiring high accuracy on language completion tasks - Best suited for simpler classification tasks ### Implementation Details - **Pruning Notebook:** [Detailed implementation and methodology](https://github.com/peremartra/Large-Language-Model-Notebooks-Course/blob/main/6-PRUNING/6_3_pruning_structured_llama3.2-1b_OK.ipynb) - **GitHub Repository:** [LLM Course](https://github.com/peremartra/Large-Language-Model-Notebooks-Course) ### Pruning Method - **Technique:** Structured pruning targeting MLP layers - **Pruning Ratio:** 40% of neurons removed from MLP layers - **Selection Criteria:** Importance scoring based on absolute maximum weights - **Architecture Specifics:** Maintained GLU structure during pruning ### Hardware Requirements - Reduced memory footprint compared to original model - Can run on hardware with ~26% less memory than original ## Acknowledgments - Thanks to [Mariusz Kurman](https://huggingface.co/mkurman) for creating [llama-pruning](https://github.com/MedITSolutionsKurman/llama-pruning), a library that extends and improve this pruning methodology.