Databricks Generative AI Engineer Associate Question 302
Select 3You are tasked with building a Retrieval-Augmented Generation (RAG) application on Databricks that uses a Large Language Model (LLM) for question answering. To control costs, you want to minimize the number of LLM calls while maintaining high performance. Which strategies could you implement using Databricks features?
- A
Cache embeddings and intermediate results in Delta tables to reduce redundant computations.
- B
Use Databricks Auto-Loader to directly preprocess user inputs before sending them to the LLM.
- C
Leverage vector search in Databricks to retrieve relevant context before making an LLM call.
- D
Apply batching to group multiple user queries and send them to the LLM as a single request.
- E
Run all LLM queries in real-time without pre-filtering to ensure the highest accuracy.
Show answer and explanation
Correct answers: A, C, D
Explanation
To control costs for RAG applications in Databricks, strategies like caching intermediate results in Delta tables, leveraging vector search, and batching queries can minimize unnecessary LLM usage while maintaining performance. These approaches align with the principles of cost-effective and efficient LLM utilization on Databricks.
- A. Correct.
Caching embeddings and intermediate results in Delta tables reduces redundant computations and avoids unnecessary LLM calls, effectively lowering costs.
- B. Incorrect.
Databricks Auto-Loader is used for ingesting streaming or batch data, not for preprocessing user inputs for LLM queries. It is unrelated to this scenario.
- C. Correct.
Using vector search in Databricks allows you to retrieve the most relevant context for the query, reducing the LLM's workload and limiting expenditure.
- D. Correct.
Batching queries reduces the number of LLM calls by grouping multiple inputs together, which can significantly cut costs.
- E. Incorrect.
Running all LLM queries in real-time without pre-filtering leads to higher costs and is not an efficient or scalable approach.