dei-model / train_configs /train_step_cot.yaml
renpas22
Add training scripts and configs
2b8876a
Raw History Blame Contribute Delete
2.18 kB
# 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
# }