Instructions to use PastelRuntime/SmolLM3-RNoPE-SWA-Adapters with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use PastelRuntime/SmolLM3-RNoPE-SWA-Adapters with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: HuggingFaceTB/SmolLM3-3B
|
| 4 |
+
library_name: peft
|
| 5 |
+
tags:
|
| 6 |
+
- lora
|
| 7 |
+
- rnope
|
| 8 |
+
- sliding-window-attention
|
| 9 |
+
- long-context
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# SmolLM3-RNoPE-SWA adapters
|
| 13 |
+
|
| 14 |
+
LoRA adapters for **HuggingFaceTB/SmolLM3-3B** trained as part of a
|
| 15 |
+
pre-registered experiment series on sliding-window attention in hybrid
|
| 16 |
+
RoPE/NoPE models. SmolLM3 has 27 RoPE layers + 9 NoPE layers; these adapters
|
| 17 |
+
test whether long-context retrieval survives capping the RoPE layers to an
|
| 18 |
+
8k attention window *when the LoRA is trained under that window*.
|
| 19 |
+
|
| 20 |
+
## Contents
|
| 21 |
+
|
| 22 |
+
| Folder | What it is |
|
| 23 |
+
|---|---|
|
| 24 |
+
| `treatment/` | LoRA (rank 32) trained **with** the 8k SWA window active on RoPE layers |
|
| 25 |
+
| `control/` | Same recipe, LoRA trained **without** the window |
|
| 26 |
+
|
| 27 |
+
## Result summary
|
| 28 |
+
|
| 29 |
+
- Inference-time-only windowing of the stock model destroys past-window
|
| 30 |
+
retrieval (needle-in-haystack 0/5 beyond 8k) despite being 11–21% faster.
|
| 31 |
+
- The **treatment** adapter restores needle-in-haystack retrieval to 5/5 at
|
| 32 |
+
8k / 16k / 32k / 64k under windowed inference.
|
| 33 |
+
- Full pre-registration, kernels, and raw results JSONs:
|
| 34 |
+
https://github.com/PastelRuntime/smollm3-research
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
from peft import PeftModel
|
| 40 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 41 |
+
|
| 42 |
+
base = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM3-3B", torch_dtype="bfloat16")
|
| 43 |
+
model = PeftModel.from_pretrained(base, "PastelRuntime/SmolLM3-RNoPE-SWA-Adapters", subfolder="treatment")
|
| 44 |
+
```
|