memprompt  by madaan

Memory-assisted prompt editing refines GPT-3 via user feedback post-deployment

created 3 years ago
329 stars

Top 84.2% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a method for improving deployed GPT-3 models using user feedback without full retraining. It targets researchers and developers working with large language models who need to adapt model behavior post-deployment, offering a way to inject corrections and clarifications into the prompt dynamically.

How It Works

The core approach involves memory-assisted prompt editing. It uses a memory module to store past interactions, feedback, and clarifications. When generating responses, the system queries this memory to retrieve relevant context, which is then incorporated into the prompt. This allows the model to adapt its output based on learned corrections, effectively "editing" the prompt on the fly to guide the model towards desired behavior.

Quick Start & Requirements

  • Install: pip install -r requirements.txt
  • Prerequisites: Requires an OpenAI API key (OPENAI_API_KEY).
  • Usage: Run streaming jobs via python src/streaming/stream_with_memory.py or python src/streaming/stream_with_growing_prompt.py with specified task files, job IDs, and memory types.
  • Checkpoint: For semantic memory, a trained checkpoint is required (link provided, but may be temporary).
  • Docs: https://www.memprompt.com/

Highlighted Details

  • Implements both "closest" and "semantic" memory retrieval mechanisms.
  • Supports a "growing prompt" strategy where the prompt evolves with interactions.
  • Includes utilities for creating new task files and processing log outputs for analysis.
  • Offers example task files for linguistic, Hindi, and pun-based prompts.

Maintenance & Community

The project is associated with the EMNLP 2022 paper "memprompt". Further community or maintenance details are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The provided checkpoint for semantic memory may be temporary. The README does not detail specific model version compatibility beyond GPT-3, nor does it mention support for other LLM providers.

Health Check
Last commit

2 years ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.