Instructions to use reasoning-degeneration-dev/algo-sft-formal-logic-truth-table with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use reasoning-degeneration-dev/algo-sft-formal-logic-truth-table with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "reasoning-degeneration-dev/algo-sft-formal-logic-truth-table") - Notebooks
- Google Colab
- Kaggle
File size: 2,213 Bytes
3e02466 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | ---
license: mit
base_model: Qwen/Qwen2.5-1.5B-Instruct
tags:
- algorithmic-sft
- lora
- formal-logic
- algorithmic-template
library_name: peft
---
# Formal Logic — Truth Table
LoRA adapter for **Qwen/Qwen2.5-1.5B-Instruct** fine-tuned on formal logic via **Algorithmic Template SFT**.
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.
## Training
| Parameter | Value |
|-----------|-------|
| **Base model** | Qwen/Qwen2.5-1.5B-Instruct |
| **Method** | Algorithmic Template SFT |
| **Framework** | LLaMA-Factory (SFT stage) |
| **LoRA rank** | 64 |
| **LoRA target** | all linear layers |
| **Learning rate** | 1e-4 |
| **Epochs** | 3 |
| **Batch size** | 4 (grad accum 4) |
| **Cutoff length** | 32,768 tokens |
| **Training data** | 5,000 deterministic truth-table enumeration traces (d5) |
## Evaluation (v3, MAX_TOKENS=32768)
| Split | Accuracy |
|-------|----------|
| Test (in-distribution) | 100.0% |
| Harder variant | 93.0% |
| Structural OOD | 90.2% |
## Notes
Also near-perfect. Slightly behind bottom-up on generalization.
## Usage
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
model = PeftModel.from_pretrained(base, "reasoning-degeneration-dev/algo-sft-formal-logic-truth-table")
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
```
## Related Datasets
- [Training data](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-training-data-v1) (63K algo traces)
- [Distillation data](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-distillation-training-data-v1) (24K QwQ traces)
- [Eval results](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-full-eval-v3) (aggregate scores)
- [Eval questions](https://huggingface.co/datasets/reasoning-degeneration-dev/algorithmic-sft-eval-sets-v1) (11K test/val/harder/OOD)
|