Artificial intelligence (AI) has become a key driver of innovation and growth in the startup ecosystem. Startups are increasingly leveraging AI technologies to build intelligent systems that can generate new content. In this blog series, we will explore how startups can effectively build generative AI applications using Amazon Web Services (AWS) and accelerate their time to market while maintaining cost efficiency and performance.

Introduction

In the first part of this blog series, we provided an overview of generative AI applications and discussed various approaches to building them. We also reviewed the key components involved in building these applications. Now, in the second part, we will map these components to the relevant AWS services that startups can use to quickly develop and launch their generative AI products or solutions.

AWS Services for Building Generative AI Applications

To better illustrate the mapping of AWS services to the components of a generative AI application, let’s refer to Figure 1, which depicts the common components and their corresponding AWS services. It’s important to note that while the services mentioned here are commonly used by startups, there are other AWS services available as well.

Common Components

The common components of a generative AI application include the foundation model (FM), its interface, and optionally the machine learning (ML) platform and accelerated computing. AWS offers managed services that can fulfill these requirements:

  1. Amazon Bedrock: This fully managed service provides access to a variety of foundation models from leading AI startups and Amazon. It offers capabilities such as text embedding, prompt/response, and fine-tuning. Amazon Bedrock is suitable for startups building value-added services around a foundation model of their choice.

  2. Amazon SageMaker JumpStart: This service provides a foundation model hub with both publicly available and proprietary models. Startups can deploy and fine-tune these models and create real-time inference endpoints. SageMaker JumpStart is ideal for startups that want more control over their infrastructure and have moderate ML skills.

  3. Amazon SageMaker: Startups can leverage SageMaker’s training and inference features, which include distributed training, multi-model endpoints, and more. Startups can bring their own foundation models or use models from the model hub. SageMaker is suitable for full-stack generative AI application builders or model providers with advanced ML skills.

  4. AWS Trainium and AWS Inferentia: These purpose-built accelerators can be used in conjunction with SageMaker as the ML platform. They offer improved performance and cost efficiency for inference workloads.

Approaches for Building Generative AI Applications

Let’s now discuss each component in Figure 1 from an implementation perspective, based on the approaches startups can take to build generative AI applications.

Zero-shot or Few-shot Learning Inference Approach

This approach is the simplest way to build a generative AI application. Startups only need the services for the common components mentioned above, along with custom code for generating prompts and a front-end web/mobile app. AWS services like Amazon Bedrock or SageMaker JumpStart can be used to select a foundation model. Developer tools like LangChain and Amazon CodeWhisperer can help with prompt templates and code efficiency. AWS Amplify can be used to easily start and scale front-end web or mobile apps.

Information Retrieval Approach

Startups can customize foundation models by augmenting them with an information retrieval system, known as retrieval-augmented generation (RAG). This approach includes all the components mentioned in the zero-shot or few-shot learning approach, along with a text embeddings endpoint and a vector database. Amazon Bedrock or SageMaker JumpStart can be used to provide text embeddings. Startups can choose between Amazon RDS for PostgreSQL or Amazon OpenSearch Service for the vector database. Developer tools like LangChain can assist in implementing this approach.

Fine-tuning or Further Pre-training Approach

In this approach, startups can fine-tune or further pre-train a foundation model. It involves all the components mentioned in the previous approaches, as well as data pre-processing and model training. Amazon SageMaker Data Wrangler can help with data preparation, while Amazon S3 can be used to store large datasets. Startups can use Amazon Bedrock or SageMaker JumpStart to privately customize foundation models. SageMaker’s distributed training libraries can be leveraged for efficient training. Additional services like Amazon SageMaker Ground Truth Plus can be used for data annotation and model development.

Example Architecture

To illustrate how these components come together in a generative AI use case, let’s consider the retrieval-augmented generation approach. The architecture would include:

  1. Ingestion pipeline: Domain-specific or proprietary data is preprocessed as text data and stored in dense vector representation.

  2. Retrieval pipeline: When a user queries the data, the system retrieves related documents using k-nearest neighbor (kNN) or semantic search. The retrieved documents are then decoded back to clear text.

  3. Summarization generation pipeline: The retrieved documents are combined with the user query to generate insights or summaries.

Developer tools like LangChain can be used to implement these pipelines efficiently.

Conclusion

Building generative AI applications can be a game-changer for startups, and AWS offers a range of services to support this process. By leveraging AWS services like Amazon Bedrock, SageMaker JumpStart, SageMaker, and accelerated computing options, startups can quickly develop and launch their generative AI products or solutions. The choice of services will depend on the specific approach and requirements of the application. AWS Activate, a free program for startups, can provide additional resources to kickstart the journey into generative AI.

Startups looking to capitalize on the growth opportunities offered by artificial intelligence should consider incorporating these strategies into their product development roadmap. By leveraging AWS services and following best practices in the field, startups can accelerate their time to market, optimize costs, and achieve success in the rapidly evolving landscape of generative AI.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *