Upload folder using huggingface_hub
Browse files- README.md +61 -0
- adapter_config.json +39 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: Qwen/Qwen2.5-1.5B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- algorithmic-sft
|
| 6 |
+
- lora
|
| 7 |
+
- long-arithmetic
|
| 8 |
+
- algorithmic-template
|
| 9 |
+
library_name: peft
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Long Arithmetic — Chunked
|
| 13 |
+
|
| 14 |
+
LoRA adapter for **Qwen/Qwen2.5-1.5B-Instruct** fine-tuned on long arithmetic via **Algorithmic Template SFT**.
|
| 15 |
+
|
| 16 |
+
Part of the [Algorithmic SFT vs Distillation](https://huggingface.co/collections/reasoning-degeneration-dev/algorithmic-sft-vs-distillation) experiment studying whether deterministic algorithmic templates teach procedural reasoning more effectively than distillation from large reasoning models.
|
| 17 |
+
|
| 18 |
+
## Training
|
| 19 |
+
|
| 20 |
+
| Parameter | Value |
|
| 21 |
+
|-----------|-------|
|
| 22 |
+
| **Base model** | Qwen/Qwen2.5-1.5B-Instruct |
|
| 23 |
+
| **Method** | Algorithmic Template SFT |
|
| 24 |
+
| **Framework** | LLaMA-Factory (SFT stage) |
|
| 25 |
+
| **LoRA rank** | 64 |
|
| 26 |
+
| **LoRA target** | all linear layers |
|
| 27 |
+
| **Learning rate** | 1e-4 |
|
| 28 |
+
| **Epochs** | 3 |
|
| 29 |
+
| **Batch size** | 4 (grad accum 4) |
|
| 30 |
+
| **Cutoff length** | 32,768 tokens |
|
| 31 |
+
| **Training data** | 5,000 deterministic chunked multiplication traces (d4) |
|
| 32 |
+
|
| 33 |
+
## Evaluation (v3, MAX_TOKENS=32768)
|
| 34 |
+
|
| 35 |
+
| Split | Accuracy |
|
| 36 |
+
|-------|----------|
|
| 37 |
+
| Test (in-distribution) | 86.2% |
|
| 38 |
+
| Harder variant | 13.2% |
|
| 39 |
+
| Structural OOD | 0.0% |
|
| 40 |
+
|
| 41 |
+
## Notes
|
| 42 |
+
|
| 43 |
+
Weaker than standard variant. Same OOD failure.
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
from peft import PeftModel
|
| 49 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 50 |
+
|
| 51 |
+
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
|
| 52 |
+
model = PeftModel.from_pretrained(base, "reasoning-degeneration-dev/algo-sft-long-arithmetic-chunked")
|
| 53 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
## Related Datasets
|
| 57 |
+
|
| 58 |
+
- [Training data](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-training-data-v1) (63K algo traces)
|
| 59 |
+
- [Distillation data](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-distillation-training-data-v1) (24K QwQ traces)
|
| 60 |
+
- [Eval results](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-full-eval-v3) (aggregate scores)
|
| 61 |
+
- [Eval questions](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-eval-sets-v1) (11K test/val/harder/OOD)
|
adapter_config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "Qwen/Qwen2.5-1.5B-Instruct",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"corda_config": null,
|
| 7 |
+
"eva_config": null,
|
| 8 |
+
"exclude_modules": null,
|
| 9 |
+
"fan_in_fan_out": false,
|
| 10 |
+
"inference_mode": true,
|
| 11 |
+
"init_lora_weights": true,
|
| 12 |
+
"layer_replication": null,
|
| 13 |
+
"layers_pattern": null,
|
| 14 |
+
"layers_to_transform": null,
|
| 15 |
+
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 128,
|
| 17 |
+
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0.0,
|
| 19 |
+
"megatron_config": null,
|
| 20 |
+
"megatron_core": "megatron.core",
|
| 21 |
+
"modules_to_save": null,
|
| 22 |
+
"peft_type": "LORA",
|
| 23 |
+
"r": 64,
|
| 24 |
+
"rank_pattern": {},
|
| 25 |
+
"revision": null,
|
| 26 |
+
"target_modules": [
|
| 27 |
+
"up_proj",
|
| 28 |
+
"v_proj",
|
| 29 |
+
"o_proj",
|
| 30 |
+
"gate_proj",
|
| 31 |
+
"q_proj",
|
| 32 |
+
"down_proj",
|
| 33 |
+
"k_proj"
|
| 34 |
+
],
|
| 35 |
+
"task_type": "CAUSAL_LM",
|
| 36 |
+
"trainable_token_indices": null,
|
| 37 |
+
"use_dora": false,
|
| 38 |
+
"use_rslora": false
|
| 39 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ad4c8c978fa3959b2f2fa7ba67e442de45f5b5227238e08cf873c854df106b9
|
| 3 |
+
size 295488936
|