本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 2.0 Amazon Nova 上監督微調
概觀
Amazon Nova 2.0 SFT 資料使用與 1.0 Amazon Nova 相同的 Converse API 格式,並新增選用的推理內容欄位。如需完整的格式規格,請參閱 ReasoningContentBlock 和 Converse API 結構描述。
支援的功能
您無法在相同資料集內或在不同回合之間混合影像和影片。
目前的限制
工具用量 – 雖然輸入格式支援工具用量,但 2.0 SFT Amazon Nova 目前不支援。新增工具區段可能會導致您的任務失敗。
多模態推理內容 – 雖然 Converse 格式支援以影像為基礎的推理內容,但 Amazon Nova 2.0 SFT 不支援。
驗證集 – 可透過 UI 支援提供驗證集,但在 SFT 訓練期間不支援。
影像 – PNG、JPEG、GIF
影片 – MOV、MKV、MP4
資料格式範例
- Text-only
-
此範例顯示與 Amazon Nova1.0 相容的基本純文字格式。
{
"schemaVersion": "bedrock-conversation-2024",
"system": [
{
"text": "You are a digital assistant with a friendly personality"
}
],
"messages": [
{
"role": "user",
"content": [
{
"text": "What country is right next to Australia?"
}
]
},
{
"role": "assistant",
"content": [
{
"text": "The closest country is New Zealand"
}
]
}
]
}
- Text with reasoning
-
此範例顯示具有 2.0 Amazon Nova 選用推理內容的文字。
{
"schemaVersion": "bedrock-conversation-2024",
"system": [
{
"text": "You are a digital assistant with a friendly personality"
}
],
"messages": [
{
"role": "user",
"content": [
{
"text": "What country is right next to Australia?"
}
]
},
{
"role": "assistant",
"content": [
{
"reasoningContent": {
"reasoningText": {
"text": "I need to use my world knowledge of geography to answer this question"
}
}
},
{
"text": "The closest country to Australia is New Zealand, located to the southeast across the Tasman Sea."
}
]
}
]
}
目前, 僅reasoningText支援 。 reasoningContent尚未提供多模式推理內容。
- Image + text
-
此範例說明如何在文字中包含影像輸入。
{
"schemaVersion": "bedrock-conversation-2024",
"system": [
{
"text": "You are a helpful assistant."
}
],
"messages": [
{
"role": "user",
"content": [
{
"image": {
"format": "jpeg",
"source": {
"s3Location": {
"uri": "s3://your-bucket/your-path/your-image.jpg",
"bucketOwner": "your-aws-account-id"
}
}
}
},
{
"text": "Which country is highlighted in the image?"
}
]
},
{
"role": "assistant",
"content": [
{
"reasoningContent": {
"reasoningText": {
"text": "I will determine the highlighted country by examining its location on the map and using my geographical knowledge"
}
}
},
{
"text": "The highlighted country is New Zealand"
}
]
}
]
}
- Video + text
-
此範例說明如何在文字中包含視訊輸入。
{
"schemaVersion": "bedrock-conversation-2024",
"system": [
{
"text": "You are a helpful assistant."
}
],
"messages": [
{
"role": "user",
"content": [
{
"video": {
"format": "mp4",
"source": {
"s3Location": {
"uri": "s3://your-bucket/your-path/your-video.mp4",
"bucketOwner": "your-aws-account-id"
}
}
}
},
{
"text": "What is shown in this video?"
}
]
},
{
"role": "assistant",
"content": [
{
"reasoningContent": {
"reasoningText": {
"text": "I will analyze the video content to identify key elements"
}
}
},
{
"text": "The video shows a map with New Zealand highlighted"
}
]
}
]
}
原因和非原因模式
了解推理內容:推理內容 (也稱為chain-of-thought) 會在產生最終答案之前擷取模型的中繼思考步驟。assistant 然後,使用 reasoningContent 欄位來包含這些推理追蹤。
如何計算損失:
您可以在多轉對話中reasoningContent跨多個助理轉場納入 。
何時啟用推理模式
當您希望模型在產生最終輸出之前產生思維權杖,或需要在複雜的推理任務上改善效能時,請在訓練組態reasoning_enabled: true中設定 。
無論您的訓練資料是否包含推理內容,都可以啟用推理模式。不過,建議在訓練資料中包含推理追蹤,讓模型可以從這些範例中學習,並改善推理品質。
當您訓練的直接任務無法受益於明確推理步驟,或想要最佳化速度並降低字符用量reasoning_enabled: false時,請設定 。
產生推理資料
如果您的資料集缺少推理追蹤,您可以使用具有推理功能的模型建立它們,例如 。將您的輸入輸出對提供給模型,並擷取其推理程序,以建置推理擴增的資料集。
使用推理權杖進行訓練
啟用推理模式的訓練時,模型會學習將內部推理與最終答案分開。訓練程序會執行下列動作:
有效的推理內容
高品質推理內容應包含下列項目:
中繼想法和分析
邏輯扣除和推論步驟
Step-by-step解決問題的方法
步驟和結論之間的明確連線
這有助於模型開發在回答之前思考的能力。
資料集準備準則
下表提供準備訓練資料集的指導方針。
資料集準備準則
| 準則 |
Description |
| 大小和品質 |
建議大小:2,000-10,000 個範例 最低範例:200 優先考慮品質而非數量。確保範例準確且標註正確。 資料集應緊密反映您的生產使用案例。
|
| 多樣性 |
包含執行下列動作的多樣化範例:
涵蓋預期輸入的完整範圍 代表不同的難度等級 包含邊緣案例和變化 防止過度擬合至窄模式
|
| 輸出格式 |
在助理回應中明確指定所需的輸出格式。範例包括您應用程式特有的 JSON 結構、資料表、CSV 格式或自訂格式。
|
| 多回合對話 |
損失只會在助理轉彎時計算,而非使用者轉彎時計算。 每個助理回應都應正確格式化。 在對話回合之間保持一致性。
|
| 品質檢查清單 |
|