amanb2000 / Magic_Words

Code for the paper "What's the Magic Word? A Control Theory of LLM Prompting"
MIT License
90 stars 12 forks source link

Multi-token backoff control #5

Closed amanb2000 closed 3 months ago

amanb2000 commented 5 months ago

Goal: Generalize the current single-output token (y) prompt optimization algorithms to multiple output tokens.

The following code snippet allows one to quickly check whether a given output string is the greedy-optimal output string for a language model:

...