🌍 All Study Guides📊 Dashboard📰 Blog💡 About
AWS Certified AI Practitioner • STUDY MODE

Practice Quiz

QUESTION 1 OF 13

A developer is building an interactive virtual assistant using direct API calls to Amazon Bedrock models. During testing, they find that the model is unable to recall the user's name or preferences from the immediately preceding prompt in the conversation. What is the cause of this behavior, and how can they resolve it?

A
Amazon Bedrock models accessed via API do not recall prior requests by default, so the developer must explicitly include the previous interaction within the current prompt.Correct Answer
B
The developer failed to enable the automatic session-tracking parameter in the API header, which would natively store and sync context across requests.
C
API-based Amazon Bedrock models only store history when utilizing Titan Text models, and the developer must switch away from other model families to resolve this.
D
Amazon Bedrock API calls require the developer to establish a persistent WebSocket connection to retain conversation state automatically.
Explanation:

If you access Amazon Bedrock models by using API calls, the models don't recall prior prompts and previous requests, unless the previous interaction is included within the current prompt.

QUESTION 2 OF 13

When utilizing Anthropic Claude models on Amazon Bedrock, what formatting practice is recommended when designing few-shot prompts to include demonstration examples without causing confusion with the delimiters for the overall prompt?

A
Wrap the demonstration examples in <example></example> tags and use different delimiters such as H: and A: inside the examples.Correct Answer
B
Wrap the demonstration examples in [demo][/demo] brackets and use the standard Human: and Assistant: delimiters inside the examples.
C
Wrap the demonstration examples in parentheses and omit any internal delimiters to keep the examples simple.
D
Convert the entire prompt into a markdown table with columns for inputs and outputs rather than using tags or delimiters.
Explanation:

When using Anthropic Claude models, it's a good practice to use <example></example> tags to include demonstration examples, and to use different delimiters such as H: and A: in the examples to avoid confusion with the delimiters Human: and Assistant: for the whole prompt.

QUESTION 3 OF 13

According to the Amazon Bedrock prompt engineering documentation, which set of options can be used by an engineer to reduce hallucinations in model outputs?

A
Use prompt optimization techniques, use Retrieval Augmented Generation (RAG) to provide relevant data, or use a different model.Correct Answer
B
Increase the temperature parameter, use a smaller context window, or disable the system prompts.
C
Enable daily automated fine-tuning, implement deep reinforcement learning, or apply custom weight constraints.
D
Configure real-time database indexing, shorten the prompt's instruction block, or use localized text embeddings only.
Explanation:

To reduce hallucinations, you can refine your prompt using prompt optimization techniques; use techniques like Retrieval Augmented Generation (RAG) to provide the model access to more relevant data; or use a different model that might produce improved results.

QUESTION 4 OF 13

When designing prompts for Amazon Bedrock, how does few-shot prompting (in-context learning) differ from zero-shot prompting?

A
Few-shot prompting provides paired example inputs and desired outputs (shots) to calibrate model outputs, whereas zero-shot prompting provides no examples in the prompt.Correct Answer
B
Few-shot prompting executes multiple parallel API calls to verify answers, whereas zero-shot prompting uses a single API request.
C
Few-shot prompting updates the underlying weights of the model permanently, whereas zero-shot prompting relies only on the base model.
D
Few-shot prompting is supported only on AI21 Labs Jurassic models, whereas zero-shot prompting is supported across all Amazon Bedrock models.
Explanation:

Few-shot prompting (in-context learning) involves providing paired example inputs and desired outputs (shots) to help LLMs better calibrate their output, whereas zero-shot prompting provides no example input-output pair in the prompt text.

QUESTION 5 OF 13

A software engineer is migrating an integration from using Titan Text models to Anthropic Claude models via Amazon Bedrock API calls. What formatting adjustment must the engineer apply to the prompts for the Anthropic Claude models that was not required for Titan Text?

A
The engineer must wrap the prompts in a conversational style for Anthropic Claude models, whereas this is not necessary for Titan Text models.Correct Answer
B
The engineer must format the entire prompt using key-value JSON parameters, whereas Titan Text models only accept plain text formats.
C
The engineer must explicitly prefix the prompt with a secure system signature token, whereas Titan Text models do not have this requirement.
D
The engineer must encode the prompt string using base64 encryption, whereas Titan Text models accept standard UTF-8 strings.
Explanation:

If you are accessing Anthropic Claude models using API calls instead of the Amazon Bedrock text playground, you wrap your prompts in a conversational style to get the desired response, whereas this conversational style formatting is not necessary for the Titan Text and AI21 Labs Jurassic model families.

QUESTION 6 OF 13

To use conversational mode on an Amazon Bedrock Titan model, what specific prompt format can be used?

A
Use the 'User: {{}} \n Bot:' format when prompting the model.Correct Answer
B
Use the '<conversation> {{}} </conversation>' tags when prompting the model.
C
Use the 'Client: {{}} \n Agent:' format when prompting the model.
D
Use the 'Question: {{}} \n Answer:' format when prompting the model.
Explanation:

To use conversational mode on Titan, you can use the format of User: {{}} \n Bot: when prompting the model.

QUESTION 7 OF 13

A developer is building a chat assistant using Amazon Bedrock via API calls. During testing, they notice that the model fails to recall information provided in previous questions during the same conversation. Based on Amazon Bedrock design, how can the developer resolve this issue?

A
Explicitly include the previous interaction and context within the current prompt text of the API call.Correct Answer
B
Enable the automatic session state parameter in the Amazon Bedrock API request header.
C
Fine-tune the foundation model using historical conversation logs so that it automatically retains user session context.
D
Store the conversation history in Amazon S3 and configure Bedrock to automatically scan the bucket before each generation.
Explanation:

Amazon Bedrock models do not recall prior prompts or previous requests across API calls unless the previous context is explicitly included within the current prompt text.

QUESTION 8 OF 13

When designing prompt templates for use with Amazon Bedrock, how should double curly braces {{ and }} be utilized and handled?

A
They are used to mark placeholders for data-specific information and must be excluded from the final prompt text sent to the model.Correct Answer
B
They are used to define system instructions that the LLM must execute with the highest priority.
C
They are used to enclose few-shot demonstration examples to prevent confusion with the main prompt delimiters.
D
They are used to trigger retrieval-augmented generation (RAG) lookups directly from a vector database.
Explanation:

Double curly braces {{ and }} are used in prompt templates to indicate placeholders for data-specific information and should be excluded from the final prompt text.

QUESTION 9 OF 13

Which of the following represents a valid set of strategies supported by Amazon Bedrock prompt engineering guidelines to reduce hallucinations in Large Language Models (LLMs)?

A
Refining prompts using prompt optimization techniques, utilizing Retrieval Augmented Generation (RAG) to provide relevant data, or selecting a different model.Correct Answer
B
Increasing the learning rate of the foundation model, decreasing the training epochs, or performing a hard reset on the model weights.
C
Converting all inputs to binary format, utilizing zero-shot prompting exclusively, or increasing the temperature parameter to its maximum value.
D
Disabling API conversation delimiters, embedding double curly braces in the final prompt text, or training a classifier from scratch.
Explanation:

To reduce hallucinations in LLMs, users can refine prompts using prompt optimization techniques, utilize Retrieval Augmented Generation (RAG) to provide access to relevant data, or select a different model.

QUESTION 10 OF 13

An AI practitioner is constructing a prompt template for Anthropic Claude models on Amazon Bedrock. The prompt will contain few-shot demonstration examples. To ensure the model processes the prompt correctly without confusing the demonstration examples with the main prompt delimiters, what formatting practices should they follow?

A
Wrap demonstration examples inside <example></example> tags and use internal delimiters like H: and A: instead of Human: and Assistant:.Correct Answer
B
Enclose the demonstration examples in double curly braces {{ and }} and prepend them with raw API query parameters.
C
Use zero-shot prompting exclusively to prevent any examples from being evaluated by the Claude model.
D
Convert the entire prompt into an external JSON schema containing no natural language tags or delimiters.
Explanation:

For Anthropic Claude models, it is recommended to wrap demonstration examples within <example></example> tags and use delimiters like H: and A: inside them to avoid confusion with the main prompt's Human: and Assistant: delimiters.

QUESTION 11 OF 13

What is the key difference between zero-shot prompting and few-shot prompting (in-context learning) when interacting with Large Language Models (LLMs)?

A
Few-shot prompting provides paired example inputs and desired outputs to calibrate model expectations, whereas zero-shot prompting contains no examples.Correct Answer
B
Few-shot prompting uses API parameters to restrict the model to a few words, whereas zero-shot prompting allows unlimited words.
C
Zero-shot prompting requires retraining the model using fine-tuning, whereas few-shot prompting relies solely on vector database retrieval.
D
Few-shot prompting requires wrapping the entire prompt inside double curly braces {{ and }}, whereas zero-shot prompting relies on <example> tags.
Explanation:

Few-shot prompting, also known as in-context learning, provides paired example inputs and desired outputs (shots) to calibrate model expectations, whereas zero-shot prompting contains no examples.

QUESTION 12 OF 13

According to Amazon Bedrock prompt engineering guidelines, a single prompt to guide a model can be made up of several distinct components. Which of the following sets of components is described as being part of a single prompt?

A
The task or instruction, the context of the task, demonstration examples, and the input text.Correct Answer
B
The loss function, the optimization algorithm, the dataset split, and the hyperparameter definitions.
C
The database connection pool, the security groups, the subnet CIDRs, and the auto-scaling configurations.
D
The encoder weights, the decoder weights, the attention heads, and the latent dimension vectors.
Explanation:

A single prompt includes several components to guide a model, including a task or instruction, context of the task, demonstration examples, and the input text.

QUESTION 13 OF 13

A developer is writing a Python application that directly calls the Amazon Bedrock API to interact with an Anthropic Claude model. During testing, the API requests fail with a formatting error. Based on Claude API requirements, how should the prompts be structured?

A
They must use a conversational style containing the specific delimiters '\\n\\nHuman:' and '\\n\\nAssistant:'.Correct Answer
B
They must contain double curly braces {{ and }} around every sentence to indicate API variable mappings.
C
They must be sent in a raw text format with all whitespace, newlines, and delimiters completely removed.
D
They must utilize zero-shot prompting only, without any external instructions or context blocks.
Explanation:

Prompts sent to Anthropic Claude models via API must use a conversational style containing the specific delimiters '\\n\\nHuman:' and '\\n\\nAssistant:'.

Ready to test your recall?

A developer is building an interactive virtual assistant using direct API calls to Amazon Bedrock models. During testing, they find that the model is unable to recall the user's name or preferences from the immediately preceding prompt in the conversation. What is the cause of this behavior, and how can they resolve it?

A
Amazon Bedrock models accessed via API do not recall prior requests by default, so the developer must explicitly include the previous interaction within the current prompt.
B
The developer failed to enable the automatic session-tracking parameter in the API header, which would natively store and sync context across requests.
C
API-based Amazon Bedrock models only store history when utilizing Titan Text models, and the developer must switch away from other model families to resolve this.
D
Amazon Bedrock API calls require the developer to establish a persistent WebSocket connection to retain conversation state automatically.

How confident are you in this answer?