rl-prompt  by mingkaid

RL-based prompt optimization framework, per research paper

Created 3 years ago
352 stars

Top 79.1% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides the codebase for RLPrompt, a framework that optimizes discrete text prompts for pre-trained language models using reinforcement learning. It is intended for researchers and practitioners in NLP who want to improve LM performance on various tasks without fine-tuning the models themselves. The key benefit is the creation of lightweight, interpretable, and transferable discrete prompts.

How It Works

RLPrompt formulates discrete prompt optimization as a reinforcement learning problem. A policy network is trained to generate prompts, which are then used to steer pre-trained LMs. The generated prompts are optimized based on a defined reward function, offering an alternative to gradient-based soft prompt tuning or heuristic-based discrete prompt search.

Quick Start & Requirements

  • Install core modules: pip install -e .
  • Requirements: Python >= 3.7, PyTorch >= 1.10.1.
  • Usage examples for few-shot classification and text style transfer are available in the examples/ directory.

Highlighted Details

  • Discrete prompts are lightweight, interpretable, and transferable across different model types and sizes.
  • Framework uses reinforcement learning to optimize prompt generation.
  • Codebase is intended for ongoing updates for easier usage and adaptation.

Maintenance & Community

The repository is associated with the RLPrompt paper. Further updates are planned.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README.

Limitations & Caveats

The README does not specify any limitations or caveats regarding the framework's usage or performance.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Edward Sun Edward Sun(Research Scientist at Meta Superintelligence Lab), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
2 more.

ama_prompting by HazyResearch

0%
547
Language model prompting strategy research paper
Created 3 years ago
Updated 2 years ago
Feedback? Help us improve.