BPO  by thu-coai

Prompt optimizer for aligning LLMs without training

Created 1 year ago
325 stars

Top 83.6% on SourcePulse

GitHubView on GitHub
Project Summary

Black-Box Prompt Optimization (BPO) addresses the challenge of aligning Large Language Models (LLMs) with human preferences without requiring model retraining. It offers a novel approach for users seeking to improve LLM output quality and safety by optimizing prompts.

How It Works

BPO operates by treating prompt engineering as an optimization problem. It leverages a separate preference model to iteratively refine prompts based on pairwise comparisons of LLM responses. This black-box approach avoids direct model fine-tuning, making it applicable to proprietary LLMs and reducing computational overhead.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Requires Python and PyTorch. GPU with CUDA is recommended for efficient inference and training.
  • Official demo available on Hugging Face.
  • Inference example provided in the README.

Highlighted Details

  • Outperforms PPO and DPO in aligning LLMs like GPT-3.5-turbo and Claude-2.
  • Achieves orthogonal improvements in LLM alignment.
  • Released model and dataset on Hugging Face.
  • Includes code for data construction, model training, inference, and evaluation.

Maintenance & Community

  • Project associated with ACL 2024.
  • Codebase references and acknowledges contributions from llm_finetuning, DeepSpeed-Chat, and LLaMA-Factory.

Licensing & Compatibility

  • The README does not explicitly state a license. The presence of code from other projects with varying licenses may imply specific usage terms.

Limitations & Caveats

The project is presented as research code, and the README includes #TODO comments indicating areas requiring user modification before execution, suggesting it may not be fully production-ready.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake), and
3 more.

prompt-lookup-decoding by apoorvumang

0.2%
566
Decoding method for faster LLM generation
Created 1 year ago
Updated 1 year ago
Starred by Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), and
8 more.

EAGLE by SafeAILab

10.6%
2k
Speculative decoding research paper for faster LLM inference
Created 1 year ago
Updated 1 week ago
Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

PromptWizard by microsoft

0.4%
4k
Agent-driven framework for task-aware prompt optimization
Created 1 year ago
Updated 1 month ago
Feedback? Help us improve.