Full details on simulation and training can be found
here.
Trained with
Stable Alignment on 8xA100s for 3H. The start checkpoint is the
hh-rlhf-sft model.
We have also released the
better-base model which is the start checkpoint of SFT.
1torchrun --nproc_per_node=8 --master_port=36646 train_alignment.py \
2 --model_name_or_path /workspace/hhh-sft \
3 --data_path /workspace/sandbox_v1.json \
4 --bf16 True \
5 --output_dir /workspace/output_lm \
6 --num_train_epochs 2 \
7 --per_device_train_batch_size 1 \
8 --per_device_eval_batch_size 1 \
9 --gradient_accumulation_steps 8 \
10 --evaluation_strategy "no" \
11 --save_strategy "steps" \
12 --save_steps 200 \
13 --save_total_limit 1 \
14 --learning_rate 2e-5 \
15 --weight_decay 0. \
16 --warmup_ratio 0.03 \
17 --lr_scheduler_type "cosine" \
18 --logging_steps 1 \
19 --fsdp "full_shard auto_wrap" \
20 --fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' \
21 --tf32 True \
22 --model_max_length 480 \
23 --rating_scale 7 \
24 --margin 1 \
25 --max_flow False \
26 --ratio 0.2 \
27 --num_comp 3
Although this project aims to better align current LMs with social norms, inappropriate content and inherent biases in the training data will still impair the alignment of the model.
The model should not be used directly in any application, without a prior assessment of safety and fairness concerns specific to the application.
1@misc{liu2023sociallyaligned,
2 title={Training Socially Aligned Language Models in Simulated Human Society},
3 author={Ruibo Liu and Ruixin Yang and Chenyan Jia and Ge Zhang and Denny Zhou and Andrew M. Dai and Diyi Yang and Soroush Vosoughi},
4 year={2023},
5 eprint={2305.16960},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}