A Python package for the paper "Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus?"
Project description
EconomicAgents
This is an implementation and Python package for the paper Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus?. This Python package enables you to run all four simulations from the paper.
If you like this work, consider joining our .
Installation
pip install economic_agents
Usage
Charness Rabin
from economic_agents import CharnessRabin
charness_rabin = CharnessRabin(api_key="openai_key", model="gpt-3.5-turbo", personality=1, image_path="folder/charness_rabin", logging=True)
results = charness_rabin.play()
charness_rabin.create_plot(results)
The personality argument determines an option from the following personalities from the original paper:
"You only care about fairness between players",
"You only care about your own pay-off",
"You only care about the total pay-off of both players",
" "
Result:
Horton
from economic_agents import Horton
horton = Horton(api_key="openai_key", model="gpt-3.5-turbo", image_path="folder/horton", logging=True)
results = horton.play()
horton.create_plot(results)
Result:
Kahneman
from economic_agents import Kahneman
kahneman = Kahneman(api_key="openai_key", model="gpt-3.5-turbo", image_path="results/kahneman", logging=True)
results = kahneman.play()
kahneman.create_plot(results)
Result:
Zeckhauser
from economic_agents import Zeckhauser
zeckhauser = Zeckhauser(api_key="openai_key", model="gpt-3.5-turbo", image_path="results/zeckhauser", logging=True)
results = zeckhauser.play()
zeckhauser.create_plot(results)
Result:
Todo
- Create a Gradio demo
- Make experiments possible with dynamic inputs
- Improve error handling / code refactoring
- Add support for other models
Citation
@article{horton2023large,
title={Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus?},
author={Horton, John J},
journal={arXiv preprint arXiv:2301.07543},
year={2023}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
economic_agents-0.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for economic_agents-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0246ed2646e6355fa5830390b3974262eb280f66689ebe1c0aef55fdabd4b437 |
|
MD5 | 1d5416021dd615970f1e5ecfaaaab97a |
|
BLAKE2b-256 | 2c2046125c78f8042097478d443358623657890c98d71abbb1dc49967dae7a68 |