AIF-C01 Question 129
Select 4You are tasked with designing a chatbot using a large language model (LLM) to answer customer inquiries about your company's products. During testing, you notice the responses are often too vague or irrelevant. Which of the following prompt engineering techniques can help improve the quality of responses?
- A
Provide detailed and specific instructions in the prompt.
- B
Use multiple comments to guide the LLM to think step-by-step.
- C
Keep prompts as short as possible to avoid overwhelming the model.
- D
Experiment with different prompt structures and phrasing.
- E
Include guardrails in the prompt to limit the scope of the response.
Show answer and explanation
Correct answers: A, B, D, E
Explanation
Prompt engineering is a crucial skill when working with large language models like those used in AWS AI services. Techniques such as providing specific instructions, guiding the model with step-by-step prompts, experimenting with different phrasing, and including guardrails ensure the responses are relevant, specific, and aligned with the use case. While brevity is important, sacrificing necessary details for conciseness can lead to poor-quality responses.
- A. Correct.
Providing detailed and specific instructions helps the LLM focus on the desired context and improves response relevance and quality.
- B. Correct.
Using multiple comments or step-by-step guidance allows the LLM to follow a logical thought process, leading to more accurate outputs.
- C. Incorrect.
While keeping prompts concise is important, overly short prompts can lack the necessary context to generate high-quality responses, making this approach incomplete.
- D. Correct.
Experimenting with different prompt structures and phrasing helps identify what works best for the specific use case, improving response quality.
- E. Correct.
Including guardrails in the prompt, such as specifying what not to include or limiting the scope, ensures the LLM generates responses within acceptable boundaries.