{"id":1024080,"date":"2024-04-18T09:00:00","date_gmt":"2024-04-18T16:00:00","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/research\/?p=1024080"},"modified":"2024-04-16T09:45:26","modified_gmt":"2024-04-16T16:45:26","slug":"sammo-a-general-purpose-framework-for-prompt-optimization","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/research\/blog\/sammo-a-general-purpose-framework-for-prompt-optimization\/","title":{"rendered":"SAMMO: A general-purpose framework for prompt optimization"},"content":{"rendered":"\n
\"SAMMO<\/figure>\n\n\n\n

Large language models (LLMs) have revolutionized a wide range of tasks and applications that were previously reliant on manually crafted machine learning (ML) solutions, streamlining through automation. However, despite these advances, a notable challenge persists: the need for extensive prompt engineering to adapt these models to new tasks. New generations of language models like GPT-4 and Mixtral 8x7B advance the capability to process long input texts. This progress enables the use of longer inputs, providing richer context and detailed instructions to language models. A common technique that uses this enhanced capacity is the Retrieval Augmented Generation (RAG) approach. RAG dynamically incorporates information into the prompt based on the specific input example. This process is illustrated in Figure 1, which shows a RAG prompt designed to translate user queries into a domain-specific language (DSL), also known as semantic parsing. <\/p>\n\n\n\n

\"A
Figure 1: A RAG prompt is used for a semantic parsing task. The underlying prompt consists of three larger parts, each with a variety of aspects that can be optimized.<\/figcaption><\/figure>\n\n\n\n

The example in Figure 1 combines three distinct structures to construct the final prompt. The first structure, the task description, remains static and independent of the input as a result of conventional prompt optimization techniques. However, RAG contains two input-specific structures: the example retriever and the input text itself. These introduce numerous optimization opportunities that surpass the scope of most traditional approaches. Despite previous efforts in prompt optimization, the evolution towards more complex prompt structures has rendered many older strategies ineffective in this new context. <\/p>\n\n\n\n

SAMMO: A prompt optimization approach <\/h2>\n\n\n\n
\n\t