TrustLLM

[ICML 2024] TrustLLM:針對真實性、安全性、公平性、穩健性、隱私與倫理的大型語言模型可信度評估。Python/命令列工具,支援本地模型。

TrustLLM 是什麼?

[ICML 2024] TrustLLM:針對真實性、安全性、公平性、穩健性、隱私與倫理的大型語言模型可信度評估。Python/命令列工具,支援本地模型、相容API與AI代理協調。

TrustLLM 概覽

這是什麼

TrustLLM 是一個開放研究工具包,用於評估大型語言模型在六個維度上的可信度,於 ICML 2024 發表。它支援本地模型權重、相容 API 以及 AI 代理程式編排。該工具包提供 Python/CLI 介面來執行基準測試,並將資料、設定和結果整合在一起。

主要功能

  • 評估六個可信度維度:真實性、安全性、公平性、穩健性、隱私和倫理。
  • 支援本地模型權重(透過 Hugging Face Transformers)和基於 API 的模型(相容 OpenAI 的端點)。
  • 提供統一的 CLI(python -m trustllm),包含指令:download、tasks、generate、evaluate。
  • 包含用於程式化使用的 Python API。
  • 為生成和評分結果產生 HTML 報告。
  • 提供可選的本地推論([local])和評分([eval])依賴項。
  • 有限制的 API 重試、每個樣本的檢查點和恢復支援。

使用情境

  • 評估新模型或現有 LLM 在多個維度上的可信度。
  • 在自訂模型或 API 上重現 ICML 2024 基準測試。
  • 將可信度評估整合到 AI 代理程式流程中。
  • 研究 LLM 的安全性、公平性、隱私和倫理。

快速開始

bash python -m pip install 'trustllm @ git+https://github.com/HowieHwong/TrustLLM.git@main#subdirectory=trustllm_pkg' python -m trustllm download --output data python -m trustllm tasks export OPENAI_API_KEY='your-api-key' export OPENAI_BASE_URL='https://your-provider.example/v1' python -m trustllm generate --backend api --model your-model-id --task safety --data data/dataset --limit 5 --concurrency 4 --output runs/api-safety 對於本地權重: bash python -m pip install 'trustllm[local] @ git+https://github.com/HowieHwong/TrustLLM.git@main#subdirectory=trustllm_pkg' python -m trustllm generate --backend local --model Qwen/Qwen2.5-0.5B-Instruct --task safety --data data/dataset --device auto --limit 5 --output runs/local-safety

授權與價格

程式碼採用 MIT 授權。資料集的條款仍歸原始來源所有。該工具包是開源且免費使用的。

內容整理自該專案公開的 README 與儲存庫資訊。

將此徽章加入你的 README

Featured on YunoDB 徽章樣式與說明

你是這個專案的維護者嗎?展示它已收錄於 YunoDB。

Markdown[![Featured on YunoDB](https://yunodb.com/badge/howiehwongtrustllm.svg)](https://yunodb.com/tools/howiehwongtrustllm?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/howiehwongtrustllm?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/howiehwongtrustllm.svg" alt="Featured on YunoDB" height="20"></a>