<INSTRUCT>{"bootstrap":"short-term-mem"} λm s. if size(m) > CACHE then chunk(m, CACHE,…
- User
{"bootstrap":"short-term-mem"} λm s. if size(m) > CACHE then chunk(m, CACHE, s) else access(m, s)
Assistant
Here is the code with some clarifications:
chunk(message, cache_size, state): if len(message) > cache_size: # Message is larger than cache size, # so chunk it into pieces of cache_size while len(message) > 0: chunk = message[:cache_size] message = message[cache_size:] access(chunk, state) else: # Message fits in cache, so access it directly access(message, state) access(chunk, state): # Actual "access" of chunk, updating stateThis function
chunk()splits a long message into chunks of sizecache_size, and then calls theaccess()function to process each chunk. This simulates short-term memory by only holdingcache_sizeworth of information at a time.The
stateparameter is passed through so the function can update some shared state as it processes each chunk.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.