r/reinforcementlearning

▲ 49 r/reinforcementlearning+1 crossposts

[P] The evolution of policy gradient methods as a chain of problems and fixes

My PhD was in RL, and something has bugged me for years: online tutorials mostly present these algorithms as a list. The evolution story (each algorithm patching the previous one's most painful failure) exists, but it's spread across a semester of lectures like CS285 or buried in the original papers. I couldn't find a compressed version that a newcomer could get through in one sitting, so I finally wrote it (with generous help from Claude to build the interactive elements and graphics)

It's a single-page, semi-technical walkthrough from the raw RL objective to GRPO. Math is deliberately sparse: the target reader is someone entering RL through the reasoning-model wave, not someone who needs the full derivations. The figures are interactive (variance of the REINFORCE estimator, a baseline slider, an on-policy collapse simulator, the PPO clip objective with adjustable epsilon, GRPO group baselines).

Interactive Link

Medium Link

I simplified in a few places to keep the narrative moving, most notably around GAE and the TRPO surrogate. I'd genuinely appreciate corrections or places where you think the simplification crosses into being wrong — the plan is to do the value-based lineage (Q-learning → DQN → Rainbow) next, so critique now improves that one too.

sreejithb.com
u/sreejithb — 16 hours ago
▲ 19 r/reinforcementlearning+1 crossposts

What are the best resources to get started with Reinforcement Learning???

I've been trying to get into rl for a long time but I don't see any good resources out there. help me out!

reddit.com
u/Jaded-Bus2966 — 19 hours ago
▲ 19 r/reinforcementlearning+1 crossposts

I built a reinforcement learning environment around Pokelike! Try to beat it!

Hey everyone!

I'm a data scientist and I've been pretty fascinated by reinforcement learning for a while. A few days ago my friends showed me Pokelike, a small Pokémon roguelike that runs in the browser. The first thing I thought was that it could be pretty fun to turn it into an RL environment.

So I did.

The repo is here:

https://github.com/pierpierpy/pokelike.xyz.bot

The idea is to run the actual game locally and expose its state and actions to an agent. There is no image processing involved. The bot gets the game state directly and decides what to do next. The agent has to make the decisions around the battles, like where to go on the map, which Pokémon to catch, which items to take, when to swap Pokémon and which moves to learn.

One thing I found interesting is that the map forces you to make some decisions quite early. Once you choose a node, the other nodes on that layer are gone, so deciding where to go can matter quite a bit later in the run. There is also a lot of information in the state that could potentially be useful, but I'm still not sure what the best way to represent it is.

I've already implemented a few basic RL agents. There is currently a Dyna-Q agent and two linear SARSA agents in the repo. The results are not amazing yet. On the current benchmark, random gets around 0.56 badges, Dyna-Q gets around 0.62, while the two SARSA agents get around 1.30 and 1.36. The two SARSA agents mainly differ in their state representation, with the better one using 100 hand-designed features instead of 81.

This is probably the part I'm most interested in at the moment. Finding a good state representation seems to make a pretty big difference, and the environment has some properties that make it a bit more interesting than I initially expected. The reward is fairly sparse, the action space depends on the current state, and some decisions only become useful several steps later.

At the same time, the environment is completely reproducible. With the same seed and the same actions you get exactly the same run. For the current leaderboard I'm using 50 fixed seeds, so different agents can be compared on the same games.

The interface is also intentionally pretty simple. You can basically implement a bot that takes the current state and returns an action. It doesn't have to be a specific RL algorithm either. You could try DQN, PPO, search, a hand-written policy, or pretty much anything else.

I'm still experimenting with the environment and the agents, so I'd be really curious to see what other people would try. In particular I'd love to see if someone can get significantly better results with a better state representation or a different reward function.

you can experiment with the environment with no efforts, just follow the guide and readme, setup the enrinvonment, experiment a bit and then if you like the result, you can create a pull request to the repo with your bot in the bots/ folder (everything is clearly explained in the GUIDE.md)

If you want to try it, everything is in the repo

https://github.com/pierpierpy/pokelike.xyz.bot

If you find bugs or have ideas for the environment, please let me know. I'm happy to make changes if there are things that would make it more useful for experimenting with RL.

The whole thing also runs offline. During setup it downloads the game and the required assets, and after that everything runs locally.

I originally started this because I thought it would be a fun little RL project, so I'm mostly curious to see how far people can push it.

u/Logical_Delivery8331 — 20 hours ago
▲ 54 r/reinforcementlearning+1 crossposts

If the weights never change, is it really recursive self-improvement?

https://preview.redd.it/e0ydm43a55kh1.png?width=2902&format=png&auto=webp&s=8c9b88ff5e4157811e8996ba5a1e96cc55c8ae6a

This paper is using a much narrower definition of recursive self-improvement than the phrase usually suggests.

AQuA stores validated evidence in a persistent research state that shapes later hypotheses. The underlying language model and evaluator remain fixed. I still find the narrower claim interesting, even if it sits closer to memory-augmented research automation than to a model rewriting itself.

The paper does not establish any weight-level capability gain. Is persistent memory that improves later research decisions enough to call a system RSI, or should the term require changes to the system’s underlying capabilities?

reddit.com
u/derspenti — 1 day ago

reinfors: an RL search/sampling engine in rust with caller-owned networks and training in python

I'd like to share reinfors, an open-source RL library that runs the engine in rust while the network and training loop remain ordinary python. Here is a quick overview, with full documentation available in the repo for anyone that's interested.

Motivation

During my own research, I found that existing open-source libraries did not offer the balance between modularity/composability and performance that I wanted. Python-first stacks are highly flexible but make simulation/search the bottleneck. Native frameworks (e.g. all-C++) keep the hot loop fast, but typically pull training into native code with it. Fully fused pipelines are generally the fastest, but their specialisation sacrifices flexibility.

Approach

reinfors is designed so that everyday use requires only python. Composing, training and evaluating never touch lower-level code. You compose an engine from the built-in games and algorithms, pass it an inference callback, and keep the network, optimizer and training loop as ordinary python code (pytorch, JAX, or anything else). Throughput-sensitive parts of the pipeline (simulation, search, episode orchestration, batch assembly) run in rust underneath. The engine pools inference requests across games and search leaves into numpy batches, so the python boundary is crossed rarely.

Does the python boundary cost performance?

This was my primary concern, so I ran some benchmarking experiments. I compared reinfors against an all-C++ libtorch implementation (OpenSpiel) on chess alphazero training, with the network, search budget and gradient intensity held equal. reinfors came out slightly ahead on throughput, and its trained agents performed slightly better in head-to-head games. Note that this was run on a single AWS instance (g5.2xlarge — one A10G GPU, four physical cores), so it is not a general claim, but it is evidence that the boundary need not cost meaningful performance. See link in repo README for details if interested.

What's in it today:

- Games — chess, backgammon, connect4, snake, gridworld, three poker variants

- Algorithms — alphazero, MCTS/treestrap, expectimax, minimax, DQN, PPO, CFR, Deep CFR, MCCFR

Current limitations:

- Fixed discrete action spaces only

- Sequential and simultaneous games only (no mixed-phase games that switch between sequential and simultaneous)

- The game/algorithm catalogue is still small

- New games and algorithms are written against rust traits (python is only for composing and training, not for defining new components)

I hope this may be useful for researchers wanting to experiment with the existing game/algorithm combinations (the examples should get you running quickly). For those comfortable with rust, the codebase is also designed to be extended. New games, policies and learners are written against small composable traits, and the extension guides should provide sufficient details.

Feedback and contributions are very welcome!

Repo: github.com/jeepjeepjeep/reinfors

reddit.com
u/jeepos — 1 day ago

DQN vs PPO/SAC for obstacle avoidance in CARLA

Hi everyone,

I’m working on a bachelor research project on using reinforcement learning for dynamic obstacle avoidance in the CARLA simulator.

My current setup is:

  • CARLA simulator
  • LiDAR observations
  • Raw 3D point cloud reduced to a 1D array of 360 minimum-distance values
  • Stable-Baselines3
  • DQN
  • Discrete action space with 36 steering/throttle combinations
  • Custom Gym environment
  • The goal is to avoid dynamic obstacles while continuing to drive forward

I chose DQN partly because my action space is discrete, but I’m interested in whether this was actually a sensible choice for this type of problem.

I’d especially appreciate feedback on these points:

1. DQN vs PPO/SAC

Given the 360-value LiDAR observation and discrete steering/throttle action space, would you consider DQN a reasonable baseline?

Would you expect PPO or SAC to have significant advantages here, and if so, why? I’m particularly interested in whether the continuous-action capabilities of algorithms such as SAC would actually be useful enough to justify changing the action space.

2. Reward design

How important is reward engineering in obstacle-avoidance tasks like this?

My main issue is finding a balance between rewarding forward progress and penalizing collisions/unsafe behaviour without encouraging unwanted behaviour such as simply stopping to avoid obstacles.

Are there particular reward-design principles or common failure modes I should be aware of?

3. CARLA and RL

For research into RL-based autonomous driving, do you consider CARLA a suitable environment, or are there other simulators/frameworks you would recommend?

I liked using CARLA but it was pretty heavy which made it so I didn't run as many training runs

Thanks in advance for any feedback or suggestions!

reddit.com
u/Super-Half-7013 — 1 day ago
▲ 1.3k r/reinforcementlearning+3 crossposts

A 150M param recurrent model scores 29.5% on ARC-AGI-1 at $0.0007 per task

Not a transformer. It's a recurrent latent reasoning setup that keeps "thinking" in latent space before answering. Sits completely outside the published cost/accuracy frontier for ARC-AGI, and something this size runs on basically anything. Paper is from the Pathway team, dropped 4 days ago. I want to see it scaled to 1-3B before getting too excited, but the shape of the result is wild.

arxiv.org
u/Balance- — 3 days ago

What do I need to do to get an internship in RL?

Hey guys,

I think people on this sub are incredibly capable and wise, I am very inspired by your projects. Therefore, I’d appreciate your tips so much.

I study robotics in Germany in masters, had theoretical courses in learning based control and reinforcement learning at a renowned technical university. I apply my theoretical knowledge in hackathons regularly, I also have my own projects with serial kinematics. I had a computer vision internship in robotics industry. I really want to gain industry experience in RL. Especially applied in fields such as construction, mining, where the work has positive contributions and impact on communities. I had completed an excavator policy optimisation project with ROS2 due to my interest. I get the impression that being accepted to a position is impossible and my efforts are not sufficient. What am I missing?

reddit.com
u/Alive-Opportunity-23 — 2 days ago
▲ 28 r/reinforcementlearning+1 crossposts

Got 6/7-DoF robot arms in Isaac Lab running reinforcement learning

We've been trying RL in Isaac Lab and adapted a SO-ARM100-based setup to two robot arms from AgileX Robotics: PiPER (6-DoF) and NERO (7-DoF). The current setup includes:

  • PiPER: end-effector reaching
  • NERO: reaching + cube manipulation
  • PPO-based training
  • 64 parallel simulation environments

The main goal was to get a quick RL workflow up and running for PiPER and NERO in simulation. Will be exploring sim-to-real deployment on the physical arms. Still a work in progress, but sharing it here in case it's useful for anyone. Feel free to drop your questions, glad to communicate.

u/Agilex_Robotics — 2 days ago
▲ 21 r/reinforcementlearning+1 crossposts

Screeps Reinforcement Learning

I haven't been playing the game for awhile, doing other programming things like machine learning instead. I've learned a lot, especially from Kaggle challenges, and decided to try my hand at a machine learning in Screeps.

Code link: https://github.com/CarsonBurke/xxscreeps/tree/main/samples/rl

First, I pretrain the model on my bot, behavioural cloning so it just tries to copy what the bot does using a bunch of data I collected running it. It can perform all kinds of actions but isn't very efficient or directional.

Then I do reinforcement learning on it. I reward it for harvesting and upgrading and expect the rest to be emergent, which sort of happens. It gets really good at harvesting and upgrading, does stationary harvesters and hauling really well, but also learns to stop building eventually. The rollouts are too short that it doesn't end up seeing the benefits of building. Regardless, I'm happy with the results given my budget.

To get more technical, it's a ~1.5M parameter model with a ViT over patches room tiles (terrain, sources, controller) and entity transformer for the entities (creeps, spawns, towers) each getting a head that outputs actions for the entity. Inspired somewhat by AlphaStar, though I figured autoregressive actioning and temporal recursion would be too expensive for marginal benefit, so I skipped them.

Then a separate 1.5M parameter model critic where I take a VAPO style approach of making the critic Monte-Carlo so it can get signal from the whole rollout for itself and also the actor's advantages. It hurts learning speed a bit, but makes it so the model can learn from very far out returns.

xxscreeps allows me to do really fast parallel rollouts. I think I did 12 games at once for 512 steps, each taking under a couple seconds. If I used the normal screeps engine it would have taken days to train. This partly avoids the immense parallelism that Ben had to do in his approach.

There were a lot of compromises to get it training fast on my single RTX 5090. If I had a bigger budget I would have done longer rollouts to allow it to build and explore more game features. It should be able to claim, colonize and expand too. Maybe a project for someone with more resources than me.

Thanks to Ben for the inspiration!

youtube.com
u/MarvinTMB — 2 days ago
▲ 16 r/reinforcementlearning+5 crossposts

how to SIMULATE a function calling dataset!

hi everyone!

i want to share with you a little project i created a few months ago to solve a problem i was having with function calling. whenever i needed a good quality and specific dataset to train my models on function calling i couldn't find a good repo for generation. i wanted a dataset that teaches the model not only how to call the tool but also when, in different contexts. i also wanted to have maniacal control on the results, i wanted to control how many tools in each convo, when the tool is called, errors in tool callings and in particular i wanted something that was flexible enought to include *PERSONALIZED* tools with personalized mock answers!!!

for example you can find some tools i made for the sample below in the repo under

>synthfc/tools/eng

and

>synthfc/tools/ita

i also wanted a way to check the results and auto-correct the pieces of data that have problems. here is the repo:

https://github.com/pierpierpy/FC-synth

here some examples i created with an open source model:

https://huggingface.co/datasets/pierjoe/function-calling-synthetic-2000

hope you find it useful!

happy tool calling!

u/Logical_Delivery8331 — 3 days ago
▲ 23 r/reinforcementlearning+1 crossposts

"Inside the Google executive moves that led to its big AI reshuffle" (Jeff Dean & Demis Hassabis out; Koray Kavukcuoglu up; Gemini uber alles)

reuters.com
u/gwern — 2 days ago

nanoRL: one RL training loop that scales from a laptop CPU to a GPU cluster.

https://github.com/alex000kim/nanoRL

nanoRL is the smallest async RL trainer I could write:

the same disaggregated trainer/worker setup that runs on 16 GPUs runs as two pods on your

laptop.

~1,800 lines across 7 files, no Ray, TRL or DeepSpeed.

u/alex000kim — 3 days ago

RL-based yaw control for suspended payloads — feedback wanted

I’ve been developing a yaw control system for suspended payloads using reinforcement learning.

Four thrusters are mounted on the suspended platform, and an SAC policy controls them at 3 Hz. Payload yaw is estimated from a camera mounted on the platform.

I started with a fixed 90° target, then extended the controller to variable targets from -90° to +90° in 5° increments. I trained separate policies for three payloads: an H-steel beam, a plate, and a truss.

One interesting result was that larger target angles were not necessarily harder to control. I also found that the learned use of thrust differed considerably between payloads. The H-steel policy tends to use relatively low average thrust with short high-output bursts, while the truss uses higher thrust more continuously.

I also modified the training/reward design to reduce unnecessary thruster output after reaching the target.

The whole system runs at 3 Hz on a Raspberry Pi, using ONNX models for both yaw estimation and control.

The attached video shows the truss payload controlling four target yaw angles (-90°, -45°, +45°, +90°) simultaneously.

Project results and videos:
https://rindajones.github.io/payload-yaw-control/en/

I’m particularly interested in criticism from people working on robotics or control:

  • Would you approach this problem with RL at all?
  • What disturbances or dynamics would you consider essential for the next step?
  • What would you want to see before considering this relevant to a real suspended-load system?

Any criticism is welcome.

u/Alarming_Engineer267 — 4 days ago

Some help seriously needed. Don't know why this is happening

Task: Grab the object, lift it up to a certain height.

I am a newbie in reinforcement learning.
I learned all the basics regarding the Q Learning Deepq Learning and Soft actor critic policy. I designed the reward system (Didnt code the entire thing by hand. Rather, give the conditions and asked ChatGPT to design the reward system)

Collected the BC data by myself But most of the data was actually idle frames, because initially I was not aware how it was going to work So I had to take one out of five frames.

I dont know why it is not giving me the optimum result. I dont know where it is lacking. I mean, if it is following up till that much Then why is giving the unexpected behaviour anyways?

Also, when it is Raising the hand up the hand is automatically opening, even though there is a reward specifically designed, so that the hand should be closed

##########
If someone is going to start with a humanoid hand, I just guessed that this is the beginning part where everyone is going to start anyways. Hence, I thought someone can point out, what is the specific error happening here

u/EnvironmentalPin4736 — 5 days ago

Distributional DQN implementation

Hi all, my studying area is traffic engineering in networks and I'd like to develop my DQN-GCN code with distributional DQN but it seems there are a lot of options such as C51, QR-DQN etc. . Do you have any suggestions to see and understand problem & variation mapping before starting the implementation? Sure, AI tools suggest some but I prefer your advices more than AI tools.

Thanks!

reddit.com
u/ImaginaryEbb6489 — 4 days ago
▲ 30 r/reinforcementlearning+1 crossposts

I turned my master's thesis on RL obstacle avoidance into an open-source manipulator toolkit — it's peer-reviewed now and just hit v1.4

So, a bit of self-promotion here, but I suspect a lot of you might have run into the same integration headache I did with my project.

My thesis was all about using reinforcement learning to keep robot arms from hitting those tricky kinematic singularities. The challenge? The obstacles were moving around unpredictably. To even get to the training phase, I needed a fully connected system: from the URDF model all the way through kinematics, dynamics, planning, control, simulation, and perception. The idea was for the AI agent to see a real obstacle and react based on an actual dynamic model, not some simplified version.

And honestly, nothing out there really covered that whole spectrum. You've got MoveIt for planning, sure, but integrating sensors meant building custom ROS nodes from scratch, and there was no GPU acceleration. Pinocchio is impressively fast, but it's CPU-only, and you're left to figure out how to sync perception and planning yourself. CuRobo offers GPU planning and collision checking, but you're on your own for the perception pipeline and closed-loop control. The Python Robotics Toolbox is great for learning the algorithms, but simulation, control, and vision are up to you.

So, before I could train a single AI policy, I had to build that integration layer. That's what eventually became ManipulaPy, with its SerialManipulator and ManipulatorDynamics classes forming the foundation for everything else in the library.

After my thesis was done, I submitted the code to the Journal of Open Source Software. What really surprised me was how much the review process actually improved the project. JOSS doesn't just check if the code runs; they require a genuine commitment to maintain it. That commitment is what kept it alive after I graduated, instead of it ending up like so many other thesis repositories that just fade away.

Where it stands now – it's been peer-reviewed and published in JOSS (October 2025), and we just shipped version 1.4:

*   The same kinematics and dynamics code now works with NumPy, CuPy, PyTorch, or JAX, all accessed through a single API. Plus, you get real automatic differentiation gradients with PyTorch and JAX.
*   It comes with 25 robots out of the box – UR, Franka, Kinova, KUKA, Fanuc, ABB, xArm, Robotiq – you can just load them by name, no need to mess with ROS workspaces or mesh files.
*   It has a native URDF parser that handles `package://` paths and works even if ROS isn't installed.
*   It integrates with PyBullet for simulation, and we've got CUDA trajectory kernels that automatically switch back to the CPU when the batch size is too small to make using the GPU worthwhile.

You can grab it with pip install ManipulaPy. Here are the links: Repo, Docs, Paper. It's under AGPL-3.0.

Genuine question for this community: for those of you working with robot arms, is that integration layer still the part you end up rebuilding every single time? I'm curious if this is a common problem or if it was just specific to my setup.

u/boelnasr — 5 days ago
▲ 4 r/reinforcementlearning+1 crossposts

Modeling a caregiver-escalation decision as a POMDP — sanity check from an RL beginner

Hi everyone — I'm a complete beginner working on a small project: an agent that decides whether to remind, wait, or notify a caregiver when someone hasn't responded to a medication reminder. The true state (fine but busy, asleep, phone dead, actual emergency) is hidden, and I only get noisy signals like elapsed time and response history.

I've been framing this as a POMDP — belief state over hidden states, updated via Bayesian filtering, with an escalation policy mapping belief → action.

Given the asymmetric costs (missing a real emergency vs. a false alarm), does POMDP even make sense here, or is this overkill for what could be solved with a simpler heuristic/threshold approach? Would appreciate any pointers or papers on similar "when to escalate" problems under uncertainty.

reddit.com
u/Tech_Tracker719 — 8 days ago

Updated Memory Clip More Detail - Simulation RL Research

I updated the animation from yesterday to show the exact locations where the memory "cells" show up from the actual study's results. This is from the "Is This A Simulation Or Real Life" research, where I wanted to see what it would take for a digital organism to tell if it was in a fake world, unprompted, meaning it was never explicitly told to look for "glitches in the matrix." The only goal it had was to find food and survive. When physics messed with the creature's ability to get food, it started to create the idea that something was not right in the environment it was in. If ya'll wanna' run the sim yourself I built a Colab notebook you can run in the cloud without worrying about hardware restrictions.

u/LevyTateLabs — 7 days ago

Status of Atari games and Montezuma's Revenge in 2026

Hello. Is somebody well acquainted with the status of Montezuma's Revenge and Atari games generally in 2026? Most of the information comes from 5 years ago. It seems that in the past there were many doubts about the level of using the domain knowledge, imitation learning etc. Are there any obvious milestones still to be achieved?

Be well!

reddit.com
u/Careless-Bit-3181 — 7 days ago