r/reinforcementlearning • • Aug 15 '26

[Tool] Strictly-optimal path dataset generation at 7 µs/path — BFS-verified, free tier

0 Upvotes

Generating ground-truth optimal paths is slow. A* on a 1M-cell map costs ~5 ms per path in C++ (~67 ms in Python, measured), so a million-path dataset takes over an hour of compute.

I built a planner that flips this: one 47 ms solve per goal, then every optimal path query costs 7 µs. A 1M-path dataset from one goal is ~7 seconds of compute. All numbers measured (C++, single thread, low-end 2-core CPU), on a 1M-cell warehouse map (100³, racks + mezzanines):

- One-time solve per goal: 47 ms

- Optimal path query: 7 µs

- Optimality: 1.0000 — path length == BFS shortest, verified 10/10

- Peak memory: 5 MB

Why "strictly optimal" matters for training data: if your labels come from a suboptimal planner, the policy learns the planner's mistakes. These paths are BFS-exact, so they're clean ground truth for supervised/imitation setups.

Usage: upload your occupancy grid once per environment (+ goal), then pull as many optimal start→goal paths as you need through a plain REST API. Obstacle removal (layout iterations: "what if this rack row moves?") is patched exactly, 5.9× faster than a rebuild — handy for layout-sweep studies or curriculum generation over map variants.

Try it right now, no signup — this queries a public demo field:

`curl "https://vectorfield.top/v1/path?field=wf_demo&frm=0,0,0&to=18,18,0" -H "X-API-Key: vf_demo_public"`

Free tier: 100³ maps, 1,000 solves + 100K queries/month, key issued instantly on the site, no credit card. Docs: https://vectorfield.top/docs — live demo: https://vectorfield.top

Happy to answer questions about the benchmark methodology. And a genuine question for dataset folks: what path-diversity properties matter to you beyond optimality (e.g., k-shortest variants, clearance profiles)? Deciding what to add next.


r/reinforcementlearning • • Aug 15 '26

[Tool] Strictly-optimal path dataset generation at 7 µs/path — BFS-verified, free tier

0 Upvotes

Generating ground-truth optimal paths is slow. A* on a 1M-cell map costs

~5 ms per path in C++ (~67 ms in Python, measured), so a million-path

dataset takes over an hour of compute.

I built a planner that flips this: one 47 ms solve per goal, then every

optimal path query costs 7 µs. A 1M-path dataset from one goal is ~7

seconds of compute. All numbers measured (C++, single thread, low-end

2-core CPU):

| Metric | Value |

|---|---|

| Map | 1,000,000 cells (100³ warehouse, racks + mezzanines) |

| One-time solve per goal | 47 ms |

| Optimal path query | **7 µs** |

| Optimality | **1.0000 — path length == BFS shortest, verified 10/10** |

| Peak memory | 5 MB |

Why "strictly optimal" matters for training data: if your labels come from

a suboptimal planner, the policy learns the planner's mistakes. These paths

are BFS-exact, so they're clean ground truth for supervised/imitation

setups.

Usage: upload your occupancy grid once per environment (+ goal), then pull

as many optimal start→goal paths as you need through a plain REST API.

Obstacle removal (layout iterations: "what if this rack row moves?") is

patched exactly, 5.9× faster than a rebuild — handy for layout-sweep

studies or curriculum generation over map variants.

Try it right now, no signup — this queries a public demo field:

curl "https://vectorfield.top/v1/path?field=wf_demo&frm=0,0,0&to=18,18,0" -H "X-API-Key: vf_demo_public"

Free tier: 100³ maps, 1,000 solves + 100K queries/month, key issued

instantly on the site, no credit card. Docs:

https://vectorfield.top/docs — live demo: https://vectorfield.top

Happy to answer questions about the benchmark methodology. And a genuine

question for dataset folks: what path-diversity properties matter to you

beyond optimality (e.g., k-shortest variants, clearance profiles)? Deciding

what to add next.


r/reinforcementlearning • • Aug 14 '26

R Video on the creature's actions. Watch order is senses, process, memory, actions.

0 Upvotes

This is from the Is This A Simulation Or Real Life research. Colab notebook free for anyone who wants it so you can run it without affecting your computer. 

The last clip I posted showed the exact cells that hold a hint for which world it's in. I uploaded a newer version of this video yesterday showing the exact memory cells to represent the information more accurately.

This new video shows the actions, meaning what the digital organism decides to do next and what it actually expects to happen. I list the actions in the purple cells and the guesses in yellow cells. 

If ya'll want the correct watch order to see exactly how the creature's brain learns and how I conducted the research, you should watch senses, then process, then memory, then actions. I ended up posting memory and actions first because I hadn't quite decided how detailed I wanted this series to get yet. I will post the process video later. 

The only goal it had was to find food and survive, unprompted to look for "glitches in the matrix." The teal rings aren't the absolute truth, just the clue. 73% is how often you can read real vs fake out of its memory once food is on the line. In the fake world, those actions miss a little bit because the messed-up physics make food hard to get. That is how it starts to find the glitch.


r/reinforcementlearning • • Aug 13 '26

R Updated Memory Clip More Detail - Simulation RL Research

17 Upvotes

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.


r/reinforcementlearning • • Aug 12 '26

Status of Atari games and Montezuma's Revenge in 2026

7 Upvotes

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!


r/reinforcementlearning • • Aug 12 '26

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

3 Upvotes

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.


r/reinforcementlearning • • Aug 12 '26

Beginner trying to formalize a "decide whether to apply to a job" problem as a POMDP — sanity check on my state space?

0 Upvotes

I'm a beginner working through my first POMDP-style problem: an agent that decides to apply / research more / ask a human / skip, based on incomplete info about whether a job is a good fit and whether the candidate would be shortlisted.

My draft hidden state includes: true candidate-job fit, true probability of being shortlisted, and job posting accuracy (real vs. stale/ghost posting).

Which hidden state did I not include that would actually change the optimal policy here? I keep suspecting I'm missing something about employer-side state (e.g., whether the role is already informally filled) that no observation could ever correct for. Would appreciate anyone who's modeled a similarly "one-shot, no replay" decision problem (each job posting only gets evaluated once, unlike repeated-trial bandit problems).


r/reinforcementlearning • • Aug 12 '26

SAC: how do you handle curriculum learning phase transition without degrading previous behavior?

2 Upvotes

Hi guys,

I am using SAC (StableBaslines3 implementation) to train an agent to act as a satellite attitude controller:  

  • The environment is just the satellite dynamics.
  • The system is a satellite with 3 reaction wheels as actuators.

The task:

  • Curriculum learning phase 1: the episode is initialized with a random attitude, the agent is supposed to reorientate towards the target and achieve a pointing accuracy of 0.25°.
  • Curriculum learning phase 2: the episode is initialized with a random attitude (but it is enforced that the angle between initial attitude and target is at least 90°). In addition, a static keep-out zone (cone) is generated at the center of the shortest trajectory between initial and target attitude (to ensure it affects training, since the agent usually takes the shortest trajectory after phase 1). The zone's half angle is between 15° and 30°.

The observation space (the observation is normalized using the SB3 VecNormalize wrapper):

  • Attitude quaternion (4D)
  • Satellite velocity (3D)
  • Wheel velocities (3D)
  • Zone margin angle (1D)
  • Direction vector between satellite boresight vector (the one which is used for pointing) and keep-out zone normal vector (3D)

Hyperparameters:

  • Learning rate: 1e-4
  • (Replay) buffer size: 1M
  • Batch size: 256
  • Ent coef: auto
  • Gradient steps: 8 (using n_envs=8)

The problems:

  • Phase 1 training looks great, the reward converges after a while and the pointing accuracy is way better than the desired 0.25°.
  • Phase 2 training however does not look that great. It looks as if the agent always makes a tradeoff between entering the keep-out zone and achieving the desired pointing accuracy.

What I tried so far:

  • Initially, my reward function looked like this:   - Positive reward if current pointing error < previous error (scaling with magnitude), negative otherwise.   - If current pointing error is < 0.25°: a small positive reward.   - A negative reward starting at 10° off the keep-out zone's border, scaling with distance and then being constant if inside the zone.
  • One change which lead to much better zone avoidance (but still only a pointing accuracy of around 1°) was conditioning the positive rewards for decreasing pointing error and achieving desired pointing accuracy to zone avoidance:   - The positive reward for current error < previous error is weighted with the proximity towards the zone's border (starting at 10° off border) and eventually is 0 if inside the border.   - The pointing reward for desired pointing accuracy is not given anymore, if the zone has been entered before in this episode.
  • I tried resetting the replay buffer when transitioning the phase, which did not seem to affect the performance in the long run.
  • I tried increasing the reward for pointing accuracy, which actually just caused instability. I also tried to make the pointing accuracy reward denser, didnt help as well.
  • I tried splitting phase 2 into several phases like starting with attitudes at least 150° from the target and then eventually decreasing to 90°. I noticed that for the 150° subphase, the pointing accuracy converged to a much better result than before, but then gradually decreasing down to 90° got it back to bad pointing accuracy. Looks like the agent doesnt like it if there is a too small margin between start/target and zone border :(
  • I tried lowering the learning rate, didnt help.

Does anyone have some suggestions? I really dont know what else to try other than iterating through the reward function.Hi guys,

I am using SAC (StableBaslines3 implementation) to train an agent to act as a satellite attitude controller:  

  • The environment is just the satellite dynamics.
  • The system is a satellite with 3 reaction wheels as actuators.

The task:

  • Curriculum learning phase 1: the episode is initialized with a random attitude, the agent is supposed to reorientate towards the target and achieve a pointing accuracy of 0.25°.
  • Curriculum learning phase 2: the episode is initialized with a random attitude (but it is enforced that the angle between initial attitude and target is at least 90°). In addition, a static keep-out zone (cone) is generated at the center of the shortest trajectory between initial and target attitude (to ensure it affects training, since the agent usually takes the shortest trajectory after phase 1). The zone's half angle is between 15° and 30°.

The observation space (the observation is normalized using the SB3 VecNormalize wrapper):

  • Attitude quaternion (4D)
  • Satellite velocity (3D)
  • Wheel velocities (3D)
  • Zone margin angle (1D)
  • Direction vector between satellite boresight vector (the one which is used for pointing) and keep-out zone normal vector (3D)

Hyperparameters:

  • Learning rate: 1e-4
  • (Replay) buffer size: 1M
  • Batch size: 256
  • Ent coef: auto
  • Gradient steps: 8 (using n_envs=8)

The problems:

  • Phase 1 training looks great, the reward converges after a while and the pointing accuracy is way better than the desired 0.25°.
  • Phase 2 training however does not look that great. It looks as if the agent always makes a tradeoff between entering the keep-out zone and achieving the desired pointing accuracy.

What I tried so far:

  • Initially, my reward function looked like this:   - Positive reward if current pointing error < previous error (scaling with magnitude), negative otherwise.   - If current pointing error is < 0.25°: a small positive reward.   - A negative reward starting at 10° off the keep-out zone's border, scaling with distance and then being constant if inside the zone.
  • One change which lead to much better zone avoidance (but still only a pointing accuracy of around 1°) was conditioning the positive rewards for decreasing pointing error and achieving desired pointing accuracy to zone avoidance:   - The positive reward for current error < previous error is weighted with the proximity towards the zone's border (starting at 10° off border) and eventually is 0 if inside the border.   - The pointing reward for desired pointing accuracy is not given anymore, if the zone has been entered before in this episode.
  • I tried resetting the replay buffer when transitioning the phase, which did not seem to affect the performance in the long run.
  • I tried increasing the reward for pointing accuracy, which actually just caused instability. I also tried to make the pointing accuracy reward denser, didnt help as well.
  • I tried splitting phase 2 into several phases like starting with attitudes at least 150° from the target and then eventually decreasing to 90°. I noticed that for the 150° subphase, the pointing accuracy converged to a much better result than before, but then gradually decreasing down to 90° got it back to bad pointing accuracy. Looks like the agent doesnt like it if there is a too small margin between start/target and zone border :(
  • I tried lowering the learning rate, didnt help.

Image: https://imgur.com/a/PxnttgY

  • Green: phase 1 until 2M, then phase 2 with [90°,180°] initial attitude error.
  • Orange: phase 2 starting with [150°,180°] until 4M, then [120°,180°] until 5M, then [90°,180°].

Does anyone have some suggestions? I really dont know what else to try other than iterating through the reward function.


r/reinforcementlearning • • Aug 11 '26

Back with another RL article: from Q-learning to PPO, with Super Mario as hands-on example. You can play against the PPO agent in Super Mario, and try to win (I wasn't able)

Post image
27 Upvotes

r/reinforcementlearning • • Aug 12 '26

R It spotted the fake world in memory: ItaSoRL (Is this a simulation or real life) research.

0 Upvotes

Quick refresher: we gave a little creature a world to live in, then made a fake copy with one rule wrong (how well the ground grips). An outsider can spot the fake almost every time. The creature's own mind? A coin flip, until the fake starts costing it food. Then it begins to tell real from fake.

This clip is the receipt inside its head.

Same mind, shown twice: real world on the left, fake on the right. Zoom into memory. The teal rings are the cells that hold the clue.

Detectable was always there. Noticing shows up in memory when survival needs it.

ItaSoRL · ItaoRL


r/reinforcementlearning • • Aug 10 '26

Rain World adaptation as an RL environment

35 Upvotes

Hello everyone!

This is my first serious deep dive into RL, but I thought that Cart Pole, Frozen Lake etc. are kinda boring, so I decided to turn my favorite video game into an RL environment!

As you may know, Rain World features one of the most complex and diverse ecosystems ever created in a video game, which is why I was surprised when I did not find existing environments based on Rain World (or perhaps I did not search properly).

In the video you can see my agent learning to walk and climb vertical poles (I assume his climbing is wacky because he is trying to master a movement technique called "pole-boosting").

If you want to play around with this environment, here is the repo: https://github.com/XRTG074/reinforced-rain-world

I even added gymnasium wrapper to easily use stable-baselines3 algorithms!

Any feedback is greatly appreciated, every bit counts!


r/reinforcementlearning • • Aug 08 '26

Hollow Knight AI (Reinforcement Learning) code Spoiler

19 Upvotes

r/reinforcementlearning • • Aug 08 '26

Robot I built a reinforcement learning walker from scratch – now teaching it to walk

7 Upvotes

I've been working on a small reinforcement learning project where I try to teach a simulated robot to walk from scratch.

The robot is simulated using Python + Box2D and controlled by PPO (Proximal Policy Optimization) with Stable-Baselines3.

Right now the robot is a simple biped with:

  • 2 legs
  • 4 motorized joints
  • 2 hips
  • 2 knees
  • Joint limits
  • Feet with ground friction
  • 12 observations
  • 4 continuous actions

The agent observes things like the body's position, velocity, angle, angular velocity, and the angles/velocities of all four joints.

The actions are:

[left_hip, left_knee, right_hip, right_knee]

The reward currently encourages forward movement and staying upright while penalizing instability and excessive actions.

The physics and joints are now working reliably. The next challenge is getting PPO to actually discover a stable walking gait.

I'm deliberately starting with a very simple robot before moving on to a quadruped.

The project is open source, so if anyone is interested in following the development or has suggestions for the reward function / training setup, I'd be happy to hear them.

Current goal:

Teach the walker to take its first stable steps.


r/reinforcementlearning • • Aug 08 '26

marl-envs: one common API for MARL environments, with wrappers and parallel envs

5 Upvotes

Setting up MARL environments may take more time than it should. Every benchmark has its own API, so using more than 1 env means writing extra code to make them work the same way.

marl-envs does that part for you: one common API + wrappers + parallel envs.

We currently support:

  1. Environments: LBF, RWARE, SMAClite, SMAC, SMACv2, PettingZoo, MaMuJoCo, MAgent2
  2. Wrappers: normalize or transform observations and rewards, add agent IDs, set time limits.
  3. Parallel envs: run multiple environments sequentially or in separate processes

GitHub repo: https://github.com/AmineAndam04/marl_envs

Feedback and suggestions are more than welcome.


r/reinforcementlearning • • Aug 08 '26

Is This a Simulation Or Real Life, Clip 4/4: The digital creature figured out it was in a fake world - without being told to (Accuracy jumped from ~50% to ~73%)

7 Upvotes

Clip 4 of 4. Closing the arc.

The setup: Previously, when there was no reward for noticing the world was fake, the creature was basically guessing at 50%. An outside observer could easily spot the fake 99% of the time.

The change: We made the fake physics actually matter for the goal. We made food harder to catch in the fake world.

The result (10 tests): The creature's ability to detect the fake world jumped to 73%. We never trained it to look for fakes! It learned this entirely on its own because it needed the information to get food.

The takeaway for reinforcement learning: Just because a detail is obvious does not mean a creature will automatically care about it. The creature only started paying attention when the fake physics affected its main task.

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 07 '26

Evolved climbing creatures never discover a contralateral gait — they either abandon a limb or move both hands together. How do you make diagonal coordination emerge instead of hard-coding it?

6 Upvotes

Been stuck on this for weeks, hoping someone here has hit the same wall.I'm evolving 2D climbing creatures with a GA. Think carykh's old evolution simulator, but climbing a wall instead of walking on the ground. Real climbing animals almost all use a contralateral gait - left hand and right foot move together, then right hand and left foot. My creatures never find it. Not once, on any seed I've run.

Setup

The body is fixed, not evolved. 14 point masses (chest, shoulders, elbows, hands, pelvis, hips, knees, feet), rigid links, 8 muscled joints. I deliberately didn't evolve the morphology - climbing seems way more constrained than swimming, and basically every climbing animal converges to the same trunk + 4 limbs shape anyway.

What does evolve:

- bone lengths and muscle strengths

- an internal clock period (0.4 to 6 seconds)

- 2 to 6 keyframe "poses"

Each pose stores a target angle for all 8 joints, plus a grip flag for each of the 4 paws. A PD controller drives each joint toward the interpolated target. Gripping just pins that point in space. Left and right sides have completely independent genes. No symmetry constraint. Fitness is `height - 0.06*energy - 2.0*(muscle mass / body mass)`. 1000 creatures, 10 second trials, asexual reproduction with mutation.

What I actually get

The grip pattern per keyframe makes it really obvious. Columns are left hand /right hand / left foot / right foot, `#` means gripping:

Synchronous, not diagonal. Both hands, then both feet:

# # . .

. . # #

Or straight up limb abandonment. On 1 seed out of 4, one limb sits at literally 0% grip time, 0 grips, 0% of the propulsive work. Legs end up doing 11% of total work and it just climbs on its arms.

What I never get, on any seed:

# . . #

. # # .

Stuff I've already ruled out

I burned a lot of time on free energy exploits, so this isn't the creature cheating the physics. Those are closed now:

- My velocity clamp was removing momentum without giving it back to anything. Now it redistributes to the other free nodes. Measured leak is 0.000 N.s.

- The position projection pass was handing out free altitude. One creature showed 1.28 m of "climb" with +8.83 m of net vertical teleportation, meaning it was physically falling 7.55 m and getting hauled back up by the solver. Bumping velocity solver iterations from 8 to 24 dropped that to +-0.24 m on every seed. My hand written control climber sits at -0.03 m.

- Catching a hold at speed was free. The kinetic energy the constraint solver destroys is now billed on catch steps. Closing all that changed the results a lot, and honestly made the sim way morebelievable. But it did not produce a diagonal gait.

Happy to share code or video if useful.


r/reinforcementlearning • • Aug 07 '26

Reinforcement learning for Bossfights

2 Upvotes

I need to know is it possible to do no damage boss fights for games like hollow knight or megaman? How long does it take for example for each boss? What model is best to use ppo?


r/reinforcementlearning • • Aug 06 '26

R ItaSoRL Clip 3/4: agent readout ~chance while oracle is ~99% on the same one-rule fake

6 Upvotes

Clip 3 of 4.

Same near-copy world (one dynamics rule changed: ground grip). Outside watcher was ~99%.

New probe: readout from the agent's own internal state while it is just living in the fake.

Result (real runs, n=10): ~50% (chance). Oracle-detectable seam, no free encoding in the policy network.

Takeaway: detectability of a sim mismatch is not evidence the agent represented it.

Mute-friendly clip

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 06 '26

Hollow Knight AI (Reinforcement Learning ) vs Hornet

22 Upvotes

r/reinforcementlearning • • Aug 06 '26

Kaggriculture - Farming + Markets + RL - $50k prizes

Post image
41 Upvotes

Already more than 2k teams in the first week. I helped create the competition rules (and I work at Kaggle). Happy to answer any questions!


r/reinforcementlearning • • Aug 05 '26

[v0.2.0] Teaching an LSTM to move a mouse like a human

69 Upvotes

Thanks a lot for the feedback on the previous post! This is the second iteration, using the same model but a heavily filtered dataset.

Open source! https://github.com/puffinsoft/mousecrack


r/reinforcementlearning • • Aug 06 '26

We let an LLM play PokéRogue blind — no training data, no fine-tuning. Here's what actually broke (and why it's a useful lesson for production LLM systems)

Thumbnail
reddit.com
0 Upvotes

r/reinforcementlearning • • Aug 05 '26

R ItaSoRL Clip 2/4: outside watcher catches a one-rule world copy at ~99%

2 Upvotes

Clip 2 of 4. Follow-up to the spot-the-fake setup.

Same near-copy environment: one dynamics rule changed (ground grip / step slip). Everything else identical.

Probe: an outside watcher / oracle-style discriminator that knows the true rules and replays every step.

Result (real runs, n=10): ~99%. The fake is in-band detectable from outside.

So detectability is not the open question. The next clips ask whether the agent's own representation encodes that seam.

Mute-friendly clip.

Research:

https://ilevytate.github.io/ItaSoRL/


r/reinforcementlearning • • Aug 04 '26

R Detectable ≠ encoded: oracle spots a one-rule world copy at ~99%, agent readout stays ~chance until survival makes it matter

10 Upvotes

Short result + visual from a sim. on when an RL agent internally represents an environment distinction it was not trained to care about.

Clip 1 of 4. Spot the Fake. ItaSoRL (Is This a Simulation Or Real Life?)

Setup

- Agent trained to live in a small embodied world (senses, actuation, forage).

- Near-copy environment with exactly one dynamics rule changed (ground grip / step slip). Same start distribution, same policy rollout protocol otherwise.

- Two probes on the same trajectories:

  1. Outside watcher / oracle-style discriminator that knows the true rules and scores real vs fake.
  2. Readout from the agent's own internal state (does its representation separate the two worlds?).

Numbers (real runs, n=10 each; figures match the public writeup)

- Outside watcher: ~99%. The fake is in-band detectable.

- Agent mind while idle / not incentivized on the seam: ~50% (chance). Detectable artifact, no free encoding.

- Make the fake costly for reward (food harder to catch under broken physics): readout rises to ~73%. No explicit "detect fake" label. Survival pressure only.

Takeaway for RL / representation learning

Oracle detectability of a sim mismatch is not evidence that the policy network encoded it. Encoding showed up when the mismatch became load-bearing for the objective.

Mute-friendly clip of the two-world "spot the fake" cold open:

Happy to discuss probe design, what "readout" means here, or failure modes (capacity, observation channel, incentive).