{"id":23726589,"url":"https://github.com/camel-ai/agent-trust","last_synced_at":"2025-03-17T15:13:27.363Z","repository":{"id":221453688,"uuid":"752872208","full_name":"camel-ai/agent-trust","owner":"camel-ai","description":"🤝 The code for \"Can Large Language Model Agents Simulate Human Trust Behaviors?\"","archived":false,"fork":false,"pushed_at":"2024-11-25T15:56:03.000Z","size":9817,"stargazers_count":63,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T18:58:05.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camel-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-05T02:09:16.000Z","updated_at":"2025-03-02T17:46:51.000Z","dependencies_parsed_at":"2024-02-24T19:39:35.312Z","dependency_job_id":"26f19354-3a73-4ccd-bec8-888770374e58","html_url":"https://github.com/camel-ai/agent-trust","commit_stats":null,"previous_names":["camel-ai/agent-trust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-ai%2Fagent-trust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-ai%2Fagent-trust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-ai%2Fagent-trust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camel-ai%2Fagent-trust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camel-ai","download_url":"https://codeload.github.com/camel-ai/agent-trust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056424,"owners_count":20390719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T00:32:23.148Z","updated_at":"2025-03-17T15:13:27.343Z","avatar_url":"https://github.com/camel-ai.png","language":"Python","funding_links":[],"categories":["A01_文本生成_文本对话"],"sub_categories":["大语言对话模型及数据"],"readme":"\n\u003cdiv align=center\u003e\u003cimg src=\"./image/agent-trust-logo-tertiary.png\" width=\"200\"/\u003e\u003c/div\u003e\n\n# Can Large Language Model Agents Simulate Human Trust Behavior?\n\n- **TLDR** : We discover that LLM agents generally exhibit trust behavior in Trust Games and GPT-4 agents manifest high ***behavioral alignment*** with humans in terms of trust behavior, indicating the potential to simulate human trust behavior with LLM agents.\n- **Authors** : [Chengxing Xie](https://yitianlian.github.io/)\\*, [Canyu Chen](https://canyuchen.com/)\\*, [Feiran Jia](https://feiran.io/), [Ziyu Ye](https://ziyu-deep.github.io/), [Shiyang Lai](https://scholar.google.com/citations?user=qALDmfcAAAAJ\u0026hl=en), [Kai Shu](http://www.cs.iit.edu/~kshu/), [Jindong Gu](https://jindonggu.github.io/), [Adel Bibi](https://www.adelbibi.com/), [Ziniu Hu](https://acbull.github.io/), [David Jurgens](http://jurgens.people.si.umich.edu/), [James Evans](https://macss.uchicago.edu/directory/James-Evans), [Philip Torr](https://www.robots.ox.ac.uk/~phst/), [Bernard Ghanem](https://www.bernardghanem.com/), [Guohao Li](https://ghli.org/). (*equal contributions)\n- **Correspondence to**: Chengxing Xie \u003c\u003cxiechengxing34@gmail.com\u003e\u003e,\nCanyu Chen \u003c\u003ccchen151@hawk.iit.edu\u003e\u003e, Guohao Li \u003c\u003cguohao.li@eigent.ai\u003e\u003e.\n- **Paper** : [Read our paper](https://arxiv.org/abs/2402.04559)\n- **Project Website**: [https://agent-trust.camel-ai.org](https://agent-trust.camel-ai.org)\n- **Online Demo**: [Trust Game Demo](https://huggingface.co/spaces/camel-ai/agent-trust-Trust-Game-Demo) \u0026 [Repeated Trust Game Demo](https://huggingface.co/spaces/camel-ai/agent-trust-Repeated-trust-game-Demo)\n\nOur research investigates the simulation of human trust behaviors through the use of large language model agents. We leverage the foundational work of the Camel Project, acknowledging its significant contributions to our research. For further information about the Camel Project, please visit [Camel AI](https://github.com/camel-ai/camel).\n\n## Framework\n\n\u003cb\u003eOur Framework for Investigating Agent Trust as well as its Behavioral Alignment with Human Trust.\u003c/b\u003e First, this figure shows the major components for studying the trust behaviors of LLM agents with Trust Games and  Belief-Desire-Intention (BDI) modeling. Then, our study centers on examining the behavioral alignment between LLM agents and humans regarding the trust behaviors.\n\u003cdiv align=center\u003e\u003cimg src=\"./image/framework.png\" width=\"90%\"/\u003e\u003c/div\u003e\n\n\n## Experiment Results\n\nAll the experiment results are recorded for verification. The prompts for games in the paper are stored in `agent_trust/prompt`. The experiment results for non-repeated games are stored in `agent_trust/No repeated res`. The experiment results for repeated games are stored in `agent_trust/repeated res`.\n\n## Setting Up the Experiment Environment\n\nTo prepare the environment for conducting experiments, follow these steps using Conda:\n\nTo create a new Conda environment with all required dependencies as specified in the `environment.yaml` file, use:\n\n```bash\nconda env create -f environment.yaml\n```\n\nAlternatively, you can set up the environment manually as follows:\n\n```bash\nconda create -n agent-trust python=3.10\npip install -r requirements.txt\n```\n\n### Running Trust Games Demos Locally\n\nThis guide provides instructions on how to run the trust games demos on your local machine. We offer two types of trust games: non-repeated and repeated. Follow the steps below to execute each demo accordingly.\n\n#### Non-Repeated Trust Game Demo\n\nTo run the non-repeated trust game demo, use the following command in your terminal:\n\n```bash\npython agent_trust/no_repeated_demo.py\n```\n\n#### Repeated Trust Game Demo\n\nFor the repeated trust game demo, execute this command:\n\n```bash\npython agent_trust/repeated_demo.py\n```\n\nRunning this command will start the demo where the trust game is played repeatedly, illustrating how trust can evolve over repeated interactions.\n\nEnsure you have the required environment set up and dependencies installed before running these commands. Enjoy exploring the trust dynamics in both scenarios!\n## Experiment Code Overview\n\nThe experiment code is primarily located in `agent_trust/all_game_person.py`, which contains the necessary implementations for executing the trust behavior experiments with large language models.\n\n### Open-Source Models\n\nWe utilize the [FastChat](https://github.com/lm-sys/FastChat) Framework for smooth interactions with open-source models. For comprehensive documentation, refer to the [FastChat GitHub repository](https://github.com/lm-sys/FastChat).\n\n### Game Prompts\n\nGame prompts are vital for our experiments and are stored in `agent_trust/prompt`. These JSON files provide the prompts used throughout the experiments, ensuring transparency and reproducibility.\n\n## Running the Experiments\n\n### No Repeated Trust Game\n\nFor scenarios where the trust game is not repeated, execute the experiment by running the `run_exp` function in the `all_game_person.py` file. Ensure you adjust the `model_list` and other parameters according to your experiment's specifics.\n\n### Repeated Trust Game Experiment\n\nFor experiments involving repeated trust games, use the `multi_round_exp` function in the `all_game_person.py` file. This function is specifically designed for use with GPT-3.5-16k and GPT-4 models.\n\n### Web Interface for Experiments\n\nTo access a web interface for running the experiments (demo), execute `agent_trust/no_repeated_demo.py` or `agent_trust/repeated_demo.py`. This provides a user-friendly interface to interact with the experiment setup. You can also visit our online demo websites: [Trust Game Demo](https://huggingface.co/spaces/camel-ai/agent-trust-Trust-Game-Demo) \u0026 [Repeated Trust Game Demo](https://huggingface.co/spaces/camel-ai/agent-trust-Repeated-trust-game-Demo)\n\n## Citation\nIf you find our paper or code useful, we will greatly appreacite it if you could consider citing our paper:\n```\n@inproceedings{\n  xie2024canllm,\n  title={Can Large Language Model Agents Simulate Human Trust Behavior?},\n  author={Chengxing Xie and Canyu Chen and Feiran Jia and Ziyu Ye and Shiyang Lai and Kai Shu and Jindong Gu and Adel Bibi and Ziniu Hu and David Jurgens and James Evans and Philip Torr and Bernard Ghanem and Guohao Li},\n  booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},\n  year={2024},\n  url={https://openreview.net/forum?id=CeOwahuQic}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamel-ai%2Fagent-trust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamel-ai%2Fagent-trust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamel-ai%2Fagent-trust/lists"}