Rapid engineering is a growing field, and research on this topic is increasing rapidly as of 2022. Some of the commonly used state-of-the-art cueing techniques include n-shot cueing, Chain of Thought (CoT) cueing and indications of generated knowledge.
A Python sample notebook demonstrating these techniques is shared under this GitHub project.
1. N-shot indications (zero shot indications, few shot indications)
Known for their variance, such as zero-shot cues and low-shot cues, N in N-shot cues represent the amount of “training” or clues the model is given to make predictions.
zero shot request is where a model makes predictions without any additional training. This works for common simple problems like classification (i.e. sentiment analysis, spam classification), text transformation (i.e. translation, summarization, expansion), and simple text generation that the LLM has trained in. big measure.
Indication of few shots Use a small amount of data (typically between two and five) to tailor your output based on these small examples. These examples are intended to guide the model towards better performance for a more context-specific problem.
2. Chain of Thought (CoT) Tips
Incitement to chain of thoughts was introduced by Google researchers in 2022. In the Incitement to chain of thoughtsthe model is asked to produce intermediate steps of reasoning before giving the final answer to a multi-step problem. The idea is that a model-generated chain of thought mimics an intuitive thought process when solving a multi-step reasoning problem.
This method allows models to decompose multi-step problems into intermediate steps, allowing them to solve complex reasoning problems that cannot be solved with standard prompting methods.
Some additional variations of the Chain-of Thought prompts include:
- Indications of self-consistency: Show multiple diverse paths of reasoning and select the most consistent answers. By using a majority voting system, the model can arrive at more accurate and reliable answers.
- Least to Major Indications (LtM): Specify the chain of thought to first break a problem into a series of simpler subproblems and then solve them in sequence. The resolution of each subproblem is facilitated by the answers to previously solved subproblems. This technique is inspired by real world educational strategies for children.
- active incitement: Scaling the CoT approach determining which questions are the most important and useful for human annotation. It first calculates the uncertainty between the LLM predictions, then selects the most uncertain questions, and these questions are selected for human annotation before being placed in a CoT prompt.
3. Incitement to generated knowledge
The idea behind the promotion of knowledge generated is to ask the LLM to generate potentially useful information on a given question/indication, and then leverage provided by knowledge as additional input to generate a final answer.
For example, let’s say you want to write an article about cybersecurity, particularly about cookie theft. Before asking the LLM to write the article, you can ask them to create some danger and protection against cookie theft. This will help the LLM to write a more informative blog post.
additional tactics
In addition to the techniques listed above, you can also use these tactics below to make prompting more effective.
- use delimiters as triple grave accents (“`), angle brackets (), or tags ( ) to indicate different parts of the input, making it cleaner for debugging and avoiding rapid injection.
- Ask for structured departure (i.e. HTML/JSON format), this is useful for using the model output for processing on another machine.
- Specifies the intended tone of text to get the tonality, format, and length of the model output you need. For example, you can tell the model to formalize the language, generate no more than 50 words, etc.
- modify the model temperature parameter to play with the degree of randomness of the model. The higher the temperature, the model output would be more random than accurate, and even hallucinatory.
A Python sample notebook demonstrating these techniques is shared under this GitHub project.