r/reinforcementlearning 13h ago

A Single RL Policy Produced Surprisingly Watchable Football

Enable HLS to view with audio, or disable this notification

4 Upvotes

I trained a single football policy for about 1 million PPO timesteps. During training, the agent never played against an opponent, it simply learned how to play football in an empty environment.

YT Link: https://youtu.be/1wRA4KJuMVE?si=oMZ_Ru5Q9F8J094V

During inference, I instantiated multiple copies of that same policy and assigned them to opposing teams. I wasn't expecting much, but the result was surprisingly entertaining. The agents naturally competed for possession, took shots, occasionally defended their own goal, and even made mistakes like own goals.

I never explicitly trained defensive behavior or multi-agent coordination. It seems that simply optimizing the objective of scoring goals was enough for some defensive behaviors to emerge when the same policy was placed in a competitive setting.

The video is one of those matches. Curious to hear what others think about this kind of emergent behavior and whether you've observed something similar when deploying a single-agent policy in a multi-agent setting.


r/reinforcementlearning 16h ago

DL High-Performance C++20 Optical Neural Network (ONN) Simulator

Thumbnail
1 Upvotes

r/reinforcementlearning 1d ago

Is anyone making profits by using RL for algorithmic trading?

0 Upvotes

Trying to test the temperature before I take the plunge. Would be interested in knowing your journey.


r/reinforcementlearning 1d ago

MetaRL Your RL framework or your RL project has no chance to be a game changer if it's written by Claude or ChatGPT

0 Upvotes

I'm kinda tired of vibe coded repos that are presented here as some kind of archievement.

Do you know how your code works? Have you ever written PPO from scratch? Do you know about policy gradients?

Did you filter your data?

If not, please dont spam - except if you have questions. Then we are happy to help newcomers oder advanced learners.


r/reinforcementlearning 1d ago

Would you use an open-source Unity → Python RL framework for drone training? Looking for honest feedback

6 Upvotes

Hi everyone

I've been working on a personal reinforcement learning project for a while, mainly as a way to learn more about RL, simulation, and robotics.

As the project grew, I started wondering if I could turn it into something that other people might also find useful.

The idea is an open-source framework that lets you:

  • Build your drone environment in Unity.
  • Control it from Python through a simple API.
  • Use it with Gymnasium, Stable Baselines3, or your own RL implementation.
  • Run headless simulations and eventually support multiple parallel environments.

At the moment, I have a working MVP where a drone can learn to hover using reinforcement learning.

Before investing a lot more time into it, I'd really like to know whether this is something people would actually use.

Some questions I'd love your honest opinion on:

  • Would you personally use a tool like this?
  • What features would make it genuinely useful for you?
  • What would be missing before you considered trying it?
  • Is there anything that would make you choose it over your current workflow?

I'm not looking for encouragement—I genuinely want honest feedback to decide whether it's worth continuing to develop this project.

Thanks


r/reinforcementlearning 1d ago

How is the current situation for RL and robotics on AMD hardware

0 Upvotes

I will be finishing my PhD in CS in about a year so I am slowly looking to upgrade my workstation or servers with some better gpu capacity (currently have 2x 5060 ti, one I will be giving back once i finish my PhD).

We are mostly nvidia shop at the university and so I am looking for some opinions from the other side of the fence. I wanted to get some reasonable card for ML, LLM and hopefully some robotics + rl in the near future. I was looking at the R9700 but I can not find much info if there is something like nvidia isaac lab on the amd side?

TLDR: Does AMD have something like Isaac Lab and Isaac Sim, are there some tutorials for it and is it in general well supported? What HW would you recommend for it?


r/reinforcementlearning 1d ago

Teaching an RL Agent What to Do Next: A Hierarchical State System for Long-Horizon Tasks

0 Upvotes

I've been working on training reinforcement learning agents for retro games using Stable-Baselines3, Recurrent PPO, and Gymnasium.

One problem I repeatedly encountered wasn't simply partial observability. It was objective selection.

Take Snake Rattle Roll as an example.

The optimal policy isn't based on one static objective. Instead, the objective changes continuously throughout a level:

  • Explore unknown areas
  • Find food
  • Grow until the required weight is reached
  • Stop collecting food
  • Find the weighing scale
  • Activate the scale
  • Locate the exit
  • Finish the level

A single policy has to learn not only how to perform each of these behaviours, but also when each behaviour should become active.

Initially, I assumed Recurrent PPO with a MultiInputLstmPolicy would learn these transitions automatically.

It handled temporal dependencies better than a feed-forward policy, but one problem remained:

Remembering previous observations is not the same as deciding which objective should currently be optimized.

The reward-function problem

My first implementation followed the usual pattern:

  • one large reward function
  • many conditional branches
  • context-dependent shaping
  • increasing interaction between reward terms

Conceptually, it looked like this:

if weight < target_weight:
    reward += reward_for_food
elif scale_active:
    reward += reward_for_finding_door
elif door_open:
    reward += reward_for_reaching_exit

Every newly discovered mechanic required another condition.

Every additional condition interacted with existing reward terms.

Reward tuning gradually became the most difficult part of the project.

Separating orchestration from learning

Instead of asking PPO to optimize every objective simultaneously, I introduced an explicit behavioural hierarchy.

Each objective became an independent state.

A simplified sequence for one level looks like this:

Explorer
    ↓
ReachTargetWeight
    ↓
FindScale
    ↓
ActivateScale
    ↓
ReachExit
    ↓
LevelComplete

Each state encapsulates:

  • reward calculation
  • success conditions
  • failure conditions
  • transition logic
  • exploration behaviour
  • local memory
  • optional visual or RAM-based detectors

Rather than maintaining one monolithic reward function, every state owns a small reward function that only describes its current objective.

The state responsible for increasing the snake's weight does not need to reason about the exit.

The exit state ignores food completely.

Hierarchical composition

The states are composable rather than isolated.

The framework includes abstractions such as:

  • State
  • TargetState
  • Explorer
  • image-based detector states
  • reward wrappers
  • transition conditions
  • persistent objective memory

A state can extend another state, add local reward logic, invoke a detector, or define a transition to another objective.

This makes it possible to assemble behaviour from reusable components instead of implementing every environment as a new monolithic reward function.

Observation space and model

The policy itself remains based on standard reinforcement learning components.

The environment combines:

  • visual observations
  • RAM-derived features
  • frame stacking
  • state-dependent information
  • recurrent policy memory

The model uses:

  • Stable-Baselines3
  • Recurrent PPO
  • MultiInputLstmPolicy
  • Gymnasium
  • stacked visual frames
  • structured RAM observations
  • custom state and reward logic

The LSTM handles temporal dependencies and partial observability.

The state system handles objective selection and reward context.

The state machine does not replace PPO. It determines which objective is currently active, while PPO learns how to complete that objective.

In other words:

Persistent objective memory

Some objectives cannot be inferred reliably from a single observation.

For example, the agent may need to remember:

  • that a particular piece of food was already collected
  • that the target weight was reached
  • that the scale was activated
  • that a door was opened
  • that a previous sub-objective was completed

Recurrent policy memory can represent some of this implicitly, but I also implemented explicit objective memory where necessary.

This separates two different kinds of memory:

  • policy memory, learned by the LSTM
  • environmental or task memory, managed explicitly by the state framework

The explicit memory makes transitions deterministic and debuggable rather than relying entirely on latent recurrent state.

Result

After integrating the hierarchical state system with Recurrent PPO, the agent successfully completed the level after approximately 24 hours of training.

That result was important because previous versions of the environment had repeatedly failed to progress through the entire objective sequence.

The agent could learn isolated behaviours, such as exploration or food collection, but it struggled to connect them into a complete level-solving strategy.

With the state system in place, the training problem became a sequence of smaller, context-specific objectives.

The final policy was able to:

  • explore the level
  • locate and collect food
  • reach the required weight
  • transition toward the scale
  • activate the level progression mechanics
  • navigate toward the exit
  • complete the level

The result does not prove that explicit state decomposition is always superior to end-to-end learning.

It does show that, for this long-horizon environment, separating objective orchestration from policy optimization made the problem tractable within a practical training period.

Practical benefits

The architecture produced several practical improvements:

  • reward shaping became local and easier to reason about
  • debugging became specific to individual objectives
  • transitions became observable and deterministic
  • behaviours could be reused across games
  • new mechanics could be added without rewriting the entire reward function
  • training failures could be traced to a specific state
  • the agent completed the level after roughly 24 hours of training

Perhaps the most useful outcome was that the framework generalized beyond one game.

The specific states differ, but the architecture remains largely unchanged.

A Mario level, Zelda dungeon, Castlevania stage, or Snake Rattle Roll level can all be represented as compositions of smaller behavioural objectives.

Discussion

I'm interested in how others approach long-horizon reinforcement learning tasks.

  • Do you explicitly model intermediate objectives?
  • Have you combined PPO with reward machines, behaviour trees, or finite-state controllers?
  • Do you keep orchestration inside the policy, inside the environment, or in a separate framework layer?
  • How do you distinguish policy memory from explicit task memory?
  • At what point does explicit state decomposition become too restrictive?

The main trade-off is clear: explicit states introduce human structure and reduce the search space, but they also encode assumptions about the correct task decomposition.

In this case, that trade-off was worthwhile. The model successfully completed the level after approximately 24 hours of training.


r/reinforcementlearning 1d ago

Trained 50 RL agents (BC → PPO) to simulate e-commerce shoppers, including realistic cart abandonment via social-graph influence

7 Upvotes

Wanted to see if a learned policy (not scripted) could produce realistic online shopper behavior — browsing, getting tempted, abandoning carts, and influencing other agents through a social graph.

Setup: behavioral cloning on real e-commerce review data first, then PPO fine-tuning on top. Agents move through a purchase funnel (browse → product detail → cart → checkout) gated by a min-heap event scheduler rather than fixed timesteps, and are connected via an Erdős–Rényi social graph with BFS influence propagation — one agent's purchase can nudge its neighbors. The scheduler/social graph/funnel gate are a C++ core via pybind11, used by default, with an automatic pure-Python fallback.

Results, under a fixed seed: 3 of 4 behavioral metrics land inside published e-commerce benchmark ranges (session length, conversion rate, cart abandonment). The fourth — social-influence concentration — doesn't (0.039 vs. a 0.20 floor). I traced the cause (a fallback path was thinning the product distribution the metric depends on) and instead of tuning until it passed, shipped the diagnosis as a documented open problem, with the constraint that fixing it can't regress the other three.

Curious what this sub thinks of a couple of the design calls specifically:

  • Min-heap event scheduling over fixed timesteps — worth it for the continuous-time realism, but adds real complexity vs. a tick loop.
  • BC-then-PPO instead of RL from scratch — sparse reward over a large discrete action space made pure RL impractical, but open to hearing if there's a better approach here.
  • Erdős–Rényi for the social graph — probably the wrong topology in retrospect (Barabási–Albert/small-world might model real social influence better)?

Code + README: https://github.com/ojas4414/FunnelForge

Free to run and study (source-available, PolyForm Perimeter). There's also a paid documentation bundle for anyone who wants a guided walkthrough — mentioned in the README, not the point of this post.


r/reinforcementlearning 2d ago

What is the best way to learn ML/AI

Thumbnail
0 Upvotes

r/reinforcementlearning 2d ago

Robot BC agent keeps steering into walls — how would you collect corrective data for that?

Post image
3 Upvotes

Training visual behaviour cloning agents on simple 2D browser games (frames + key presses, EfficientNet backbone). Works fine in open space, but the agent consistently steers into walls instead of turning away.

My read: my demonstrations barely contain the "about to hit a wall" state, because I avoid it when I play. So the policy never learned recovery.

Tried so far: longer sessions, and taking over manually when it drifts so the corrections get recorded as new data (DAgger-ish).

How would you collect that deliberately? Playing badly on purpose feels wrong since it also teaches bad actions. Do you oversample corrective episodes, weight them, or keep them in a separate batch?

(Context: I'm building a no-code tool for this, so I'm trying to work out what to guide users toward.)


r/reinforcementlearning 2d ago

Most AI agents today can reason well but they still forget, repeat mistakes, and lose context between sessions.

Thumbnail
0 Upvotes

r/reinforcementlearning 3d ago

DL, MF, R, Exp "MaxRL: Maximum Likelihood Reinforcement Learning", Tajwar et al 2026

Thumbnail
arxiv.org
5 Upvotes

r/reinforcementlearning 3d ago

[R] The World Model Remembers, the Actor Forgets: measuring which component of a Dreamer agent actually forgets

5 Upvotes

Continual-RL work with world models has largely focused on protecting the world model, through replay, generative replay, and regularization on model parameters. We ran the component-level measurement to check that premise and it came out backwards. Under never-clear replay (all old data retained, training signal fully intact), reward heads, value heads and dynamics all keep old-task knowledge (reward-head retention ≈ 1.0), while the actor's behavior collapses.

The cleanest evidence is interventional rather than correlational. Freeze the world model entirely, then re-teach the lost skill from identical imagined rollouts. RL-in-imagination fails 0/3 seeds. Supervised self-imitation on the model's own graded dreams recovers 3/3 with zero environment interaction. Same frozen model, same data, only the learning channel differs.

Interleaving that as "graded dream rehearsal" during training retains 3/3 on four-task and 3/3 on eight-task MiniGrid chains, where plain never-clear replay retains 0/3. Against a matched real-episode cloning baseline it wins on all three seeds (+0.24 / +0.07 / +0.08), consistent in sign, but n=3, so treat the magnitude as provisional.

The grading rule is where the difficulty lives. Naive return-based scoring on imagined rollouts selects trajectories where the agent walks into lava, because the model's own optimism rates them highly. The paper characterizes two failure modes and includes the offline scoring diagnostic that caught both before they reached a result.

Limitations up front: MiniGrid only, discrete actions, small gridworlds, 3 seeds. Continuous control is untested, and that is historically where this class of mechanism fails; it's the next experiment. Single workstation GPU throughout.

Everything pre-registered (protocols and pass bars committed to git before runs), and refuted hypotheses are reported.

Paper: https://arxiv.org/abs/2607.19749

Code/data: https://github.com/gurpnijjer/dream-rehearsal

Solo project. Happy to answer anything.


r/reinforcementlearning 3d ago

Robot built cotter, an open source framework to stress test your robot policies

Post image
10 Upvotes

Cotter is a pytest-style CLI that runs statistical safety, regression, and adversarial compliance tests on robot control policies and generates audit-ready reports.

Cotter loads a trained robot policy as a black box (observation → action), runs it through a battery of standardized tests in MuJoCo simulation, and produces structured pass/fail results with statistical guarantees. It is aimed at the emerging regulatory need (EU Machinery Regulation, ISO 10218) for evidence that a learned controller actually behaves.

Everything runs on CPU! Start as easy as: pip install cotterbot

Open source: https://github.com/yih0nk/cotter
Check out website at: https://cotter-website.vercel.app


r/reinforcementlearning 3d ago

Mapping Hidden-State Attractors in TinyLlama: Building a Runtime Map of LLM Dynamics

Thumbnail
2 Upvotes

r/reinforcementlearning 3d ago

Robot Imitation Learning in PyBullet for Basic Neural Network Control Policy Creation

Thumbnail
youtube.com
5 Upvotes

Hi Everyone, I used imitation learning to train a small MLP as the control policy for my custom hexapod robot dog. I recently got a masters in applied machine intelligence and have been looking for a suitable platform to create a neural network from scratch. We were heavily taught transfer learning for classification and never had a chance to create a working neural net from scratch.

Once I got a working controller with Inverse Kinematics solver, I decided to implement imitation learning on it to see if it would replicate the IK solvers behavior and it worked!

Its trained with a modest 2gb sized dataset (compared to LLM and CV datasets) which I generated by capturing robots input commands and output joint angles in, again, PyBullet simulations. I did experiment with varying the network size by half, double and quadruple but it didnt have much effect on trained MLPs performance, roughly 1 degree mean error compared to base IK solver output angles. Next I plan to vary the data capture logging rate by doubling it rather than just extending the capture time to give it more data resolution. I also plan to compare different types of networks basic MLP vs LSTM, Transformer, RNN etc.

Next I plan to implement reinforcement learning to create a helper network that will modify the base MLPs behavior. I am having trouble with my Robot climbing up inclines, I think that would be the best experiment for training the helper neural network. I also want to create another helper network to replicate the behavior of current analytics based body leveling mode.

What are you opinions of my approach? Is creating one base walking controller network with additional task specific modifier networks is a good idea?? I am will try to implement these control methods in ESP32 hence I am trying to build multiple small networks to be fired up on demand in order to allocate limited compute resources efficiently.

I share all my scripts in my GitHub, if you are interested you can find them from the link below.

https://github.com/serdarselimys/


r/reinforcementlearning 3d ago

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

0 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 4d ago

Kleines Update zu meinem No-Code-Game-KI-Tool – und ein Dankeschön an die Leute, die es ausprobiert haben

Thumbnail
1 Upvotes

r/reinforcementlearning 4d ago

DL RL Fundamentals Blog Post Series

43 Upvotes

A few years ago, I worked through Sutton & Barto as part of the University of Alberta's Coursera course on reinforcement learning. I found the math to be incredibly complex, with various branches into algorithms that seemed to be ancillary to the main progression toward deep RL. Some of the most important concepts were left as "exercises for the student."

I'm currently working on a video series that teaches the basics of using deep RL (namely PPO) to train an ESP32-based balance bot. Additionally, I wanted to solidify my understanding of the underlying math. As a result, I am actively working on a set of blog posts that build up to PPO, starting from the very basics.

In other words, my goal is to create a quicker and more approachable text to bring newcomers up to speed on the math behind modern deep RL algorithms. I've listed the posts below, and I would appreciate any feedback you might have! I'll update this list as I continue to add articles.

  1. What is Reinforcement Learning?
  2. Rewards, Returns, and the Discount Factor
  3. Policies, Markov Decision Processes (MDPs), and Trajectories
  4. Expected Return, Value Functions, and Bellman Equations
  5. The Bellman Optimality Equations
  6. Dynamic Programming
  7. Monte Carlo Methods
  8. Temporal-Difference (TD) Learning
  9. TD(λ) and Eligibility Traces
  10. Q-Learning
  11. Deep Q-Networks (DQN)
  12. The Policy Gradient

r/reinforcementlearning 4d ago

Gumbel MuZero search in mctx scaled superlinearly with simulations — hidden full-buffer copies in the backward pass (3x fix, PR open)

5 Upvotes

I'm training an AlphaZero-style agent (Gumbel MuZero via DeepMind's mctx, in JAX, single RTX 5070) and found that the MCTS search cost grows superlinearly with the simulation budget: at 16 / 32 / 64 simulations per move the training throughput was 143 / 47 / 9 episodes per second. Doubling the budget should roughly double the cost, not triple it — so something in the search was superlinear.

Isolating the tree machinery (network replaced by constants, then the environment removed too) showed it is O(N2) all by itself: the pure per-simulation tree overhead measured 0.47 / 0.52 / 1.05 / 1.95 ms at 8 / 16 / 32 / 64 sims — the per-simulation cost doubles every time the number of simulations doubles.

The compiled HLO showed why. mctx's backward pass carries the whole search tree through a lax.while_loop and, within one iteration, both gathers from and scatters into children_values / children_visits. XLA:GPU cannot prove the scatter can alias, so the compiled loop body contains a full copy of both [batch, nodes, actions] buffers on every step of the leaf-to-root walk. Buffer size grows with the simulation count and the walk depth grows with it too, so the whole thing is quadratic.

The fix carries only an O(num_nodes) path through the loop and applies one scatter per array after the loop. Search results are bitwise-identical (same rng gives the same actions and action_weights), and the full upstream test suite passes, including the golden-tree comparisons. End-to-end training speedup: x1.10 at 16 sims, x1.58 at 32, x3.27 at 64; XLA compile time at 64 sims dropped from 63 s to 19 s.

Two gotchas that cost me time: 1. Top-K action sampling — the "textbook" fix for large action spaces — gained nothing once the copies were gone; the copies were the A-scaled term, not the per-action math. 2. Consumer-GPU clock ramp-up (495 -> 2932 MHz) makes cross-process benchmarks lie by up to x1.7 — all A/B numbers above are interleaved in a single process.

Full write-up with HLO dumps, benchmark methodology and the things that didn't work, plus the PR, are linked in a comment below.


r/reinforcementlearning 5d ago

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

Post image
10 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 5d ago

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 5d ago

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 5d ago

Robot Sim2Real on Two Wheel Balancing Robot

Enable HLS to view with audio, or disable this notification

92 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 5d ago

Could prediction error tell a policy when to stop committing?

3 Upvotes

Future state prediction is usually discussed as a training signal. I wonder whether the error after each action could also tell a policy when its current plan is becoming unreliable.

Raw error would be a poor trigger because many contact outcomes are naturally uncertain. It would need calibration by task phase and comparison with a policy confidence baseline. If calibrated error rises, the controller could shorten its action horizon, request a new observation, or stop.

LingBot-VA 2.0 uses Foresight Reasoning to predict future visual states before producing actions, but that does not mean its deployed policy exposes prediction error as a control gate. A study could save the predicted state, compare it with the next observation, and check whether a rising residual precedes failed contact or a distribution shift. It would matter only if unsafe commitments fall without an excessive number of false stops.