A Reinforcement Learning framework tailored for training Large Language Models (specifically Qwen) to play Atari Breakout using purely text-based observations. This project leverages Proximal Policy Optimization (PPO) with Low-Rank Adaptation (LoRA) to fine-tune the model efficiently.
git clone https://github.com/oberpierre/hs25-rl-ppo.git
cd hs25-rl-ppo
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Start a new training session with default hyperparameters (Qwen/Qwen3-0.6B):
python train.py
Outputs (logs, checkpoints, and videos) are saved in the runs/ and videos/ directories.
Watch the trained model play:
# Play 1 episode
python play.py --checkpoint checkpoints/[run_name]/step_[N]
# Play 5 episodes and get stats
python play.py --checkpoint checkpoints/[run_name]/step_[N] --episodes 5
Run a hyperparameter sweep over Learning Rates and KL Targets:
python grid_search.py
Run a quick environment check to ensure text observations and actions are working:
python verify_env.py
train.py: Entry point for training.play.py: Inference script for playing/evaluating checkpoints.src/
env_wrapper.py: Gymnasium wrapper converting RAM states to text.model.py: ActorCritic architecture wrapping the HuggingFace model.ppo.py: PPO algorithm implementation.reward_shaping.py: Reward shaping logic (e.g., paddle-ball alignment).checkpoints/: Saved models.runs/: Tensorboard logs.19 commits
Python
100.0%
A Reinforcement Learning framework tailored for training Large Language Models (specifically Qwen) to play Atari Breakout using purely text-based observations. This project leverages Proximal Policy Optimization (PPO) with Low-Rank Adaptation (LoRA) to fine-tune the model efficiently.
git clone https://github.com/oberpierre/hs25-rl-ppo.git
cd hs25-rl-ppo
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Start a new training session with default hyperparameters (Qwen/Qwen3-0.6B):
python train.py
Outputs (logs, checkpoints, and videos) are saved in the runs/ and videos/ directories.
Watch the trained model play:
# Play 1 episode
python play.py --checkpoint checkpoints/[run_name]/step_[N]
# Play 5 episodes and get stats
python play.py --checkpoint checkpoints/[run_name]/step_[N] --episodes 5
Run a hyperparameter sweep over Learning Rates and KL Targets:
python grid_search.py
Run a quick environment check to ensure text observations and actions are working:
python verify_env.py
train.py: Entry point for training.play.py: Inference script for playing/evaluating checkpoints.src/
env_wrapper.py: Gymnasium wrapper converting RAM states to text.model.py: ActorCritic architecture wrapping the HuggingFace model.ppo.py: PPO algorithm implementation.reward_shaping.py: Reward shaping logic (e.g., paddle-ball alignment).checkpoints/: Saved models.runs/: Tensorboard logs.19 commits
Python
100.0%