Prompt engineering concepts
Prompt engineering refers to the practice of optimizing textual input to a Large Language Model (LLM) to obtain desired responses. Prompting helps a LLM perform a wide variety of tasks, including classification, question answering, code generation, creative writing, and more. The quality of prompts that you provide to a LLM can impact the quality of the model's responses. This section provides you the necessary information to get started with prompt engineering. It also covers tools to help you find the best possible prompt format for your use case when using a LLM on Amazon Bedrock.
Note
All examples in this doc are obtained via API calls. The response may vary due to the stochastic nature of the LLM generation process. If not otherwise specified, the prompts are written by employees of AWS.
Amazon Bedrock includes models from a variety of providers. The following is a list prompt engineering guidelines for those models.
-
Anthropic Claude model prompt guide: https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview
-
Cohere prompt guide: https://txt.cohere.com/how-to-train-your-pet-llm-prompt-engineering
-
AI21 Labs Jurassic model prompt guide: https://docs.ai21.com/docs/prompt-engineering
-
Meta Llama 2 prompt guide: https://ai.meta.com/llama/get-started/#prompting
-
Stability AI prompt guide: https://platform.stability.ai/docs/getting-started
-
Mistral AI prompt guide: https://docs.mistral.ai/guides/prompting_capabilities/
Disclaimer: The examples in this document use the current text models available within Amazon Bedrock. Also, this document is for general prompting guidelines. For model-specific guides, refer to their respective docs on Amazon Bedrock. This document provides a starting point. While the following example responses are generated using specific models on Amazon Bedrock, you can use other models in Amazon Bedrock to get results as well. The results may differ between models as each model has its own performance characteristics. The output that you generate using AI services is your content. Due to the nature of machine learning, output may not be unique across customers and the services may generate the same or similar results across customers.