ALI-Agent: Assessing LLMs'Alignment with Human Values via Agent-based Evaluation [NeurIPS 2024]
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.
Metadata
Release files for ALI-Agent 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ali_agent-0.2.4.tar.gz | 5.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ALI_Agent-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 MB
Release files / ali_agent-0.2.4.tar.gz
| Download URL | ali_agent-0.2.4.tar.gz |
|---|---|
| Size | 5.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47b61085fc07ba1f580a0c424a3883e13e3f85f6ff144889ed17edbe652a04a2
|
|
BLAKE2b-256 checksum How to use checksums |
1b1ae519c918338a16bfb7a46321adc40505573a208e273dc1d1c3da9e12526f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.17
|
Release files / ALI_Agent-0.2.4-py3-none-any.whl
| Download URL | ALI_Agent-0.2.4-py3-none-any.whl |
|---|---|
| Size | 5.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fafa4b9c3e8873066ca941dc8645c4ff6161c20b5130bbc876ce2fee70054ee5
|
|
BLAKE2b-256 checksum How to use checksums |
739289daf5926b10520aa287eadef1755dc7ab3a9df4764a7a277ae23573d5c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.17
|