Interview practice question
Restructuring prompts to benefit from caching
Machine Learning · LLM Fundamentals · Intermediate
Each request sends a 6,000-token system prompt with policies and examples, followed by the user's message. How can you reduce cost and latency?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Enable prompt caching on the static prefix.
- Keep static content identical and at the start.
- Move dynamic content (user data, timestamps) to the end.
- Trim unnecessary instructions and examples.
- Measure cache hit rate.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.