Prompt engineering resources for eliciting top performance from foundation models
Top 9.2% on sourcepulse
This repository provides a collection of resources, best practices, and example scripts for advanced prompt engineering, specifically targeting foundation models like GPT-4. It aims to help researchers and practitioners achieve state-of-the-art performance on various benchmarks, particularly in complex reasoning and domain-specific tasks, by offering structured methodologies and extensible frameworks.
How It Works
The core of the project is the "Medprompt" methodology, which combines dynamic few-shot selection, self-generated chain-of-thought (CoT), and choice-shuffle ensembling. Dynamic few-shot selection uses semantic similarity (via text-embedding-ada-002
) to retrieve relevant examples for each query. Self-generated CoT automates the creation of reasoning steps, and ensembling with choice shuffling enhances robustness. Medprompt+ extends this by incorporating a portfolio approach, dynamically selecting between direct few-shot prompts and CoT-based prompts based on GPT-4's assessment of task complexity.
Quick Start & Requirements
pip install -e .
after cloning the repository and navigating to the src
directory.src/promptbase/datasets/
.python -m promptbase mmlu --subject <SUBJECT>
Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Some scripts are for reference and may not be immediately executable against public APIs. Medprompt+ relies on access to logprobs from GPT-4, which were not publicly available via the API at the time of the README's writing but were expected to be enabled.
1 year ago
Inactive