ladderlore
  • S3 や IAM などのサービス名を入力してください。

概念

Fine-tuning and continued pre-training in Bedrock

Customization jobs in Amazon Bedrock: data in S3, a few hyperparameters, and a custom model you must serve.

このレッスンはまだ翻訳されていないため、英語で表示しています。

  • Fine-tuning

    Data
    Labeled prompt and completion pairs
    Goal
    Task, format, tone
  • Continued pre-training

    Data
    Unlabeled text
    Goal
    Domain knowledge
  • Distillation

    Data
    Prompts and teacher answers
    Goal
    A small, fast model
  • Reinforcement tuning

    Data
    Prompts and a reward function
    Goal
    Better answers by score
Four customization jobs.

1 / 2

  • Fine-tuning

    Data
    Labeled prompt and completion pairs
    Goal
    Task, format, tone
  • Continued pre-training

    Data
    Unlabeled text
    Goal
    Domain knowledge
  • Distillation

    Data
    Prompts and teacher answers
    Goal
    A small, fast model

2 / 2

  • Reinforcement tuning

    Data
    Prompts and a reward function
    Goal
    Better answers by score
Four customization jobs.
S3 as the ML data lake
Customization job
Custom model
Provisioned Throughput
  1. 1Bedrock reads the training data from S3.
  2. 2It trains a private copy of the model.
  3. 3Serve it with Provisioned Throughput. Only a few models can use an on-demand deployment.
From S3 data to a served custom model.

流れ

  1. 1Bedrock reads the training data from S3.
  2. 2It trains a private copy of the model.
  3. 3Serve it with Provisioned Throughput. Only a few models can use an on-demand deployment.

From S3 data to a served custom model.

概要

An Amazon Bedrock customization job trains a copy of a foundation model on your data. Fine-tuning (supervised) uses labeled examples, prompt and completion pairs in a JSONL file in Amazon S3, to teach a task, a format or a tone. Continued pre-training uses large amounts of unlabeled text from your domain to widen the model’s knowledge. It was offered only for a few Amazon Titan text models. The current Bedrock customization pages no longer list it, so check the console before you plan on it. On the exam, unlabeled domain text still points to continued pre-training.

概要

Bedrock also offers distillation, and reinforcement fine-tuning, which scores answers with a reward function you write in AWS Lambda.

You supply training data and, optionally, validation data in S3, an S3 output location and an IAM service role. You set hyperparameters such as epochs, batch size and learning rate; each model lists the ranges it allows. Only some models can be customized, and the list differs by Region. At the time of writing, Amazon Nova models were listed in US East (N. Virginia) and Meta Llama and Claude 3 Haiku in US West (Oregon), so check the current table.

概要

For security you can run the job in your VPC, with subnets and security groups, so training data stays on private networks. You can also encrypt the custom model with your own AWS KMS key. Training is billed on tokens processed (tokens in the training data times epochs), plus a monthly fee for storing each custom model.

概要

A custom model is not called like a base model. To serve it, buy Provisioned Throughput for the model. Only a few base models can use a custom model deployment and pay per token. These are some Amazon Nova models and Llama 3.3 70B, in limited Regions. Other custom models need Provisioned Throughput to run. Provisioned Throughput is billed by the hour whether or not you send requests, so delete it when you stop.

覚えること

  • Fine-tuning: labeled prompt and completion pairs. Continued pre-training: unlabeled text.
  • Data in S3 as JSONL, with an optional validation set.
  • Settings: epochs, batch size and learning rate.
  • VPC configuration and a KMS key protect data and the custom model.
  • Billed on tokens times epochs, plus storage each month.

覚えること

  • Serve with Provisioned Throughput. Only a few models can use an on-demand deployment.

試験では

  • “Teach the model our ticket format using 3,000 labeled examples” points to Bedrock fine-tuning.
  • “A large archive of unlabeled company documents” points to continued pre-training.
  • “Run the fine-tuned model in production” points to Provisioned Throughput for the custom model, or an on-demand deployment.