whatisgithub

What is behavioral_rl?

affaan-m/behavioral_rl — explained in plain English

Analysis updated 2026-05-18

26HTMLAudience · researcherComplexity · 4/5LicenseSetup · moderate

In one sentence

This research project trains reinforcement learning agents on the Iowa Gambling Task to see if adding human-like risk biases makes AI decisions resemble real human behavior.

Mindmap

mindmap
  root((Behavioral RL))
    What it does
      Iowa Gambling Task simulation
      Standard RL agent
      Risk-sensitive RL agent
      Compares to human data
    Tech stack
      Python
      PyTorch
      Gymnasium
      Plotly
    Use cases
      Compare agent behaviors
      Study prospect theory in AI
      Research or coursework base
    Concepts
      Prospect theory
      CVaR risk measure
      1994 human study

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Compare a standard reinforcement learning agent against a risk-sensitive, prospect-theory-based agent on the Iowa Gambling Task.

USE CASE 2

Study how adding behavioral economics concepts like prospect theory and CVaR changes an AI's card-picking behavior.

USE CASE 3

Use the codebase as a starting point for coursework or research on human-like decision modeling.

What is it built with?

PythonPyTorchGymnasiumPlotly

How does it compare?

affaan-m/behavioral_rlpoellie01/pentestcompanionasweigart/lottie-website-tester
Stars262627
LanguageHTMLHTMLHTML
Setup difficultymoderatemoderateeasy
Complexity4/53/51/5
Audienceresearcherops devopsgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires a Python environment with PyTorch and Gymnasium installed, understanding the research setup takes longer than a typical drop-in library.

MIT license, free to use, modify, and build on for any purpose including commercial use.

So what is it?

This project is a research implementation that trains an AI to make decisions the way humans do, specifically in a well-known psychology experiment called the Iowa Gambling Task. In that experiment, participants pick cards from four decks. Two of the decks look appealing because they offer big immediate rewards, but over time they lose money. The other two offer smaller rewards but come out ahead in the long run. Healthy people gradually figure this out, people with certain brain injuries often do not. The experiment has been used for decades to study how humans weigh risk and reward. The code builds two versions of an AI that plays this card game. The first is a standard reinforcement learning agent, meaning it learns by trial and error what actions produce better outcomes over time. The second is a modified version that incorporates two ideas from behavioral economics. One is prospect theory, which describes how humans feel losses more sharply than equivalent gains, and weight small probabilities differently than large ones. The other is a statistical measure called CVaR that makes the agent more cautious about worst-case outcomes. The goal is to see whether adding these human-like biases makes the AI's card-picking behavior resemble actual human experimental data more closely. The results show it does, at least partially. The risk-sensitive model's final deck preferences are closer to the patterns observed in human participants from the original 1994 study, even though it learns more slowly at first. The implementation uses PyTorch for the neural network, Gymnasium for the card-game environment, and Plotly for visualizing results. All code is in Python. The project is released under the MIT license and appears to be research or coursework rather than a finished product.

Copy-paste prompts

Prompt 1
Explain how this project's risk-sensitive agent uses prospect theory and CVaR to change its card-picking behavior.
Prompt 2
Walk me through running both the standard and risk-sensitive agents in this repo and comparing their results.
Prompt 3
How does the Iowa Gambling Task environment work in this codebase, and how is it implemented with Gymnasium?
Prompt 4
Summarize how closely this project's risk-sensitive model matches the 1994 human experimental data.

Frequently asked questions

What is behavioral_rl?

This research project trains reinforcement learning agents on the Iowa Gambling Task to see if adding human-like risk biases makes AI decisions resemble real human behavior.

What language is behavioral_rl written in?

Mainly HTML. The stack also includes Python, PyTorch, Gymnasium.

What license does behavioral_rl use?

MIT license, free to use, modify, and build on for any purpose including commercial use.

How hard is behavioral_rl to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is behavioral_rl for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.