Skip to main content
QUICK REVIEW

[Paper Review] Prompt Middleware: Mapping Prompts for Large Language Models to UI Affordances

Stephen MacNeil, Andrew Tran|arXiv (Cornell University)|Jul 3, 2023
Topic ModelingComputer Science7 citations
TL;DR

This paper introduces Prompt Middleware, a framework that maps user interface (UI) affordances to prompts for large language models (LLMs), enabling three interaction modes: static prompts (predefined by experts), template-based prompts (generated from UI options), and free-form prompts (user-created). The approach is demonstrated in FeedbackBuffet, a writing assistant that uses template-based middleware to generate GPT-3 prompts from user-selected feedback types, significantly simplifying LLM interaction for non-experts.

ABSTRACT

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.

Motivation & Objective

  • To address the challenge of making large language models (LLMs) accessible to non-expert users in interactive systems.
  • To explore how UI affordances can be used to mediate and structure interactions with LLMs through prompt engineering.
  • To reduce the cognitive burden of prompt crafting by providing structured, expert-designed pathways into LLM capabilities.
  • To evaluate the effectiveness of different prompt generation strategies—static, template-based, and free-form—in a real-world writing assistance context.

Proposed method

  • Designs a Prompt Middleware framework that maps UI components (e.g., buttons, dropdowns, text fields) to LLM prompts through three modes: static, template-based, and free-form.
  • Employs template-based prompt generation where user selections from UI menus are composed into a natural language prompt using predefined templates.
  • Uses zero-shot prompting with GPT-3 by sending the composed prompt via API without fine-tuning.
  • Integrates established feedback design principles (e.g., sandwiching criticism, actionability) into the template structure to improve feedback quality.
  • Builds FeedbackBuffet as a proof-of-concept writing assistant that allows users to select feedback types (e.g., structure, tone, clarity) via a UI, which are then used to generate a prompt for GPT-3.
  • Abstracts LLM complexity behind a UI facade, enabling non-experts to leverage LLM capabilities without writing prompts from scratch.
Figure 1. Three methods to connect user interface components to large language models. 1) static prompts are predefined prompts that can be selected directly from the UI, 2) template-based prompts generate prompts based on selected options in the UI, 3) free-form prompts provide a direct way of inte
Figure 1. Three methods to connect user interface components to large language models. 1) static prompts are predefined prompts that can be selected directly from the UI, 2) template-based prompts generate prompts based on selected options in the UI, 3) free-form prompts provide a direct way of inte

Experimental results

Research questions

  • RQ1How can user interface affordances be effectively mapped to prompts for large language models to support non-expert users?
  • RQ2What are the relative benefits and limitations of static, template-based, and free-form prompt generation in interactive LLM applications?
  • RQ3Can structured prompt generation via templates improve the quality and consistency of LLM outputs in real-world writing assistance tasks?
  • RQ4How does providing expert-designed prompt pathways reduce the cognitive load of prompt engineering for end users?
  • RQ5To what extent can a UI-based middleware framework expose the capabilities of LLMs without requiring users to understand prompt engineering?

Key findings

  • FeedbackBuffet successfully generates high-quality, actionable feedback by composing user-selected options into a GPT-3 prompt using a structured template.
  • The use of expert-designed templates reduces the need for users to craft prompts from scratch, lowering the barrier to effective LLM use.
  • Template-based prompts enable consistent application of feedback design best practices (e.g., positive-negative-positive structure) across outputs.
  • The framework demonstrates that UI components can effectively serve as a facade for LLM interaction, abstracting away prompt complexity.
  • The approach supports iterative user interaction, as seen when users refine their writing based on feedback and re-engage with the system.
  • The authors conclude that Prompt Middleware provides a lightweight, scalable method to integrate LLM capabilities into UIs without requiring specialized models or costly human-in-the-loop systems.
Figure 2. FeedbackBuffet enables users to insert writing samples (1) and select from a set of predefined options for the type of feedback they want to receive (2). Using a template, these options are combined to form a prompt (3) which is sent to GPT-3 using OpenAI’s public API (4). GPT-3 then gener
Figure 2. FeedbackBuffet enables users to insert writing samples (1) and select from a set of predefined options for the type of feedback they want to receive (2). Using a template, these options are combined to form a prompt (3) which is sent to GPT-3 using OpenAI’s public API (4). GPT-3 then gener

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.