Prompt Learner is designed to make prompts modular.
This enables easy tuning, quick experimentation, and frictionless maintenance.
A prompt is composed of distinct modules where each module can be optimized & modified both on its own, and as a part of the complete system. Some modules are -
- The task type
- The task description
- A few examples
- Custom Prompt Technique specific Instructions
- Instructions for output format
See the documentation on "Why Prompt Learner?" to learn more.
You can pip install
Prompt Learner:
pip install prompt-learner
Tip
See the getting started tutorial for a detailed example of Prompt Learner in action.
Prompt-learner runs on the above architecture.
Starting from the left, the user has to decide on 3 aspects -
- The Task
- A set of Examples
- An LLM Adapter
A task and examples feed into the template of choice (Claude, Open AI..). The task and examples also interact with selectors which can pick the best n examples for the task using statistical and machine learning techniques. These selected examples slot into the template, along with any custom instructions from any prompting technique( such as adding 'think step by step' for chain of thought prompting) comprise the final prompt. The prompt invokes the LLM through the adapter with any given inference sample to produce the final output.