Building Generative AI Apps with Amazon Bedrock

Artificial Intelligence & MLOps

Explore the basics of GenAI, the necessary skills needed to utilize it, resources you need to build your own AI apps, and how to use Amazon Bedrock to reduce the initial investments towards getting started.

There’s a huge demand right now for generative AI apps, and they have the potential to revolutionize many industries - but how do you get started with minimal upfront investment? 

In this blog post, we will discuss the basics of GenAI and what skills you will need to get started. We will also introduce Amazon Bedrock, the new managed service AWS offers in this space.

The Generative AI Breakthrough

Generative AI is a rapidly growing field of artificial intelligence that is capable of generating new content, including text, images, audio, and video. This technology has the potential to revolutionize many industries, from healthcare to manufacturing to entertainment.

This innovative form of AI works by using data models to learn the patterns and relationships in existing data. Once the model has learned these patterns, it can be used to generate new data that is similar to the original data. For example, a model trained on a dataset of text can be used to generate new text, such as poems, code, or scripts.

There are many potential use cases, some of the most promising include:

  • Interactive bots: Interactive bots can be created to engage in conversation with humans. These bots can be used in a variety of applications, such as customer service, education, and entertainment.
  • Data summarization: Large amounts of data can be summarized in a concise and understandable way. This can be helpful for businesses that need to make sense of their data or for students who need to study for exams.
  • Auto-generation of work products: Work products, such as code, designs, and marketing materials can be automatically generated. This can save businesses time and money, and it can also help to improve the quality of the work products.

A recent survey by PWC found that 70% of executives believe that AI has the potential to add as much as $15.7 trillion to the worldwide economy by 2030. Out of this sum, around $6.6 trillion might be attributed to enhanced productivity, while about $9.1 trillion could arise from effects on the consumer side.

McKinsey estimates that this technology could add $4.4 trillion of value to the economy by 2030. This growth is being driven by the increasing availability of data, the advances in machine learning algorithms, and the growing demand for AI-powered applications.

This powerful new technology has the potential to revolutionize many industries, however there are still challenges that need to be addressed such as:

  • Concerns around bias, security, misinformation and the potential for job displacement
  • The need for more data to train these models, and the expense that accompanies that training
  • The need for a framework that manages the ethical and legal concerns around the ownership of the generated content

With that said, the benefits of generative AI are being widely recognized and are likely to have a major impact for organizations willing to innovate.

Building your own AI apps

Building AI apps is a great way to introduce new functionality and product value to your customers through personalization, automation, improved decision making, or new product development. These apps can be standalone with a targeted use case, or embedded into a larger platform to extend their capabilities.

To build your own AI apps, you will need the following:

  • Foundation models: These are models that have been pre-trained on vast amounts of data. They provide the foundation for your AI app, and they can be customized to your specific needs.
  • ML platform: ML platforms provide a variety of tools and resources for building and deploying AI apps. These tools include:
  • Data preparation tools to help you to clean and prepare your data for training your AI model.
  • Model training tools to help you to train your AI model on your data.
  • Model deployment tools to help you to deploy your AI model to a production environment.
  • User interface: You will need the ability to accept prompts from the user while returning the requested output. An interface should be easy to use and understand, while offering the appropriate functionality to address the needs of the user.
  • Monitoring: This is a critical operational aspect of the app development and deployment process as it ensures the accuracy of responses while allowing you to continuously fine-tune the models
  • Prompt Engineering: In order to ensure that your application will provide the most relevant responses to your users, it is important to understand prompt engineering which tells the model what to do with the inputs provided, this can include areas like sentiment, target audience, style, length, etc.

What is Amazon Bedrock? 

Amazon Bedrock is a serverless service that makes it easy to adopt and customize foundation models with your own data. You can use AWS tools and services, such as AWS Lambda, Amazon SageMaker, Amazon Kendra, and Amazon OpenSearch Vector Store, to create applications like chatbots, document processors, and document generators.

AWS is regularly adding new large language models to Bedrock, such as the Claude 2 and Stable Diffusion XL 1.0 models. They are also adding new foundation model providers, such as Titan, AI21 Labs, and Stability AI. In the future, we can expect to see new tools and services built on Bedrock, such as:

  • Agents for Bedrock: These make it easier for developers to build applications by breaking down tasks and creating orchestration plans. They can also connect to other data sources via API and automatically convert them into a usable format.
  • HealthScribe: This HIPAA-eligible service can summarize notes with traceable transcript references.

Benefits of using Amazon Bedrock 

Amazon Bedrock offers many advantages to application developers to ease the burden of infrastructure management, application development, and scaling to meet your needs. Some of these benefits include:

  • Fully serverless deployment model: As a fully serverless service, you don't have to worry about managing the underlying infrastructure. This makes it easy to get started with Amazon Bedrock and to scale your applications as your needs grow.
  • Integrates with other AWS ML/AI tools and with AWS: Native integration with other AWS ML/AI tools, such as Amazon SageMaker, Amazon Kendra, and Amazon OpenSearch Vector Store make it easy to build and deploy AI applications that use Amazon Bedrock. 
  • All data and changes are maintained securely in your own AWS accounts: By keeping all of your data and changes securely within your own AWS accounts, you have full control over your data and can comply with your organization's security policies and industry regulations.
  • Availability of a large number of existing models makes it easier to get started with AI: By offering a large number of pre-trained models, you can get started with AI quickly and easily.

Challenges with Amazon Bedrock and generative AI

When deciding to develop applications backed by generative AI, there will be several challenges that you will need to consider. These challenges can be both technical and non-technical in nature. They will require legal considerations and technical expertise related to Data Science, ML Ops, and data preparation. Additionally, you will need to consider the time investment required to identify the optimal model, train and tune that model, operationalize it, and finally monitor it. This cyclical process can take many iterations to reach a state that meets your application’s needs.

The following are some examples of the challenges that you may encounter and how you might go about resolving them:

Challenge: Legal and ethical concerns exist about the ownership of the content generated by models.

Solution: There is no “one size fits all” solution currently, as this is a complex subject, and it is constantly evolving. That doesn’t mean that you can’t navigate this challenge effectively. Some considerations that need to be considered are transparency, accountability, and consent. Being transparent about how you use generative AI is more than simply saying you are using it. You should also be clear about how you manage the generated content and what sources contribute to the model training. Being accountable for the content generated means constantly monitoring the content for bias, harmful or derogatory output, and accuracy. AI is not perfect and can sometimes make up answers to questions even if it doesn’t know the answer, also known as the hallucination problem. Finally, you need to receive consent from your users to use their information in model training.

Challenge: Getting high-quality data to train your model(s)

Solution: Data for model training is critical as the quality of a model’s output is tied to the quality of the data used to train it, also known as GIGO or “Garbage In, Garbage Out.” You can manage this using already prepared datasets like those on the AWS Data Exchange or datasets procured from other available public or private sources. You must be sure however that you are using the data in a way that aligns with any licensing requirements, or business regulations. Additionally, you can incorporate in-house data, which requires a heavy focus on having a governed data platform that constantly monitors and validates the quality of the data, the transformations that occur, and the lineage while also having processes in place to manage any issues that may arise in the data preparation, transformation, movement, and storage.

Challenge: Generative AI Solutions, even when using managed services like Amazon Bedrock, require specialized skills to develop and maintain. Not all businesses have these skills in-house.

Solution: There are a couple of reasonably straightforward solutions to this problem. You can hire new employees or contractors with the skillset, though be prepared to pay a premium as skills on the leading edge of technology tend to command higher pay. You can train existing team members, though be aware of the time commitment and set expectations that you need to have Data Scientists or Machine Learning Engineers on staff to avoid a steep learning curve. And lastly, you can find a company that offers services that support these solutions’ development, deployment, and integration.

Features of Amazon Bedrock 

As with many of the AWS services, you can expect regular updates to the features and functionality of Amazon Bedrock. As of the writing of this article, it is still in preview, which means access is limited, requiring you to sign up. 

What makes Amazon Bedrock so accessible to app developers is its growing list of foundation models that are accessible via API, allowing coverage of multiple different use cases:

Titan by Amazon: a 175B parameter LLM trained on text and code. This model is designed to be a general-purpose language model. You can use it for various tasks, including text summarization, question answering, code generation, translation, and text generation, including creative text formats and content (emails, letters, poetry).

Jurassic-2 by AI21 Labs: a 178B parameter LLM trained on text and code. It is also designed to be a general-purpose language model that can be used for tasks including text summarization, question answering, code generation, translation, and text generation including creative text formats and content (emails, letters, poetry).

Claude 2 by Anthropic: a 137B parameter LLM trained on text and code specifically designed to be informative and comprehensive. This model is designed to be a factual language model, which excels in answering factual questions, summarizing factual text, and extracting information from text.

Command and Embed by Cohere: two LLM models designed to work together. Command is a 137B parameter LLM trained to follow instructions. In comparison, Embed is a 10B parameter LLM trained to understand the meaning of text. These two models are used together for tasks that incorporate instructions such as chatbots, answering questions, and generating text content.

Stable Diffusion XL 1.0 by Stability.ai: a 1.5B parameter LLM trained on text and code that describes images. This model is designed for image generation and can generate realistic images from text descriptions and apply artistic styles.

With these valuable models, you can cover almost any generative AI feature you want to include in your application(s). There is also more to Bedrock than calling an API; you can expand on the quality of output by incorporating Retrieval Augmented Generation or RAG, which will extend the content used to derive responses to an internal or external knowledge base, allowing your answers to be more customized to your business case or organization. Finally, you can accelerate the delivery of front-ends by incorporating Conversational Agents, which provide a fully managed service that allows developers a no-code approach to orchestrating a series of tasks, such as calling APIs to improve responses, that has the advantage of automating tasks that can be performed as part of a request to Bedrock.

Conclusion 

The generative AI boom is just starting, and it will be vital for your organization to stay ahead of the competition by identifying opportunities to use it to your advantage. We have provided an overview of what it is, what skills you will need to utilize it, and how to use the Amazon Bedrock services to minimize the up-front investment to get started. Only some organizations are prepared to tackle this new technology, and that is where companies like Caylent can help you by working with your team(s) to formulate your generative AI strategy on AWS. With our team of data and AI experts, we can assist with all aspects of your strategy, whether that includes modernizing your data platform, implementing governance initiatives, or delivering prototypes incorporating AWS services like Amazon Bedrock.


References:

Accelerate your GenAI initiatives

Leveraging our accelerators and technical experience

Browse GenAI Offerings
Artificial Intelligence & MLOps
Chad Stieve

Chad Stieve

As a Director for Caylent's Cloud Data Engineering practice, Chad leads some of the best and brightest thought leaders in Data and Analytics. He has orchestrated transformative initiatives and product launches around AWS services to modernize organizations' data infrastructure while helping them realize competitive advantages through the use of their data. Throughout his almost 20-year career in technology, Chad's passion for the inherent value of data has led to success as a Data and Software Engineer and Leader, Program Manager, and Agile Coach, where he has used data-driven approaches to foster collaborative cultures and guide teams to exceptional project outcomes across the Media, Finance, Education, and Services industries.

View Chad's articles

Related Blog Posts

OpenAI vs Bedrock: Optimizing Generative AI on AWS

The AI industry is growing rapidly and a variety of models now exist to tackle different use cases. Amazon Bedrock provides access to diverse AI models, seamless AWS integration, and robust security, making it a top choice for businesses who want to pursue innovation without vendor lock-in.

Artificial Intelligence & MLOps

AI-Augmented OCR with Amazon Textract

Learn how organizations can eliminate manual data extraction with Amazon Textract, a cutting-edge tool that uses machine learning to extract and organize text and data from scanned documents.

Artificial Intelligence & MLOps

Building Recommendation Systems Using Generative AI and Amazon Personalize

In this blog, learn how Generative AI augmented recommendation systems can improve the quality of customer interactions and produce higher quality data to train analytical ML models, taking personalized customer experiences to the next level.

Artificial Intelligence & MLOps