Downloads · 30 days
0
Atharva2099/openenv-smogon-rl
openenv-smogon-rl is a reinforcement learning model from Atharva2099. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
A LoRA adapter on top of Qwen3-4B-Instruct trained with GRPO to play competitive Pokemon Showdown (Gen 4 OU). This is run 3 — the best performing checkpoint from the series.
Downloads · 30 days
0
Access
Public
Updated Mar 27, 2026
Repo size
408 MB
Likes
0
Public
Click a slice to open those files.
.safetensors132 MB · 89%
From the Hugging Face model README
A LoRA adapter on top of Qwen3-4B-Instruct trained with GRPO to play competitive Pokemon Showdown (Gen 4 OU). This is run 3 — the best performing checkpoint from the series.
Links:
Competitive Pokemon isn't just a children's game — it's a partially observable, long-horizon decision problem. Each turn the model must:
That makes it a legitimate benchmark for LLM planning and reasoning, and a natural fit for GRPO training with real environment rewards.
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
| Adapter type | LoRA (PEFT) |
| LoRA rank | 32 |
| LoRA alpha | 32 |
| Dropout | 0.0 |
| Target modules | q/k/v/o proj, gate/up/down proj |
| Training method | GRPO on live battle trajectories |
| Format | Gen 4 OU (competitive, older format — more stable) |
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507")
tokenizer = AutoTokenizer.from_pretrained("Atharva2099/openenv-smogon-rl")
model = PeftModel.from_pretrained(base, "Atharva2099/openenv-smogon-rl")
# The model expects a structured markdown battle state and outputs a JSON action:
# {"action": "move" | "switch", "choice": "Exact Move or Pokemon Name"}
For full environment setup and battle loop, see the GitHub repo.
Base: Qwen3-4B-Instruct
|
[JSON SFT warm-up] teach the model to output valid action JSON
|
[Rollout collection] live battles against RandomPlayer on local Showdown
|
[GRPO training] optimize on real shaped rewards from environment
|
LoRA checkpoint -> HF Hub
Reward signal (dense, per-turn):
+1.0 per 10% opponent HP dealt / -1.0 per 10% HP lost+3.0 opponent faint / -3.0 self faint+0.5 super effective hit / -1.0 immune/no-effect+0.5 per stat stage gained (capped), +1.0 per 10% healed (capped)-10.0 illegal action (hallucinated move/pokemon)-0.05 step penalty (anti-stall)| Branch | Notes |
|---|---|
grpo-qwen3-4b-run1 | First GRPO run, baseline |
grpo-qwen3-4b-run2 | Tuned reward shaping |
grpo-qwen3-4b-run3 | Best performing (this branch = main) |
RandomPlayer — will struggle against strong competitive opponents