text-to-text 모델 미세 조정을 위한 데이터 준비 - Amazon Bedrock

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

text-to-text 모델 미세 조정을 위한 데이터 준비

참고

Amazon Nova 모델 미세 조정에 대한 자세한 내용은 Amazon Nova 모델 미세 조정을 참조하세요.

text-to-text 모델을 미세 조정하는 경우 각 JSON 객체는 제공된 텍스트 프롬프트를 기반으로 모델을 원하는 텍스트 출력을 생성하는 방향으로 안내하도록 설계된 구조화된 필드가 포함된 샘플입니다. 데이터 형식은 사용 사례에 따라 다르며 비대화형 사용 사례와 대화형 사용 사례로 광범위하게 분류됩니다. 비대화 작업에는 독립 실행형 프롬프트 및 출력이 수반되는 반면, 대화 작업은 모델이 단일 사용자 입력에 응답하는 단일 턴 교환과 모델이 여러 교환에서 컨텍스트를 유지하는 다중 턴 대화로 더 나눌 수 있습니다.

비대화 작업

비대화 작업에는 지정된 입력에 대해 단일 출력을 생성하는 작업이 포함됩니다. 각 데이터 세트 샘플에는 입력 텍스트가 포함된 prompt 필드와 예상 출력이 있는 completion 필드가 포함됩니다. 이 형식은 질문 응답, 요약, 번역, 텍스트 완성 및 정보 추출과 같은 다양한 작업을 지원합니다.

예제 형식

{"prompt": "What is the capital of France?", "completion": "The capital of France is Paris."} {"prompt": "Summarize the article about climate change.", "completion": "Climate change refers to the long-term alteration of temperature and typical weather patterns in a place."}

토큰당 약 6자를 사용하여 데이터 세트 크기를 계획하기 위한 토큰 수를 추정합니다.

Converse API 형식(단일 회전 및 다중 회전)

Converse API를 사용하려면 Converse 또는 ConverseStream 작업을 직접적으로 호출하여 모델에 메시지를 보냅니다. Converse를 직접적으로 호출하려면 bedrock:InvokeModel 작업에 대한 권한이 필요합니다. ConverseStream을 직접적으로 호출하려면 bedrock:InvokeModelWithResponseStream 작업에 대한 권한이 필요합니다. 자세한 내용은 Converse API 사용 단원을 참조하십시오. Converse API 작업에 대한 자세한 내용은 섹션을 참조하세요. Converse API 작업과 대화 수행

예제 형식

{ "schemaVersion": "bedrock-conversation-2024", "system": [ { "text": "You are a digital assistant with a friendly personality" } ], "messages": [ { "role": "user", "content": [ { "text": "What is the capital of Mars?" } ] }, { "role": "assistant", "content": [ { "text": "Mars does not have a capital. Perhaps it will one day." } ] } ] }

Anthropic Claude 3 Haiku 전용: 단일 턴 대화

싱글턴 대화 작업에는 이전 컨텍스트를 고려하지 않고 모델이 현재 사용자 입력만을 기반으로 응답을 생성하는 격리된 교환이 포함됩니다. 각 데이터 세트 샘플은 user 및의 대체 역할이 있는 메시지 배열을 사용합니다assistant.

형식

{"system": "<system message>","messages":[{"role": "user", "content": "<user query>"},{"role": "assistant", "content": "<expected generated text>"}]}

예제

{"system": "You are an helpful assistant.","messages":[{"role": "user", "content": "what is AWS"},{"role": "assistant", "content": "it's Amazon Web Services."}]}

Anthropic Claude 3 Haiku 전용: 멀티턴 대화

멀티턴 대화 작업에는 이전 교환의 컨텍스트를 유지하면서 모델이 응답을 생성해야 하는 확장된 대화가 포함됩니다. 이 형식은 고객 지원 또는 복잡한 토론과 같은 대화형 작업의 동적 특성을 캡처합니다.

형식

{"system": "<system message>","messages":[{"role": "user", "content": "<user query 1>"},{"role": "assistant", "content": "<expected generated text 1>"}, {"role": "user", "content": "<user query 2>"},{"role": "assistant", "content": "<expected generated text 2>"}]}

예제

{"system": "system message","messages":[{"role": "user", "content": "Hello there."},{"role": "assistant", "content": "Hi, how can I help you?"},{"role": "user", "content": "what are LLMs?"},{"role": "assistant", "content": "LLM means large language model."},]}