Prompt like Michelangelo: How to become a better prompt engineer
What does prompt engineering have to do with Michelangelo? It will make sense, I promise. First, we need to talk about the multiverse.
The best mental model and framework for conceptualizing large language models (LLM) that I’ve come across so far has been the multiversal view, or the idea that ”language models are multiverse generators” [1].
In this work, authors L. Reynolds and K. McDonell conceptualize language models as multiverse generators where several branching narratives can grow from a root node representing a starting prompt. By sampling tokens from the model’s probabilistic distribution at each point in a sentence, one can construct a narrative tree where the root is the starting prompt and the branches are the various possible responses that result from different token selections along the way.
The following image (from [1]) illustrates the process of constructing a narrative tree.
And what is the point of all that? The idea is that you can think of a language model as a multiverse generator since any possible input you can give it can be used to generate a virtually infinite number of parallel branches, all representing possible futures with different probabilities. For each token that is chosen as the next token in a sentence, a concrete present (out of the infinite future possibilities) materializes. The authors even draw an analogy with the many-worlds interpretation of quantum mechanics.
Subtractive prompting
In a similar work by the same authors [2], they also describe how effective 0-shot prompt programming (or prompt engineering) can outperform few-shot prompting in many cases by approaching prompting in a subtractive manner, i.e., focusing not so much on steering the model’s toward the right output, but steering it away from all the possible wrong outputs (which, in that multiversal view of LLMs, would far outnumber the correct ones). Instead of writing a lot of instructions to your prompt, think about simple ways to tell the model what not to do.
As an example applied to the task of translation, the authors used a prompt structure such as :
English: <English sentence>
French:
And that alone was better performing than such instructions as "translate this to French", or "translate the following sentence to French" which all leave room for undesirable continuations (for example, the model may well decide to continue the English sentence by generating a few more words before finally translating it to French, since it's not clearly defined where the sentence is supposed to end).
Another important thing to understand is that, fundamentally, an LLM is modeling not how any individual human may complete a sentence, but how any human potentially would. In other words, LLMs model language not after a single author but rather a superposition of authors, thus motivating a subtractive approach to prompting - i.e., one that constraints model behavior into a narrower view. As the authors put it, “we want a prompt that is not merely consistent with the desired continuation, but inconsistent with undesired continuations” (emphasis mine).
After all, the main reason that the prompt engineering discipline exists is because oftentimes the model fails to answer a question not because the answer doesn’t exist among the space of all possible answers the model can generate, but rather because it simply fails to arrive at the answer (even though it is already “there”), because it goes down the wrong "path". The primary function of prompt engineering is thus locating the solution to a given task in the model’s existing space of learned solutions. It’s about finding what’s already there, which may not be trivial to do given the size of the multiverse.
领英推荐
And this whole idea of locating and revealing a solution is what reminded me of Michelangelo’s famous quote:
The sculpture is already complete within the marble block, before I start my work. It is already there, I just have to chisel away the superfluous material.
So here’s my thesis: Prompt engineering is the art of revealing an answer that is already there by “chiseling away the superfluous”. Just like Michelangelo and his sculptures.
So how does that help you become better at prompting?
Moving from the philosophical to the practical, I believe that understanding language models in this way - though neither sufficient nor necessary for improving one’s prompt engineering skills - can help you determine a more effective prompting method for a given task. If nothing else, it helps you better understand why a particular prompting method is effective.
In other words, if you learn how to prompt like Michelangelo, you’ll be a better prompt engineer.
As an example, let’s take Open AI’s recently published prompt engineering guide [3], and look at how we can derive an explanation for why they work form the starting point of the intuition we just built.
Open AI’s six strategies to get better results
I recommend a thorough read of [2] for a more complete picture, but I hope this article gave you some inspiration for a mental framework with which to approach prompt engineering.
References
AI Business Developer, Sales Specialist & Public Speaker
1 年I love your posts! Clear, concise, informative. As always, #keepposting! ??????