AIF-C01 Question 131
Select 3A data science team is building a natural language processing (NLP) chatbot using a pre-trained large language model (LLM) on AWS. They notice that the chatbot occasionally generates irrelevant or overly verbose responses. How can the team improve the chatbot's response quality by applying prompt engineering best practices?
- A
Rewrite the prompts to be more specific and concise, clearly defining the expected output format.
- B
Use multiple prompts with slight variations to discover which phrasing produces the best results.
- C
Ensure the prompt includes guardrails by explicitly stating what the chatbot should not do.
- D
Avoid experimenting with different prompt designs to maintain consistency during development.
- E
Rely entirely on the default behavior of the pre-trained model without modifying the prompts.
Show answer and explanation
Correct answers: A, B, C
Explanation
Improving response quality when working with large language models on AWS involves applying prompt engineering best practices, such as writing specific and concise prompts, experimenting with different variations, and including explicit instructions or guardrails. These practices help tailor the model's behavior to the desired use case, ensuring more relevant and accurate outputs.
- A. Correct.
Specific and concise prompts help guide the model toward generating more relevant and targeted responses, improving overall quality.
- B. Correct.
Experimenting with multiple prompts allows the team to identify the most effective phrasing for eliciting desired responses, which is a best practice in prompt engineering.
- C. Correct.
Including guardrails in the prompt, such as specifying what the chatbot should avoid, minimizes the risk of irrelevant or inappropriate outputs.
- D. Incorrect.
Avoiding experimentation limits the team's ability to optimize the prompt design, which can hinder response quality improvement.
- E. Incorrect.
Relying entirely on the default behavior of the model often leads to suboptimal results, as pre-trained models may not align perfectly with specific use cases without prompt tuning.