Views
No views yet
| Parameter | Value |
|---|---|
| Base model | meta-llama/Meta-Llama-3.1-8B-Instruct |
| Fine-tuning method | GRPO (reinforcement learning, no supervised labels) |
| Dataset | GSM8K (7,473 train examples) |
| Training steps | 250 |
| LoRA rank | 32 |
| Quantization | None (BF16) |
| Effective batch size | 12 (6 generations × 2 accumulation × 1 GPU) |
| Learning rate | 5e-6 |
| Hardware | AMD Instinct MI300X VF (191.688 GB HBM) |
| Framework | Unsloth 2025.3.19 + TRL + ROCm |
| Torch | 2.7.0 + ROCm |
| vLLM | 0.7.4 |
| Reward Function | Max Score | What it checks |
|---|---|---|
correctness_reward_func | 2.0 | Extracted answer matches gold answer exactly |
int_reward_func | 0.5 | Answer is a valid integer |
strict_format_reward_func | 0.5 | Exact newline structure inside tags |
soft_format_reward_func | 0.5 | Tags present anywhere in output |
xmlcount_reward_func | 0.5 | Partial credit for tag placement; penalises text after </answer> |
xmlcount_reward_func applies a -0.001 penalty per character appearing after </answer>, discouraging the model from rambling after giving its answer.1<reasoning>
2Step 1: ...
3Step 2: ...
4</reasoning>
5<answer>
642
7</answer>1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained(
4 "sarapatel/llama31-8b-grpo-gsm8k-run1",
5 torch_dtype="auto",
6 device_map="auto"
7)
8
9tokenizer = AutoTokenizer.from_pretrained("sarapatel/llama31-8b-grpo-gsm8k-run1")
10
11SYSTEM_PROMPT = """
12Respond in the following format:
13<reasoning>
14...
15</reasoning>
16<answer>
17...
18</answer>
19"""
20
21prompt = [
22 {"role": "system", "content": SYSTEM_PROMPT},
23 {"role": "user", "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many in May. How many clips did she sell altogether?"}
24]
25
26inputs = tokenizer.apply_chat_template(
27 prompt,
28 return_tensors="pt",
29 add_generation_prompt=True
30).to(model.device)
31
32outputs = model.generate(inputs, max_new_tokens=512, temperature=0.8, top_p=0.95)
33print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))gpu_memory_utilization = 0.6 was sufficient for the full runload_in_4bit = True fails immediately with:RuntimeError: bitsandbytes quantization is currently not supported in rocm.bitsandbytes is a CUDA-only library. Its 4bit/8bit quantization kernels have no ROCm equivalent. If you are on AMD hardware, keep load_in_4bit = False.num_generations beyond 6 with full BF16 weights caused OOM kernel crashes around step 100/250 due to peak VRAM pressure during simultaneous generation.bitsandbytes 4bit quantization is unavailable on ROCm. Use BF16 for inference, or explore GPTQ via AutoGPTQ as an alternative quantization path on AMD hardware.grpo-gsm8k-amd, run name llama31-8b-noquant-250steps.