

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 증류를 위한 훈련 데이터세트 준비
<a name="distillation-prepare-datasets"></a>

모델 사용자 지정 작업을 시작하기 전에 훈련 데이터세트는 반드시 준비해야 합니다. 사용자 지정 모델에 대한 입력 데이터세트를 준비하려면 각 라인이 레코드에 해당하는 JSON 객체인 `.jsonl` 파일을 만듭니다. 생성하는 파일은 선택한 모델 증류 및 모델 형식에 부합해야 합니다. 레코드는 크기 요구 사항도 준수해야 합니다.

입력 데이터를 프롬프트로 제공합니다. Amazon Bedrock은 입력 데이터를 사용하여 교사 모델에서 응답을 생성한 다음 이 응답을 사용하여 학생 모델을 미세 조정합니다. Amazon Bedrock에서 사용하는 입력에 대한 자세한 내용과 사용 사례에 가장 적합한 옵션을 선택하려면 [Amazon Bedrock Model Distillation의 작동 방식](model-distillation.md#how-md-works) 섹션을 참조하세요. 입력 데이터세트를 준비하는 몇 가지 옵션이 있습니다.

**참고**  
Amazon Nova 모델마다 증류 요구 사항이 다릅니다. 자세한 내용은 [Amazon Nova 모델 증류](https://docs.aws.amazon.com/nova/latest/userguide/customize-distill.html)를 참조하세요.

## 증류에 지원되는 양식
<a name="distillation-supported-modalities"></a>

[Amazon Bedrock Model Distillation에 지원되는 리전 및 모델](prequisites-model-distillation.md#model-distillation-supported)에 나열된 모델은 text-to-text 양식만 지원합니다.

## 합성 데이터 생성을 위한 입력 프롬프트 최적화
<a name="distillation-data-prep-prompt-optimization"></a>

모델 증류 중에 Amazon Bedrock은 특정 사용 사례에 맞게 학생 모델을 미세 조정하는 데 사용하는 합성 데이터세트를 생성합니다. 자세한 내용은 [Amazon Bedrock Model Distillation의 작동 방식](model-distillation.md#how-md-works) 단원을 참조하십시오.

원하는 사용 사례에 대한 입력 프롬프트의 형식을 지정하여 합성 데이터 생성 프로세스를 최적화할 수 있습니다. 예를 들어, 증류된 모델의 사용 사례가 검색 증강 생성(RAG)인 경우 모델이 에이전트 사용 사례에 집중하도록 하려는 경우와 다르게 프롬프트의 형식을 지정합니다.

다음은 RAG 또는 에이전트 사용 사례에 대한 입력 프롬프트의 형식을 지정하는 방법에 대한 예입니다.

------
#### [ RAG prompt example ]

```
{
  "schemaVersion": "bedrock-conversation-2024",
  "system": [
    {
      "text": "You are a financial analyst charged with answering questions about 10K and 10Q SEC filings. Given the context below, answer the following question."
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "<context>\nDocument 1: Multiple legal actions have been filed against us as a result of the October 29, 2018 accident of Lion Air Flight 610 and the March 10, 2019 accident of Ethiopian Airlines Flight 302.\n</context>\n\n<question>Has Boeing reported any materially important ongoing legal battles from FY2022?</question>"
        }
      ]
    }
  ]
}
```

------
#### [ Agent prompt example ]

```
{
    "schemaVersion": "bedrock-conversation-2024",
    "system": [
        {
            "text": 'You are an expert in composing functions. You are given a question and a set of possible functions. Based on the question, you will need to make one or more function/tool calls to achieve the purpose.
                    Here is a list of functions in JSON format that you can invoke.
                    [
                        {
                            "name": "lookup_weather",
                            "description: "Lookup weather to a specific location",
                            "parameters": {
                                "type": "dict",
                                "required": [
                                    "city"
                                ],
                                "properties": {
                                    "location": {
                                        "type": "string",
                                    },
                                    "date": {
                                        "type": "string",
                                    }
                                }
                            }
                        }
                    ]'
        }
    ],
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "text": "What's the weather tomorrow?"
                }
            ]
        },
        {
            "role": "assistant",
            "content": [
               {
                   "text": "[lookup_weather(location=\"san francisco\", date=\"tomorrow\")]"
               }
            ]
        }
    ]
}
```

------