dm4ml / motion

Framework for building and maintaining self-updating prompts for LLMs
https://dm4ml.github.io/motion/
58 stars 4 forks source link

Experimentation mode #150

Closed shreyashankar closed 10 months ago

shreyashankar commented 1 year ago

Maybe have a context manager?

shreyashankar commented 1 year ago

See https://github.com/shreyashankar/prompteng/blob/main/travelagent.py for a very clunky example of user having to hash the experiment variables.

shreyashankar commented 1 year ago

Possibly, each component state comes with an OpenAI or LLM connection, and we have nice utils to query the LLM (with retry decorators, role the LLM must play, parsing functions, etc). Or we have our own LLMComponent object that users can put in their component states, which encompass roles, parsing functions, etc. LLMComponent objects should not have any data!

LLM role:

Parsing functions:

shreyashankar commented 1 year ago

Experimentation

Goal: for a component, a user should be able to define a dataset, initialize a template in init_state, iteratively refine a template in a jupyter notebook, and then launch an experiment to find the best prompt template for their dataset. When the component is running in prod, the experiment should be able to run automatically, under the hood.

Iterative Prompt Exploration

Auto Prompt Exploration

(Start from a template found by the process above)

Things to add

shreyashankar commented 1 year ago

Consider always setting batch size to 1? Might be easier to manage tbh