Prompt Engineering with Amazon Bedrock — AWS
Amazon Bedrock
The easiest way to build and scale generative AI applications with foundation models (FMs). A fully managed service that makes the foundation models from leading AI startups via an API. Bedrock is serverless where one can start quickly and customize FMs with your own data, integrate and deploy them into the applications using the AWS tools. The primary aadvantage with Bedrock is we can develop generative AI applications using FMs through API without the need to manage infrastructure. None of our data will be sent to train the foundation models and everything we do shall stick around our AWS account.
There are many use cases with Amazon Bedrock like Text Generation, Chatbots, Text Summarization, Image Generation etc.
The choice of foundation models are vast and some of them are Amazon Titan, Meta, Claude, Jurassic-2 etc.
Generative AI
A subset of deep-learning. Generative AI is used to generate new data on what it was trained earlier with. Unlike the traditional AI models, the Gen AI generate original outputs that mimic the real world. Some of the examples are text, images, audio and video. To generate the data we must rely on a Foundation Model
Foundation Model
These models are trained on a wide variety of data inputs. Foundational models are the base for applications and tasks. One such example is GPT-4 if the foundational model behind ChatGPT.
LLM (Large Language Models)
Type of AI designed to generate human like text. It generates human like text based on the input received. LLMs are trained on vast amount of text data to perform various language-related tasks such as generation, translation, summarization and question-answering.
Prompt Engineering
Prompt engineering is about creating and improving the questions or instructions you give to AI models, especially ones that generate content like text. The aim is to design prompts that help the AI produce clear, relevant, and accurate responses.
There are few ways that we need to follow while giving the proper prompt to the AI model. We need to use the modules like Instructions, Context, Input data, Output indicator and Negative Prompting.
Negative Prompting: Defining what the AI should not generate. To avoid unwanted content. Reducing the chances of inappropriate content. The model will stay on the topic.
Example:
Instructions: Please give me a 15 day travel itineary trip to Inida. The inteneary should include visits to the top cities, beaches, and popular restaurants. Ensure that you also find me a best hotel to stay in those cities. Each day should also have the breakfast, lunch, snak and dinner suggestions at the top rated places. The budget should not exclude 150k INR
Context: The traveller is from India and wants to experience something that is not well-known to everyone. The transport recommendation can be Flight, car, bus, train. The traveller is comfortable with the language and food so there are no restrictions on those.
Input Data: 15 day trip to India
Output Indicator: Travel Iteneary with specific time, date of journey, locations, descriptions and dining recommendations.
Negative Prompting: While chosing the places to visit, avoid selecting the places where the temperature is over 100F and exclude the cities with no beaches. Do not recommend 2 activities per day
AWS Tip
Before selecting and playing with any AI model in Amazon Bedrock, it is important to get the IAM permissions enabled. So request them first.
For Better learning — take up Stéphane Maarek course in Udemy — Ultimate AWS Certified AI Practitioner AIF-C01