Skip to content

训练配置疑问 #414

Description

@caihuaiguang

Problem Description / 问题描述

我用OpenDCAI/dataflow-instruct-10k数据集,base模型为Qwen2.5-7B-base,learning rate为2e-5,per_device_train_batch_size为1,batch size为128,训练了3个epoch,在C-Eval(评测温度为0)的上:1个epoch准确率为74.81,第2个epoch是75.85,第三个epoch是74.96,和报告中的80.2差距较大;求助论文采用的训练配置,感谢!

System Info (dataflow env) / 系统信息(dataflow env)

None

Minimal Reproducible Example / 最小可复现示例

# e.g.
from dataflow.operators.generate import PromptedVQA
...

Additional Information / 其他补充

No response

Activity

  1. haolpku commented on Dec 22, 2025

    @haolpku
    Contributor

    之前用的这个配置

    model

    model_name_or_path: Qwen2-7B

    method

    stage: sft
    do_train: true
    finetuning_type: full
    deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
    flash_attn: fa2

    dataset

    dataset: xx
    template: qwen
    cutoff_len: 16384
    max_samples: 100000000000
    overwrite_cache: true
    preprocessing_num_workers: 96

    output

    output_dir: xx
    logging_steps: 10
    save_steps: 1000
    plot_loss: true
    overwrite_output_dir: true

    train

    per_device_train_batch_size: 1
    gradient_accumulation_steps: 64
    learning_rate: 5.0e-6
    num_train_epochs: 1
    lr_scheduler_type: cosine
    warmup_ratio: 0.05
    bf16: true
    ddp_timeout: 180000000

  2. caihuaiguang commented on Dec 22, 2025

    @caihuaiguang
    Author

    非常感谢!还想确认下,多少张GPU呀?global batch size是64么?

  3. huruo1010 commented on Dec 23, 2025

    @huruo1010

    训练时用的8张GPU,global batch size为512;测试时C-eval采用lm-eval框架,max_model_len设置为16384;可能比较重要的是训练时的学习率以及测试时的输出长度;学习率过大可能造成模型重复输出现象增多;因为训练用的cutoff_len为16384以及训练数据为长链,如果测试时设置max_model_len太小会导致截断无法得到正确答案。

  4. caihuaiguang commented on Dec 23, 2025

    @caihuaiguang
    Author

    @huruo1010 原来如此,搞明白了,非常感谢👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions