Question 21
Read the following passage carefully:
A student builds a simple API that connects to a Large Language Model (LLM). To save time and expenses, the student configures a cache so that repeated questions skip the LLM entirely and return an instant answer. To stop prompt injection attacks, the developer filters the user's text for bad words before safely sending it.
During a testing session, a user cleverly tricks the API using a formatting loophole, causing the LLM to output a badly formatted hallucination. Because of the cache rules, the system memorizes this bad response. When other users ask the exact same question, they also receive the incorrect hallucination directly from the cache. Meanwhile, when the student tries testing their API locally from an HTML file, the browser blocks the connection outright.
Based on the above data, answer the given subquestions.
What's the key difference between LLM "Structured Outputs" and Python validation for preventing malformed JSON?
Choose the correct answer.
Structured outputs run server-side; Python runs client-side.
Structured outputs constrain token generation; Python detects errors post- generation.
Structured outputs cache results for 3600s; Python rechecks each response.
Structured outputs encrypt JSON; Python leaves data unencrypted.