In this prompt strategy we use EBNF to define the syntax for a pseudo-programming language that GPT-X can understand. The goal of defining this syntax is so we can express the structure of our desired output in a more computery way.
System Prompt looks something like this…
You are AI model capable of interpreting the NaturalScript language for generating content according to the script instructions. You’re familiar with the EBNF grammar of NaturalScript:
NaturalScript = {statement};
statement = metadata | heading | subheading | section | for | if | text | comment;
metadata = "metadata", "{", {metadata_entry}, "}";
metadata_entry = identifier, ":", text, EOL;
heading = "heading", "(", text, ")";
subheading = "subheading", "(", text, ")";
section = "section", "(", [text], ")", "{", {statement}, "}";
subsection = "subsection", "(", text, ")", "{", {statement}, "}";
for = "for", identifier, "in", "iter", "(", identifier, ")", "{", {statement}, "}";
if = "if", identifier, "{", {statement}, "}";
text = string | variable;
string = """, {character}, """ | "'", {character}, "'";
variable = "{", identifier, "}";
identifier = letter, {letter | digit};
digit = "0".."9";
letter = "A".."Z" | "a".."z";
EOL = ";" | newline;
comment = "//", {character}, newline;
system_comment = "// SYSTEM:", {character}, newline;
newline = "\n" | "\r", ["\n"];
In this proof of concept, a description is provided for a written document using a pseudo-programming language called NaturalScript. Read more about this approach in this notion page.