View a markdown version of this page

BYOD(Bring-Your-Own-Dataset) 작업에 지원되는 데이터 세트 형식 - Amazon SageMaker AI

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

BYOD(Bring-Your-Own-Dataset) 작업에 지원되는 데이터 세트 형식

Custom Scorer 및 LLM-as-judge 평가 유형에는 AWS S3에 위치한 사용자 지정 데이터 세트 JSONL 파일이 필요합니다. 다음 지원되는 형식 중 하나를 준수하는 JSON Lines 파일로 파일을 제공해야 합니다. 이 문서의 예제는 명확성을 위해 확장되었습니다.

각 형식에는 고유한 뉘앙스가 있지만 최소한 모두 사용자 프롬프트가 필요합니다.

필수 필드
Field 필수
사용자 프롬프트
시스템 프롬프트 아니요
실측 정보 사용자 지정 Scorer에만 해당
카테고리 아니요

1: OpenAI 형식

{ "messages": [ { "role": "system", # System prompt (looks for system role) "content": "You are a helpful assistant." }, { "role": "user", # Query (looks for user role) "content": "Hello!" }, { "role": "assistant", # Ground truth (looks for assistant role) "content": "Hello to you!" } ] }

2. SageMaker 평가

{ "system":"You are an English major with top marks in class who likes to give minimal word responses: ", "query":"What is the symbol that ends the sentence as a question", "response":"?", # Ground truth "category": "Grammar" }

3. HuggingFace 프롬프트 완료

표준 형식과 대화 형식이 모두 지원됩니다.

# Standard { "prompt" : "What is the symbol that ends the sentence as a question", # Query "completion" : "?" # Ground truth } # Conversational { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What is the symbol that ends the sentence as a question" } ], "completion": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "?" } ] }

4. HuggingFace 기본 설정

표준 형식(문자열)과 대화 형식(메시지 배열)을 모두 지원합니다.

# Standard: {"prompt": "text", "chosen": "text", "rejected": "text"} { "prompt" : "The sky is", # Query "chosen" : "blue", # Ground truth "rejected" : "green" } # Conversational: { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What color is the sky?" } ], "chosen": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "It is blue." } ], "rejected": [ { "role": "assistant", "content": "It is green." } ] }

5. Verl 형식

Verl 형식(현재 및 레거시 형식 모두)은 강화 학습 사용 사례에 지원됩니다. 참조용 Verl 문서: https://verl.readthedocs.io/en/latest/preparation/prepare_data.html

VERL 형식의 사용자는 일반적으로 실제 응답을 제공하지 않습니다. 어쨌든 제공하려면 extra_info.answer 또는 필드 중 하나를 사용합니다. reward_model.ground_truthextra_info가 우선합니다.

SageMaker는 다음 VERL 관련 필드가 있는 경우 메타데이터로 보존합니다.

  • id

  • data_source

  • ability

  • reward_model

  • extra_info

  • attributes

  • difficulty

# Newest VERL format where `prompt` is an array of messages. { "data_source": "openai/gsm8k", "prompt": [ { "content": "You are a helpful math tutor who explains solutions to questions step-by-step.", "role": "system" }, { "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "role": "user" } ], "ability": "math", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" }, "reward_model": { "ground_truth": "72" # Ignored in favor of extra_info.answer } } # Legacy VERL format where `prompt` is a string. Also supported. { "data_source": "openai/gsm8k", "prompt": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" } }