Giter Club home page Giter Club logo

amazonpricehistory's Introduction

This is the official repository of our paper Measuring Bargaining Abilities of LLMs: A Benchmark and A Buyer-Enhancement Method.

Abstract

Bargaining is an important and unique part of negotiation between humans. As LLM-driven agents learn to negotiate and act like real humans, how to evaluate agents' bargaining abilities remains an open problem.

For the first time, we formally described the Bargaining task as an asymmetric incomplete information game, defining the gains of the Buyer and Seller in multiple bargaining processes. It allows us to quantitatively assess an agent's performance in the Bargain task.

We collected a real product price dataset, AmazonHistoryPrice, and conducted evaluations of various LLM agents' bargaining abilities. We find that playing a Buyer is much harder than a Seller, and increasing model size can not effectively improve the Buyer's performance.

To address the challenge, we propose a novel approach called OG-Narrator that integrates a deterministic Offer Generator to control the price range of Buyer's offers, and an LLM Narrator to create natural language sentences for generated offers.

Experimental results show that OG-Narrator improves the buyer's deal rates from 26.67% to 88.88% and brings a ten times of multiplication of profits on all baselines, even a model that has not been aligned.

Dataset

AmazonHistoryPrice is in the data/AmazonHistoryPrice folder. We provided the dataset_analysis/analyse.py to examine the dataset.

Running Benchmarks

  1. pip install openai vllm jsonlines fire matplotlib pandas seaborn
  2. fill all your keys into "openai_keys" in api_settings.py.
  3. source start_vllm_server.sh $YOUR_MODEL_DIR $YOUR_GPU_NUM to start a vllm server that runs your model. (For example, source start_vllm_server.sh ../models/Llama-2-70b-chat-hf 4). By default, it runs at half precision.
  4. source run_2stages.sh $MODEL_NAME ./results $EXPERIMENTS_NAME will run the Buyer and Seller benchmarks for you. If you are interested in OGNarrator, you can replace the "run_2stages.sh" with "run_3stages.sh". The model name doesn't have to be exact. (For example, source run_3stages.sh llama-2-70b ./results run1-2024.1.1).
  5. after all tests are completed, python eval.py ./results will write all evaluation results into "./results/eval_results.csv". Also, the distributions of normalized profits are plotted in directories with the same names as the jsonl files.

amazonpricehistory's People

Contributors

tianxiasjtu avatar

Stargazers

Zhuosheng Zhang avatar Liebhaner avatar Zhiwei He avatar

Watchers

 avatar

Forkers

cooelf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.