Databricks Certified Generative AI Engineer Associate — Question 18
What is an effective method to preprocess prompts using custom code before sending them to an LLM?
Answer options
- A. Directly modify the LLM’s internal architecture to include preprocessing steps
- B. It is better not to introduce custom code to preprocess prompts as the LLM has not been trained with examples of the preprocessed prompts
- C. Rather than preprocessing prompts, it’s more effective to postprocess the LLM outputs to align the outputs to desired outcomes
- D. Write a MLflow PyFunc model that has a separate function to process the prompts
Correct answer: D
Explanation
Option D is correct because developing a separate MLflow PyFunc model allows for effective preprocessing of prompts before they are sent to the LLM. Option A is incorrect since modifying the LLM's internal architecture is not practical or recommended. Option B is wrong as using custom preprocessing can still be beneficial, and Option C misses the point, as preprocessing can help improve the quality of inputs to the LLM rather than solely relying on postprocessing the outputs.