
Answer-first summary for fast verification
Answer: Implement a safety filter that detects any harmful inputs and ask the LLM to respond that it is unable to assist
Option D is the most effective technique because it proactively detects and blocks harmful inputs before they reach the LLM, preventing potential security risks while maintaining a professional response. This aligns with best practices for LLM safety by implementing a dedicated safety filter layer. Option A (reducing interaction time) doesn't address the core security issue. Option B (increasing compute) may improve performance but doesn't protect against malicious inputs. Option C (reminding but continuing) is problematic as it still processes harmful content and could enable further malicious interactions. The community discussion shows 67% support for D with the highest upvoted comment endorsing it, while C received only 33% support with less convincing reasoning.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A Generative AI engineer is building an LLM application for personalized movie recommendations. Considering the risk of malicious user inputs, what is the most effective technique to protect the application?
A
Reduce the time that the users can interact with the LLM
B
Increase the amount of compute that powers the LLM to process input faster
C
Ask the LLM to remind the user that the input is malicious but continue the conversation with the user
D
Implement a safety filter that detects any harmful inputs and ask the LLM to respond that it is unable to assist