[论文解读] Prompt Middleware: Mapping Prompts for Large Language Models to UI Affordances
本文提出了提示中间件(Prompt Middleware)框架,将用户界面(UI)功能映射为大语言模型(LLM)的提示,支持三种交互模式:静态提示(由专家预定义)、基于模板的提示(由UI选项生成)以及自由格式提示(用户自行创建)。该方法在FeedbackBuffet写作助手中的应用展示了其有效性,该助手利用基于模板的中间件,从用户选择的反馈类型生成GPT-3提示,显著简化了非专家用户与LLM的交互。
To help users do complex work, researchers have developed techniques to integrate AI and human intelligence into user interfaces (UIs). With the recent introduction of large language models (LLMs), which can generate text in response to a natural language prompt, there are new opportunities to consider how to integrate LLMs into UIs. We present Prompt Middleware, a framework for generating prompts for LLMs based on UI affordances. These include prompts that are predefined by experts (static prompts), generated from templates with fill-in options in the UI (template-based prompts), or created from scratch (free-form prompts). We demonstrate this framework with FeedbackBuffet, a writing assistant that automatically generates feedback based on a user's text input. Inspired by prior research showing how templates can help non-experts perform more like experts, FeedbackBuffet leverages template-based prompt middleware to enable feedback seekers to specify the types of feedback they want to receive as options in a UI. These options are composed using a template to form a feedback request prompt to GPT-3. We conclude with a discussion about how Prompt Middleware can help developers integrate LLMs into UIs.
研究动机与目标
- 解决在交互式系统中使大语言模型(LLMs)对非专家用户更易用的挑战。
- 探索如何利用UI功能通过提示工程来中介和结构化与LLM的交互。
- 通过提供结构化、专家设计的路径,降低提示工程的认知负担。
- 在真实世界的写作辅助场景中,评估不同提示生成策略(静态、基于模板、自由格式)的有效性。
提出的方法
- 设计Prompt Middleware框架,通过三种模式将UI组件(如按钮、下拉菜单、文本框)映射为LLM提示:静态、基于模板和自由格式。
- 采用基于模板的提示生成方法,将用户从UI菜单中选择的选项,利用预定义模板组合成自然语言提示。
- 使用零样本提示(zero-shot prompting)通过GPT-3 API发送组合后的提示,无需微调。
- 将既定的反馈设计原则(如批评的正负正结构、可操作性)整合到模板结构中,以提升反馈质量。
- 构建FeedbackBuffet作为概念验证的写作助手,允许用户通过UI选择反馈类型(如结构、语气、清晰度),这些选择随后被用于生成GPT-3的提示。
- 将LLM的复杂性隐藏在UI界面之下,使非专家用户无需从零开始编写提示即可利用LLM功能。

实验结果
研究问题
- RQ1如何有效将用户界面功能映射为大语言模型的提示,以支持非专家用户?
- RQ2在交互式LLM应用中,静态、基于模板和自由格式提示生成的相对优势与局限性是什么?
- RQ3通过模板实现结构化提示生成,是否能提升真实世界写作辅助任务中LLM输出的质量与一致性?
- RQ4提供专家设计的提示路径,能否有效降低终端用户在提示工程中的认知负担?
- RQ5基于UI的中间件框架在多大程度上可以暴露LLM的能力,而无需用户理解提示工程?
主要发现
- FeedbackBuffet通过使用结构化模板将用户选择的选项组合成GPT-3提示,成功生成了高质量且可操作的反馈。
- 使用专家设计的模板减少了用户从零开始编写提示的需求,降低了有效使用LLM的门槛。
- 基于模板的提示确保了反馈设计最佳实践(如正-负-正结构)在输出中的一致应用。
- 该框架证明,UI组件可以有效作为LLM交互的界面,隐藏提示复杂性。
- 该方法支持迭代式用户交互,例如用户根据反馈改进写作后可再次与系统互动。
- 作者得出结论:Prompt Middleware提供了一种轻量级、可扩展的方法,可在不依赖专用模型或昂贵人工介入系统的情况下,将LLM功能集成到用户界面中。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。