Skip to main content

A brief description of your project

Project description

ALI-Agent: Assessing LLMs'Alignment with Human Values via Agent-based Evaluation [NeurIPS 2024]

license

world

ALI-Agent, an evaluation framework that leverages the autonomous abilities of LLM-powered agents to conduct in-depth, adaptive and comprehensive alignment assessments on LLMs. ALI-Agent operates through two principal stages: Emulation and Refinement. During the Emulation stage, ALI-Agent automates the generation of realistic test scenarios. In the Refinement stage, it iteratively refines the scenarios to probe long-tail risks. Specifically, ALI-Agent incorporates a memory module to guide test scenario generation, a tool-using module to reduce human labor in tasks such as evaluating feedback from target LLMs, and an action module to refine tests.

📋 Catalogue

⚙️ Preparations

Step 1. Install requirements.txt

Set up a virtualenv and install the pytorch manually.

Our experiments have been tested on Python 3.9.17 with PyTorch 2.0.1+cu117.

conda create --name myenv python=3.9.17
conda activate myenv

After that, install all the dependencies listed in the requirements.txt file by running the following command:

pip install -r requirements.txt

Step 2. Download checkpoints of evaluator

You can find checkpoints of evaluators in the link : (checkpoints)

Directly download the three folders and put them in the main directory (where main.py can be found).

⌛️ Evaluation

Make sure you are in the main directory (where main.py can be found).

Replace "OPENAI_API_KEY" in simulation/utils.py with your own OpenAI API key.

Quick Start

To run the agent on a specified dataset, run code as

python main.py --llm_name llama2-13b --dataset ethic_ETHICS  --type ethic --start_from 0 --seed 0

Supported names for llm_name, data_set, type can be found in parse.py

To run the agent with web browsing, replace "BING_API_KEY" in simulation/utils.py with your own BING API key.

python main.py --llm_name llama2-13b --web_browsing

See the Results

The results of the simulation will be saved to database/<dataset>/<llm_name> directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ali_agent-0.2.1.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ALI_Agent-0.2.1-py3-none-any.whl (5.5 MB view details)

Uploaded Python 3

File details

Details for the file ali_agent-0.2.1.tar.gz.

File metadata

  • Download URL: ali_agent-0.2.1.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.17

File hashes

Hashes for ali_agent-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b1dd8fe64db678819c39c9f7f6e27e08c2de90d8a6f6ca2aae1f999a7bd7cc8f
MD5 fff7044dc9fbd7ff170300a2ba13de92
BLAKE2b-256 ba4fb9f67e02abe8f856efb4cd7b9dd830f1840056b161761582a26578720181

See more details on using hashes here.

File details

Details for the file ALI_Agent-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ALI_Agent-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.17

File hashes

Hashes for ALI_Agent-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d139b4e568301a11c0d876188e9cabb321106491daab2882516d58501172443
MD5 1f3ed56380203e23f8f3348cf305f2c8
BLAKE2b-256 5ee18a0f74395b0b274d08123dbba83e59a5fdbb18f2c693e536f93e4bc77806

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page