Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问是否能够分享一下预训练时的超参数,以及模型预训练时的一些经验? #33

Open
kangyishuai opened this issue May 24, 2021 · 1 comment

Comments

@kangyishuai
Copy link

如果方便的话,麻烦您能分享一些继续预训练的经验,包括但不限于:
1.预训练任务;
2.不同预训练模型,再次预训练时的差异;
3.超参数设置(是否需要根据训练数据量调整,怎么调整);
4.分段预训练是否有效,例如:第一次预训练使用10W数据,然后再此基础上用另外10W数据再次预训练,然后重复此过程;
5.根据您的经验,您是如何判断预训练在什么时候可以结束;
6.等等。

@luhua-rain
Copy link
Owner

1、预训练任务:典型的mrc抽取任务,如果无答案,则start=end=0(没有加mlm任务,发现加入后效果下游任务略微下降)
2、不同预训练模型(如 roberta、macbert、albert),再次预训练(在大量mrc数据上)的差异:感觉没啥差异,就是收敛速度不一样(macbert>roberta>albert),albert训练的不仅慢而且效果一般,不太适合mrc任务
3、超参数如下:{
"adv_type": "fgm",
"version_2_with_negative": true,
"max_seq_length": 384,
"doc_stride": 128,
"max_query_length": 32,
"per_gpu_train_batch_size": 64,
"learning_rate": 1e-05,
"weight_decay": 0.01,
"max_grad_norm": 1.0,
"num_train_epochs": 1.0,
"warmup_ratio": 0.1,
"threads": 12,
"n_gpu":8,
}
4、没试过
5、抽取一部分数据作为验证集以观察训练情况。基本上验证集的得分一直升高,所以使用预训练最后一个checkpoint
6、个人经验:预训练对学习率和初始化比较敏感(主要是这两点)。我则是加载预训练好的语言模型进行mrc任务再训练,发现设置较小的学习率进行预训练,在下游任务微调效果更好。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants