您的浏览器禁用了JavaScript(一种计算机语言,用以实现您与网页的交互),请解除该禁用,或者联系我们。[未知机构]:chatGPT究极进化指南-如何让prompt成为高效的咒语 - 发现报告
当前位置:首页/其他报告/报告详情/

chatGPT究极进化指南-如何让prompt成为高效的咒语

2023-03-22-未知机构爱***
chatGPT究极进化指南-如何让prompt成为高效的咒语

chatGPT究极进化指南⸺如何让prompt成为高效的咒语更多chatGPT知识:0基础小白学习ChatGPT来源⻚面:https://github.com/dair-ai/Prompt-Engineering-Guide本文在线地址(可根据目录查看):chatGPT究极进化指南⸺如何让prompt成为高效的咒语翻译:openai校对:Stephen(水平有限)账号,plus代充,聊天机器人部署,chatGPT商业化交流微信:isiuonkPromptingIntroduction(prompt介绍)=====================================================================================Promptengineeringisarelativelynewdisciplinefordevelopingandoptimizingpromptstoefficientlyuselanguagemodels(LMs)forawidevarietyofapplicationsandresearchtopics.Promptengineeringskillshelptobetterunderstandthecapabilitiesandlimitationsoflargelanguagemodels(LLMs).ResearchersusepromptengineeringtoimprovethecapacityofLLMsonawiderangeofcommonandcomplextaskssuchasquestionansweringandarithmeticreasoning.DevelopersusepromptengineeringtodesignrobustandeffectivepromptingtechniquesthatinterfacewithLLMsandothertools."提示工程是一⻔相对较新的学科,用于开发和优化提示以有效地使用语言模型(LMs)来处理各种应用程序和研究主题。提示工程技能有助于更好地了解大型语言模型(LLMs)的能力和局限性。研究人员使用提示工程来改进LLMs在各种常⻅和复杂的任务上的能力,例如问答和算术推理。开发者使用提示工程来设计强大而有效的提示技术,与LLMs和其他工具进行交互。" Thisguidecoversthebasicsofstandardpromptstoprovidearoughideaonhowtousepromptstointeractandinstructlargelanguagemodels(LLMs).这篇指南涵盖了标准提示的基础知识,提供了使用提示与大型语言模型(LLMs)进行交互和指导的大致思路。Allexamplesaretestedwithtext-davinci-003(usingOpenAI'splayground)unlessotherwisespecified.Itusesthedefaultconfigurations,e.g.,temperature=0.7andtop-p=1.除非另有说明,否则所有例子都是使用OpenAI的playground中的text-davinci-003进行测试的。它使用默认配置,例如temperature=0.7和top-p=1。Topic:•[BasicPrompts]•[AWordonLLMSettings]•[StandardPrompts]•[PromptElements]•[GeneralTipsforDesigningPrompts]BasicPrompts(基本提示)--------------------------------------- Youcanalreadyachievealotwithprompts,butthequalityofresultsdependsonhowmuchinformationyouprovideit.Apromptcancontaininformationliketheinstructionorquestionyouarepassingtothemodelandincludingotherdetailssuchasinputsorexamples.你已经可以通过提示实现很多功能,但是结果的质量取决于你提供的信息量。提示可以包含如指令或问题等传递给模型的信息,以及包括其他细节,如输入或示例。Hereisabasicexampleofasimpleprompt:这里是一个简单提示的基本例子:PromptThe sky is天空是。123Output:blueThe sky is blue on a clear day. On a cloudy day, the sky may be gray or white.在晴朗的日子里,天空是蓝色的。在多云的日子里,天空可能是灰色或白色的。12345Asyoucansee,thelanguagemodeloutputsacontinuationofstringsthatmakesensegivethecontext"The sky is".Theoutputmightbeunexpectedorfarfromthetaskwewanttoaccomplish. 正如你所看到的,语言模型输出了一系列字符串的延续,这些字符串在给定上下文“天空是......”下是有意义的。输出结果可能出乎意料,或者离我们想要完成的任务相差甚远。Thisbasicexamplealsohighlightsthenecessitytoprovidemorecontextorinstructionsonwhatspecificallywewanttoachieve.这个基本示例也突显了提供更多上下文或说明以明确我们想要实现的具体目标的必要性。Let'strytoimproveitabit:让我们试着稍微改进一下吧:Prompt:Complete the sentence: The sky is完成这个句子:天空12345Output:so beautiful today.今天真美丽。123Isthatbetter?Well,wetoldthemodeltocompletethesentencesotheresultlooksalotbetterasitfollowsexactlywhatwetoldittodo("completethesentence").Thisapproachofdesigning optimalpromptstoinstructthemodeltoperformataskiswhat'sreferredtoaspromptengineering.这个更好了吗?我们告诉模型要完成这个句子,所以结果看起来更好,因为它完全按照我们告诉它要做的("完成句子")来执行。这种通过设计最佳提示来指导模型执行任务的方法被称为提示工程。Theexampleaboveisabasicillustrationofwhat'spossiblewithLLMstoday.Today'sLLMsareabletoperformallkindsofadvancedtasksthatrangefromtextsummarizationtomathematicalreasoningtocodegeneration.上面的例子是展示LLMs今天所能做到的基本示例。现今的LLMs能够执行各种高级任务,包括文本摘要、数学推理以及代码生成。AWordonLLMSettings(LLM设置注意事项)-----------------------------------------------------------------Whenworkingwithprompts,youwillbeinteractingwiththeLLMviaanAPIordirectly.Youcanconfigureafewparameterstogetdifferentresultsforyourprompts.在使用提示时,您将通过API或直接与LLM进行交互。您可以配置一些参数,以获取不同的提示结果。Temperature-Inshort,thelowerthetemperaturethemoredeterministictheresultsinthesensethatthehighestprobablenexttokenisalwayspicked.Increasingtemperaturecouldleadtomorerandomnessencouragingmorediverseorcreativeoutputs.Weareessentiallyincreasingtheweightsoftheotherpossibletokens.Intermsofapplication,wemightwanttouselowertemperatureforsomethinglikefact-basedQAtoencouragemorefactualandconciseresponses.Forpoemgenerationorothercreativetasksitmightbebeneficialtoincreasetemperature. 温度-简而言之,温度越低,结果越确定,因为最有可能的下一个标记总是被优先选择。增加温度可能会导致更多的随机性,鼓励更多的多样化或创造性输出,实际上增加了其他可能标记的权重。在应用方面,对于像基于事实的问答这样的内容,我们可能希望使用较低的温度来鼓励更加实际和简洁的回答。对于诗歌生成或其他创意任务,增加温度可能会更有益。Top_p-Similarly,withtop_p,asamplingtechniquewithtemperaturecallednucleussampling,youcancontrolhowdeterministicthemodelisatgeneratingaresponse.Ifyouarelookingforexactandfactualanswerskeepthislow.Ifyouarelookingformorediverseresponses,increasetoahighervalue.使用top_p技术和称为核心采样的带有温