gitmyhub

Behavioral_RL

HTML ★ 32 updated 16d ago

Reinforcement Learning with human behavioral biases integration

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.