准备数据以蒸馏理解模型
首先,按照文本理解提示最佳实践中所述,使用 Amazon Nova Premier 和 Amazon Nova Pro 调整输入提示,确保对提示进行优化,充分利用教师式模型。
在使用自己的提示为蒸馏作业准备输入数据集时,请遵循以下建议:
-
如果只有未标注的提示数据可用,请补充少量(约 10 个)精选的高质量带标注提示–回复对数据,帮助模型更好地学习。如果提交少量高质量且具代表性的示例,则可以创建超出教师式模型性能的自定义模型。
-
如果带标注的提示–回复对数据可用,但仍有改进余地,请在提交的数据中包含回复。
-
如果有带标注的提示–回复对数据可用,但标签质量较差且训练更适合直接与教师式模型保持一致,请在提交数据之前删除所有回复。
示例数据集格式
以下提示提供了如何为模型蒸馏提供带标签和不带标签的提示的示例。
使用无标签提示进行蒸馏
{ "schemaVersion": "bedrock-conversation-2024", "system": [ { "text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions." } ], "messages": [ { "role": "user", "content": [ { "text": "Why is the sky blue?" } ] } ] }
使用带标签提示进行蒸馏
{ "schemaVersion": "bedrock-conversation-2024", "system": [ { "text": "A chat between a curious User and an artificial intelligence Bot. The Bot gives helpful, detailed, and polite answers to the User's questions." } ], "messages": [ { "role": "user", "content": [ { "text": "Why is the sky blue?" } ] }, { "role": "assistant", "content": [ { "text": "The sky is blue because molecules in the air scatter blue light from the Sun more than other colors." } ] } ] }
数据集限制
执行模型蒸馏时,您必须提供的提示或提示-响应对的数量有最小值和最大值。
Item |
最小值 |
最大值 |
---|---|---|
提示 |
100 |
15K |
提示-响应对 |
100 |
15K |