HeisenbergQ-0.5B is a fine-tuned version of Qwen2.5-0.5B-Instruct, optimized for quantum physics reasoning using GRPO reinforcement learning with custom reward functions.
This model is trained to produce structured answers in XML format with and tags. It excels at step-by-step logical reasoning in physics-related problems.
Primary: Solving and reasoning through quantum physics problems
Secondary: General scientific reasoning in math & physics
Not for: General-purpose conversation (model is specialized)
Bias, Risks, and Limitations
Trained only on ~1K samples (domain-specific)
May hallucinate outside physics domain
Small 0.5B parameter size = lightweight, but reasoning depth is limited compared to larger models
How to Get Started with the Model
Use the code below to get started with the model.
fromtransformersimportAutoTokenizer,AutoModelForCausalLMtokenizer=AutoTokenizer.from_pretrained("khazarai/HeisenbergQ-0.5B-RL")model=AutoModelForCausalLM.from_pretrained("khazarai/HeisenbergQ-0.5B-RL",device_map={"":0})system="""
Respond in the following format:
<reasoning>
...
</reasoning>
<answer>
...
</answer>
"""question="""
What is the significance of setting mass equal to 1 in a quantum dynamical system, and how does it impact the formulation of the Hamiltonian and the operators?
"""messages=[{"role":"system","content":system},{"role":"user","content":question}]text=tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True,)fromtransformersimportTextStreamer_=model.generate(**tokenizer(text,return_tensors="pt").to("cuda"),max_new_tokens=1800,streamer=TextStreamer(tokenizer,skip_prompt=True),)
Training Details
Training Procedure
Training Method: GRPO (Grouped Relative Policy Optimization)
Reward Models: Reasoning Quality Reward: Encourages logical markers & coherent chains of thought
Token Count Reward: Prevents under- or over-explaining
XML Reward: Enforces / format
Soft Format Reward: Ensures graceful handling of edge cases