Problems / Every Message Costs More
Every Message Costs More Stop paying again for the chat so far
- Sheet
- C-04
- Difficulty
- Easy 3
- Format
- Config
- Mode
- Simulated
- Sub-topics
- Long ChatsBreakpoint Placement
Open this on a computer to solve it. Config problems need a wider screen.
A support chat resends the whole conversation at full price on every message. Cache it, without losing an answer.
The Situation
Bramblegate Games' support assistant helps players of Starforge Arena through long troubleshooting chats. Models read and bill text in tokens, which are small pieces of words. Each message resends the whole chat so far, so each costs more than the last. Your day of 8 chats cost $12.26.
Your job: cut that cost without a single wrong answer. Messages in a chat come less than 5 minutes apart.
Your Move
Change chat.yaml:
cache.breakpoints: up to 4 ofinstructions,manual,history,statusandquestion(R1).history:all, orlast_5to send only the last five exchanges, each a player's message and its reply (R2).
The Rules That Decide
R1. Caching
Each message sends one request with five blocks, in this order: instructions, manual, history, status and question. The player's status is looked up again for every message, so it differs each time. A cache stores the start of a request for later requests to reuse. Each breakpoint stores one part: the request up to the end of its block.
- Reading: when a request starts with the same tokens as a stored part, those tokens cost 0.1× the input price (R3).
- Writing: a newly stored token costs 1.25× the input price.
- Lifetime: a stored part lasts 5 minutes after it was last written or read.
R2. Right Answers
A message that refers back to an earlier exchange is answered right only if that exchange is still in history.
Targets
- Cost cut, your day's saving: at least 35% to pass, and 43.5% for full points.
- Accuracy must stay at 100%.
Your fix is also checked on inputs you can't see, so tune for the rule, not the sample.
The Fine Print
R3. Prices
Every request goes to the same model. Prices are in dollars per million tokens:
- Input, the text sent to the model: 5.
- Output, the reply it writes: 25.
Input tokens that aren't read from or written to the cache cost the input price.
R4. Blocks
instructions: 1,900 tokens.manual: the game's support manual, 7,300 tokens.history, the earlier exchanges, grows with every message.status: the player's live account and server status, 1,600 tokens.question, the player's newest message: 30–70 tokens.
R5. More About the Cache
- Reading a part also keeps the shorter stored parts at its start alive.
- When several stored parts match, the longest one is read.
- A breakpoint writes only when no stored copy of its part exists yet.
- A part shorter than 1,024 tokens isn't stored, and its breakpoint is ignored.
R6. Your Day
- The day has 8 chats and 298 messages. Each chat has from 35 to 38 messages.
- Each chat starts from 33m 58s to 57m 54s after the one before it, so chats often overlap.
Need a Hint?
Hint 1 of 3 caps what you can earn at 28 out of 30 points. Points you’ve already earned stay. How points work