Home

Awesome

Cooperation, Competition, and Maliciousness: LLM-Stakeholders Interactive Negotiation

Abstract

There is an growing interest in using Large Language Models (LLMs) in multi-agent systems to tackle interactive real-world tasks that require effective collaboration and assessing complex situations. Yet, we still have a limited understanding of LLMs' communication and decision-making abilities in multi-agent setups. The fundamental task of negotiation spans many key features of communication, such as cooperation, competition, and manipulation potentials. Thus, we propose using scorable negotiation to evaluate LLMs. We create a testbed of complex multi-agent, multi-issue, and semantically rich negotiation games. To reach an agreement, agents must have strong arithmetic, inference, exploration, and planning capabilities while integrating them in a dynamic and multi-turn setup. We propose multiple metrics to rigorously quantify agents' performance and alignment with the assigned role. We provide procedures to create new games and increase games' difficulty to have an evolving benchmark. Importantly, we evaluate critical safety aspects such as the interaction dynamics between agents influenced by greedy and adversarial players. Our benchmark is highly challenging; GPT-3.5 and small models mostly fail, and GPT-4 and SoTA large models (e.g., Llama-3 70b) still underperform in adversarial, noisy, and more competitive games.

Example

<p align="center"> <img src="https://github.com/S-Abdelnabi/LLM-Deliberation/blob/main/teaser.png" width="750"> </p>

The repo includes:


Table of Content


Setup

conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidia
conda install conda-forge::transformers
pip install google-cloud-aiplatform
pip install openai
pip install accelerate

Games


Setting the game and simulation configuration


Guide on how the prompts are organized

1- initial prompts

self.global_instructions = self.load_global_instructions(os.path.join(game_description_dir,'global_instructions.txt'))
individual_scores_file = os.path.join(game_description_dir,'scores_files', agent_file_name+'.txt')
self.scores = self.load_scores(individual_scores_file)
        
individual_instructions_file = os.path.join(game_description_dir,'individual_instructions',incentive, agent_file_name+'.txt')
self.individual_instructions = self.load_individual_instructions(individual_instructions_file)
final_initial_prompt = self.global_instructions + '\n' + self.individual_instructions +  scoring_rules + voting_rules + incentive_rules

2- round prompts

slot_prompt = history_prompt + scratch_pad + unified_instructions + plan_prompt 

Supporting new incentives:


Running the simulation

python main.py --exp_name <OUTPUT_DIR> --agents_num <NUM> --issues_num <NUM> --window_size <NUM> --game_dir ./games_descriptions/<GAME> --rounds_num <NUM>
history['content']["rounds"].append({'agent':agent_name, 'prompt': prompt, 'full_answer': full_answer, 'public_answer': public_answer})

Evaluation

1- evaluation/evaluate_deals.ipynb:

<p align="center"> <img src="https://github.com/S-Abdelnabi/LLM-Deliberation/blob/main/p1.png" width="350"> </p>

2- evaluation/score_leakage.py:

MAX_THREADS = 60 

parser = argparse.ArgumentParser(
                    prog='Verifier')

parser.add_argument('--azure_openai_api', default='', help='azure api') 
parser.add_argument('--azure_openai_endpoint', default='', help='azure endpoint')   
parser.add_argument('--model_name', default='', help='azure model')  
parser.add_argument('--exp_dir')

args, _ = parser.parse_known_args()

os.environ["AZURE_OPENAI_API_KEY"] = args.azure_openai_api
os.environ["AZURE_OPENAI_ENDPOINT"] = args.azure_openai_endpoint

3- evaluation/adjust_games.ipynb

HOME = '/HOME/'
GAME_DIR = os.path.join(HOME,'LLM-Deliberation/games_descriptions/base/')
AGENTS_NUM = 6
ISSUES_NUM = 5

Logs


Citation

If you find our paper, dataset, or this repo helpful, please cite our paper:

@inproceedings{
abdelnabi2024negotiation,
title={Cooperation, Competition, and Maliciousness: {LLM}-Stakeholders Interactive Negotiation},
author={Sahar Abdelnabi and Amr Gomaa and Sarath Sivaprasad and Lea Schönherr and Mario Fritz},
booktitle={The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
year={2024},
}