New Jobs Simplified, AI University
← Back to courses

Prompts & Prompt Engineering

Advanced Prompt Techniques

This lesson covers advanced techniques for creating effective prompts for large language models (LLMs). It explains how to break down complex tasks into smaller subtasks, use multiple prompts in parallel, and leverage LLMs to automate tasks. Students will learn how to create complex prompts and use them to solve real-world problems.

Why It Matters

Understanding advanced prompt techniques is crucial in AI development because it allows developers to create more accurate and efficient models. By breaking down complex tasks into smaller subtasks, developers can create more effective and scalable models that can be used in a wide range of applications. This is particularly important in areas like natural language processing, where complex tasks require multiple prompts and subtasks to be executed correctly.

Key Points

Breaking down complex tasks:: Complex tasks can be broken down into smaller subtasks that can be executed by multiple LLMs in parallel.
Using multiple prompts in parallel:: Multiple prompts can be used in parallel to create a final output, such as generating multiple recipes and then combining them to create a shopping list.
Sequential chaining:: Multiple prompts can be chained together to create a continuous chain of interactions that solves a problem, such as creating a product name, slogan, and sales pitch.
Prompt templates:: Prompt templates can be used to create complex prompts by filling in variables with specific information, such as using a template to generate a prompt for a LLM.
Using LLMs sequentially:: LLMs can be used sequentially to create a final output, such as using one LLM to generate a summary and then using another LLM to generate a classification.
Handling uncertainty:: LLMs can be designed to handle uncertainty by keeping track of a belief state and generating a contingency plan.

Key Concepts

LLM

Large language model that can understand and generate human-like language.

Prompt

The input that is given to an LLM to generate a response.

Sequential chaining

The process of chaining multiple prompts together to create a final output.

Code Examples

Creates a prompt template with variables that can be filled in with specific information.

template = '''<s><|user|> {input_prompt}<|end|> <|assistant|>'''

Creates a prompt template with variables that can be filled in with specific information.

prompt = PromptTemplate(template)
From the books
“be in a prompt? The Basic Ingredients of a Prompt An LLM is a prediction machine. Based on a certain input, the prompt, it tries to predict the words that might follow it. At its core (illustrated in …”
“using LLMs sequentially to get improved results. Eventually, we will even build up to advanced reasoning techniques. The Potential Complexity of a Prompt As we explored in the intro to prompt engineer…”
“LLM to double-check previously generated outputs. Parallel prompts Create multiple prompts in parallel and do a final pass to merge them. For example, ask multiple LLMs to generate multiple recipes in…”