8

I was wondering if there is some syntax or reserved words, operators or commands to work with the ChatGPT. For example, how do you put an updated context based on the documentation of a library?

Implement a function in JavaScript using the latest ChartJS library (4.3.2). The function should take
two arguments one for the canvas element and an object with the basic configuration of the chart.
The function will return an ChartJS instance and plot a doughnut chart on the canvas element. The
function should include a plugin to show the percentage value of each segment outside of the doughnut.

This kind of prompt will not use the latest version of ChartJS because it is limited to their training data until 2021.

I found some examples, on the internet, where people use [ and ] or < and > to put a new context:

Base on this context: [
some context here
]

Implement a function in JavaScript using the latest ChartJS...

Also, I found some prompts using special characters such as [INSTRUCTIONS], {snake_case_variable}, or anything inside of a character that isn't in the rest of the prompt (i.e. {}, [] ### ###...) to declare variables. But I want to know if this really works or where can I get an official or reliable source of information to understand how to craft prompts.

3 Answers 3

12

ChatGPT has no true "reserved words" in the sense of programming languages.

Some of what you're seeing is the result of fine-tuning: a fine-tune for "perform this task" will separate the instruction from the response in the training data using some marker, and then repeat that marker when using the trained model.

Most of what you're seeing, though, is "cargo-cult prompting": people see other users include things in their prompts, and copy those features without understanding why they're used. Occasionally, those features will line up with some aspect of the training data and produce useful effects, but more often, they have no predictable result.

5
  • Perhaps unlike the traditional futility of a cargo cult, this cargo-cult prompting will eventually "cause cargo planes to land", as ChatGPT starts to determine from context what its users are hoping for when they include those pseudo-keywords? Jul 29, 2023 at 0:33
  • 2
    @JeremyFriesner, no. ChatGPT does not learn over time. All the learning took place during the training process; any changes after that are in the "short-term memory" of the history of a specific conversation and will not be available to other conversations.
    – Mark
    Jul 29, 2023 at 1:43
  • 1
    I think there will be future training processes, though, and they will likely include knowledge gleaned from previous user-interactions. Jul 29, 2023 at 3:46
  • 1
    @JeremyFriesner OpenAI claims to train on user conversations, so this might indeed have an effect. However, I doubt it'd have as much of an effect as you suggest, since users aren't providing the expected output (and there's only so far a thumbs-up / thumbs-down signal will get you).
    – wizzwizz4
    Jul 29, 2023 at 12:36
  • It does have reserved tokens, though. <|endoftext|> for instance.
    – endolith
    Aug 2, 2023 at 15:25
5

I agree that ChatGPT has no "reserved words" nor a fixed-structure programming language to tap into.

But you can use all kinds of markers to set out parts of your prompt as special instructions: it groks most of them. Eg you can give it structured data in YAML or JSON or Markdown or INI file format: it understands all of them.

It's often more efficient to ask in a "pseudocode" language rather than in natural language, because that allows you to ask more precisely, and save on tokens. Eg see

It's notable that sudolang was designed by a person and ChatGPT in cooperation :-)

2
  • Very interesting the idea to prompt a sudo-language to have more control and increase the precision of what we want to get from this platform. Most of the plugins of ChatGPT work like that they add their own prompting crafted to support their features.
    – Teocci
    Jul 29, 2023 at 1:07
  • Notice that the word sudolang is derived from both "pseudo language" ("pseudo code") and sudo (a cult unix command). Its best feature is that you can use natural language to "implement" functions, or even use functions without defining them, if the name is obvious Jul 30, 2023 at 6:44
2

The ChatGPT documentation doesn't mention "reserved words" but the documentation is pretty scarce compared with, let's say, Google Sheets, and it's ridiculous if you put it aside to the documentation of an app like Microsoft Excel.

Please don't get the above wrong. As the OpenAI people have determined, the documentation might need to be considered a "research preview". If they launch a full-fledge app, I think there will be a lot of stuff currently unknown about ChatGPT if they want to keep a strong base of "power users".

Most of what we have learned about ChatGPT features is what early adopters have figured out and distributed by "content creators".

Remember, ChatGPT is intended to use the typical way that most people use a chat app, but instead of chatting with real people, there is a machine pretending to behave similarly to most people according to its training. While ChatGPT might spill out large, grammatically looking good and kind responses, it is just a machine putting one word after another using complex algorithms based on the conversation held with the user.

Start using ChatGPT like you usually have a text chat with a human being. If the answer is not satisfactory, tell ChatGPT what is wrong. If it's still not delivering a satisfactory response, ask ChatGPT to give you a sample prompt.

Some handy features are rarely mentioned, prompt editing and regenerating response. If you have carefully crafted a prompt and it's not working as expected, you might try to edit it instead of submitting a new prompt. If the response given by ChatGPT is not satisfactory, you might get a different response by clicking "regenerate response".

There are several ChatGPT prompt collections out there; you might get inspiration from them, but be careful about the discourse about the repository, especially if they are selling something.

One of the common suggestions is that at the beginning of a new conversation with ChatGPT, start with setting the tone and context of the conversation, like if you want brief responses or if you want the responses to be formatted, let's say, as a table. Choose using complete wording instead of abbreviations. If you use an abbreviation, start using the complete wording and tell ChatGPT that from that point, you will use an abbreviation—the same for the special symbols and operators. If you use a known, well-defined syntax like the one, a programming language requires, mention what syntax you will be using, being specific should help to get more precise responses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.