Module 2.4 · Deepens page 4
bc-01's ten lines called the model exactly once. Call it twice in a row, with nothing carried over between calls, and watch what actually happens — not "it says it doesn't know," something stranger.
The script
def ask(message):
# every call starts from scratch — nothing about a previous call is passed in here
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": message}], tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
outputs = model.generate(**inputs, max_new_tokens=30)
return tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
ask("My name is Alex.")
ask("What's my name?") # a separate call — this function has no idea Alex was ever mentioned
apply_chat_template wraps the message in the model's special turn tokens — but it only ever sees the one message you pass to it. Download bc-04-no-memory.py ⬇
Run bc-04-no-memory.py ⬇ a few times. The exact persona in Turn 2 will change each run (it's sampling, not a fixed script) — but it will never correctly say "Alex." Predict why before running it: is there any version of this script, unchanged, that could get it right by luck?
So what
The model has no memory to forget — every call is the first call unless you build the memory yourself.