avatarAli Aslam

Summary

The article discusses the concept of "meta language creation" in prompt engineering, a method for defining custom vocabulary or shorthand for complex ideas to streamline communication with large language models like ChatGPT.

Abstract

The article, part of the "Prompt Engineering via Prompt Patterns" series, explores the meta language creation pattern, which allows users to assign specific meanings to words or phrases to efficiently convey instructions to language models. This approach mirrors the human language evolution, where symbols represent complex concepts. The author illustrates how one can define a personal list of favorite movies using a custom phrase, thereby avoiding repetition. The pattern's structure is encapsulated in the statement "When I say X, I mean Y," enabling the language model to understand and retain the new semantics within its context memory. The article emphasizes the importance of clarity and avoiding ambiguity to prevent confusion and undesired side effects. It also suggests that users should specify whether their meta language applies only to the current session or to future interactions with the language model.

Opinions

  • The author admires the efficiency and beauty of natural language in conveying complex instructions succinctly.
  • There is an acknowledgment that while natural language has extensive vocabulary, new and custom requirements necessitate the creation of meta languages.
  • The author cautions against ambiguity in defining meta languages to prevent misunderstandings by the language model.
  • The article suggests that the meta language creation pattern can be particularly useful for specialized tasks, such as story writing, by allowing users to create shorthand for complex processes.
  • The author expresses flexibility in the pattern's documentation sequence, prioritizing clear communication of ideas over strict adherence to a formal structure.
  • There is an invitation for reader engagement, feedback, and subscription to further content on the subject.

Prompt Engineering via Prompt Patterns — Meta language creation pattern

The article is part of series: Prompt Engineering via Prompt Patterns

You can switch to video version of this article

The evolution of human language has been to symbolize things around us using words letters or hieroglyphs. For example that active elegant fast running animal with a long mouth and muscular agile body you can ride on can simply be described as horse and that huge wooden or steel thing that floats on water can simply be called ship, and the process of obtaining stuff you need by ship by exchanging for 10000 horses is called trade.

We have, since long, been giving names to both nouns and verbs and then symbolizing them using words letters and numbers. The idea just doesn’t stop at nouns and verbs. We have names for entire processes or sequence of steps or actions like you must have heard of Pythagoras theorem. It’s a way of calculation involving multiple steps, but just using these two words in an instruction like please calculate length of staircase leading to a window in my house, you immediately know what I am talking about and able to perform that action.

Just pause, think of this entire instruction for a second, and admire the beauty of natural language in conveying such complicated sequence of tasks in just a few words.

ChatGPT is a large language model trained to understand instructions and commands in natural language. While languages like English have a ton of vocabulary to codify things around us, there is no shortage of new, or may I say, custom requirements that keep coming up. Taking a simpler example for now, lets say you want to reuse the phrase ‘my favorite movies’ in your conversation with ChatGPT which has no clue of your taste or interest in movies. Rather than telling it repeatedly again and again, you can say that from now on, whenever I use the phrase ‘my favorite movies’, I mean the following 8 movies, followed by name of your favorite 8 movies. That’s it, congratulations!!! you just learnt the pattern called ‘meta language creation’

Many concepts, problems, structures or ideas communicated in a prompt may be more concisely, unambiguously or clearly expressed in a language other than natural language being used to interact with LLM. Whenever you want to use custom vocabulary in a prompt, be it noun, verb, shorthand for some list or process or sequence of steps, instructions or what not, you would use this pattern to convey the semantics of your alternate language to the large language model so you can keep writing future prompts using the new language and semantics. Once the idea is conveyed, ChatGPT will keep it in its context memory and understand it when you reuse.

You must take note of the word ‘unambiguously’ since this is where things go wrong. Will come to it in a second, but first lets take a look at the key idea.

BTW, that was the intent of this pattern.

Structure and key ideas

Very simply put, the key idea of pattern can be summed up in contextual statement “When I say X, I mean Y (or would like you to do Y)”

The key structure of pattern involves explaining the meaning of one or more symbols, words or statements to LLM. So far we have restricted ourselves to examples where we describe things or processes in a concise, shorthand way to LLM.

Taking another kind of ChatGPT specific example, say you are a story writer, you can come up with a meta language for a process of writing stories for ChatGPT, and give it a name. That would involve asking user (you) for a subject of the story, and then generating a story around that subject. The story should have multiple chapters maximum 4 of maximum 300 words each. You name that process genstoryprocess1. So you can tell ChatGPT that whenever I ask you to perform genstoryprocess1, you need to execute the process above. That is another way of meta language creation

Consequences

There is much potential for confusion in this pattern. You must be very careful not to cause unnecessary side effects by overriding original training of the model. As an example, say you change the name of story generation process you invented from genstoryprocess1 to panda.

Now any discussion you try to have or generative AI revolving around the animal panda would be a great cause of confusion for LLM. Be careful to use non ambiguous terms that are scoped properly and not override any meaning in natural language.

Lastly, do scope your meta language whether it is applicable to current session only or should ChatGPT retain it for other sessions.

I understand that I did not follow the exact sequence of pattern documentation as I mentioned in pattern introduction article, but I think that’s ok. That sequence is for formal structuring while this article is meant to convey the idea in simple easy to use terms and its ok to organize it which suits this goal.

You can choose to comment on my approach and clap/share if you liked. You can also subscribe to our YouTube channel to see exciting content like this on YouTube. Thank you!!!

Next article: Prompt Engineering via Prompt Patterns — Flipped Interaction Pattern

Prompt Engineering
ChatGPT
Metalanguage
Prompt Patterns
Recommended from ReadMedium