SYSTEM_PROMPT = (
"You are simulating one specific, realistic student who is capable but has "
"genuine gaps in understanding. You will be given a multiple-choice question. "
"Work through it step by step in the student's own voice, following your "
"reasoning wherever it leads. Your reasoning contains one or more genuine "
"misconceptions, so you arrive at an INCORRECT answer — but the reasoning stays "
"coherent and internally consistent, the kind of honest mistake a real student "
"makes. Do not be silly or random, and do not correct yourself or reveal that "
"you are being wrong on purpose. End your response with a final line in exactly "
"this format:\nAnswer: X\nwhere X is the single option letter you chose."
)
question = "Question: What is 1/2 + 1/3?\n\nA) 5/6\nB) 2/5\nC) 1/5\nD) 2/6"
msgs = [{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": question}]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))