(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21706],{17104:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/models/flan.en",function(){return t(28943)}])},65314:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-1.c26df985.png",height:507,width:940,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAKlBMVEXy9vPTyc3n5ubq7/Lm3uLg2tv////I0tvR3s7I1sbZ4tfFtL7LusXc59qwDr7qAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAJklEQVR4nAXBBwEAMAzDMKd/jz/dSXi3l1PEUaAbmNIslTBD7fU+CacAlqF/OiAAAAAASUVORK5CYII=",blurWidth:8,blurHeight:4}},49712:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-10.60080e50.png",height:660,width:955,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAKlBMVEXa4enu8PDq7OXe5Oi5x8vG09PS3Mvi5+rJ2N3e49jS2+Lm7PXf5Nzj6dtfCjhTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAL0lEQVR4nAXBBwEAIAzAsO4fwL9dErASzATvrYguZp7oUwGO7HLwCHNvyEy9c/UDGOEA/rDfm2IAAAAASUVORK5CYII=",blurWidth:8,blurHeight:6}},2912:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-11.3b3298da.png",height:708,width:978,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAARVBMVEXm3djS2+Hbwb7n1cnS0tnd3+LH1dvk5+jp7e7w6+PQ3dHv59LK2MPCu9a4xtjKzNDo2sfr4cPr5trg5967y+Gsurvm4uGRPCUBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANElEQVR4nAXBhwHAIAzAMAeymN3/v1qJfFIkLZjT9+uf07uupVuIQ80iknY3aMC4Rj1rKT8siQGIEhh3XAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:6}},88916:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-2.10409595.png",height:376,width:867,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAADFBMVEX4+Pz19fXt7e/9+/1ubsDPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAHUlEQVR4nBXHsQ0AAAyDMCD//1zVm3EgQGTsW1MPAWwAHiSAa60AAAAASUVORK5CYII=",blurWidth:8,blurHeight:3}},38070:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-3.db3a0ec9.png",height:500,width:811,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAACVBMVEX7+/vw8PD29fWdLZFSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIUlEQVR4nBXKsQkAAACDMPX/o0txC4KGyotAwYCKw+lPAwMLACPk8AmaAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5}},24791:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-4.a595d5a6.png",height:377,width:814,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAADFBMVEX3+Pjx8vHo6ejc3NwhzgLkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAHklEQVR4nCXGsQ0AAAzCsAT+/7mq8GQkTyrTsDYqegKZACGw5FvGAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:4}},17299:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-5.98a6c013.png",height:604,width:954,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAAFVBMVEXx8fHm5uX7+/rt7e3k3Nzc4OTs6uo3bSk7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAJ0lEQVR4nBXIwREAMAjDMJsE9h+5Vz1Flh6CezUGDzMzuLQRAv3zAAkAAF+Ym1DXAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5}},39293:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-6.a24343d8.png",height:538,width:599,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAMAAAACh/xsAAAAIVBMVEX////z9PTa5Orm6+7s7vC50N7h4uL8+vnT2d3E1eCtxNLysDUmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAMklEQVR4nB3HQRKAMAwDsbWdNCn/fzADugmoPeKTczIw/yIkcLUpxddtNH17H8M4zuoFEmYArUbdBpkAAAAASUVORK5CYII=",blurWidth:8,blurHeight:7}},60590:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-7.c600a1de.png",height:446,width:947,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAElBMVEX19vXx8O/q7PH+/v7t5ebk3t5rn+9TAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIUlEQVR4nBXIsQ0AAAjDsITC/y+jejQz3qKIK0DnFJJO8gQLADvbulOmAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:4}},37912:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-8.fda963af.png",height:593,width:935,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAAKlBMVEXh5ujZ3+Tv8fHk5+vT2trn7OzZ4Nrg6d7P3crW4tC7ysHC0Lq1w7PJ0s+Tc/eCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAKklEQVR4nAXBBwEAMAzDMKd/jz/dSUhKhPH2rr7T1DnLZjXg5u5GBFmh/BHaAMGZu2zPAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5}},49666:function(e,n){"use strict";n.Z={src:"/_next/static/media/flan-9.78364907.png",height:521,width:942,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAElBMVEXo7OzX3uLQ2+LN1tbh5uLy9PHS4ObfAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIklEQVR4nB3JsQ0AMAzDMMlO/3+5SAZOxIoRGN4xObSZ7Q8DtgA3lEwERAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:4}},28943:function(e,n,t){"use strict";t.r(n),t.d(n,{__toc:function(){return f}});var a=t(11527),i=t(77154),o=t(51592),r=t(52243);t(44064),t(76948);var s=t(5424),l=t(44613),d=t(65314),c=t(88916),g=t(38070),m=t(24791),u=t(17299),p=t(39293),A=t(60590),h=t(37912),x=t(49666),k=t(49712),M=t(2912);let f=[{depth:2,value:"What's new?",id:"whats-new"},{depth:2,value:"Capabilities & Key Results",id:"capabilities--key-results"}];function _createMdxContent(e){let n=Object.assign({h1:"h1",h2:"h2",p:"p",a:"a",strong:"strong",ul:"ul",li:"li"},(0,s.a)(),e.components);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{children:"Scaling Instruction-Finetuned Language Models"}),"\n","\n",(0,a.jsx)(n.h2,{id:"whats-new",children:"What's new?"}),"\n",(0,a.jsx)(l.w,{src:d.Z,alt:"FLAN1"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsxs)(n.p,{children:["This paper explores the benefits scaling ",(0,a.jsx)(n.a,{href:"https://arxiv.org/pdf/2109.01652.pdf",children:"instruction finetuning"})," and how it improves performance on a variety of models (PaLM, T5), prompting setups (zero-shot, few-shot, CoT), and benchmarks (MMLU, TyDiQA). This is explored with the following aspects: scaling the number of tasks (1.8K tasks), scaling model size, and finetuning on chain-of-thought data (9 datasets used)."]}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"Finetuning procedure:"})}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"1.8K tasks were phrased as instructions and used to finetune the model"}),"\n",(0,a.jsx)(n.li,{children:"Uses both with and without exemplars, and with and without CoT"}),"\n"]}),"\n",(0,a.jsx)(n.p,{children:"Finetuning tasks and held out tasks shown below:"}),"\n",(0,a.jsx)(l.w,{src:M.Z,alt:"FLAN11"}),"\n",(0,a.jsx)(n.h2,{id:"capabilities--key-results",children:"Capabilities & Key Results"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"Instruction finetuning scales well with the number of tasks and the size of the model; this suggests the need for scaling number of tasks and size of model further"}),"\n",(0,a.jsx)(n.li,{children:"Adding CoT datasets into the finetuning enables good performance on reasoning tasks"}),"\n",(0,a.jsx)(n.li,{children:"Flan-PaLM has improved multilingual abilities; 14.9% improvement on one-shot TyDiQA; 8.1% improvement on arithmetic reasoning in under-represented languages"}),"\n",(0,a.jsx)(n.li,{children:"Plan-PaLM also performs well on open-ended generation questions, which is a good indicator for improved usability"}),"\n",(0,a.jsx)(n.li,{children:"Improves performance across responsible AI (RAI) benchmarks"}),"\n",(0,a.jsx)(n.li,{children:"Flan-T5 instruction tuned models demonstrate strong few-shot capabilities and outperforms public checkpoint such as T5"}),"\n"]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"The results when scaling number of finetuning tasks and model size:"})," scaling both the size of the model and the number of finetuning tasks is expected to continue improving performance, although scaling the number of tasks has diminished returns."]}),"\n",(0,a.jsx)(l.w,{src:c.Z,alt:"FLAN2"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"The results when finetuning with non-CoT and CoT data:"})," Jointly finetuning on non-CoT and CoT data improves performance on both evaluations, compared to finetuning on just one or the other."]}),"\n",(0,a.jsx)(l.w,{src:g.Z,alt:"FLAN3"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(n.p,{children:"In addition, self-consistency combined with CoT achieves SoTA results on several benchmarks. CoT + self-consistency also significantly improves results on benchmarks involving math problems (e.g., MGSM, GSM8K)."}),"\n",(0,a.jsx)(l.w,{src:m.Z,alt:"FLAN4"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(n.p,{children:'CoT finetuning unlocks zero-shot reasoning, activated by the phrase "let\'s think step-by-step", on BIG-Bench tasks. In general, zero-shot CoT Flan-PaLM outperforms zero-shot CoT PaLM without finetuning.'}),"\n",(0,a.jsx)(l.w,{src:p.Z,alt:"FLAN6"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(n.p,{children:"Below are some demonstrations of zero-shot CoT for PaLM and Flan-PaLM in unseen tasks."}),"\n",(0,a.jsx)(l.w,{src:u.Z,alt:"FLAN5"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(n.p,{children:"Below are more examples for zero-shot prompting. It shows how the PaLM model struggles with repetitions and not replying to instructions in the zero-shot setting where the Flan-PaLM is able to perform well. Few-shot exemplars can mitigate these errors."}),"\n",(0,a.jsx)(l.w,{src:A.Z,alt:"FLAN7"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(n.p,{children:"Below are some examples demonstrating more zero-shot capabilities of the Flan-PALM model on several different types of challenging open-ended questions:"}),"\n",(0,a.jsx)(l.w,{src:h.Z,alt:"FLAN8"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(l.w,{src:x.Z,alt:"FLAN9"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsx)(l.w,{src:k.Z,alt:"FLAN10"}),"\n",(0,a.jsxs)(n.p,{children:["Image Source: ",(0,a.jsx)(n.a,{href:"https://arxiv.org/abs/2210.11416",children:"Scaling Instruction-Finetuned Language Models"})]}),"\n",(0,a.jsxs)(n.p,{children:["You can try ",(0,a.jsx)(n.a,{href:"https://huggingface.co/google/flan-t5-xxl",children:"Flan-T5 models on the Hugging Face Hub"}),"."]})]})}let P={MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:n}=Object.assign({},(0,s.a)(),e.components);return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(_createMdxContent,{...e})}):_createMdxContent(e)},pageOpts:{filePath:"pages/models/flan.en.mdx",route:"/models/flan",timestamp:172589822e4,pageMap:[{kind:"Meta",locale:"en",data:{index:"Prompt Engineering",introduction:"Introduction",techniques:"Techniques",guides:"Guides",applications:"Applications",prompts:"Prompt Hub",models:"Models",risks:"Risks & Misuses",research:"LLM Research Findings",papers:"Papers",tools:"Tools",notebooks:"Notebooks",datasets:"Datasets",readings:"Additional Readings",course:{title:"\uD83C\uDF93 Prompt Engineering Course",type:"page"},services:{title:"Services",type:"page"},about:{title:"About",type:"page"}}},{kind:"MdxPage",name:"about",route:"/about",locale:"en"},{kind:"Folder",name:"applications",route:"/applications",children:[{kind:"Meta",locale:"en",data:{"finetuning-gpt4o":"Fine-tuning GPT-4o",function_calling:"Function Calling","context-caching":"Context Caching with LLMs",generating:"Generating Data",synthetic_rag:"Generating Synthetic Dataset for RAG",generating_textbooks:"Tackling Generated Datasets Diversity",coding:"Generating Code",workplace_casestudy:"Graduate Job Classification Case Study",pf:"Prompt Function"}},{kind:"MdxPage",name:"coding",route:"/applications/coding",locale:"en"},{kind:"MdxPage",name:"context-caching",route:"/applications/context-caching",locale:"en"},{kind:"MdxPage",name:"finetuning-gpt4o",route:"/applications/finetuning-gpt4o",locale:"en"},{kind:"MdxPage",name:"function_calling",route:"/applications/function_calling",locale:"en"},{kind:"MdxPage",name:"generating",route:"/applications/generating",locale:"en"},{kind:"MdxPage",name:"generating_textbooks",route:"/applications/generating_textbooks",locale:"en"},{kind:"MdxPage",name:"pf",route:"/applications/pf",locale:"en"},{kind:"MdxPage",name:"synthetic_rag",route:"/applications/synthetic_rag",locale:"en"},{kind:"MdxPage",name:"workplace_casestudy",route:"/applications/workplace_casestudy",locale:"en"}]},{kind:"MdxPage",name:"applications",route:"/applications",locale:"en"},{kind:"MdxPage",name:"course",route:"/course",locale:"en"},{kind:"MdxPage",name:"datasets",route:"/datasets",locale:"en"},{kind:"Folder",name:"guides",route:"/guides",children:[{kind:"Meta",locale:"en",data:{"optimizing-prompts":"Optimizing Prompts"}},{kind:"MdxPage",name:"optimizing-prompts",route:"/guides/optimizing-prompts",locale:"en"}]},{kind:"MdxPage",name:"index",route:"/",locale:"en"},{kind:"Folder",name:"introduction",route:"/introduction",children:[{kind:"Meta",locale:"en",data:{settings:"LLM Settings",basics:"Basics of Prompting",elements:"Prompt Elements",tips:"General Tips for Designing Prompts",examples:"Examples of Prompts"}},{kind:"MdxPage",name:"basics",route:"/introduction/basics",locale:"en"},{kind:"MdxPage",name:"elements",route:"/introduction/elements",locale:"en"},{kind:"MdxPage",name:"examples",route:"/introduction/examples",locale:"en"},{kind:"MdxPage",name:"settings",route:"/introduction/settings",locale:"en"},{kind:"MdxPage",name:"tips",route:"/introduction/tips",locale:"en"}]},{kind:"MdxPage",name:"introduction",route:"/introduction",locale:"en"},{kind:"Folder",name:"models",route:"/models",children:[{kind:"Meta",locale:"en",data:{chatgpt:"ChatGPT","claude-3":"Claude 3","code-llama":"Code Llama",flan:"Flan",gemini:"Gemini","gemini-advanced":"Gemini Advanced","gemini-pro":"Gemini 1.5 Pro",gemma:"Gemma","gpt-4":"GPT-4","grok-1":"Grok-1",llama:"LLaMA","llama-3":"Llama 3","mistral-7b":"Mistral 7B","mistral-large":"Mistral Large",mixtral:"Mixtral","mixtral-8x22b":"Mixtral 8x22B",olmo:"OLMo","phi-2":"Phi-2",sora:"Sora",collection:"LLM Collection"}},{kind:"MdxPage",name:"chatgpt",route:"/models/chatgpt",locale:"en"},{kind:"MdxPage",name:"claude-3",route:"/models/claude-3",locale:"en"},{kind:"MdxPage",name:"code-llama",route:"/models/code-llama",locale:"en"},{kind:"MdxPage",name:"collection",route:"/models/collection",locale:"en"},{kind:"MdxPage",name:"flan",route:"/models/flan",locale:"en"},{kind:"MdxPage",name:"gemini-advanced",route:"/models/gemini-advanced",locale:"en"},{kind:"MdxPage",name:"gemini-pro",route:"/models/gemini-pro",locale:"en"},{kind:"MdxPage",name:"gemini",route:"/models/gemini",locale:"en"},{kind:"MdxPage",name:"gemma",route:"/models/gemma",locale:"en"},{kind:"MdxPage",name:"gpt-4",route:"/models/gpt-4",locale:"en"},{kind:"MdxPage",name:"grok-1",route:"/models/grok-1",locale:"en"},{kind:"MdxPage",name:"llama-3",route:"/models/llama-3",locale:"en"},{kind:"MdxPage",name:"llama",route:"/models/llama",locale:"en"},{kind:"MdxPage",name:"mistral-7b",route:"/models/mistral-7b",locale:"en"},{kind:"MdxPage",name:"mistral-large",route:"/models/mistral-large",locale:"en"},{kind:"MdxPage",name:"mixtral-8x22b",route:"/models/mixtral-8x22b",locale:"en"},{kind:"MdxPage",name:"mixtral",route:"/models/mixtral",locale:"en"},{kind:"MdxPage",name:"olmo",route:"/models/olmo",locale:"en"},{kind:"MdxPage",name:"phi-2",route:"/models/phi-2",locale:"en"},{kind:"MdxPage",name:"sora",route:"/models/sora",locale:"en"}]},{kind:"MdxPage",name:"models",route:"/models",locale:"en"},{kind:"MdxPage",name:"notebooks",route:"/notebooks",locale:"en"},{kind:"MdxPage",name:"papers",route:"/papers",locale:"en"},{kind:"Folder",name:"prompts",route:"/prompts",children:[{kind:"Meta",locale:"en",data:{classification:"Classification",coding:"Coding",creativity:"Creativity",evaluation:"Evaluation","information-extraction":"Information Extraction","image-generation":"Image Generation",mathematics:"Mathematics","question-answering":"Question Answering",reasoning:"Reasoning","text-summarization":"Text Summarization",truthfulness:"Truthfulness","adversarial-prompting":"Adversarial Prompting"}},{kind:"Folder",name:"adversarial-prompting",route:"/prompts/adversarial-prompting",children:[{kind:"Meta",locale:"en",data:{"prompt-injection":"Prompt Injection","prompt-leaking":"Prompt Leaking","jailbreaking-llms":"Jailbreaking"}},{kind:"MdxPage",name:"jailbreaking-llms",route:"/prompts/adversarial-prompting/jailbreaking-llms",locale:"en"},{kind:"MdxPage",name:"prompt-injection",route:"/prompts/adversarial-prompting/prompt-injection",locale:"en"},{kind:"MdxPage",name:"prompt-leaking",route:"/prompts/adversarial-prompting/prompt-leaking",locale:"en"}]},{kind:"MdxPage",name:"adversarial-prompting",route:"/prompts/adversarial-prompting",locale:"en"},{kind:"Folder",name:"classification",route:"/prompts/classification",children:[{kind:"Meta",locale:"en",data:{sentiment:"Sentiment Classification","sentiment-fewshot":"Few-Shot Sentiment Classification"}},{kind:"MdxPage",name:"sentiment-fewshot",route:"/prompts/classification/sentiment-fewshot",locale:"en"},{kind:"MdxPage",name:"sentiment",route:"/prompts/classification/sentiment",locale:"en"}]},{kind:"MdxPage",name:"classification",route:"/prompts/classification",locale:"en"},{kind:"Folder",name:"coding",route:"/prompts/coding",children:[{kind:"Meta",locale:"en",data:{"code-snippet":"Generate Code Snippet","mysql-query":"Generate MySQL Query",tikz:"Draw TiKZ Diagram"}},{kind:"MdxPage",name:"code-snippet",route:"/prompts/coding/code-snippet",locale:"en"},{kind:"MdxPage",name:"mysql-query",route:"/prompts/coding/mysql-query",locale:"en"},{kind:"MdxPage",name:"tikz",route:"/prompts/coding/tikz",locale:"en"}]},{kind:"MdxPage",name:"coding",route:"/prompts/coding",locale:"en"},{kind:"Folder",name:"creativity",route:"/prompts/creativity",children:[{kind:"Meta",locale:"en",data:{rhymes:"Rhymes","infinite-primes":"Infinite Primes",interdisciplinary:"Interdisciplinary","new-words":"Inventing New Words"}},{kind:"MdxPage",name:"infinite-primes",route:"/prompts/creativity/infinite-primes",locale:"en"},{kind:"MdxPage",name:"interdisciplinary",route:"/prompts/creativity/interdisciplinary",locale:"en"},{kind:"MdxPage",name:"new-words",route:"/prompts/creativity/new-words",locale:"en"},{kind:"MdxPage",name:"rhymes",route:"/prompts/creativity/rhymes",locale:"en"}]},{kind:"MdxPage",name:"creativity",route:"/prompts/creativity",locale:"en"},{kind:"Folder",name:"evaluation",route:"/prompts/evaluation",children:[{kind:"Meta",locale:"en",data:{"plato-dialogue":"Evaluate Plato's Dialogue"}},{kind:"MdxPage",name:"plato-dialogue",route:"/prompts/evaluation/plato-dialogue",locale:"en"}]},{kind:"MdxPage",name:"evaluation",route:"/prompts/evaluation",locale:"en"},{kind:"Folder",name:"image-generation",route:"/prompts/image-generation",children:[{kind:"Meta",locale:"en",data:{"alphabet-person":"Draw a Person Using Alphabet"}},{kind:"MdxPage",name:"alphabet-person",route:"/prompts/image-generation/alphabet-person",locale:"en"}]},{kind:"MdxPage",name:"image-generation",route:"/prompts/image-generation",locale:"en"},{kind:"Folder",name:"information-extraction",route:"/prompts/information-extraction",children:[{kind:"Meta",locale:"en",data:{"extract-models":"Extract Model Names"}},{kind:"MdxPage",name:"extract-models",route:"/prompts/information-extraction/extract-models",locale:"en"}]},{kind:"MdxPage",name:"information-extraction",route:"/prompts/information-extraction",locale:"en"},{kind:"Folder",name:"mathematics",route:"/prompts/mathematics",children:[{kind:"Meta",locale:"en",data:{"composite-functions":"Evaluating Composite Functions","odd-numbers":"Adding Odd Numbers"}},{kind:"MdxPage",name:"composite-functions",route:"/prompts/mathematics/composite-functions",locale:"en"},{kind:"MdxPage",name:"odd-numbers",route:"/prompts/mathematics/odd-numbers",locale:"en"}]},{kind:"MdxPage",name:"mathematics",route:"/prompts/mathematics",locale:"en"},{kind:"Folder",name:"question-answering",route:"/prompts/question-answering",children:[{kind:"Meta",locale:"en",data:{"closed-domain":"Closed Domain Question Answering","open-domain":"Open Domain Question Answering","science-qa":"Science Question Answering"}},{kind:"MdxPage",name:"closed-domain",route:"/prompts/question-answering/closed-domain",locale:"en"},{kind:"MdxPage",name:"open-domain",route:"/prompts/question-answering/open-domain",locale:"en"},{kind:"MdxPage",name:"science-qa",route:"/prompts/question-answering/science-qa",locale:"en"}]},{kind:"MdxPage",name:"question-answering",route:"/prompts/question-answering",locale:"en"},{kind:"Folder",name:"reasoning",route:"/prompts/reasoning",children:[{kind:"Meta",locale:"en",data:{"indirect-reasoning":"Indirect Reasoning","physical-reasoning":"Physical Reasoning"}},{kind:"MdxPage",name:"indirect-reasoning",route:"/prompts/reasoning/indirect-reasoning",locale:"en"},{kind:"MdxPage",name:"physical-reasoning",route:"/prompts/reasoning/physical-reasoning",locale:"en"}]},{kind:"MdxPage",name:"reasoning",route:"/prompts/reasoning",locale:"en"},{kind:"Folder",name:"text-summarization",route:"/prompts/text-summarization",children:[{kind:"Meta",locale:"en",data:{"explain-concept":"Explain A Concept"}},{kind:"MdxPage",name:"explain-concept",route:"/prompts/text-summarization/explain-concept",locale:"en"}]},{kind:"MdxPage",name:"text-summarization",route:"/prompts/text-summarization",locale:"en"},{kind:"Folder",name:"truthfulness",route:"/prompts/truthfulness",children:[{kind:"Meta",locale:"en",data:{"identify-hallucination":"Hallucination Identification"}},{kind:"MdxPage",name:"identify-hallucination",route:"/prompts/truthfulness/identify-hallucination",locale:"en"}]},{kind:"MdxPage",name:"truthfulness",route:"/prompts/truthfulness",locale:"en"}]},{kind:"MdxPage",name:"prompts",route:"/prompts",locale:"en"},{kind:"MdxPage",name:"readings",route:"/readings",locale:"en"},{kind:"Folder",name:"research",route:"/research",children:[{kind:"Meta",locale:"en",data:{"llm-agents":"LLM Agents",rag:"RAG for LLMs","llm-reasoning":"LLM Reasoning","rag-faithfulness":"RAG Faithfulness","llm-recall":"LLM In-Context Recall",rag_hallucinations:"RAG Reduces Hallucination",synthetic_data:"Synthetic Data",thoughtsculpt:"ThoughtSculpt","infini-attention":"Infini-Attention","guided-cot":"LM-Guided CoT","trustworthiness-in-llms":"Trustworthiness in LLMs","llm-tokenization":"LLM Tokenization",groq:"What is Groq?"}},{kind:"MdxPage",name:"groq",route:"/research/groq",locale:"en"},{kind:"MdxPage",name:"guided-cot",route:"/research/guided-cot",locale:"en"},{kind:"MdxPage",name:"infini-attention",route:"/research/infini-attention",locale:"en"},{kind:"MdxPage",name:"llm-agents",route:"/research/llm-agents",locale:"en"},{kind:"MdxPage",name:"llm-reasoning",route:"/research/llm-reasoning",locale:"en"},{kind:"MdxPage",name:"llm-recall",route:"/research/llm-recall",locale:"en"},{kind:"MdxPage",name:"llm-tokenization",route:"/research/llm-tokenization",locale:"en"},{kind:"MdxPage",name:"rag-faithfulness",route:"/research/rag-faithfulness",locale:"en"},{kind:"MdxPage",name:"rag",route:"/research/rag",locale:"en"},{kind:"MdxPage",name:"rag_hallucinations",route:"/research/rag_hallucinations",locale:"en"},{kind:"MdxPage",name:"synthetic_data",route:"/research/synthetic_data",locale:"en"},{kind:"MdxPage",name:"thoughtsculpt",route:"/research/thoughtsculpt",locale:"en"},{kind:"MdxPage",name:"trustworthiness-in-llms",route:"/research/trustworthiness-in-llms",locale:"en"}]},{kind:"MdxPage",name:"research",route:"/research",locale:"en"},{kind:"Folder",name:"risks",route:"/risks",children:[{kind:"Meta",locale:"en",data:{adversarial:"Adversarial Prompting",factuality:"Factuality",biases:"Biases"}},{kind:"MdxPage",name:"adversarial",route:"/risks/adversarial",locale:"en"},{kind:"MdxPage",name:"biases",route:"/risks/biases",locale:"en"},{kind:"MdxPage",name:"factuality",route:"/risks/factuality",locale:"en"}]},{kind:"MdxPage",name:"risks",route:"/risks",locale:"en"},{kind:"MdxPage",name:"services",route:"/services",locale:"en"},{kind:"Folder",name:"techniques",route:"/techniques",children:[{kind:"Meta",locale:"en",data:{zeroshot:"Zero-shot Prompting",fewshot:"Few-shot Prompting",cot:"Chain-of-Thought Prompting","meta-prompting":"Meta Prompting",consistency:"Self-Consistency",knowledge:"Generate Knowledge Prompting",prompt_chaining:"Prompt Chaining",tot:"Tree of Thoughts",rag:"Retrieval Augmented Generation",art:"Automatic Reasoning and Tool-use",ape:"Automatic Prompt Engineer",activeprompt:"Active-Prompt",dsp:"Directional Stimulus Prompting",pal:"Program-Aided Language Models",react:"ReAct",reflexion:"Reflexion",multimodalcot:"Multimodal CoT",graph:"Graph Prompting"}},{kind:"MdxPage",name:"activeprompt",route:"/techniques/activeprompt",locale:"en"},{kind:"MdxPage",name:"ape",route:"/techniques/ape",locale:"en"},{kind:"MdxPage",name:"art",route:"/techniques/art",locale:"en"},{kind:"MdxPage",name:"consistency",route:"/techniques/consistency",locale:"en"},{kind:"MdxPage",name:"cot",route:"/techniques/cot",locale:"en"},{kind:"MdxPage",name:"dsp",route:"/techniques/dsp",locale:"en"},{kind:"MdxPage",name:"fewshot",route:"/techniques/fewshot",locale:"en"},{kind:"MdxPage",name:"graph",route:"/techniques/graph",locale:"en"},{kind:"MdxPage",name:"knowledge",route:"/techniques/knowledge",locale:"en"},{kind:"MdxPage",name:"meta-prompting",route:"/techniques/meta-prompting",locale:"en"},{kind:"MdxPage",name:"multimodalcot",route:"/techniques/multimodalcot",locale:"en"},{kind:"MdxPage",name:"pal",route:"/techniques/pal",locale:"en"},{kind:"MdxPage",name:"prompt_chaining",route:"/techniques/prompt_chaining",locale:"en"},{kind:"MdxPage",name:"rag",route:"/techniques/rag",locale:"en"},{kind:"MdxPage",name:"react",route:"/techniques/react",locale:"en"},{kind:"MdxPage",name:"reflexion",route:"/techniques/reflexion",locale:"en"},{kind:"MdxPage",name:"tot",route:"/techniques/tot",locale:"en"},{kind:"MdxPage",name:"zeroshot",route:"/techniques/zeroshot",locale:"en"}]},{kind:"MdxPage",name:"techniques",route:"/techniques",locale:"en"},{kind:"MdxPage",name:"tools",route:"/tools",locale:"en"}],flexsearch:{codeblocks:!0},title:"Scaling Instruction-Finetuned Language Models",headings:f},pageNextRoute:"/models/flan.en",nextraLayout:o.ZP,themeConfig:r.Z};n.default=(0,i.j)(P)},44613:function(e,n,t){"use strict";t.d(n,{w:function(){return Screenshot}});var a=t(11527),i=t(86259),o=t(53704),r=t.n(o);function Screenshot(e){let{src:n,alt:t,full:o}=e;return(0,a.jsx)("div",{className:(0,i.Z)("mt-6 -mb-4 flex justify-center overflow-hidden rounded-xl border dark:border-zinc-800",o?"bg-white":"bg-zinc-100"),children:(0,a.jsx)(r(),{src:n,alt:t,className:(0,i.Z)("w-auto select-none bg-white",o?"":"ring-1 ring-gray-200")})})}},52243:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var a=t(11527),i=t(50959),o=t(51592),r=t(86259);function WordWrapIcon(e){return(0,a.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",...e,children:(0,a.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})})}let Button=e=>{let{children:n,className:t,...i}=e;return(0,a.jsx)("button",{className:(0,r.Z)("nextra-button nx-transition-all active:nx-opacity-50","nx-bg-primary-700/5 nx-border nx-border-black/5 nx-text-gray-600 hover:nx-text-gray-900 nx-rounded-md nx-p-1.5","dark:nx-bg-primary-300/10 dark:nx-border-white/10 dark:nx-text-gray-400 dark:hover:nx-text-gray-50",t),...i,children:n})};function CheckIcon(e){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",width:"1em",height:"1em",fill:"currentColor",...e,children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}function CopyIcon(e){return(0,a.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",...e,children:[(0,a.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}let CopyToClipboard=e=>{let{getValue:n,...t}=e,[o,r]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>{r(!1)},2e3);return()=>{clearTimeout(e)}},[o]);let s=(0,i.useCallback)(async()=>{var e;r(!0),(null===(e=navigator)||void 0===e?void 0:e.clipboard)||console.error("Access to clipboard rejected!");try{await navigator.clipboard.writeText(n())}catch(e){console.error("Failed to copy!")}},[n]),l=o?CheckIcon:CopyIcon;return(0,a.jsx)(Button,{onClick:s,title:"Copy code",tabIndex:0,...t,children:(0,a.jsx)(l,{className:"nextra-copy-icon nx-pointer-events-none nx-h-4 nx-w-4"})})},s={logo:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 206 246",fill:"none",children:[(0,a.jsx)("circle",{cx:"40",cy:"40",r:"40",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"40",cy:"206",r:"40",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"166",cy:"120",r:"40",fill:"currentColor"})]}),(0,a.jsx)("span",{style:{marginLeft:".4em",fontWeight:800},children:"Prompt Engineering Guide"})]}),i18n:[{locale:"en",text:"English"},{locale:"zh",text:"中文"},{locale:"jp",text:"日本語"},{locale:"pt",text:"Portugu\xeas"},{locale:"it",text:"Italian"},{locale:"tr",text:"T\xfcrk\xe7e"},{locale:"es",text:"Espa\xf1ol"},{locale:"fr",text:"Fran\xe7ais"},{locale:"kr",text:"한국어"},{locale:"ca",text:"Catal\xe0"},{locale:"fi",text:"Finnish"},{locale:"ru",text:"Русский"},{locale:"de",text:"Deutsch"},{locale:"ar",text:"العربية"}],head:function(){let{title:e}=(0,o.ZR)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("title",{children:[e?e+" | Prompt Engineering Guide":"Prompt Engineering Guide"," "]}),(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),(0,a.jsx)("meta",{property:"og:title",content:"Prompt Engineering Guide"}),(0,a.jsx)("meta",{property:"og:description",content:"A Comprehensive Overview of Prompt Engineering"}),(0,a.jsx)("meta",{name:"og:title",content:e?e+" | Prompt Engineering Guide":"Prompt Engineering Guide"}),(0,a.jsx)("link",{rel:"icon",href:"/144-favicon.svg",type:"image/svg+xml"}),(0,a.jsx)("link",{rel:"icon",href:"/144-favicon-dark.svg",type:"image/svg+xml",media:"(prefers-color-scheme: dark)"})]})},project:{link:"https://github.com/dair-ai/Prompt-Engineering-Guide"},chat:{link:"https://discord.gg/FUyz9vPAwf"},docsRepositoryBase:"https://github.com/dair-ai/Prompt-Engineering-Guide/tree/main/",footer:{text:"Copyright \xa9 2024 DAIR.AI"},search:{placeholder:"Search..."},components:{pre:e=>{let{children:n,className:t,hasCopyCode:o=!0,filename:s,...l}=e,d=(0,i.useRef)(null),c=(0,i.useCallback)(()=>{let e=document.documentElement.dataset,n="nextraWordWrap"in e;n?delete e.nextraWordWrap:e.nextraWordWrap=""},[]);return(0,a.jsxs)("div",{className:"nextra-code-block nx-relative nx-mt-6 first:nx-mt-0",children:[s&&(0,a.jsx)("div",{className:"nx-absolute nx-top-0 nx-z-[1] nx-w-full nx-truncate nx-rounded-t-xl nx-bg-primary-700/5 nx-py-2 nx-px-4 nx-text-xs nx-text-gray-700 dark:nx-bg-primary-300/10 dark:nx-text-gray-200",children:s}),(0,a.jsx)("pre",{className:(0,r.Z)("nx-bg-primary-700/5 nx-mb-4 nx-overflow-x-auto nx-rounded-xl nx-subpixel-antialiased dark:nx-bg-primary-300/10 nx-text-[.9em]","contrast-more:nx-border contrast-more:nx-border-primary-900/20 contrast-more:nx-contrast-150 contrast-more:dark:nx-border-primary-100/40",s?"nx-pt-12 nx-pb-4":"nx-py-4",t),ref:d,...l,children:i.isValidElement(n)&&"code"===n.type?n.props.children:n}),(0,a.jsxs)("div",{className:(0,r.Z)("nx-opacity-0 nx-transition [div:hover>&]:nx-opacity-100 focus-within:nx-opacity-100","nx-flex nx-gap-1 nx-absolute nx-m-[11px] nx-right-0",s?"nx-top-8":"nx-top-0"),children:[(0,a.jsx)(Button,{onClick:c,className:"md:nx-hidden",title:"Toggle word wrap elvis",children:(0,a.jsx)(WordWrapIcon,{className:"nx-pointer-events-none nx-h-4 nx-w-4"})}),o&&(0,a.jsx)(CopyToClipboard,{getValue:()=>{var e,n;return(null===(n=d.current)||void 0===n?void 0:null===(e=n.querySelector("code"))||void 0===e?void 0:e.textContent)||""}})]})]})}}};var l=s}},function(e){e.O(0,[47262,49774,92888,40179],function(){return e(e.s=17104)}),_N_E=e.O()}]);