# Prompt Middleware: Mapping Prompts for Large Language Models to UI Affordances

**Authors:** Stephen MacNeil, Andrew Tran, Joanne Kim, Ziheng Huang, Seth Bernstein, Dan Mogil  
**arXiv:** [2307.01142](https://arxiv.org/abs/2307.01142)  
**Date:** 2023-07-03  
**Summary page:** https://www.summarizepaper.com/en/arxiv-id/2307.01142v1/

## Key points

- Researchers exploring integration of AI and human intelligence into UIs for complex tasks
- Large language models (LLMs) offer new opportunities for incorporating LLMs into UIs
- Prompt Middleware framework for generating prompts for LLMs based on UI affordances
- Prompts can be predefined by experts, generated from templates, or created by users
- FeedbackBuffet writing assistant utilizes template-based prompt middleware to generate feedback
- Feedback request prompts formed using templates for GPT-3, an LLM
- Prompt Middleware helps developers integrate LLMs into UIs and enhance user experiences and performance in complex tasks
- Case study using FeedbackBuffet prototype showcases implementation of template-based prompting in a UI

## Summary

Researchers have been exploring ways to integrate artificial intelligence (AI) and human intelligence into user interfaces (UIs) to assist users in complex tasks. With the emergence of large language models (LLMs), which can generate text based on natural language prompts, there are new opportunities to incorporate LLMs into UIs. In this paper, the authors present Prompt Middleware, a framework for generating prompts for LLMs based on UI affordances. These prompts can be predefined by experts, generated from templates with fill-in options in the UI, or created from scratch by users. The authors demonstrate the framework through FeedbackBuffet, a writing assistant that generates feedback based on user input. FeedbackBuffet utilizes template-based prompt middleware to allow users to specify the types of feedback they want to receive as options in the UI. These options are then composed using a template to form a feedback request prompt for GPT-3, an LLM. The paper concludes with a discussion on how Prompt Middleware can help developers integrate LLMs into UIs and provides insights into different prompt generation techniques that can enhance user experiences and performance in complex tasks. To illustrate this concept further, they present a case study using the FeedbackBuffet prototype which showcases how template-based prompting can be implemented in a user interface. Overall, this research highlights the potential of integrating LLMs into UIs and provides guidance on how different prompt generation techniques can be used effectively.
