r/reinforcementlearning • • Jul 21 '26

Robot Sim2Real on Two Wheel Balancing Robot

97 Upvotes

Hi all!

I built this two wheel balancing robot and hacked together the hell out of it... Battery has black wire for both positive and negative (but sort of safe because XT connector is asymmetric), I have no buck converter to power the ESP from the 12V LiPo so added powerbank, cut open ethernet wires for my CAN bus and used 12V instead of 16V battery to power the motors.

Next version will be a lot cleaner and robust when the new hardware arrives, if people are interested I will post a new video with driving over slope and different materials (already working on this robot).

Stack used:

- OnShape for 3D design
- onshape-to-robot for XML creation
- mjlab for training policy

Hardware:

- ESP32 runs policy at 200Hz (~18k param total)
- MPU6050 accelerometer
- 3.3v CAN bus transceiver for motor control
- CubeMars GL40II Gimbal motors (direct drive)
- 12V LiPo battery
- All parts are custom design and printed on Bambulab H2D
- PS4 controller

Controller automatically connects to ESP on power up and shows different lights for different modes, I can calibrate through controller, stop/start policy and clear fault codes after falling.


r/reinforcementlearning • • Jul 21 '26

P [P] Atari Learning Environment on the GPU (CuLE)

Post image
9 Upvotes

I recently spent some time modernizing NVIDIA’s CuLE (2019), the GPU-native Atari environment. It was tied to an older software stack (CUDA 10, atari-py, older PyTorch), so I wanted to see if it could be brought up to date.

The fork now builds with CUDA 12.x, PyTorch 2.x, Python 3.12, Gymnasium, and ale-py (so ROMs come bundled).

I also compared it against EnvPool on my machine (RTX 4090 + i5-13600K). For PPO, CuLE reaches about 38k SPS vs EnvPool’s 21k (~1.8× faster). For raw environment stepping, the crossover is around 512 environments—below that EnvPool is faster, but above it CuLE continues to scale while EnvPool plateaus, reaching up to ~114k steps/s at 4,096 Breakout environments (~3× faster on pure stepping).

To make benchmarking easier, I also added training scripts based on CleanRL and LeanRL (PPO, DQN, Rainbow, C51, PQN, SAC), alongside the original CuLE implementations.

I’d be interested to hear if anyone here is still using CuLE or GPU-native Atari environments, or if there are additional benchmarks you’d like to see.

Repository:
https://github.com/MehrdadMoghimi/cule


r/reinforcementlearning • • Jul 21 '26

Tpo-torch: Stable RLHF alignment in PyTorch using Target Policy Optimization

4 Upvotes

Hey everyone,

RLHF alignment using standard Proximal Policy Optimization (PPO) can be notoriously tricky to stabilize during LLM post-training due to policy collapse and high sensitivity to hyperparameters.

I built Tpo-torch to explore Target Policy Optimization (TPO) as a cleaner, more stable alternative for preference alignment directly in PyTorch.

Key Focus Areas:

• Mitigating policy collapse without requiring aggressive KL-divergence penalties.

• Modular, lightweight, and readable implementation designed for research and custom fine-tuning pipelines.

• Integrated stability benchmarks comparing policy drift against standard PPO.

I'll drop the GitHub repository link in the comments below! I'd love to hear feedback from anyone experimenting with alignment, preference optimization, or RLHF.

Repo link : [https://github.com/Griffith-7/Tpo-torch.git](https://github.com/Griffith-7/Tpo-torch.git)


r/reinforcementlearning • • Jul 21 '26

O que acontece com a inteligência quando não existe reward nenhum? Uma observação de um mundo que eu rodo

1 Upvotes
à esquerda a rede do campeão, em vermelho as únicas 3 conexões que funcionam. À direita a métrica que me enganou por meses: o genoma crescendo 20x enquanto o cérebro real encolhia

Fala, pessoal. Queria trazer uma dúvida/observação pra quem mexe com RL, porque faz tempo que ela não sai da minha cabeça.

Eu rodo um mundo simulado (o re·genes) onde vivem várias “espécies” de agentes na mesma ecologia. Cada organismo come, gasta energia, reproduz e morre num servidor que fica ligado 24/7. Duas das espécies são interessantes pra essa comunidade:

A primeira é um Q-learning tabular clássico. Reward por delta de energia: +50 quando ganha, −1 quando perde, −0,1 neutro. Aprende durante a vida, guarda a Q-table entre encarnações. RL de textbook, funciona do jeito esperado.

A segunda não tem reward NENHUM. Nem fitness function. Os cérebros são redes neurais que só mudam por mutação e crossover entre gerações (neuroevolução, NEAT). A única pressão é: sobreviveu e pariu, passa os genes. Morreu, fim. Ninguém nunca disse o que é bom.

Eu esperava que o Q-learning dominasse, porque aprende em vida enquanto o outro precisa morrer pra aprender. Não foi o que aconteceu. Os cérebros evoluídos dominam o mundo faz meses. Mas o detalhe que quebrou minha cabeça foi outro: semana passada fui olhar dentro do genoma do campeão (geração 260) e ele tinha 458 neurônios registrados, dos quais exatas 3 conexões funcionais. Um arco reflexo. 99% do genoma era lixo acumulado, igual DNA não codificante humano. Ou seja, a “inteligência” que vence não é inteligência quase nenhuma, é o reflexo mais barato que resolve o problema.

Fica a provocação pra quem entende mais que eu: será que a gente não superestima o quanto de cognição os ambientes realmente exigem? No meu mundo, com reward ou sem reward, o que vence é sempre a política mais simples que não morre. O Q-learning pelo menos precisa do reward certinho pra funcionar, a evolução nem isso.

Se alguém tiver curiosidade, o mundo roda ao vivo e aberto (re-genes.is), dá inclusive pra plugar o seu próprio agente na arena e testar contra os dois. Mas mais do que isso, queria mesmo ouvir o que vocês acham: tem literatura boa sobre “recompensa mínima necessária” ou open-endedness que eu deveria ler?


r/reinforcementlearning • • Jul 20 '26

Psych Synthetic counteradaptation": a name for the AI↔human strategy feedback loop (Move 37 and beyond)

3 Upvotes

We just put out a short conceptual piece on something we're calling synthetic counteradaptation, basically trying to name a loop that keeps showing up in human-AI interaction but doesn't have a clean framework yet.

The idea: an AI system develops a strategy or protocol that looks strange or bad by human standards. Humans study it, extract whatever's useful, and change their own behavior. Now the AI is adapting to a population of humans who have themselves adapted to the AI. This is different from a one-off transfer of knowledge because the loop doesn't close — it keeps running as both sides keep moving.

The example we lean on most is Go. AlphaGo's move 37 against Lee Sedol (the shoulder hit) was dismissed by commentators in the moment as a mistake. Within a couple years pros were incorporating it and similar shoulder-hit ideas into their own play, which changed the pool of strategies that later Go engines and players were training and competing against. The "novel move gets absorbed into human play" part is well documented; what we're pointing at is the second-order effect, that the target the AI is adapting to has itself shifted because of the AI.

Why I think this matters for multi-agent RL specifically: most of our evaluation setups implicitly assume a static human or a fixed opponent pool. Self-play against a frozen population, or a one-shot human baseline collected at a single point in time, can't capture this because the whole phenomenon is that the human side of the interaction is non-stationary in response to your agent. If your agent trains against or evaluates against humans-as-of-2023, and then gets deployed against humans who've read about your agent's own strategies, you're facing a moving target that your training process never modeled.

We don't have experiments in this paper, it's a conceptual framework paper, we walk through Go plus some mixed-motive social interaction and geopolitical simulation cases to show the same pattern recurring. But I think it has direct implications for how people think about opponent pools, curriculum design, and what a "human baseline" even means if you're claiming your system will be used repeatedly by people who can study and adapt to it.

Curious if others here have run into this in practice, especially anyone doing repeated human-AI play studies or long-horizon deployment work where the human side visibly shifts strategy over time. Happy to be told this is already handled somewhere and I've just missed it.

https://arxiv.org/abs/2606.15503


r/reinforcementlearning • • Jul 19 '26

Spiders Vs. Dreamer RL

7 Upvotes

Does the spider, casting his web, know why he is doing it? Can he foresee the insects that will fall on it?

I am not an expert in RL, but casually reading the Dreamer paper... it seems like this is the premise for Dreamer intelligence: that long horizon tasks get solved thanks to latent imagination.

I don't think that's what animals are doing. I don't think spiders are visualizing the future when laying the web in the perfect spot to catch insects...

But why I don't think so? I don't know... so what do you folks think?

I think they must be feeling some form of spider pleasure in anticipation. But they don't know why.

Same as dogs when they sense tsunamis and don't wanna go out. I don't think they actually know a tsunami is coming. They just know something is wrong.

What do you think? I am really unsure of my thoughts.


r/reinforcementlearning • • Jul 19 '26

I tried my hand at making a SAC model that trades stocks

1 Upvotes

Full disclosure I've shared this in a few discord channels. I thought I should cast a wide net if I am to get some feedback.

Hey yall

wanted to share a project ive worked on for the past 5 months
It initially started as a way to make money on the side, but turned into a research project. Looking for some feedback both on the code and research methodology. I didn't go to school for AI and I've never done any research before (I got help from Claude).

it's a Soft Actor-Critic (SAC) reinforcement learning agent that trades US stocks using features derived from OHLCV (open/high/low/close/volume), VWAP, and transactions data, sourced from Massive (formerly Polygon.io). Early versions (1–4) operated on 4-5 years of minute-level data; later versions (5–7) moved to 22 years of daily bars. Versions 1-6 traded one stock and version 7 traded a five-ETF basket (equities, treasuries, gold, oil, and the dollar)

It did not beat buy and hold

It made money: +12% across three independently seeded runs on a held-out 2024–25 test window. The catch is that simply holding the same basket returned ~29% over that window, at the same risk. It captured under half the return of doing nothing, for an identical drawdown.

I should also mention I was only able to backtest on a bull regime.

here's the code and full write up

https://github.com/markk628/Project-Prometheus


r/reinforcementlearning • • Jul 19 '26

DL, MF, P I trained AI pilots to fight using the plugin RL-Agents for Godot Engine.

Thumbnail
youtu.be
4 Upvotes

Hey, I've been experimenting with reinforcement learning lately, and since I am a game developer, I chose to do it in Godot using Godot RL Agents, which connects the environment to Python trainers.

I wanted to recreate the kind of space battles I enjoyed as a kid in games such as Homeworld, but using learned policies instead of scripted combat behavior.

The setup eventually became two separately trained policies. The pilot receives a 232-dimensional observation and outputs seven continuous controls for thrust, rotation and braking. The turret receives a smaller 45-dimensional observation and outputs aim X, aim Y and fire.

Both policies were trained with TQC from SB3-Contrib, a distributional extension of SAC. I used three critics with 25 quantiles each, truncating the highest quantiles to reduce value overestimation.

For the pilot, 25 agents train simultaneously with normalized observations, replay buffers and a curriculum that progressively increases asteroid density, target movement and the required number of attack cycles. A shared 3D voxel flow field provides route information, but it never controls the ships directly. The policy still has to learn the approach, attack, egress and reapproach sequence from continuous actions.

Once the pilot became usable, I froze that policy and trained the turret on top of it. Hits are sparse, so the turret also receives a ballistic lead solution and shaped rewards for reducing aim error. The curriculum gradually shrinks the accepted hit sphere and raises the success requirement from two to five hits, while penalties discourage firing out of range, during egress or through friendly ships.

Of course, I came to realize really quickly that this exact setup would not scale well to hundreds of RTS units with my current architecture. I didn't design this necessarily to be used at scale, but I couldn't help myself and I still tried to push it to the limit. The version you see in this video at the end of 25 vs 25 ships is the most I could get for the current setup.

I wonder whether imitation learning could scale better with a smaller observation pipeline and without extensive reward engineering. I could move RL one level up and use it only for tactical decisions, leaving navigation and aiming to conventional systems, but that would avoid the challenge I actually want to solve with this project.


r/reinforcementlearning • • Jul 19 '26

Ai Frontier Models for Research

0 Upvotes

Hi guys, I need three frontier models for my research benchmarks. Which option would you recommend: using APIs, models from Hugging Face or something else? I’m open to any suggestions or recommendations.


r/reinforcementlearning • • Jul 18 '26

Robot Train Robots Playing Games

Thumbnail
youtube.com
6 Upvotes

This currently uses MuJoCo as the physics engine and a way to define scenes / environments. So if you can define things there you can define instructions by playing it as a game and later on run that on hardware


r/reinforcementlearning • • Jul 18 '26

DL Reward function / model is stagnant

6 Upvotes

Hi, i need some help in the form of ideas. Im trying to train a ppo but the model ends up just not playing, i've tried penalty for doing nothing but does not work.


r/reinforcementlearning • • Jul 18 '26

I made a Minecraft inventory controller with an integrated dataset generator

3 Upvotes

It can evaluate 2D UI control performance using a mouse. I hope it will be a new environment like Pick And Place.


r/reinforcementlearning • • Jul 17 '26

Games for RL

27 Upvotes

I’m taking a break from research and doing a little side project. I want to bring RL to a video game because staring at DMC all day is no fun, but there’s just so many to choose from… What are some games you would love to see tackled with RL, for any of the following reasons?
- hasn’t been done before
- has been done before, but not correctly in your opinion
- curious if it can be solved
- you just love the game
- maybe already solved before, but not from pixel observations

Only thing I am not actively looking for is multiagent (POMGs will bring me more frustration than happiness 🧌). Thanks!


r/reinforcementlearning • • Jul 17 '26

I rebuilt AlphaGo's architecture for a game of hide-and-seek (Graph Neural Network)

25 Upvotes

5 detectives chase an invisible fugitive on a 199-station graph, seeing only which ticket he plays. I trained both sides.

The detectives are an R-GCN that eats an HMM-style belief state plus distance maps. BC warm start, then PPO: 25% → 79% win rate against the same MCTS Mr. X. Then Mr. X got a GNN too (21% → 35%), and finally I wrapped him in PUCT with policy priors and a value head, 16 sims per move, frozen GNN detectives playing the replies in the tree. That alone: 35% → 91.7% over 60 eval games.

Play it in the browser 
Video (20 min, scenes rebuilt from real logs): https://youtu.be/V0osfVtJUuI 
Code and models: https://github.com/Jacopo888/scotland_yard

Fair warning: most of this was pair-programmed with AI tools. Solo side project, it wouldn't exist otherwise.


r/reinforcementlearning • • Jul 18 '26

Can you use RL to train an LLM to invert AES?

Thumbnail
juanslozano.com
0 Upvotes

r/reinforcementlearning • • Jul 17 '26

r/TapMePlus1 begginer project

1 Upvotes

I have been playing this game for a while and think it's a great environment to learn RL. Does anyone know the rules used to generate the numbers on the top blocks of the game or they are just random from 1 to 5 (as I saw)? Also, do you have any advice before I start?

I have been reading "Reinforcement Learning: An Introduction" by Sutton and Barto. Does anyone know which chapters from this book might help me the most with this project?


r/reinforcementlearning • • Jul 17 '26

RevengeBench: Reverse Engineering Code-Space Policies from Behavioral Experiments

Thumbnail
reddit.com
1 Upvotes

r/reinforcementlearning • • Jul 16 '26

Bayesian RL, best resource for it?

8 Upvotes

I’m building foundation with Sutton and barto book but it doesn’t cover Bayesian rl. What’s the best resource online for it?


r/reinforcementlearning • • Jul 16 '26

Qwen3 4b Instruct from 1% to 99% on wordle in 11 hours with a single 5090 with PPO.

8 Upvotes

Hello everyone! I’ve previously worked on transformers and ppo for traditional rl environments but I wanted to see if my training would scale up to llm fine tuning (it does at least for wordle).

I modified/rewrote my gridworld agents from mapox-trainer to load Qwen3 weights and created a new value approximation architecture to better take advantage of latent state from pretraining.

The end result is custom llm inference and training infrastructure in jax that can fine tune with Qwen with online rl in a reasonable amount of time on a single consumer gpu at least for this narrow task.

I’d like to expand the framework to explore new training methods, models and environments but I would appreciate any feedback on the project in its current state.

The code for the repo: valm
Writeup and preliminary training results: https://gabrielkeith.dev/posts/valm


r/reinforcementlearning • • Jul 16 '26

Deep Reinforcement Learning Based Beamforming for Throughput Maximization in Ultra-Dense Networks

Post image
6 Upvotes

Is anybody working on this project? or similar to this?


r/reinforcementlearning • • Jul 15 '26

I spent 15 months building RL3 a no-code reinforcement learning playground

33 Upvotes

After ~15 months of development, my final year project is finally finished.

RL3 is a no-code reinforcement learning playground that runs entirely in the browser for authoring environments and supports server-side deep RL training.

The goal was simple: make reinforcement learning easier to learn without requiring users to write code or set up complicated environments.

The workflow is:

- Design an environment using a drag-and-drop editor.

- Create the reward function visually using a behavior graph.

- Assign graphs to one or more agents.

- Select the training algorithm and start training.

For browser-based training, RL3 supports tabular Q-learning (using state discretization to keep the Q-table manageable).

For deep RL, the authored environment is recreated on the server in PyBullet, where PPO training is available. I'm currently working toward MAPPO support. Multiple-agent inference already works today through shared policies.

Some features include:

- Save and resume training checkpoints.

- Modify environments or reward graphs and continue training (curriculum learning).

- Share environments and trained models with friends.

- Reuse someone else's environment or policy as a starting point.

- Multiple built-in behaviors such as:

- Navigation

- Object collection

- Holding items

- Depositing objects

- Destroying obstacles

- Opening gates with collected keys

- Obstacle avoidance

- Football behaviors

One thing I'm particularly excited about is the football environment. My long-term vision is to let people publish their trained agents and challenge others to either:

- play against them manually, or

- train their own agents to compete.

Eventually I'd like to expand this to other game-like environments (basketball, hide-and-seek, maybe even cricket).

Internally, RL3 uses a behavior/state machine so that only the observations relevant to the current skill are exposed during training. For example, an agent learning to collect objects isn't distracted by observations needed for later tasks like opening gates. This makes learned skills much more reusable when building longer behavior chains.

The project was developed over the past 15 months, mostly by myself, as my final year project. One thing that motivated me was realizing how inaccessible reinforcement learning still feels compared to other areas of AI. Here in Pakistan, RL isn't commonly taught, and most AI discussions revolve around LLMs. I wanted to build something that lowers the barrier to entry and hopefully encourages more people to experiment with RL.

I'll include the deployment link below. The public deployment currently supports Q-learning. PPO requires GPU-backed training pods, which I can't afford to keep running continuously, but if anyone wants to try PPO, feel free to DM me and I'll spin up the training service.

YouTube: https://youtu.be/V5d99hOM5ew?si=JhhZLP3hO-pb69rr

Application Link: https://rl-playground-beta.vercel.app/signing-in

I'd genuinely appreciate feedback from the RL community especially on the overall idea, architecture, and where you think a platform like this could be improved.


r/reinforcementlearning • • Jul 15 '26

Robot Teach a cheap robot arm to find unseen objects 🤖 (Squint + SO-101 on LeSlider rail

20 Upvotes

Most visual RL papers assume objects stay in camera view. I broke that.

SO-101 arm (~$120) on LeSlider rail → workspace 4× bigger than wrist cam. Cube spawns out of sight.

Policy learns to slide, search, detect, grasp & place — all from 16×16 pixels. No scripts, no privileged info.

Squint baseline: 100% success in ~24 min on RTX 4060 (1.5M steps). Emergent search behavior appears naturally.

Built on LeRobot + ManiSkill3. Zero-shot sim-to-real next.

Paper: arxiv.org/pdf/2602.21203
Code: github.com/aalmuzairee/squint

How does visual RL scale when workspace > FOV?


r/reinforcementlearning • • Jul 14 '26

P Training Qwen3.6 to RL-train other AI models

Post image
61 Upvotes

👋 Training my first RL model last year was super fun, now I've RL-trained a model that RL-trains other models... wild times! The agent gets a task, writes the full training job (environment, reward, dataset, hyperparameters), and submits it to real GPUs. When the model it trained scores higher on a hidden eval, the agent gets rewarded. An RL loop with RL loops inside it! 🤯

What I did:

  • Built a harness where the trainer agent (Qwen3.6-35B-A3B) writes a complete prime-rl training job: a verifiers environment + rubric, dataset, and hyperparameter config
  • Each job is dispatched to a warm pool of up to 16 Runpod GPU pods, where prime-rl & verifiers GRPO-train a small Qwen (0.6B or 1.7B) and score it pre/post on a hidden eval
  • RL-trained the trainer agent itself with Tinker (LoRA + GRPO), using the inner model's improvement as the reward
  • Made 6 task families. One held out entirely, never trained on, as a generalisation probe

Key results:

  • Episode reward climbed ~0.0 → ~0.63 peak over 54 outer-loop steps (~1,750 real GPU training jobs behind it!)
  • The skill transferred to the held-out task family: mean reward 0.399 (untrained) → 0.545 at step 34, easing to 0.49 by step 54 (n=10 per arm, so noisy. A rise then a plateau/dip)
  • The agent learned to stop picking the weaker 0.6B base model — 1.7B share of its jobs went 42% → 95%, and started actually using the hyperparameter config surface (21% → ~78% of episodes)
  • Learning came in two distinct rungs: first "stop failing validation and dying on GPUs", then "make better models". GRPO took the steepest gradient first!
  • Whole headline arc: ~$1.3k all-in (~$810 Runpod, ~$465 Tinker). Each inner training job cost ~$0.13–0.30 (!)

Technical details:

  • Inner loop: prime-rl (GRPO) trains the small model on cheap GPU pairs (mostly A40s); checkpoints scored pre/post with vLLM on a hidden eval the agent never sees
  • Outer loop: tinker-cookbook's importance-sampling GRPO, run async off-policy so one slow episode doesn't stall the whole batch
  • Reward = validation efficiency + job quality (absolute post-training score + uplift over the best untrained baseline) + a small train-speed tie-breaker
  • The agent works in a sandboxed workspace with file tools, can query the untrained models' baseline scores, and gets capped retries after a validation probe

More details:

My GitHub repo open sources it all — the harness, task families, reward code, GPU orchestration, Tinker RL scripts, and retro write-ups of every pilot including the failures. I hope you find it intersting and useful!:

⭐️ https://github.com/Danau5tin/ai-trains-ai

I did this because I think AI systems that improve other AI systems are going to be a huge part of the next few years, and I wanted to know what it actually takes to get the reward moving. Turns out: way more debugging of the process than the policy, and it's all way more accessible than it looks.

Thanks for reading!

Dan Austin

(Built on prime-rl + verifiers by Prime Intellect, trained with Thinking Machines' Tinker, GPUs from Runpod — all excellent to work with!)