File size: 2,610 Bytes
ddca772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
base_model: OpenOneRec/OneReason-0.8B-pretrain-competition
library_name: peft
pipeline_tag: text-generation
tags:
- recommendation
- lora
- generative-recommendation
- itemic-token
- qwen3
- llama-factory
- transformers
license: apache-2.0
---

# OneReason-0.8B-LoRA-ExpA

LoRA adapter fine-tuned from [OpenOneRec/OneReason-0.8B-pretrain-competition](https://huggingface.co/OpenOneRec/OneReason-0.8B-pretrain-competition) on the Kuaishou Explorer LLM-Rec Challenge dataset.

## Model Details

- **Base Model:** OpenOneRec/OneReason-0.8B-pretrain-competition (Qwen3-0.8B)
- **Fine-tuning Method:** LoRA (rank=16, alpha=32)
- **Target Modules:** q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- **Training Data:** Kuaishou LLM-Rec Challenge competition dataset (32K samples)
- **Training Steps:** 4,660 / 11,571 (~40% of 3 epochs)
- **Hardware:** NVIDIA RTX 4090 (47GB VRAM)
- **Training Time:** ~2h 41min

## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model = "OpenOneRec/OneReason-0.8B-pretrain-competition"
model = AutoModelForCausalLM.from_pretrained(
    base_model,
    trust_remote_code=True,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)

# Load LoRA adapter
model = PeftModel.from_pretrained(model, "dfdu233/OneReason-0.8B-lora-expA")

# Example inference
prompt = "<|prod_begin|><s_a_1183><s_b_746><s_c_5290>,这个商品卖的是什么? /no_think"
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, top_p=0.95, temperature=0.7)
print(tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True))
```

## Training Details

- **Loss:** 3.023 → 1.337 (56% reduction over 4660 steps)
- **Validation Loss:** 1.373 (decreasing, no overfitting)
- **Cutoff Length:** 8192
- **Batch Size:** 1 (gradient accumulation 8 = effective batch 8)
- **Learning Rate:** 3e-5 (cosine schedule)
- **Optimizer:** paged_adamw_8bit
- **Context Length:** 8192 tokens
- **Flash Attention:** fa2

## Training Data Distribution

| Task | Samples |
|------|--------:|
| Recommendation (懂推荐) | 21,885 |
| Item Understanding (懂物料) | 5,807 |
| User Prediction (懂用户) | 4,788 |
| **Total** | **32,480** |

## Framework versions

- PEFT 0.18.1
- PyTorch 2.4.0
- Transformers 5.6.0
- Flash-Attn 2.6.3