跳至主要内容

Amazon Bedrock

Amazon Bedrock Model Distillation

概览

借助 Amazon Bedrock Model Distillation,您可以使用更小、更快、更具成本效益的模型,这些模型可提供与 Amazon Bedrock 中最先进模型相媲美的特定于使用案例的准确性。与原始模型相比,Amazon Bedrock 中的蒸馏模型速度最多可提高 500%,成本最多可降低 75%,而在 RAG 等使用案例中,准确度损失不到 2%。

使用更小、更经济高效的模型

借助 Model Distillation,客户可选择他们希望在使用案例中达到某种准确性的“教师”模型,然后选择想要微调的“学生”模型。客户还会为其使用案例提供提示。Model Distillation 可自动生成教师的响应,并利用这些响应对学生模型进行微调。这样,学生模型就能像教师模型一样,以更低的成本获得类似的准确性。模型蒸馏功能支持来自不同模型提供商的各种模型,包括 Amazon Nova Premier(教师)和 Nova Pro(学生)、Claude 3.5 Sonnet v2(教师)、Llama 3.3 70B(教师)和 Llama 3.2 1B/3B(学生)。 可以通过按需推理来调用特定的自定义模型,这有助于减少对不间断基础架构的需求。请参阅 此处的模型列表。
Screenshot of a user interface for selecting teacher and student models for distillation, featuring Llama 3.1 models. The teacher model Llama 3.1 405B is selected, and student model options include Llama 3.1 70B and Llama 3.1 8B.

使用专有数据合成大幅提高蒸馏模型的性能

针对特定使用案例微调较小且经济高效的模型以获得与较大模型相似的精度是一个迭代过程。为减轻迭代的负担以获得更好的结果,Model Distillation 可选择应用最适合您使用案例的不同数据综合方法。例如,Bedrock 可以通过生成相似的提示词来扩展训练数据集,或者使用客户提供的提示词-响应对作为黄金示例来生成高质量的合成响应。
Screenshot of the AWS Synthetic Data Generation and Model Distillation user interface. The UI enables users to set the maximum response length, choose a distillation input dataset from an S3 location or invocation logs, and provides options to upload data or browse S3 buckets to generate synthetic responses for fine-tuning machine learning models.

通过轻松导入生产数据来降低成本

使用传统的微调功能时,客户需要创建提示和响应。而使用 Model Distillation,客户只需提供提示,然后 Model Distillation 会使用该提示生成合成响应并微调学生模型。客户可以将我们引导至他们的调用日志,并根据某些元数据字段筛选出日志。Model Distillation 可以通过调用日志读取提示和响应,并跳过 Model Distillation 工作流程中的合成响应生成,这样就不必再次从教师模型生成响应,因而降低成本。开始使用 代码示例
Screenshot of the AWS Synthetic Data Generation interface showing options for model distillation, including setting response length, selecting distillation input dataset, configuring S3 log access, adding metadata, and managing access to input data such as prompts or prompt-response pairs.

提高代理的函数调用预测准确度

代理函数调用是现代人工智能应用程序的一项关键功能,允许模型通过准确确定何时和如何调用特定函数,与外部工具、数据库和 API 进行交互。虽然较大的模型通常擅长识别适当的函数来调用并构造正确的参数,但通常会带来更高的成本和更长的延迟。Amazon Bedrock 模型蒸馏功能可帮助较小的模型准确预测函数调用,从而大大缩短响应时间并降低运营成本。