rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x
012
hep-agent-qwen-qwen3-5-9b-mi300x
HEP domain expert — Fine-tuned Qwen/Qwen3.5-9B on High Energy Physics data.
This model is a full fine-tune of Qwen/Qwen3.5-9B on a curated corpus of High Energy Physics literature, experimental data, and synthetic Q&A. Trained on a single AMD MI300X (192 GB HBM3, ROCm 7.0).
Model Overview
Evaluation Results
All scores are accuracy (%) unless noted. Comparison against the unmodified Qwen/Qwen3.5-9B base.
General Benchmarks
No significant regressions were detected (threshold: −3 pp).
MMLU Physics Subsets (extracted from MMLU Full run)
MMLU STEM aggregate: Base 68.3% → Fine-tuned 68.7% (+0.4 pp).
Custom Physics Calculations (8 problems)
Note: This custom benchmark covers only 8 problems and uses strict exact-match numeric scoring. Both models demonstrate correct reasoning in the response text but often fail the final answer-extraction step (e.g., outputting an intermediate value rather than the final result in the expected units). A lenient scoring pass would yield higher effective accuracy. The benchmark will be expanded in a future evaluation run.
Benchmarks Not Yet Available
The following benchmarks encountered infrastructure errors during this evaluation run and will be included in a future update:
Intended Use
This model is designed for:
- Answering questions about experimental and theoretical particle physics
- Explaining detector physics, collision analysis, and data analysis
- Solving quantitative physics problems (kinematics, cross-sections, decay calculations)
- Summarizing HEP papers and explaining their methodology
Not intended for:
- Real-time experimental analysis or ROOT file processing
- Safety-critical applications
- Medical or regulatory decisions
Training Data
Training Configuration
Usage
Basic Generation
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
# ChatML format (for Qwen base)
prompt = """<|im_start|>system
You are an expert particle physicist.<|im_end|>
<|im_start|>user
What is the invariant mass of two photons with energies 62.5 GeV each, traveling back-to-back?<|im_end|>
<|im_start|>assistant
"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=300, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))Example 2
# Install latest stable Transformers
!pip install -U transformers==5.5.0
# Install remaining deps
!pip install -U accelerate bitsandbytes sentencepiece protobuf peft trl
# Optional
!pip install -U unslothfrom transformers import (
AutoTokenizer,
AutoModelForCausalLM,
BitsAndBytesConfig,
)
import torch
model_name = "rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x"
# Quantization config
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
)
# Tokenizer
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True
)
# Model
model = AutoModelForCausalLM.from_pretrained(
model_name,
device_map="auto",
dtype=torch.float16,
trust_remote_code=True,
quantization_config=bnb_config,
)
prompt = "Explain what a jet detector is in particle physics."
messages = [
{"role": "user", "content": prompt}
]
# Apply chat template
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
inputs = tokenizer(
text,
return_tensors="pt"
).to(model.device)
# Generate
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=2048,
temperature=0.5,
do_sample=True,
top_p=0.9,
)
response = tokenizer.decode(
outputs[0],
skip_special_tokens=True
)
print(response)vLLM Server (Recommended for Production)
# Install vLLM with ROCm support
pip install vllm --extra-index-url https://download.pytorch.org/whl/rocm7.0
# Launch server
vllm serve rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x \
--dtype bfloat16 \
--max-model-len 4096 \
--port 8000from openai import OpenAI
client = OpenAI(api_key="EMPTY", base_url="http://localhost:8000/v1")
response = client.chat.completions.create(
model="rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x",
messages=[{"role": "user", "content": "Explain the CMS detector architecture."}],
max_tokens=500,
)
print(response.choices[0].message.content)Limitations
- Knowledge cutoff reflects training data (primarily pre-2025 papers)
- May hallucinate specific numerical values; always verify against PDG/PDG Live
- Not trained for function-calling or tool-use tasks
- Quantitative calculations: correct reasoning approach observed but strict exact-match scores are low on small test sets; verify numerical outputs independently
- Limited coverage of very recent experimental results
- Several planned benchmarks (GSM8K, HellaSwag, TruthfulQA) could not run due to harness infrastructure issues; results will be added in a follow-up evaluation
Citation
@misc{hep-agent-mi300x-2026,
title = {HEP-Agent: Full Fine-Tuning of Qwen/Qwen3.5-9B on High Energy Physics Data},
author = {Rathod, Rajveer},
year = {2026},
howpublished = {\url{https://huggingface.co/rajveer43/hep-agent-qwen-qwen3-5-9b-mi300x}},
note = {Fine-tuned on AMD MI300X (ROCm 7.0) using Unsloth acceleration}
}License
Apache License 2.0.
Base model weights are subject to their own license: Qwen/Qwen3.5-9B License
