AWS bedrock documentation change
Summary
Restructured documentation to remove detailed model capability tables and examples, replacing them with topic links. Added new sections organizing models by modality type and consolidated preparation instructions into referenced pages.
Security assessment
Changes focus on content reorganization and information architecture improvements rather than addressing security vulnerabilities or documenting security features. Removed IAM policy references appear to have been relocated rather than addressing security flaws.
Diff
diff --git a/bedrock/latest/userguide/model-customization-prepare.md b/bedrock/latest/userguide/model-customization-prepare.md index 7d0ba4134..57eb49ad9 100644 --- a//bedrock/latest/userguide/model-customization-prepare.md +++ b//bedrock/latest/userguide/model-customization-prepare.md @@ -5 +5 @@ -Supported modalities for fine-tuning and continued pre-training Prepare datasets for fine-tuningPrepare datasets for continued pre-trainingModel requirements for training and validation datasets +Supported modalities @@ -9 +9 @@ Supported modalities for fine-tuning and continued pre-training Prepare datasets -Before you can begin a model customization job, you need to minimally prepare a training dataset. Whether a validation dataset is supported and the format of your training and validation dataset depend on the following factors. For information about fine-tuning Amazon Nova models, see [Fine-tuning Amazon Nova models](https://docs.aws.amazon.com/nova/latest/userguide/customize-fine-tune.html). +To prepare training and validation datasets for your custom model, you create `.jsonl` files, where each line is a JSON object corresponding to a record. Before you can begin a model customization job, you must at minimum prepare a training dataset. The files you create must conform to the format for the customization method and model that you choose. The records in it must conform to size requirements depending your model. @@ -11,57 +11 @@ Before you can begin a model customization job, you need to minimally prepare a - * The type of fine-tuning customization job (Fine-tuning or Continued Pre-training). - - * The input and output modalities of the data. - - - - -## Supported modalities for fine-tuning and continued pre-training - -The following table shows the input and output modalities that distillation supports with each model: - - * **Fine-Tuning: Text-to-Text** — Model generates textual output from textual input by learning language-based patterns such as grammar, semantics, or contextual meaning. Fine-tuning enables the model to perform specific tasks like summarization, translation, or answering questions. - - * **Fine-Tuning: Text-Image-to-Text** — Model generates textual output from both text and image inputs, supporting tasks like image captioning or visual question answering. Fine-tuning enhances the model's ability to interpret and combine multimodal data for improved task-specific performance. - - * **Fine-Tuning: Text-to-Image** — Model generates image outputs from textual prompts by translating descriptive text into detailed visual representations. Fine-tuning tailors the model to produce domain-specific or stylistically consistent images. - - * **Fine-Tuning: Image-to-Embeddings** — Model generates embeddings (numeric representations) from image inputs for tasks like classification, retrieval, or multimodal alignment. Fine-tuning optimizes the embedding space for accuracy and relevance in specific applications. - - * **Fine-Tuning: Single-Turn Messaging** — Model generates concise and contextually accurate responses for isolated, single-turn input messages. Fine-tuning improves the model's ability to handle one-off conversational exchanges effectively. - - * **Fine-Tuning: Multi-Turn Messaging** — Model generates coherent and contextually aware responses in multi-turn conversations by maintaining context across exchanges. Fine-tuning enhances the model's ability to manage dialogue flow and sustain context over extended conversations. - - - - -Model name | Fine-tuning: Text-to-text (Non-conversational) | Fine-tuning: Image-text-to-text | Fine-tuning: Text-to-image & Image-to-embeddings | Fine-tuning: Single-turn messaging | Fine-tuning: Multi-turn messaging | Continued Pre-training:Text-to-text ----|---|---|---|---|---|--- -Amazon Titan Text G1 - Express | Yes | No | No | No | No | Yes -Amazon Titan Text G1 - Lite | Yes | No | No | No | No | Yes -Amazon Titan Text Premier | Yes | No | No | No | No | No -Amazon Titan Image Generator G1 V1 | Yes | No | Yes | No | No | No -Amazon Titan Multimodal Embeddings G1 G1 | Yes | No | Yes | No | No | No -Anthropic Claude 3 Haiku | No | No | No | Yes | Yes | No -Cohere Command | Yes | No | No | No | No | No -Cohere Command Light | Yes | No | No | No | No | No -Meta Llama 3.1 8B Instruct | Yes | No | No | No | No | No -Meta Llama 3.1 70B Instruct | Yes | No | No | No | No | No -Meta Llama 3.2 1B Instruct | No | No | No | Yes (Converse API format) | Yes (Converse API format) | No -Meta Llama 3.2 3B Instruct | No | No | No | Yes (Converse API format) | Yes (Converse API format) | No -Meta Llama 3.2 11B Instruct Vision | No | Yes | No | Yes (Converse API format) | Yes (Converse API format) | No -Meta Llama 3.2 90B Instruct Vision | No | Yes | No | Yes (Converse API format) | Yes (Converse API format) | No - -To see the default quotas that apply for training and validation datasets used for customizing different models, see the **Sum of training and validation records** quotas in [Amazon Bedrock endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/bedrock.html) in the AWS General Reference. - -## Prepare datasets for fine-tuning - -To prepare training and validation datasets for your custom model, you create `.jsonl` files, each line of which is a JSON object corresponding to a record. The files you create must conform to the format for the customization method and model that you choose and the records in it must conform to size requirements. - -The format depends on the input and output modality of the model. Choose the tab for your preferred method, and then follow the steps: - -Text-to-text - - -For fine-tuning text-to-text models, each JSON object is a sample containing structured fields designed to guide the model toward generating the desired textual output based on a provided textual prompt. The data format varies depending on the use case, broadly categorized into non-conversational and conversational use cases. Non-conversational tasks involve standalone prompts and outputs, while conversational tasks can be further divided into single-turn exchanges, where the model responds to a single user input, and multi-turn dialogues, where the model maintains context across multiple exchanges. - -**Non-conversational tasks** +For information about model requirments, see [Model requirements for training and validation datasets](./model-training-validation-requirements.html). To see the default quotas that apply for training and validation datasets used for customizing different models, see the **Sum of training and validation records** quotas in [Amazon Bedrock endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/bedrock.html) in the AWS General Reference. @@ -69,73 +13 @@ For fine-tuning text-to-text models, each JSON object is a sample containing str -Non-conversational tasks involve generating a single output for a given input. Each dataset sample includes a `prompt` field containing the input text and a `completion` field with the expected output. This format supports a range of tasks such as question-answering, summarizing, translation, text completion, and information extraction. - -Example format - - - {"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."} - -Use approximately 6 characters per token to estimate the number of tokens for planning dataset size. - -**Converse API format (Single turn and Multi turn)** - -To use the Converse API, you call the `Converse` or `ConverseStream` operations to send messages to a model. To call `Converse`, you require permission for the `bedrock:InvokeModel` operation. To call `ConverseStream`, you require permission for the `bedrock:InvokeModelWithResponseStream` operation. For more information, see [Using the Converse API](./conversation-inference-call.html). - -Example format - - - { - "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." - } - ] - } - ] - } - -**For Anthropic Claude 3 Haiku only: Single-turn conversations** - -Single-turn conversational tasks involve isolated exchanges, where the model generates a response based solely on the current user input without considering prior context. Each dataset sample uses a messages array, with alternating roles of `user` and `assistant`. - -Format - - - {"system": "<system message>","messages":[{"role": "user", "content": "<user query>"},{"role": "assistant", "content": "<expected generated text>"}]} - -Example - - - {"system": "You are an helpful assistant.","messages":[{"role": "user", "content": "what is AWS"},{"role": "assistant", "content": "it's Amazon Web Services."}]} - -**For Anthropic Claude 3 Haiku only: Multi-turn conversations** - -Multi-turn conversational tasks involve extended dialogues where the model must generate responses while preserving the context of previous exchanges. This format captures the dynamic nature of interactive tasks, such as customer support or complex discussions. - -Format - - - {"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>"}]} - -Example - - - {"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."},]} - -Image-text-to-text +Whether a validation dataset is supported and the format of your training and validation dataset depend on the following factors. @@ -142,0 +15 @@ Image-text-to-text + * The type of fine-tuning customization job (Fine-tuning or Continued Pre-training). @@ -144 +17 @@ Image-text-to-text -For fine-tuning image-text-to-text models, each JSON object is a sample containing a conversation structured as a `messages` array, consisting of alternating JSON objects representing the user's inputs and the assistant's responses. User inputs can include both text and images, while assistant responses are always textual. This structure supports both single-turn and multi-turn conversational flows, enabling the model to handle diverse tasks effectively. Supported image formats for Meta Llama-3.2 11B Vision Instruct and Meta Llama-3.2 90B Vision Instruct include: `gif`, `jpeg`, `png`, and `webp`. + * The input and output modalities of the data. @@ -146 +18,0 @@ For fine-tuning image-text-to-text models, each JSON object is a sample containi -To allow Amazon Bedrock access to the image files, add an IAM policy similar to the one in [Permissions to access training and validation files and to write output files in S3](./model-customization-iam-role.html#model-customization-iam-role-s3) to the Amazon Bedrock model customization service role that you set up or that was automatically set up for you in the console. The Amazon S3 paths you provide in the training dataset must be in folders that you specify in the policy. @@ -148 +19,0 @@ To allow Amazon Bedrock access to the image files, add an IAM policy similar to -**Single-turn conversations** @@ -150 +20,0 @@ To allow Amazon Bedrock access to the image files, add an IAM policy similar to -Each JSON object for single-turn conversations consists of a user message and an assistant message. The user message includes a role field set to _user_ and a _content_ field containing an array with a `type` field (_text_ or _image_) that describes the input modality. For text inputs, the `content` field includes a `text` field with the user’s question or prompt. For image inputs, the `content` field specifies the image `format` (for example, _jpeg_ , _png_) and its `source` with a `uri` pointing to the Amazon S3 location of the image. The `uri` represents the unique path to the image stored in an Amazon S3 bucket, typically in the format `s3://<bucket-name>/<path-to-file>`. The assistant message includes a `role` field set to _assistant_ and a `content` field containing an array with a `type` field set to _text_ and a `text` field containing the assistant’s generated response. @@ -152 +22 @@ Each JSON object for single-turn conversations consists of a user message and an -Example format +For information about fine-tuning Amazon Nova models, see [Fine-tuning Amazon Nova models](https://docs.aws.amazon.com/nova/latest/userguide/customize-fine-tune.html). @@ -153,0 +24 @@ Example format +###### Topics @@ -155,31 +26 @@ Example format - { - "schemaVersion": "bedrock-conversation-2024", - "system": [{ - "text": "You are a smart assistant that answers questions respectfully" - }], - "messages": [{ - "role": "user", - "content": [{ - "text": "What does the text in this image say?" - }, - { - "image": { - "format": "png", - "source": { - "s3Location": { - "uri": "s3://your-bucket/your-path/your-image.png", - "bucketOwner": "your-aws-account-id" - } - } - } - } - ] - }, - { - "role": "assistant", - "content": [{ - "text": "The text in the attached image says 'LOL'." - }] - } - ] - } + * Supported modalities for fine-tuning and continued pre-training @@ -187 +28 @@ Example format -**Multi-turn conversations** + * [Model requirements for training and validation datasets](./model-training-validation-requirements.html) @@ -189 +30 @@ Example format -Each JSON object for multi-turn conversations contains a sequence of messages with alternating roles, where user messages and assistant messages are structured consistently to enable coherent exchanges. User messages include a `role` field set to _user_ and a `content` field that describes the input modality. For text inputs, the `content` field includes a `text` field with the user’s question or follow-up, while for image inputs, it specifies the image `format` and its `source` with a `uri` pointing to the Amazon S3 location of the image. The `uri` serves as a unique identifier in the format s3://<bucket-name>/<path-to-file> and allows the model to access the image from the designated Amazon S3 bucket. Assistant messages include a `role` field set to _assistant_ and a `content` field containing an array with a `type` field set to _text_ and a `text` field containing the assistant’s generated response. Conversations can span multiple exchanges, allowing the assistant to maintain context and deliver coherent responses throughout. + * [Prepare data for fine-tuning text-to-text models](./preparing-text-data.html) @@ -191 +32 @@ Each JSON object for multi-turn conversations contains a sequence of messages wi