No chat template. The model writes a trace of functional tokens with optional result values, then [eof] and the final answer, and stops at the tokenizer's EOS token. Stop on EOS, not on [eof], and decode with skip_special_tokens=False to keep the boundaries.
Inference
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer repo_id = "JhCIFT/CIRF-Qwen3-8B-Instruct-Backward-Greedy-6"tokenizer = AutoTokenizer.from_pretrained(repo_id)model = AutoModelForCausalLM.from_pretrained(repo_id, dtype=torch.bfloat16, device_map="auto").eval() prompt = "What is 2 + 2?[sof]"inputs = tokenizer(prompt, add_special_tokens=False, return_tensors="pt").to(model.device)with torch.inference_mode(): output = model.generate(**inputs, max_new_tokens=384, do_sample=False, eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.pad_token_id)ids = output[0, inputs.input_ids.shape[1]:].tolist()if tokenizer.eos_token_id in ids: ids = ids[:ids.index(tokenizer.eos_token_id)]trace = tokenizer.decode(ids, skip_special_tokens=False)print(trace)print(trace.split("[eof]", 1)[1].strip() if "[eof]" in trace else None)
The evaluation below additionally limits each trace to 32 functional tokens (forcing [eof] when the limit is reached). The included inference.py reproduces that protocol and needs only Torch and Transformers:
python inference.py --model JhCIFT/CIRF-Qwen3-8B-Instruct-Backward-Greedy-6 --question "What is 2 + 2?"
Test accuracy
Table with columns: Test set, Questions, Accuracy| Test set | Questions | Accuracy |
|---|
| GSM8K | 1,319 | 52.62% |
| MultiArith | 178 | 100.00% |
| SVAMP | 300 | 84.00% |
| CommonsenseQA | 1,221 | 81.33% |
| Coin Flip (parity-corrected) | 3,333 | 83.68% |
Greedy decoding, at most 384 new tokens and 32 functional tokens, exact-match answer scoring. Coin Flip is scored against the parity of the flips stated in the question, because about 20% of the dataset's labels disagree with it. The full per-dataset results, including MATH-500, StrategyQA and batch-1 latency, are in test_results.json; training_config.json, provenance.json and export_verification.json record the training settings, source checkpoint hashes and export checks.
License
The base model is Qwen/Qwen3-8B, released under Apache 2.0; this derivative keeps that license (LICENSE). Changes comprise the CIRF functional-token vocabulary, learned embedding and output rows, supervised adaptation, and the merged LoRA update.