Table of Contents
Fetching ...

Dynamic Prompt Middleware: Contextual Prompt Refinement Controls for Comprehension Tasks

Ian Drosos, Jack Williams, Advait Sarkar, Nicholas Wilson

TL;DR

This work tackles the difficulty users face when prompting GenAI for comprehension tasks (e.g., explaining formulas or code) and introduces dynamic prompt middleware to provide context-sensitive controls. It presents two prompt control approaches—Dynamic Prompt Refinement Control (Dynamic PRC) and Static Prompt Refinement Control (Static PRC)—implemented as an Option Module that generates refinements and a Chat Module that grounds responses with those refinements, arranged in a two-tier architecture with inline and session options. A formative study with $n=38$ participants identifies a trade-off between standardized, predictable prompting and adaptive but potentially opaque controls, guiding the design goals of controllable and adaptable interfaces. A controlled within-subjects study with $n=16$ shows a clear preference for Dynamic PRC, which increases perceived control and task exploration but raises questions about cognitive load and interpretation of option effects; the work concludes with design implications for future Dynamic PRC systems and discusses alignment with broader explainability goals and the potential for Generative UI to augment human reasoning in knowledge work.

Abstract

Effective prompting of generative AI is challenging for many users, particularly in expressing context for comprehension tasks such as explaining spreadsheet formulas, Python code, and text passages. Prompt middleware aims to address this barrier by assisting in prompt construction, but barriers remain for users in expressing adequate control so that they can receive AI-responses that match their preferences. We conduct a formative survey (n=38) investigating user needs for control over AI-generated explanations in comprehension tasks, which uncovers a trade-off between standardized but predictable support for prompting, and adaptive but unpredictable support tailored to the user and task. To explore this trade-off, we implement two prompt middleware approaches: Dynamic Prompt Refinement Control (Dynamic PRC) and Static Prompt Refinement Control (Static PRC). The Dynamic PRC approach generates context-specific UI elements that provide prompt refinements based on the user's prompt and user needs from the AI, while the Static PRC approach offers a preset list of generally applicable refinements. We evaluate these two approaches with a controlled user study (n=16) to assess the impact of these approaches on user control of AI responses for crafting better explanations. Results show a preference for the Dynamic PRC approach as it afforded more control, lowered barriers to providing context, and encouraged exploration and reflection of the tasks, but that reasoning about the effects of different generated controls on the final output remains challenging. Drawing on participant feedback, we discuss design implications for future Dynamic PRC systems that enhance user control of AI responses. Our findings suggest that dynamic prompt middleware can improve the user experience of generative AI workflows by affording greater control and guide users to a better AI response.

Dynamic Prompt Middleware: Contextual Prompt Refinement Controls for Comprehension Tasks

TL;DR

This work tackles the difficulty users face when prompting GenAI for comprehension tasks (e.g., explaining formulas or code) and introduces dynamic prompt middleware to provide context-sensitive controls. It presents two prompt control approaches—Dynamic Prompt Refinement Control (Dynamic PRC) and Static Prompt Refinement Control (Static PRC)—implemented as an Option Module that generates refinements and a Chat Module that grounds responses with those refinements, arranged in a two-tier architecture with inline and session options. A formative study with participants identifies a trade-off between standardized, predictable prompting and adaptive but potentially opaque controls, guiding the design goals of controllable and adaptable interfaces. A controlled within-subjects study with shows a clear preference for Dynamic PRC, which increases perceived control and task exploration but raises questions about cognitive load and interpretation of option effects; the work concludes with design implications for future Dynamic PRC systems and discusses alignment with broader explainability goals and the potential for Generative UI to augment human reasoning in knowledge work.

Abstract

Effective prompting of generative AI is challenging for many users, particularly in expressing context for comprehension tasks such as explaining spreadsheet formulas, Python code, and text passages. Prompt middleware aims to address this barrier by assisting in prompt construction, but barriers remain for users in expressing adequate control so that they can receive AI-responses that match their preferences. We conduct a formative survey (n=38) investigating user needs for control over AI-generated explanations in comprehension tasks, which uncovers a trade-off between standardized but predictable support for prompting, and adaptive but unpredictable support tailored to the user and task. To explore this trade-off, we implement two prompt middleware approaches: Dynamic Prompt Refinement Control (Dynamic PRC) and Static Prompt Refinement Control (Static PRC). The Dynamic PRC approach generates context-specific UI elements that provide prompt refinements based on the user's prompt and user needs from the AI, while the Static PRC approach offers a preset list of generally applicable refinements. We evaluate these two approaches with a controlled user study (n=16) to assess the impact of these approaches on user control of AI responses for crafting better explanations. Results show a preference for the Dynamic PRC approach as it afforded more control, lowered barriers to providing context, and encouraged exploration and reflection of the tasks, but that reasoning about the effects of different generated controls on the final output remains challenging. Drawing on participant feedback, we discuss design implications for future Dynamic PRC systems that enhance user control of AI responses. Our findings suggest that dynamic prompt middleware can improve the user experience of generative AI workflows by affording greater control and guide users to a better AI response.

Paper Structure

This paper contains 67 sections, 15 figures.

Figures (15)

  • Figure 1: One frame of the control interface presented to users as part of the formative design probe to collect feedback for a final design. (1) Shows an open ended text-box that users can input their goal which prompts the AI to select relevant options. (2) A grid of option elements that users can select which would adapt the AI's responses.
  • Figure 2: User flow with the Dynamic PRC system. (1) User submits their prompt. (2) The Option Module generates a set of options to help steer the Chat Module's response. (3) User can update the refinements sent to the Chat Module by clicking their preferences. (4) On change, Chat Module regenerates the response with the new chosen refinements. (5) User can request controls through NL prompting. (6) The Option Module generates a set of session options based on this prompt. (7) The session options apply to the current and every subsequent response from the Chat Module.
  • Figure 3: Prompt options model
  • Figure 4: Dynamic PRC overall system flow. Inline: (1) The Option Module takes the user's prompt input and conversation history. (2) The Option Module returns a set of prompt options with initial values based on the prompt. (3) Prompt options are rendered inline using a rendering engine. (4) The Chat Module uses these refinements as grounding, along with the user's prompt input and conversation history, to generate a chat response. (5) User can adjust GUI controls which updates the refinements and re-invokes the Chat Module to regenerate the current response. Session: Users can directly invoke the Option Module to generate Session options through natural language prompting within the Session control panel. (7) Users can also directly add and modify options manually through JSON input in the Session control panel. (8) Users can pin Inline options to the Session by clicking the pin icon on each inline option, which applies the inline option to follow-up queries.
  • Figure 5: Static PRC model.
  • ...and 10 more figures