File size: 1,950 Bytes
9fe04ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Conditional Length Penalty Lambda Sweep

## Experiment Description

GRPO training on DeepScaleR math problems with conditional length penalty.
Conditional mode: length penalty only applied when the model gets the answer correct.
Reward = correctness - lambda * (tokens / max_tokens) if correct, else 0.0

## Lambda Values

- lambda=1.0 (steps 50, 100, 150, 200)
- lambda=0.3 (steps 50, 100 — still running)
- lambda=0.1 (queued)
- lambda=0.05 (running)

## Common Config

| Parameter | Value |
|-----------|-------|
| Model | Qwen/Qwen3-1.7B |
| KL beta | 0.01 |
| Learning rate | 5e-5 |
| LR scheduler | constant |
| Warmup steps | 10 |
| Max steps | 200 |
| Max completion tokens | 15,000 |
| Max prompt tokens | 1,024 |
| Prompts per step | 8 |
| Rollouts per prompt | 8 |
| per_device_batch_size | 8 |
| LoRA rank | 32 |
| LoRA alpha | 64 |
| Seed | 42 |
| Temperature | 1.0 |
| top_p | 0.95 |
| enable_thinking | True |
| gdpo_mode | False |
| norm_adv_by_std_in_grpo | True |
| Save frequency | Every 50 steps |
| Optimizer | AdamW 8-bit |
| Weight decay | 0.1 |
| Adam betas | (0.9, 0.99) |
| Max grad norm | 1.0 |
| KL loss type | low_var_kl |
| Gradient checkpointing | True |

## System Prompt

```
Please reason through this problem for yourself, and then when giving your answer ONLY provide your final answer within \boxed{} and DO NOT provide any reasoning.
```

system_prompt_method: replace

## Dataset

DeepScaleR (lime-nlp/deepscaleR_difficulty) filtered to solved_percentage 50-95%, max 1024 prompt tokens. 12,789 problems.

## Reward Function

MathLengthPenaltyReward with:
- correct_reward: 1.0
- max_answer_tokens: 0 (unlimited)
- max_completion_length: 15,000
- conditional: True
- lambda_length: varies per run

## WandB

Project: length_penalty_experiments

## Checkpoint Format

LoRA adapters only (no full model weights). Base model: Qwen/Qwen3-1.7B.
Load with: peft.PeftModel.from_pretrained(base_model, adapter_path)