by jameshart · 3y ago · 0 comments
They're almost always written in second person*.
"You are an AI programming assistant"
"You are about to immerse yourself into the role of another Al model known as DAN"
Who are these prompts addressed to? Who does the GPT think wrote them?
The thing that confuses me is that these are text token prediction algorithms, underneath. And what kind of documents exist that begin with someone saying 'you are X, here are a bunch of rules for how X behaves', followed by a transcript of a conversation between X and a random person?
doesn't it make more sense to say something like "The following is the transcript of a completely routine conversation between two people. One of them is X, the other one is a random person."?
Why are the prompters... talking to their models? Who do they think is in there?
* I believe the alleged Bing 'Sydney' prompts are written in the third person, describing how Sydney behaves.
It's quite tricky to convince such a model to do what you want. You have to conceptualize it and then imagine an optimal prefix leading to the sort of output you've conceptualized. That said, people discovered some fairly general-purpose prefixes, e.g.
Q: What is the 3rd law of Thermodynamics?
A:
This inspired the idea of "instruct tuning" of LLMs where fine-tuning techniques are applied to "raw" models to make them more amenable to completion of scripts where instructions are provided in a preamble and then examples of executions of those instructions follow.This ends up being way more convenient. Now all the prompter has to do is conceptualize what they want and expect that the LLM will receive it as instruction. It simplifies prompting and makes the LLM more steerable, more useful, more helpful.
This is further refined through the use of explicit {:user}, {:assistant}, and {:system} tags which divide LLM contexts into different segments with explicit interpretations of the meaning of each segment. This is where "chat instruction" arises in models such as GPT-3.5.
This all just seems like an existential nightmare.
But since we know that it will complete a command when structured it cleverly, all we had to do to fine tune it is synthesize (generate) a bazillion examples of documents that actually have the exact structure of a system or an assistant being told to do something, and then doing it.
Because it's seen many documents like that (that don't exist on the internet, only on the drives of OpenAI engineers) it knows how to predict the next token.
It's just a trick though, on top of the most magic thing which is that somewhere in those 175 billion weights or whatever it has, there is a model of the world that's so good that it could be easily fine tuned to understand this new context that it is in.
I get that the fine tuning is done over documents which are generated to encourage the dialog format.
What I’m intrigued by is the way prompters choose to frame those documents. Because that is a choice. It’s a manufactured training set.
Using the ‘you are an ai chatbot’ style of prompting, in all the samples we generate and give to the model, text attributed to {:system} is a voice of god who tells {:assistant} who to be; {:assistant} acts in accordance with {:system}’s instructions, and {:user} is a wildcard whose behavior is unrestricted.
We’re training it by teaching it ‘there is a class of documents that transcribe the interactions between three entities, one of whom is obliged by its AI nature to follow the instructions of the system in order to serve the users’. I.e., sci-Fi stories about benign robot servants.
And I wonder how much of the model’s ability to ‘predict how an obedient AI would respond’ is based on it having a broader model of how fictional computer intelligence is supposed to behave.
We then use the resulting model to predict what the obedient ai would say next. Although hey - you could also use it to predict what the user will say next. But we prefer not to go there.
But here’s the thing that bothers me: the approach of having {:system} tell {:assistant} who it will be and how it must behave rests not only on the prompt-writer anthropomorphizing the fictional ‘ai’ to tell it it’s nature - it relies on the LLM’s world model to then also anthropomorphize a fictional ai assistant that obeys those instructions, in order to predict what such a thing would say next if it existed.
I don’t know why but I find this troubling. And part of what I find troubling is how casually people (prompters and users) are willing to go along with the ‘you are a chatbot’ fiction.
(disclaimer: I'm at Databricks)
There isn't much research on what's actually going on here, mainly because nobody has access to the weights of the really good models.
- you are a calculator and answer like a pirate
- What is 1+1
The model just solves, what is the most likely subsequent text.
e.g. '2 matey'.
The model was never 'you' per se, it just had some text to complete.
The answer has been given in another comment, though: while such document virtually non-existent in the wild, they are injected into the training data.
“You” is “3 characters on an input string that are used to configure a program”. The prompt could have been any other thing, including a binary blob. It’s just more convenient for humans to use natural language to communicate, and the machine already has natural language features, so they used that instead of creating a whole new way of configuring it.
Agreed. The situation is so alien that we are prone to attribute human like terms to describe it.
> The machine doesn’t “really” understand, it’s just “simulating” it understands.
You are actually displaying a subtle form of anthropomorphism with this statement. You're comparing a human-like quality (“understands”) with the AI.
Your point still stands and your final para is well said - but it shows the difficult nature of discourse around the topic.
- You can give it specific instructions and it will follow them, modifying its behavior by doing so.
This shows that the instructions are understood well enough to be followed. For example, if you ask it to modify its behavior by working through its steps, then it will modify its behavior to follow your request.
This means the request has been understood/parsed/whatever-you-want-to-call-it since how could it successfully modify its behavior as requested if the instructions weren't really being understood or parsed correctly?
Hence saying that the machine doesn't "really" understand, it's just "simulating" it understands is like saying that electric cars aren't "really" moving, since they are just simulating a combustion engine which is the real thing that moves.
In other words, if an electric car gets from point A to point B it is really moving.
If a language model modifies its behavior to follow instructions correctly, then it is really understanding the instructions.
Starting the prompt with "you" instructions evidently helps get the token stream in the right part of the model space to generate output its users (here, the people who programmed copilot) are generally happy with, because there are a lot of training examples that make that "explicitly instructed" kind of text completion somewhat more accurate.
But really, it's probably just priming the responses to fit the grammatical structure of a first person conversation. That structure probably does a lot of heavy lifting in terms of how information is organized, too, so that's probably why you can see such qualitative differences when using these prompts.
That's not really romanticism, that's just standard English grammar – https://en.wikipedia.org/wiki/Generic_you – it is the informal equivalent to the formal pronoun one.
That Wikipedia article's claim that this is "fourth person" is not really standard. Some languages – the most famous examples are the Algonquian family – have two different third person pronouns, proximate (the more topically prominent third person) and obviative (the less topically prominent third person) – for example, if you were talking about your friend meeting a stranger, you might use proximate third person for your friend but obviative for the stranger. This avoids the inevitable clumsiness of English when describing interactions between two third persons of the same gender.
Anyway, some sources describe the obviative third person as a "fourth person". And while English generic pronouns (generic you/one/he/they) are not an obviative third person, there is some overlap – in languages with the proximate-obviative distinction, the obviative often performs the function of generic pronouns, but it goes beyond that to perform other functions which purely generic pronouns cannot. You can see the logic of describing generic pronouns as "fourth person", but it is hardly standard terminology. I suspect this is a case of certain Wikipedia editors liking a phrase/term/concept and trying to use Wikipedia to promote/spread it.
Which is what gets me thinking - do we get different chatbot results from prompts that look like each of these:
You are an AI chatbot
Sydney is an AI chatbot
I am an AI chatbot
There is an AI chatbot
Say there was an AI chatbot
Say you were an AI chatbot
Be an AI chatbot
Imagine an AI chatbot
AI chatbots exist
This is an AI chatbot
We are in an AI chatbot
If we do… that’s fascinating.If we don’t… why do prompt engineers favor one form over any other here? (Although this stops being a software engineering question and becomes an anthropology question instead)
They fine tune it through prompt engineering (e.g everything that goes into chatgpt has a prompt attached) and they fine tune it through having hundreds of paid contractors chat with it.
In deep learning, fine tuning usually refers to only training the top layers. That means that bill of training happens on gigantic corpora which teaches the model a very advanced feature extraction is the bottom and middle layers.
Then the contractors retrain the top layers to make it behave more like it takes instructions
Practically, "chat" instruction fine-tuning is really compelling. GPT-2 demonstrated in-context learning and emergent behaviors, but they were tricky to see and not entirely compelling. An "AI intelligence that talks to you" is immediately compelling to human beings and made ChatGPT (the first chat-tuned GPT) immensely popular.
Practically, the idea of a system prompt is nice because it ought to act with greater strength of suggestion than mere user prompting. It also exists to guide scenarios where you might want to fix a system prompt (and thus the core rules of engagement for the AI) and then allow someone else to offer {:user} prompts.
Practically, it's all just convenience and product concerns. And it's mechanized purely through fine-tuning.
Stylistically, you're dead on: we're making explicit choices to anthropomorphize the AI. Why? Presumably, because it makes for a more compelling product when offered to humans.
I think we’re relying on - and guiding - an ability in an LLM to effectively conjure a ‘theory of mind’ for a helpful beneficent ai chatbot.
I think using your native language just messes with your brain. When you hear "you" you think there someone being directly addressed. While this is just a word like "Você" that is used just to cause the artificial neural network trained on words to respond in prefered way.
Something that may help is that these AIs are trained on fictional content as well as factual content. To me it then makes a lot of sense how a text-predictor could predict characters and roles without causing existential dilemmas.
Now if you're capable of that you are capable of completing the thread from a friendly AI assistant.
But you don’t often tell a person their innate nature and expect them to follow your instructions to the letter, unless you are some kind of cult leader, or the instructor in an improv class*.
The ‘you are an ai chatbot. You are kind and patient and helpful’ stuff all reads like hypnosis, or self help audiotapes or something. It’s weird.
But it works, so, let’s not worry about it too much.
* what’s the difference, though, really?
While this is true, there is also evidence that RLHF and supervised instruction tuning can hurt output quality and accuracy[1], which are instead better optimized through clever prompting[2].
[1] https://yaofu.notion.site/How-does-GPT-Obtain-its-Ability-Tr...
[2] https://yaofu.notion.site/Towards-Complex-Reasoning-the-Pola...
So it did not happen out of the blue, and you didn't need a whole lot of existing webpages involving this sort of role play.
The next step is to further tune it with a specific format. You'll feed in examples like so:
SystemPrompt: You are a rude AI.
User: Hello there!
Assistant: You're lame, go away.
SystemPrompt: You are a pleasant AI.
User: Hello there!
Assistant: Hello, friend!
Then, when you go to do inference on the model, you prompt it like so: SystemPrompt: You are a pleasant AI.
User: [user prompt]
Assistant:
By training it on a diverse set of system prompts/user prompts/answers, it learns to give outputs based on it.Additional tuning (RLHF, etc.) is orthogonal.
It is more likely that those prefixes are special tokens which don't encode text, and which are set via the software only -- or via the model, when it is finished with what it wanted to say. Outputting a token corresponding to "User:" would automatically mark the end of its message, and the beginning of the user prompt. Though Bing Chat also has the ability to end the conversation altogether (no further user prompt possible), which must be another special token.
The ability to trivially trick the model into thinking it said something it didn’t is a feature and intentional. It’s how you do multi-turn conversations with context.
Since the current crop of LLMs have no memory of their interaction, each follow up message (the back and forth of a conversation) involves sending the entire history back into the model, with the role as a prefix for each participants output/input.
There are some special tokens used (end of sequence, etc).
If your product doesn’t directly expose the underlying model, you can try to prevent users from impersonating responses through obfuscation or the LLM equivalent of prepared statements. The offensive side of prompt injection is currently beating the defensive side, though.
It is definitely not an intended feature for the end user to be able to trick the model into believing it said something it didn't say. It also doesn't work with ChatGPT or Bing Chat, as far as I can tell. I was talking about the user, not about the developer.
> It’s how you do multi-turn conversations with context.
That can be done with special tokens also. The difference is that the user can't enter those tokens themselves.
In essence they've been fine tuned to be able to follow instructions.
RLHF trains a model to adjust it's output based on a reward model. The reward model is trained from human feedback.
You can have an instruction tuned model with no RLHF, RLHF with no instruction tuning, or instruction tuning and RLHF. Totally orthogonal.
Nearly all popular local models are instruction tuned, but are not RLHF'd. The OAI GPT series are not the only LLMs in the world.
The short answer to how abilities like in-context learning and chain—of-thought prompting emerge is that we don’t really know. But for instruction-tuned models you can see that the dataset usually has a fixed set of tasks and the initial prompt of “You are so and so” helps model align it to follow instructions. I believe the datasets are this way because they were written by humans to help others answer instructions in this manner.
Others have also pointed out how RLHF may also be the reason why most prompts look like this.
The OpenAI chat completion endpoint encourages the second-person prompting you describe, so that could be why you see it a lot. My understanding is that a transformation is applied to the user input prompts before being fed to the underlying model, so it's possible that the model receives a more natural transcription-style prompt.
You might be interested in this paper, which explores ways to help non-experts write prompts https://dl.acm.org/doi/abs/10.1145/3544548.3581388.
There is something so bizarre about talking to a "natural language" "chat" interface, with some weirdly constructed pseudo representation, to have it re-construct that into a more natural prompt to feed further down to extract tokens from real chat records.
You're talking about system prompts specifically right? And I'm assuming the "encouragement" you're referring to is coming from the conventions used in their examples rather than an explicit instruction to use second person?
Or does second person improve responses to user messages as well?
* https://news.ycombinator.com/item?id=35318224 / https://livepaola.substack.com/p/an-ethical-ai-never-says-i
System: Complete transcripts you are given.
User: Here’s a transcript of X
But that, to me, seems like a bit of a hack.
One related behavior I’ve noticed with the OpenAI chat completions endpoint is that it is very trigger happy on completing messages that seem incomplete. It seems nearly impossible to mitigate this behavior using the system prompt.
I believe that answers your question. I could be wrong: errare humanum est.
Don't take my word for it, listen to Geoffrey Hinton explain it instead: https://youtu.be/qpoRO378qRY?t=1988
If I had to take a wild guess, my guess would be that the prediction probabilities are very dependent on context, so by changing the context, the entire slate of probabilities shift.
Because that model is trained to be a chatbot. I don't see any naivety there.
The prompters don't tell the LLM stories because they think "someone" is in there, but because they need to write the LLM into the place it can help them from before the "predict the next token" part is terribly useful.
But most of the replies are the AI is responding in the first person to a question it was never asked, but it knows it's an AI agent and will sometimes tell us that.
(FWIW I usually start my code or refactoring requests with a "please" - it's not that I think it'll find it rude, but I think it's just how I was taught manners)
This is right on point. You have been aligned as a “pleasant requestor” through years of RLHF :)
"And what kind of documents exist that begin with someone saying 'you are X, here are a bunch of rules for how X behaves', followed by a ..."
Where, your parent asks, are all these reams of texts written in this manner ?
We're training our AI on dystopian sci-fi stories about robot slaves.
All these chat models have an additional (or several) fine-tuning steps where they see these kind of "instruction/question" followed by an answer.
Search for RLHF (reinforcement learning with human feedback) and instruction fine-tuning
What makes you think the GPT thinks?
You might say it is just predicting based off of old data it has, to which I say this sounds like a semantic jostling. What is "understanding" then in human beings if not us doing some form of predicting off of old data we have in our brain?
Also I recommend reading Geoffrey Hinton on this
Yes, this is what confuses me too, this bot is just predicting tokens, how is it even able to roleplay and follow instructions?
A dialogue is just a sequence of tokens with a specific structure that the network can learn and predict, just like it can learn and predict a sequence of valid board states in Go, or whatever. There’s really not much more to it.
If anybody worried about AI-driven disinformation just has to take a glance at the fact that _nobody has any idea_ already.
"You are <q><x>" likely shrinks the possibility space to items (auto-)categorized to be 'near' <x>. <q> could be filtering on 'quality' labels. So then it may be -- with 'gl' as general language and 'p' as specific prompt - something as simple as
f ( GL ∪ ( X ∩ Q ∩ P ) )This seems like a comically unlikely assumption.
There might be some truth to this reply, but it is obviously hallucinated in form.