Wordflow: Social Prompt Engineering for Large Language Models (2024)

Abstract: Large language models (LLMs) require well-crafted prompts for effective use. Prompt engineering, the process of designing prompts, is challenging, particularly for non-experts who are less familiar with AI technologies. While researchers have proposed techniques and tools to assist LLM users in prompt design, these works primarily target AI application developers rather than non-experts. To address this research gap, we propose social prompt engineering, a novel paradigm that leverages social computing techniques to facilitate collaborative prompt design. To investigate social prompt engineering, we introduce Wordflow, an open-source and social text editor that enables everyday users to easily create, run, share, and discover LLM prompts. Additionally, by leveraging modern web technologies, Wordflow allows users to run LLMs locally and privately in their browsers. Two usage scenarios highlight how social prompt engineering and our tool can enhance laypeople’s interaction with LLMs. Wordflow is publicly accessible at https://poloclub.github.io/wordflow.

## introduction recently, there has been a surge in the popularity of large language models (llms) such as gpt-4 (openai, 2023a), gemini @xcite , and llama 2 @xcite . these pretrained artificial intelligence (ai) models demonstrate a diverse array of capabilities that are continually being discovered, including summarization, question-answering, creative writing, and translation @xcite . to instruct these general-purpose llms to perform specific tasks, users need to provide them with prompts-text instructions and examples of desired outputs @xcite . these prompts serve as background contexts and guides for llms to generate text that aligns with users' objectives. prompting enables users to employ llms for various tasks with plain language; in fact, well-crafted prompts can make general-purpose llms outperform specialized ai models @xcite . designing effective prompts, known as prompt engineering, poses significant challenges for llm users @xcite . llm users often rely on trial and error and employ unintuitive patterns, such as adding "think step by step" @xcite to their prompts, to successfully instruct llms. prompt engineering, despite its name, is considered an art @xcite and is even compared to wizards learning "magic spells" @xcite . prompt writers may not fully understand why certain prompts work, but they still add them to their "spell books." furthermore, prompting is especially challenging for non-ai-experts, who are often confused about getting started and lack sufficient guidance and training on llms and prompting @xcite . to help users prompt llms, researchers propose instruction tuning @xcite and reinforcement learning from human feedback @xcite to align a model's output with users' intent. prompting techniques @xcite are introduced to improve llms' performance on complex tasks. libraries and interactive tools have also been developed to streamline the prompt crafting process (e.g., @xcite . however, existing techniques and tools primarily cater to ai application developers who use llms to build ai applications (e.g., chatbot applications), overlooking non-expert users who use llms for everyday tasks (e.g., checking emails for grammar errors). to bridge this critical research gap, we propose social prompt engineering, a novel paradigm that leverages social computing techniques to facilitate collaborative prompt designs. we contribute: researchers have proposed libraries such as langchain @xcite , guidance @xcite , and outlines @xcite to help users write prompts programmatically and control the structure of an llm's output. by formulating prompting as programming, researchers propose techniques that help users edit @xcite and unit test prompts @xcite . @xcite introduces a collaborative editor for multiple programmers to write prompts simultaneously. ai prototyping tools like prompt-maker @xcite , google ai stu-dio @xcite , openai playground (ope-nai, 2023b), and partyrock @xcite allow users to rapidly write and run prompts. by leveraging visual programming techniques, tools such as ai chains @xcite , prompt sapper @xcite , and chain-forge @xcite enable ai application developers to visually design and test complex prompts. similarly, promptide @xcite , promptaid @xcite , and prompterator @xcite employ mixed-initiative and interactive visualization techniques to help llm users brainstorm and refine prompts. these existing tools function as ides that help ai developers craft prompts that will later be integrated into other applications. in contrast, wordflow aims to serve as a runtime interface for everyday users, who act as both the prompt engineers and direct users of their prompts, and may not be well-versed in ai technologies. ## system design & implementation wordflow is an interactive tool that empowers everyday users to easily create, run, share, and discover llm prompts. it tightly integrates four views: the editor view ( § 3.1), where users can write text, run llm prompts, and inspect changes made by llms; the personal prompt library ( § 3.2), offering a prompt manager for creating and editing prompts locally; the community prompt hub ( § 3.2), enabling users to explore and search for the latest and popular prompts shared by the community; and the setting panel for configuring remote or local llms ( § 3.4). ## future work & conclusion in this work, we present social prompt engineering, a new paradigm that leverages social computing techniques to facilitate collaborative prompt design. to realize social prompt engineering, we design and develop wordflow, an open-source and social text editor empowering users to easily create, run, share, and discover llm prompts. two usage scenarios highlight social prompt engineering and wordflow can assist everyday users in interacting with llms. reflecting on our design and development of this system, we discuss future research directions to help everyone use llms. with recent advancements in on-device machine learning, we see great potential for on-device llms, which allow users to avoid sending sensitive data to external services, reduce api costs, and use llms without network access.