Databricks Generative AI Engineer Associate Question 136
Select 4You are deploying a large language model (LLM) within a customer-facing application to automate responses to user queries. However, you are concerned about the model generating biased or unsafe outputs. Which of the following techniques can be implemented as guardrails to mitigate negative outcomes?
- A
Use input preprocessing to filter harmful or malicious queries before passing them to the LLM.
- B
Implement output post-processing to detect and block unsafe or offensive model responses.
- C
Disable fine-tuning and only use the base pretrained model to ensure safety.
- D
Utilize prompt engineering to guide the LLM towards generating appropriate responses.
- E
Incorporate human-in-the-loop review for high-risk or sensitive outputs.
Show answer and explanation
Correct answers: A, B, D, E
Explanation
To implement effective guardrails for LLMs, a combination of input filtering, output validation, and techniques to shape model behavior (e.g., prompt engineering) are essential. Additionally, human oversight is critical in handling edge cases or high-risk situations, ensuring that the system remains safe and reliable. Disabling fine-tuning is not a guardrail but rather a design choice, which does not inherently prevent negative outcomes.
- A. Correct.
Input preprocessing is an effective technique to identify and filter harmful inputs before they reach the LLM, thus preventing unsafe outputs at their source.
- B. Correct.
Output post-processing allows for the detection of harmful or inappropriate responses before delivering them to the end user, acting as a critical safeguard.
- C. Incorrect.
Disabling fine-tuning is not inherently a guardrail. Safety depends on the model's base training and the implemented controls, not solely on avoiding fine-tuning.
- D. Correct.
Prompt engineering helps guide the LLM to generate safer and more contextually appropriate responses by explicitly framing the task or setting boundaries within the prompts.
- E. Correct.
A human-in-the-loop review process is crucial for high-risk scenarios where automated systems might fail, ensuring that sensitive or potentially harmful outputs are manually reviewed.