File size: 2,177 Bytes
2b8876a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Step-Level CoT Training Configuration
# Configuration for training vision-language models with fine-grained chain-of-thought reasoning

# Model settings
pretrained_model_name_or_path: "Qwen/Qwen-Image"
vision_dim: 768
text_dim: 768

# Output settings
output_dir: "./outputs/step_level_cot"
report_to: "tensorboard"  # Options: tensorboard, wandb

# Training settings
train_batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 5.0e-5
rl_learning_rate: 1.0e-5
prm_learning_rate: 3.0e-5
weight_decay: 0.01
warmup_steps: 1000
max_train_steps: 50000
mixed_precision: "fp16"  # Options: no, fp16, bf16
gradient_checkpointing: true

# Process Reward Model (PRM) settings
prm_hidden_dim: 512
prm_num_heads: 8
prm_dropout: 0.1
max_reasoning_steps: 10

# Reinforcement Learning settings (PPO)
ppo_clip_epsilon: 0.2
value_loss_coef: 0.5
entropy_coef: 0.01
gamma: 0.99  # Discount factor
gae_lambda: 0.95  # GAE lambda

# Inference-time scaling settings
num_inference_samples: 8
inference_temperature: 0.7
aggregation_method: "best_of_n"  # Options: best_of_n, majority_vote, weighted_vote

# Data settings
dataloader_num_workers: 4
max_seq_length: 512

# Logging settings
logging_steps: 10
save_steps: 1000
eval_steps: 500
save_total_limit: 5

# Evaluation settings
run_evaluation: true
eval_batch_size: 8
num_eval_samples: 100

# Ablation study settings
run_ablation: false
ablation_components:
  - "prm"
  - "rl"
  - "inference_scaling"
  - "full_system"

# Step-level reasoning data format
# Expected structure:
# data_dir/
#   train/
#     chain_0001.json
#     chain_0002.json
#     ...
#   val/
#     chain_0001.json
#     ...
#   test/
#     chain_0001.json
#     ...
#
# Each JSON file contains a ReasoningChain with:
# {
#   "chain_id": "unique_id",
#   "image_path": "path/to/image.jpg",
#   "prompt": "What is shown in the image?",
#   "steps": [
#     {
#       "step_id": 0,
#       "step_type": "perception",
#       "description": "I observe a red ball...",
#       "confidence": 0.9,
#       "reward": 0.8,
#       "dependencies": []
#     },
#     ...
#   ],
#   "final_answer": "The image shows a red ball.",
#   "total_reward": 2.4,
#   "is_correct": true
# }