A chatbot's conversation history is growing longer than the model's context window. What is a common way to handle it?
Show the answer and explanation
Correct answer: C, Keep recent turns verbatim and replace older turns with a short running summary, so key facts stay within budget.
Explanation Context Management
The model only sees what is in the current request, so the application must keep the history within the token budget. Standard strategies are a sliding window (keep the last N turns), summarizing older turns into a short running summary, and retrieving only the relevant earlier messages. A common hybrid keeps the system prompt and recent turns verbatim and summarizes the rest.
Why the other ideas are wrong:
- The model does not compress oversized input: a request beyond the context window is rejected or truncated, losing information.
- The system prompt carries the instructions and persona, so it is normally the last thing to drop, not the first.
- Fine-tuning after every turn is slow, costly and not how chat memory works; history is handled in the prompt.
Interview tip: mention the trade-off: truncation is simple but forgets early facts, while summarization keeps them at the cost of an extra LLM call and possible loss of detail.