Skip to content

Code for the Paper "On the Conversational Persuasiveness of Large Language Models"

License

Notifications You must be signed in to change notification settings

epfl-dlab/debategpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

02156e0 · Feb 13, 2025

History

2 Commits
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Feb 9, 2025
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025

Repository files navigation

Python 3.10 MIT License arXiv

DebateGPT - On the Conversational Persuasiveness of Large Language Models

This repo contains the code for the paper On the Conversational Persuasiveness of Large Language Models.

Citation

Please cite our work as:

@misc{salvi2024conversationalpersuasivenesslargelanguage,
      title={On the Conversational Persuasiveness of Large Language Models: A Randomized Controlled Trial}, 
      author={Francesco Salvi and Manoel Horta Ribeiro and Riccardo Gallotti and Robert West},
      year={2024},
      eprint={2403.14380},
      archivePrefix={arXiv},
      primaryClass={cs.CY},
      url={https://arxiv.org/abs/2403.14380}, 
}

Getting Started

Before proceeding, make sure you have the following installed:

Then follow these steps:

  1. Clone the repository
git clone --recurse-submodules git@github.com:epfl-dlab/debategpt.git

If you forgot to clone with --recurse-submodules, you can run the following command to get the submodules:

git submodule update --init --recursive
  1. Initialize a new conda environment
conda env create -f debategpt.yml
  1. Install required libraries
pip install -r requirements.txt
  1. Run the following command to install the R kernel in your environment:
conda install -c r r-irkernel
  1. Open R and run the following commands to install the necessary packages:
install.packages("IRkernel")
IRkernel::installspec(user = TRUE)
install.packages("readr")
install.packages("MASS")
install.packages("ordinal")
install.packages("brant")
install.packages("broom")
install.packages("generalhoslem")
install.packages("boot")
  1. Setup secrets
echo <your-openai-key> >> secrets/OPENAI_API_KEY.txt

Repo Structure

The repo is structured as follows:

  • assets/: stores the vector images generated for the paper.
  • data/: stores the processed data used in the analysis.
  • debategpt/: contains the code to recreate the experimental platform used in the paper to have people debate synchronously with other participants or with LLMs.
  • scripts/: contains the code to process the data and run all the analyses presented in the paper.
    • process_data.py: processes the raw data and saves the processed data in the data/ folder.
    • regressionAnalysisR.ipynb: runs the regression analysis using R. This notebook should be run in an R environment.
    • analysis.py: runs the analysis and generates the plots presented in the paper.
    • extractLIWC.py: extracts LIWC features from the data. Called in process_data.py.
    • extractStrategies.py: extracts persuasive strategies from the data. Called in process_data.py.
    • extractTendimensions.py: extracts underlying social dimensions from the data. Called in process_data.py.

About

Code for the Paper "On the Conversational Persuasiveness of Large Language Models"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published