What Are You Going to Learn?To Whom is This Guide For?Join the CommunityAbout the AuthorThe Companion ToolkitYour Feedback MattersFrom NLP to Large Language ModelsWhat is Natural Language Processing?Language ModelsStatistical Models (N-Grams)Knowledge-Based ModelsContextual Language ModelsNeural Network-Based ModelsFeedforward Neural NetworksRecurrent Neural Networks (RNNs)Long Short-Term Memory (LSTM)Gated Recurrent Units (Grus)Transformer ModelsBidirectional Encoder Representations from Transformers (BERT)Generative pre-trained transformer (GPT)What’s Next?Introduction to Prompt EngineeringOpenAI GPT and Prompting: An IntroductionGenerative Pre-trained Transformers (GPT) ModelsWhat Is GPT and How Is It Different from ChatGPT?The GPT models series: a closer lookGPT-3.5GPT-4Other ModelsAPI Usage vs. Web InterfaceTokensCosts, Tokens, and Initial Prompts: How to Calculate the Cost of Using a ModelPrompting: How Does It Work?Probability and Sampling: At the Heart of GPTUnderstanding the API ParametersTemperatureTop-pTop-kSequence Length (max_tokens)Presence Penalty (presence_penalty)Frequency Penalty (frequency_penalty)Number of Responses (n)Best of (best_of)OpenAI Official ExamplesUsing the API without CodingCompletion (Deprecated)ChatInsert (Deprecated)Edit (Deprecated)Setting Up the EnvironmentChoosing the ModelChoosing the Programming LanguageInstalling the PrerequisitesInstalling the OpenAI Python libraryGetting an OpenAI API keyA Hello World ExampleInteractive PromptingInteractive Prompting with Multiline PromptFew-Shot Learning and Chain of ThoughtWhat Is Few-Shot Learning?Zero-Shot vs Few-Shot LearningApproaches to Few-Shot LearningPrior Knowledge about SimilarityPrior Knowledge about LearningPrior Knowledge of DataExamples of Few-Shot LearningLimitations of Few-Shot LearningChain of Thought (CoT)Zero-Shot CoT PromptingAuto Chain of Thought Prompting (AutoCoT)Self-ConsistencyTransfer LearningWhat Is Transfer Learning?Inductive TransferTransductive TransferInductive vs. Transductive TransferTransfer Learning, Fine-Tuning, and Prompt EngineeringFine-Tuning with a Prompt Dataset: A Practical ExampleWhy Is Prompt Engineering Vital for Transfer Learning and Fine-Tuning?Perplexity as a Metric for Prompt OptimizationAvoid Surprising the ModelHow to Calculate Perplexity?A Practical Example with BetterpromptHack the PromptReAct: Reason + ActWhat Is It?React Using LanchainGeneral Knowledge PromptingWhat Is General Knowledge Prompting?Example of General Knowledge PromptingIntroduction to Azure Prompt FlowWhat Is Azure Prompt Flow?Prompt Engineering AgilityConsiderations before Using Azure Prompt FlowCreating Your First Prompt FlowDeploying the Flow for Real-Time InferenceLangChain: The Prompt Engineer’s GuideWhat is LangChain?InstallationGetting StartedPrompt Templates and FormattingPartial PromptingComposing Prompts Using Pipeline PromptsChat Prompt TemplatesThe Core Building Block of LangChain: LLMchainCustom Prompt TemplatesFew-Shot Prompt TemplatesBetter Few-Shot Learning with Example SelectorsNGram Overlap Example SelectorMax Marginal Relevance Example SelectorLength-Based Example SelectorThe Custom Example SelectorFew-Shot Learning with Chat ModelsUsing Prompts from a FileValidating Prompt TemplatesA Practical Guide to Testing and Scoring PromptsHow and What to Evaluate in a PromptTesting and Scoring Prompts with promptfoopromptFoo: Using Variablespromptfoo: Testing with AssertionsIntegration of promptfoo with LangChainReusing Assertions with Templates in promptfoo (Dry)Streamlining the Test with promptfoo ScenariosGeneral Guidelines and Best PracticesIntroductionStart with an Action VerbProvide a Clear ContextUse Role-PlayingUse ReferencesUse Double QuotesUse Single Quotes When NeededUse Text SeparatorsBe SpecificGive ExamplesIndicate the Desired Response LengthGuide the ModelDon’t Hesitate to RefineConsider Looking at Your Problem from a Different AngleConsider Opening Another Chat (ChatGPT)Use the Right Words and PhrasesExperiment and IterateStay Mindful of LLMs LimitationsHow and Where Prompt Engineering Is UsedCreative WritingContent Generation, SEO, Marketing, and AdvertisingCustomer ServiceData Analysis, Reporting, and VisualizationVirtual Assistants and Smart DevicesGame DevelopmentHealthcare and MedicalStory Generation and Role-PlayingBusiness intelligence and analyticsImage GenerationAnatomy of a PromptRole or PersonaInstructionsInput DataContextRulesOutputExamplesTypes of PromptsDirect InstructionsOpen-Ended PromptsSocratic PromptsSystem PromptsOther Types of PromptsInteractive PromptsPrompt Databases, Tools, and ResourcesPrompt EnginePrompt Generator for ChatGPTPromptAppGPTPromptifyPromptBenchpromptfooPromptperfect: A Prompt Optimization ToolAiprm for ChatGPT: Prompt Management and DatabaseFlowGPT: A Visual Interface for ChatGPT and Prompt DatabaseWnr.ai: A No-Code Tool to Create Animated AI AvatarsAfterwordWhat’s Next?Your Feedback Matters