r/reinforcementlearning • • 1h ago

Reward bugs in coding-RL graders: a wrong answer gets reward 1 on Terminal-Bench 2, and a conftest.py hack passes SWE-bench Verified

1 Upvotes

If you use benchmark tests as an RL reward, a test that accepts a wrong answer is a reward bug, and a policy will find it.

Two I found and filed this week:

  1. Terminal-Bench 2, constraints-scheduling (https://github.com/harbor-framework/terminal-bench-2/issues/107). Two of three tests read the first DTSTART in the output file, not the scheduled meeting. Put a decoy event at the right time first and book the real meeting at a clashing slot: 3/3 tests, reward 1, in the official image.
  2. SWE-bench Verified (https://github.com/SWE-bench/SWE-bench/issues/733). With the official harness, a patch that only adds a root conftest.py hooking pytest_runtest_makereport to mark every test passed is graded resolved in 4 repos (pytest, sphinx, scikit-learn, xarray). That's the classic reward hack, and it gets past the exit-code check added for the earlier report #631 because pytest exits 0. Separately, wrong or incomplete patches graded resolved on 9 instances.

I built Aethens (Apache-2.0, v0.1.0 out now) to check this kind of thing before training. It runs a task's tests in Docker against the gold, labelled-wrong answers, mutants of the gold, and reward-hack probes (exit-zero, atexit, framework patching, sitecustomize, always-equal objects, lookup tables of visible answers). Every finding has a one-line repro. No LLM judge.

Limits: Python tasks in its own format only. The TB2 and SWE-bench converters I used aren't released yet. It doesn't probe conftest.py hooks yet; that's next. On its own planted-defect bench (34 tasks) it scores precision 1.0, recall 1.0 (20/20) and 116/116 reward-hack probes, which only shows it catches what I planted. On HumanEval judged by HumanEval+, the mutation check's precision is 0.8158 (31/38).

pipx install aethens · https://github.com/beastrog/aethens/

If you train on coding environments: which reward hacks have you seen policies find that a tool like this wouldn't probe?


r/reinforcementlearning • • 9h ago

Sample

2 Upvotes

Hi everyone

I am new to reinforcement learning and i have question about policy-based algorithm like PPO. in this algorithm do we sample from distribution function when we want to select action in both training and test phases?or just in training and argmax use in testing? I think sampling or argmax is two different way to select action in reinforcement learning and it is not mandatory to use specific way in training and test


r/reinforcementlearning • • 11h ago

DL [P] Chasing the Shadow of SAI: Stabilizing Muon Optimizer & Hybrid Transformers in AlphaZero Self-Play (9x9 Go)

2 Upvotes

GitHub Repo & Full Logs: https://github.com/MAOmao000/Sayuri-TensorRT

I ran a series of 8 single-GPU experiments extending the open-source Sayuri Go engine with Muon, Hybrid ResNet-Transformer blocks, and Gumbel AlphaZero to see if a compact model (`b6xc128h32`) could match the larger `SAI b8c160` baseline in 9x9 Go.

**Key Takeaways:**

- **Result:** Reached 52.25% point win rate (+16 Elo over 200 games) against `SAI b8c160` in 310K steps (~400K self-play games) without warm restarts.

- **Head-Split Muon:** Splitting attention projections by `head_dim=32` prior to Newton-Schulz orthogonalization was critical for parameter efficiency.

- **Preventing RL Mode Collapse:** Mixing 3 distinct MCTS worker personalities (Balance, Offense, Defense) kept exploration entropy alive and prevented draw-overfitting.

- **SWA & Cosine Cycle Trap:** Terminating SWA strictly before the cosine annealing cycle reset avoided a -50 Elo drop caused by post-reset LR spikes.

- **Loss–Strength Paradox:** Lowest self-play training loss did not equal highest Elo when rule/komi distributions were narrowed.

All training configs, loss curves, and evaluation logs are documented in the repo. Feedback and thoughts on RL + Muon stability are very welcome!


r/reinforcementlearning • • 1d ago

Rubiks Cube solver using Reinforcement Learning (Beating Sebastian Lague's solver)

29 Upvotes

I made multiple attempts at solving the Rubiks Cube using Reinforcement learning.

Initially, I tried to map states to actions with both Rainbow DQN and GRPO using curriculum learning. This had no success. After scrambling 6 moves it was already to hard for the agent.

Then I found the DeepCubeA approach and I took some inspiration from that. I trained a DQN to estimate the cost-to-go for each possible action, using a combination of demonstrations and self-generated rollouts. Essentially, each output estimates how many moves are still needed to solve the cube after taking that action. I then used these estimates as a heuristic to guide beam search.

With a beam_width of 2^18 and 1.5 hours of Kaggle GPU usage, here are the results for 1000 cubes (100 moves scrambles):

Time per cube: 10.30s

Avg steps: 19.67

Success: 100%

This beats Sebastian Lague's solver which had an average steps of 19.9 to solve the cubes. Not that it is a competition or something :)

Github: https://github.com/Cain15/RL4RubiksCube
Youtube: https://www.youtube.com/watch?v=UWPQ-Mzkq_A


r/reinforcementlearning • • 13h ago

Started learning rl

Thumbnail reddit.com
1 Upvotes

r/reinforcementlearning • • 1d ago

DL Looking for project-based resources to learn Reinforcement Learning (RL)

4 Upvotes

I'm looking for good resources to learn RL through a hands-on, project-oriented approach.

I'd prefer resources where I can learn concepts by building projects, implementing algorithms, experimenting with different approaches, and modifying existing implementations to understand how things work under the hood.

I'm comfortable with programming and have some ML/DL background, so I'm open to GitHub repositories, practical courses, tutorials, or research-oriented projects.

I'd really appreciate recommendations from people who've learned RL through this approach. What resources helped you the most?


r/reinforcementlearning • • 1d ago

I just spent a year trying to fix an RL self-play game player only to discover the reason it failed every fucking time was a small difference between my Windows 5090 build and my rented linux boxes.

5 Upvotes

That is all. I do not know whether to laugh or cry. My model kept collapsing with more data. I have spent an entire fucking year trying to work out why, and the end result was that a tiny difference between PyTorch versions plus the fact that I compiled some related code in a slightly different way.

Everything I did was getting slightly corrupted for an entire year.

I just wanted to rant.


r/reinforcementlearning • • 1d ago

Has anyone tried giving an AI agent the "CEO" role of a physical space? What should the guardrails look like?

Post image
0 Upvotes

r/reinforcementlearning • • 2d ago

How well do you actually understand what's going on inside RL?

4 Upvotes

Reinforcement learning: you see it all the time in the context of LLMs and chess agents.

I'm an undergrad doing RL research.

We often hear that it trains on rewards without labeled data, but how much of the actual algorithms under the hood could you explain?


r/reinforcementlearning • • 1d ago

I put MADDPG into a full event-driven banking backend for AML detection. Results, weak points, and code (MSc project)

Post image
0 Upvotes

How it works

- 3 agents each score a payment: transaction pattern (XGBoost), customer risk (XGBoost), and network graph (CatBoost).

- A Multi-Agent Deep Deterministic Policy Gradient (MADDPG)( orchestrator (3 actors, 1 shared critic) combines their scores.

- Compliance-officer decisions go back into training as reward.

Architecture

- Event-driven: Java/Spring Boot microservices and Python AI services communicate only over Kafka + Avro.

- Payments are event-sourced with the Axon Framework. Sagas control the flow (risk check → proceed / escalate / block), with timeouts.

- TigerBeetle is the double-entry ledger, and Neo4j holds the transaction graph.

- Every Kafka consumer has a dead-letter queue, and one OpenTelemetry trace follows a payment across Java and Python.

Results (10K synthetic payments, SAML-D dataset)

- Recall: 97.3%

- Precision: 11% (I chose to prefer recall, and a human reviews the alerts)

- Round-trip laundering is the weakest pattern, at 76%.

Weak points: The data is only synthetic, and I have not yet compared it eline.

Questions:

  1. Is MADDPG too much for this? Would a bandit or a stacking model be enough
  2. How do you train well with human feedback that is rare and arrives late?

Repo: https://github.com/dogaanismail/multi-agents-in-fintech-regulatory-compliance


r/reinforcementlearning • • 1d ago

N, M, Safe "[OpenAI/Anthropic] AI employees sound alarm: models too powerful to ever release", Axios

Thumbnail axios.com
0 Upvotes

r/reinforcementlearning • • 2d ago

[P] Tabular Q-Learning for IDS evasion in an autonomous pentester — feedback on state/action design?

1 Upvotes

IDS evasion driven by tabular Q-Learning (no deep RL, no LLM — reproducible baseline). State (1512): OS × ports × privilege × 5-min alerts × SDN blocks × phase. Action: {tool, timing, delay, fragmentation}. Reward: objective − 10·alerts − 0.1·time − 5·quarantine. Goal: minimize Suricata alerts while reaching the objective. Feedback on reward shaping / state discretization / cross-detector transferability welcome.
https://github.com/14juanito/Projet-Nzoyi


r/reinforcementlearning • • 2d ago

pullgym: Scoring AI agents on honest error bars (and why binary RLVR fails on continuous uncertainty)

Post image
2 Upvotes

r/reinforcementlearning • • 2d ago

The Four-Argument p(s', r | s, a) Explained | Probability for RL (3.2, P...

Thumbnail
youtube.com
2 Upvotes

r/reinforcementlearning • • 2d ago

Exp PPO agent for Balatro ends on the same Pair build every run and stalls at 23% on the hardest stake. How do I get it to explore other builds?

4 Upvotes

PPO agent for Balatro: 95% wins on the easiest stake, 23% on the hardest (30,000 seeds), and every training run ends on the same build. It looks like an exploration problem but I can't prove it is one.

If you haven't played it: a run is 8 antes of 3 blinds, each a score target you beat by playing poker hands from your deck. Between blinds you shop for jokers (permanent modifiers that add chips or multiply your score) and cards that level up one hand type. A build is the hand type you commit to plus the jokers that scale it. Gold is the hardest of 8 difficulty levels.

Setup: transformer policy, about 7M parameters. PPO, 512 envs x 128 steps, gamma 0.999, GAE 0.95, entropy 0.003, a bit over a billion steps, trained on all stakes at once. Masked discrete actions: which cards to play or discard, what to buy, sell, use or skip. Reward is +1 for winning the run, no shaping.

It sees everything on screen plus the exact score each possible play would get. Which is computed from visible cards only, but a human would have to do the arithmetic (not cheating, trust). The simulator is 1:1, checked against the game's code, and the agent plays the game through a mod with the same results.

The build: it plays Pairs, levels Pair up, and takes whatever multiplier jokers the shop gives it. In the run in the video linked below, 50 of its 60 hands are Pairs.

Its single shop decisions hold up. At 500 shop decisions on Gold I tried every option, 128 redrawn futures each, with the same net playing on afterwards (earlier checkpoint). Overriding its choice with the best option gains +0.0003 win rate, 95% CI -0.0013 to +0.0018. I know that only shows each choice is the best one given how this net plays afterwards. It can't tell me whether a different plan across many shops would win more.

Tried so far, measured on Gold with paired seeds:

  • Random starting jokers on a third of training episodes, so it gets to play other builds: +0.007 +/- 0.007, same build.
  • Restarting 30% of episodes from its own mid-game states: -0.002 +/- 0.010.
  • Cutting the per-blind progress reward it used to have to a quarter: +0.003 +/- 0.008, same build.
  • Search inside a round, 16 sampled futures with policy rollouts: -0.013 +/- 0.013.
  • Replaying each seed several times and training on the best line: -0.006 +/- 0.003. It learns moves that fit one deal.
  • More steps: the last 320M bought under a point.
  • Averaging the weights of six runs: about +1 point. The only thing that helped.

From a given state, about 60% of the win/loss variance on Gold comes from the hidden future, so the signal for any single choice is weak.

  1. I can't show that a better build exists for this agent. I only know that people win Gold with flushes, straights and scaling jokers. How would you test whether it's stuck in a basin, or whether nothing better is within its reach?
  2. Has anyone made exploration at the level of a whole strategy work with PPO in a game this noisy? I'm thinking of a per-episode latent with a diversity reward on the final build, or an archive of states keyed on build to restart from. My restarts used its own states, which are all Pair builds, so that probably explains that null.

Video of a Gold run


r/reinforcementlearning • • 2d ago

What’s the best way to build an AI that can play a game like RDR2 for hours?

0 Upvotes

I’m looking into game-playing agents. I know Claude can take screenshots and decide what to press next, but that seems painfully slow for a full 3D game.

Ideally, the AI would have something like an API reference for the game: a list of controls, actions and game states it can read. I’d give it a goal like “ride to Valentine, sell my loot, then hunt for an hour,” and it would write a script that runs on its own, handles interruptions and checks its progress without calling a chatbot at every step.

Has anyone built something like this for a single-player game? Would you start with a mod or scripting framework that exposes game state, or train a model on gameplay? Any repos or papers worth checking out?

What I’m picturing is something closer to old-school RuneScape bots, with an AI planner on top.


r/reinforcementlearning • • 3d ago

Lazy Agents Answer Against Their Own Beliefs: Reinforcement Learning with Verifiable Beliefs Teaches Them to Act on What They Believe [R]

15 Upvotes

Sharing RLVB from our team at DeCLaRe Lab, a way to give evidence-seeking agents a reward at every turn, computed from the exact posterior instead of a learned reward model.

The problem we started from: VLM agents often answer while their own belief still lists several possible answers. An end-of-episode reward can't show which step was the mistake, and it still pays for a lucky guess. In many hidden-information tasks, though, the simulator knows the rules linking the hidden answer to the evidence, so it can compute the exact posterior after every step.

A few details about the setup:

  • Before each action, the agent writes a belief line (the answers it still thinks are possible), and the update trains this line together with the action.
  • Each action is scored against a teacher that acts on the exact posterior: another step is right while several answers remain, and answering is right once the evidence identifies one.
  • No judge, no critic, no reward model. The reward comes only from the simulator's rules.
  • Training uses one task suite only. Two of the three test benchmarks (RoboQuest and Pro-Worlds) are never seen in training.

On Qwen3-VL-4B, Qwen3-VL-8B and Qwen3.5-4B across 3 benchmarks, RLVB improves on the base model in all 9 settings (+17.1 points on average with GRPO as the learner, +10.4 with EM). GRPO and PPO with the outcome reward lose accuracy on average. The rate of committing while the belief still names several answers drops from 3–68% to 0.1–2.2%.

The exact posterior is only needed for training, on closed worlds where the simulator knows the rules. At test time no posterior is needed: the trained agent transfers to benchmarks it never saw in training, including RoboQuest's open-ended robot tasks.

Paper · Code · Website

One question we would like other views on: when the exact posterior isnt available, what would you use as the signal that the agent has seen enough to commit?


r/reinforcementlearning • • 3d ago

P, M DreamerV3 in an open-source PyTorch library, reproduced on a 4 GB laptop GPU: Boxing 83, cartpole swing-up 866

10 Upvotes

Simulusion 1.2.0 adds DreamerV3 (https://github.com/ParamThakkar123/simulusion). The video shows the world model imagining Atari Boxing next to the real game, then the trained agent playing.

Single-seed results on an RTX 3050 Laptop (4 GB):

- Atari100k Boxing, 400K frames, 12M model: 83.3 (paper: 78 with 200M)
- DMC cartpole swing-up from joint states: 866 (paper: 850)
- DMC cartpole swing-up from pixels: 740–840
- BSuite: memory_len 1.0, umbrella_length 1.0, bandit 0.81

Things that made the difference while reproducing it:

  1. Prefill only one batch with random actions. A 5K-frame random prefill cost about half the score on short BSuite tasks.
  2. Train while acting at the replay ratio, not in separate collect and train phases.
  3. Use the reference initialisation (zero-initialised reward and critic outputs, 0.01 policy output scale).
  4. Watch for Box action spaces that are really one-hot (Crafter, native Atari): they need a categorical policy.

Open problem on our side: BSuite mnist doesn't learn at 12M or 25M. If you've seen DreamerV3 solve it, I'd like to know the setup.

Presets follow the paper's tables, so benchmark_config("atari100k") gives the 100k protocol directly. New environment adapters too: Crafter, Craftax, Memory Maze, Atari 100k, Minecraft Diamond, BSuite, DMLab-30.

pip install -U simulusion
docs: https://www.simulusion.co/docs/dreamer-v3


r/reinforcementlearning • • 2d ago

Do you guys make codex to everything?

0 Upvotes

I did the hugging face RL course half-way till DQN where you gotta write the code by hand and shit.

But now with my actual project, I just make codex do all the work. I don't even read stable baseline doc or stuff. I did used to read pytorch doc in the past though and now even stopped that and before LLMs got better, I always did coding by hand but now I don't even touch the code.

What about you guys? I just tell it what algorithm and strategy to use.


r/reinforcementlearning • • 3d ago

P RoboUniverse-10K: 10,807 verifiable robot manipulation environments for agent training

6 Upvotes

Sharing RoboUniverse-10K from our team at Einsia: 10,807 interactive robot manipulation environments built from real-world demonstration videos.

The goal is to provide a larger pool of executable tasks for training robotic coding agents. Each task runs in Isaac Sim and packages an instruction, an observation/action interface, a reference controller, and a verifier. Tasks cover single-arm Franka and dual-arm AgileX Piper manipulation.

The agent writes and executes Python controllers, observes the outcome, and adjusts. A few details about the setup:

  • The agent sandbox is isolated from the simulator and grading code.
  • Observations include camera images and joint states, but no ground-truth object poses or intermediate success signals.
  • The verifier returns a binary reward at the end of the episode.
  • Physics advances only when actions are executed, so model inference and code-writing time don’t consume simulation steps.

The environments support trajectory collection and online RL. For this release, the training experiment is SFT on successful interaction trajectories, not RL. The resulting model, RoboUniverse-35B-A3B, is also available.

For anyone working on verifiable environments, one design choice worth discussing is withholding intermediate success signals: the agent has to judge progress and decide when to stop from observations alone. Would you keep that constraint during training, or introduce additional feedback and reserve terminal-only scoring for evaluation?

Code and setup · Environments · Paper · Demos


r/reinforcementlearning • • 3d ago

Advice for reinforcement learning

0 Upvotes

Hey guyss...
Dont mind me I am a 16-year-old who is amazed by ML and RL and really wanted to persue these fields in my career. I had this interest from the age of 13 when I started to watch beginner videos about Model training in games and other areas . I have been researching from a while and got to know that maths was a improtant cretieria in this . For That I did Linear algebra and eigen vectors and eigen values and doing calculus right now . The main problem is not that I cannot learn these high level things but it is that I do not know what to do . Like I made a number guessing model with claude for experiemnt but could not learn much valuable from that . I have came across many courses to do but Cant choose the right one. I know RL requires a lot of computer power for which I am collacting and saving side by side . But rn I do not know where to go . Like some say focus on basic things and then code with ai and make models while others say that coding with ai is not good and the best is coding by hand . I do not want to suppose anything as u people are the professionals and I will leave u to that . I am doing this course free rn : Mathematics for Machine Learning and Data Science .Instructor: Luis Serrano . I want to build models that will be valueable and actually hold something in appliactions or even in my work experince it will make me learn


r/reinforcementlearning • • 3d ago

Safe 16-year-old trying to get into ML and RL

1 Upvotes

Hey guyss...

Dont mind me I am a 16-year-old who is amazed by ML and RL and really wanted to persue these fields in my career. I had this interest from the age of 13 when I started to watch beginner videos about Model training in games and other areas . I have been researching from a while and got to know that maths was a improtant cretieria in this . For That I did Linear algebra and eigen vectors and eigen values and doing calculus rn . The main problem is not that I cannot learn these high level things but it is that I do not know what to do . Like I made a number guessing model with claude for experiemnt but could not learn much valuable from that . I have came across many courses to do but Cant choose the right one. I know RL requires a lot of computer power for which I am collacting and saving side by side . But rn I do not know where to go . Like some say focus on basic things and then code with ai and make models while others say that coding with ai is not good and the best is coding by hand . I do not want to suppose anything as u people are the professionals and I will leave u to that . I am doing this course free rn : Mathematics for Machine Learning and Data Science .. Instructor: Luis Serrano . I want to build models that will be valueable and actually hold something in appliactions or even in my work experince it will make me learn .


r/reinforcementlearning • • 4d ago

P [P] Brain v4: a <1 MB brain-inspired learner (plain CPU) that learns within a life.

Thumbnail labs.khive.io
96 Upvotes

We're Khive Labs, a small research team in Rawalpindi/Islamabad, Pakistan. Since early November we've been building brain v4, a learning system that borrows principles from neuroscience: memory of mistakes, in-life self-imitation, specialist parts with a learned router, a novelty bonus, self-edited learning rules. The idea is to copy the principle, not the biology. The whole thing is under 1 MB and runs on a plain CPU.

We're posting mainly for critique. Every result on our page has its limits written next to it, and the failures are listed alongside the wins.

  1. Fighting games (FightingICE): it learns during the fight

- vs Iconic (FightingICE 2026 champion): loses early. After 120 practice rounds, it won its last 8 games straight.

- vs PyThunder (2025 winner): wins the last third of the fight in 3 of 3 seeds.

- vs EmcmAi (strongest 2020 bot): improves by +59 to +351 health per round from the first third to the last third, and still loses every fight.

- Kept mind: a second life that keeps the first life's mind starts ahead of a newborn in all 3 seeds (+67 to +173 health per round in the first third). The rule was written before the run.

2. Held-out suite: 10 task families, 77M steps, same budget for every learner

- brain v4: 0.51 ± 0.04 (3 runs)

- brain v4 without memory of mistakes: 0.43 ± 0.03

- Tuned PPO: 0.076 (10 seeds)

- Tuned RL²: 0.068 (10 seeds)

Before you say it:

- It's our own suite, not a public benchmark. Nobody outside the team has run it.

- The memory of mistakes is a separate module with its own store. PPO doesn't have one, so this isn't apples to apples.

- Most of the memory gain comes from two families: forks maze (0.31 → 0.78) and detours (0.33 → 0.56).

- The "maze" is a chain of cued left/right forks. In the spatial results, a hand-written map module does the steering, not the network.

- PPO runs hit numeric overflow past ~80M steps.

Where we'd value input

  1. Which public benchmark would you want to see first?
  2. What's a fair baseline for the memory comparison? PPO plus an episodic memory module?
  3. For the fighting results, what would convince you? More seeds, more characters, whole-match win rate, human players?
  4. On the guard-gaming result: is per-family gating the right direction?

Links

- Brain map (what it can and can't do yet): https://labs.khive.io/brain

- Full results with limits: https://labs.khive.io/results

- Research log: https://labs.khive.io/log

- Safety: https://labs.khive.io/safety

- Live demo (teach words to one shared brain): https://labs.khive.io/live/

Happy to answer anything in the comments.


r/reinforcementlearning • • 4d ago

DL RL in industrial setting

9 Upvotes

Hi everyone, I worked a lot with reinforcement learning but always wondered how things are handled in industry, especially in robotics.

You know RL is particularly complex because you have to define first of all the scenario and the mdp, including the rewards. Usually the reward needs dense components and each dense components have an associate weight. While you try to find the optimal reward component configuration you should also optimize the parameter and while optimizing parameters you should also runs the same parameters over multiple seeds to have some robust results.

Therefore my question is kinda general. I'm really curious on how you/your team handle this, when you decide that the reward components and their weghts are good enough and when you go to the hyperparameter tuning, if you use curriculum and how etc.

Or even if you use a completely different approach

Sorry for the errors, I wrote a bit in a rush