what is Prompt? Intuition behind prompts
A prompt is a stimulus or input provided to a language model to initiate or guide its response
generation. It is the basis of communication between a user or system and the language model.
The intuition behind prompts lies in the fact that language models, such as GPT-3.5, are
powerful but contextually blind; they lack the knowledge of the preceding context, making them
highly sensitive to the initial input they receive.
By providing a well-crafted prompt, users or developers can effectively shape the behavior of the
language model and direct it towards desired outcomes. The goal of using prompts is to obtain
specific, relevant, and coherent responses from the language model for a given task or
application.
The intuition can be better understood through examples:
Question-Answering: If you want to use the language model as a question-answering system,
you would frame your input as a question in the prompt. For example:
Prompt: "What is the capital of France?"
Response: "The capital of France is Paris."
Translation: To utilize the model as a translation system, provide the text in one language as the
prompt:
Prompt: "Translate the following English text into French: 'Hello, how are you?'"
Response: "Bonjour, comment ça va ?"
Creative Writing: If you wish to generate creative content, you can start with a creative prompt:
Prompt: "Write a short story about a robot that learns to love."
Response: (a creatively generated story)
Code Completion: For programming tasks, you can set up the prompt to be a partial code
snippet that needs to be completed:
Prompt: "Complete the function to calculate the factorial of a number in Python: def
factorial(n):"
Response: (Python code completing the factorial function)
A prompt is a stimulus or input provided to a language model to initiate or guide its response
generation. It is the basis of communication between a user or system and the language model.
The intuition behind prompts lies in the fact that language models, such as GPT-3.5, are
powerful but contextually blind; they lack the knowledge of the preceding context, making them
highly sensitive to the initial input they receive.
By providing a well-crafted prompt, users or developers can effectively shape the behavior of the
language model and direct it towards desired outcomes. The goal of using prompts is to obtain
specific, relevant, and coherent responses from the language model for a given task or
application.
The intuition can be better understood through examples:
Question-Answering: If you want to use the language model as a question-answering system,
you would frame your input as a question in the prompt. For example:
Prompt: "What is the capital of France?"
Response: "The capital of France is Paris."
Translation: To utilize the model as a translation system, provide the text in one language as the
prompt:
Prompt: "Translate the following English text into French: 'Hello, how are you?'"
Response: "Bonjour, comment ça va ?"
Creative Writing: If you wish to generate creative content, you can start with a creative prompt:
Prompt: "Write a short story about a robot that learns to love."
Response: (a creatively generated story)
Code Completion: For programming tasks, you can set up the prompt to be a partial code
snippet that needs to be completed:
Prompt: "Complete the function to calculate the factorial of a number in Python: def
factorial(n):"
Response: (Python code completing the factorial function)