Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,128 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
tags: []
|
| 4 |
---
|
| 5 |
|
| 6 |
-
# Model Card for
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
- **Developed by:**
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
### Model Sources
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
### Direct Use
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
[More Information Needed]
|
| 63 |
|
| 64 |
### Recommendations
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
|
| 84 |
### Training Procedure
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
|
| 103 |
## Evaluation
|
| 104 |
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
|
| 127 |
### Results
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
|
| 141 |
## Environmental Impact
|
|
|
|
| 142 |
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
|
| 153 |
-
## Technical Specifications
|
| 154 |
|
| 155 |
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
tags: ["pruned", "compressed-model", "llama", "research-only", "needs-finetuning"]
|
| 4 |
---
|
| 5 |
|
| 6 |
+
# Model Card for `SmolLM-135M-Instruct-layer-width-pruned-90M-raw`
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
## Model Details
|
| 9 |
|
| 10 |
### Model Description
|
| 11 |
|
| 12 |
+
This model is a **pruned version** of [HuggingFaceTB/SmolLM-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM-135M-Instruct).
|
| 13 |
+
The pruning procedure reduced both **layers** and **hidden dimensions**, decreasing parameter count from **134M → ~93M** (~30.5% reduction).
|
| 14 |
|
| 15 |
+
⚠️ **Important Note:**
|
| 16 |
+
This model has **not been fine-tuned** after pruning. Since layers and parts of weights were dropped, the model will not produce accurate outputs in its current state. To make it useful, one must apply **distillation or fine-tuning**.
|
| 17 |
|
| 18 |
+
- **Developed by:** Independent modification (original model: HuggingFaceTB)
|
| 19 |
+
- **Model type:** Causal Language Model (decoder-only, LLaMA architecture)
|
| 20 |
+
- **Language(s) (NLP):** English (same as original SmolLM training corpus)
|
| 21 |
+
- **License:** Inherits license from the original [SmolLM-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM-135M-Instruct)
|
| 22 |
+
- **Finetuned from model:** `HuggingFaceTB/SmolLM-135M-Instruct`
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
### Model Sources
|
| 25 |
+
- **Repository:** [Original SmolLM](https://huggingface.co/HuggingFaceTB/SmolLM-135M-Instruct)
|
| 26 |
+
- **Paper [optional]:** N/A
|
| 27 |
+
- **Demo [optional]:** N/A
|
| 28 |
|
| 29 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
## Uses
|
| 32 |
|
|
|
|
|
|
|
| 33 |
### Direct Use
|
| 34 |
+
- ⚠️ Not suitable for inference out-of-the-box.
|
| 35 |
+
- Intended for **research in pruning, model compression, and architecture efficiency experiments**.
|
| 36 |
|
| 37 |
+
### Downstream Use
|
| 38 |
+
- Can be **fine-tuned or distilled** on downstream NLP tasks (instruction following, summarization, dialogue, etc.) to regain performance.
|
| 39 |
+
- Useful as a **smaller backbone** for constrained environments (edge devices, prototyping).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
### Out-of-Scope Use
|
| 42 |
+
- Do **not** expect reliable outputs without fine-tuning.
|
| 43 |
+
- Not suitable for production or safety-critical tasks.
|
| 44 |
+
- Not intended for generating factual, unbiased, or safe text without retraining.
|
| 45 |
|
| 46 |
+
---
|
|
|
|
|
|
|
| 47 |
|
| 48 |
## Bias, Risks, and Limitations
|
| 49 |
+
- **Risks:** Outputs are nonsensical and misleading in current state.
|
| 50 |
+
- **Biases:** Same biases as original SmolLM dataset, but pruning may amplify instability.
|
| 51 |
+
- **Limitations:** Lower representational capacity due to fewer layers/hidden units → lower accuracy even after retraining.
|
|
|
|
| 52 |
|
| 53 |
### Recommendations
|
| 54 |
+
- Perform **knowledge distillation** from the original model onto this pruned version.
|
| 55 |
+
- Apply **fine-tuning** for task-specific usage.
|
| 56 |
+
- Do **not** use for real-world decision-making without retraining and evaluation.
|
| 57 |
|
| 58 |
+
---
|
|
|
|
|
|
|
| 59 |
|
| 60 |
## How to Get Started with the Model
|
| 61 |
+
```python
|
| 62 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 63 |
+
|
| 64 |
+
model_name = "your-username/SmolLM-135M-Instruct-layer-width-pruned-90M-raw"
|
| 65 |
+
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-135M-Instruct")
|
| 66 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 67 |
|
| 68 |
+
inputs = tokenizer("Hello world!", return_tensors="pt")
|
| 69 |
+
outputs = model.generate(**inputs, max_length=50)
|
| 70 |
+
print(tokenizer.decode(outputs[0]))
|
| 71 |
+
```
|
| 72 |
+
⚠��� The outputs are not meaningful until fine-tuned.
|
| 73 |
|
| 74 |
+
---
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
+
- Same as original **SmolLM-135M-Instruct**.
|
| 80 |
+
- No new training performed after pruning.
|
|
|
|
|
|
|
| 81 |
|
| 82 |
### Training Procedure
|
| 83 |
+
- **Step 1:** Layer pruning → kept **25/30 layers**.
|
| 84 |
+
- **Step 2:** Hidden dimension pruning → hidden size **576 → 504**; intermediate size **1536 → 1344**.
|
| 85 |
+
- **No fine-tuning yet.**
|
| 86 |
|
| 87 |
+
### Training Hyperparameters
|
| 88 |
+
- No training performed. Model is raw after pruning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
+
---
|
|
|
|
|
|
|
| 91 |
|
| 92 |
## Evaluation
|
| 93 |
|
|
|
|
|
|
|
| 94 |
### Testing Data, Factors & Metrics
|
| 95 |
+
- No evaluation performed post-pruning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
### Results
|
| 98 |
+
- Model reduced from **134.5M → ~93.4M parameters**.
|
| 99 |
+
- ~**30.5% reduction** in size.
|
| 100 |
+
- Accuracy and output quality degraded (**requires fine-tuning**).
|
| 101 |
|
| 102 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
## Environmental Impact
|
| 105 |
+
Minimal, since no retraining has been done yet. Only pruning + saving.
|
| 106 |
|
| 107 |
+
- **Hardware Type:** Single GPU (pruning experiment)
|
| 108 |
+
- **Hours used:** <1
|
| 109 |
+
- **Cloud Provider:** N/A
|
| 110 |
+
- **Carbon Emitted:** Negligible
|
| 111 |
|
| 112 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
+
## Technical Specifications
|
| 115 |
|
| 116 |
### Model Architecture and Objective
|
| 117 |
+
- Based on **LLaMA decoder-only transformer**.
|
| 118 |
+
- **Objective:** next-token prediction (causal LM).
|
| 119 |
+
- **Modified architecture:**
|
| 120 |
+
- Layers: **30 → 25**
|
| 121 |
+
- Hidden size: **576 → 504**
|
| 122 |
+
- Intermediate size: **1536 → 1344**
|
| 123 |
+
- Attention heads: **9 (unchanged)**
|
| 124 |
+
- Key/Value heads: **3 (unchanged)**
|
| 125 |
|
| 126 |
### Compute Infrastructure
|
| 127 |
+
- **Hardware:** Single consumer GPU (e.g., RTX series)
|
| 128 |
+
- **Software:** PyTorch, Hugging Face Transformers **4.57.0**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|