All publications

Applied AI & Data Scienceby Dr. Dennis Weiser20244 min read

Deploying generative AI with Amazon Bedrock

Amazon Bedrock provides foundation models from various vendors as a serverless service in the AWS cloud. An overview of access, data security, customisation options, agent systems, usage modes and available models.

Introduction

Since the release of ChatGPT in November 2022, more and more people have been using generative AI in their professional or private lives. Very early on, OpenAI also released an interface to make its models available to developers. At the time, many companies carried out their first pilot developments based on the OpenAI interface.

The trend in generative AI has since developed to the point where countless vendors offer large, general-purpose base models (so-called foundation models), either commercially or on an open-source basis. Major cloud providers such as AWS, Azure and Google Cloud now offer services for deploying these foundation models in a dedicated, secure cloud environment. Combined with open-source foundation models, the security, flexibility and scalability of the cloud open up unprecedented possibilities for building solutions based on generative AI.

In this blog post, we want to look specifically at the current options for deploying generative AI using the AWS service Amazon Bedrock.

Amazon Bedrock

Amazon Bedrock is a fully managed service that makes various current foundation models available through a single interface. Because it is a serverless service, you do not have to manage the underlying computing infrastructure yourself.

Amazon Bedrock can be accessed either over the internet or through a private connection directly from your own virtual private cloud (VPC). The latter is possible once an interface endpoint has been created via AWS PrivateLink.

AWS Cloud

Customer account

Customer VPC

Client
AWS PrivateLink

Amazon Bedrock service account

API endpoint
Amazon Bedrock

Corporate network

Client
AWS Direct Connect
AWS PrivateLinkinto the customer VPC
Figure 1: Example architecture for accessing Amazon Bedrock

User-specific data (model inputs and outputs) is isolated per user, encrypted and not shared. In particular, this data is not used to improve the models. It is also possible to fine-tune models with your own data. In this case, the fine-tuned model is provided as a separate private instance (single tenant) to which only its creator has access.

Besides using the foundation models as they are, Amazon Bedrock currently offers two options for adapting the large, general-purpose models to your own data:

Retrieval augmented generation (RAG)

Retrieval augmented generation uses a generic foundation model. It is adapted to the customer's data through context, without the model itself having to be changed. In a first step, the specific knowledge base that is to be attached to the model is searched with respect to the input. In a second step, matching information is then passed to the model as context, so that it can produce a targeted output.

Model customisation

There are two ways of customising foundation models: fine-tuning and continued pre-training. Fine-tuning can increase model precision by using a task-specific labelled training dataset to further adapt the foundation model. Continued pre-training can be used to give the foundation model more domain-specific knowledge by using an unlabelled training dataset to build up its knowledge.

Amazon Bedrock also makes it possible to build so-called agent systems with foundation models. These are autonomous systems that orchestrate the interaction between foundation models, data sources, software applications and user input. You can think of them as programmed robots that can work through specific tasks independently and automatically. Agents therefore go beyond the "next word prediction" principle of LLMs and now enable tools/applications to be used autonomously. Agent systems are often credited with great potential in the field of automation.

There are three modes to choose from when using the models: on-demand, batch or provisioned throughput. In on-demand and batch mode, usage is billed per input/output token; with provisioned throughput, the units of provisioned time are billed, regardless of usage.

Generative AI models in Amazon Bedrock

Amazon Bedrock supports various foundation models from different vendors. At present, the selection still varies considerably depending on the AWS region chosen. For example, the current top model, Anthropic Claude 3.5 Sonnet, is so far only available in the North Virginia region (us-east-1). Below we give an overview of the 8 best foundation models currently available:

Foundation modelUseInput tokensHELM MMLU score
Anthropic Claude 3.5 SonnetText & image20000086.5%
Anthropic Claude 3 OpusText & image20000084.6%
Meta Llama 3 70BText800079.3%
Anthropic Claude 3 SonnetText & image20000075.9%
Anthropic Claude 3 HaikuText & image20000073.8%
Mistral AI Mixtral 8x7BText3200071.7%
Mistral AI Mistral LargeText3200068.8%
Meta Llama 3 8BText800066.8%

The foundation models are sorted by their result in the Massive Multi-task Language Understanding (MMLU) benchmark from Stanford CRFM. This is a widely used benchmark that aims to test the performance of LLMs across 57 subject areas with around 16,000 multiple-choice questions. The performance range of the foundation models listed here is comparable to OpenAI's well-known foundation models GPT-3.5 Turbo (68.9%) and GPT-4o (84.2%).

Conclusion

Amazon Bedrock offers a user-friendly solution for deploying generative AI. Thanks to the serverless architecture, you do not have to manage the underlying computing infrastructure yourself. Comprehensive security mechanisms are in place to ensure the confidentiality and protection of your own data. State-of-the-art foundation models for text and images are available, with performance comparable to OpenAI's GPT-3.5 or even GPT-4o.

In summary, Amazon Bedrock is an excellent way to put generative AI to work and thereby build innovative solutions in the AWS cloud.

Applied AI & Data Science

Working on a similar topic?

Tell us what you are working on. We'll put you in touch with Dr. Dennis Weiser and the team working on this topic.

Send an enquiry

At least 20 characters.

Fields marked with * are required.