Dynamic Prompt Middleware: Contextual Prompt Refinement Controls for Comprehension Tasks

Authors: Ian Drosos, Jack Williams, Advait Sarkar, Nicholas Wilson, Sean Rintel, Payod Panda
Venue: CHIWORK 2025

AThe study

Controlled lab study with 16 knowledge workers. Each used two AI chat tools on comprehension tasks in counterbalanced order, in a session of about 90 minutes, after a formative survey of 38 knowledge workers.

Comprehension tasksAfter each toolEnd of session Generated controlsall 16 people Controls generated by the AI for each request Questionnaire on the controls End of session: direct comparisonThe same 16 people used both tools, then were interviewed Fixed controlsall 16 people A fixed list of generic controls Questionnaire on the controls

BThe tool

  1. Type a requestThe person asks the AI chat to explain something, for example a spreadsheet formula.
  2. Generate controlsOne AI model reads the request and generates controls tailored to it, with starting values already chosen.detail levellearning objective
  3. AnswerA second AI model answers using the request plus the selected options.
  4. Adjust and regenerateWhenever the person changes a control, the answer is regenerated.
  5. Keep options for the sessionThe person can ask in plain language for controls that apply to every request, or pin a generated control.

Steps 2, 4 and 5 are the generated controls. The fixed controls tool had the same chat with a fixed list of generic explanation controls from the formative survey.

CWhat changed

Rated after each toolthe same people rated generated and fixed controls

  • ↑Generated controls: rated more effective at steering the AI's explanations.Self-reported, mean 6.44 against 5.81 on a 1 to 7 scale. A medium effect, r = .363, though 16 people gave the test low power.
  • ↑Generated controls: people said they needed less extra control over explanations.Self-reported, mean 2.75 against 4.44 on a 1 to 7 scale. A medium effect, r = .42.
  • –Generated controls: rated about as useful as fixed controls for understanding concepts.Self-reported, mean 6.44 against 5.88. Not a reliable difference, p = .164.
  • ↓Generated controls: rated less helpful for understanding when explaining Python code.Self-reported for that task, p = 0.0355. It was the only task where ratings of understanding differed reliably.
  • –Generated controls: task success was rated about the same as with fixed controls.Self-reported after each tool. Ratings of task success did not differ reliably.

Compared directly, then discussedend of session preference and interviews

  • Generated controls: most people preferred them to fixed controls.Self-reported on a scale from 1, generated, to 7, fixed, median 2.0. People also judged generated controls slightly more demanding.
  • Generated controls: several people said they made it easier to give the AI context.For some, options shown with each answer replaced much typing of follow-up prompts. Several said the options also prompted reflection on the task.
  • Both groups: with either tool, people found an option's effect hard to predict.Responses sometimes changed in unexpected places, changed too little, or ignored one option because of another.

↑ better than with fixed controls ↓ worse – no reliable difference

DKey takeaway

Dynamic prompt middleware, which generates controls for each request, can help people steer AI explanations and reflect on their task. People may also need to see how options change the answer.

Made for this site with AI assistance from the verified research brief. It is not the paper's own figure.

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.

Research brief

By Ian Drosos, Jack Williams, Advait Sarkar, Nicholas Wilson, Sean Rintel, and Payod Panda.

Takeaway: Ephemeral UI (controls an AI generates fresh for each prompt) can help people steer AI explanations. Knowledge workers rated this dynamic prompt middleware more effective than fixed controls and said it eased context-giving and prompted reflection. But how the AI would apply an option often stayed hard to predict.

Why this matters

What was known
Prompting generative AI is hard, from expressing context in text to the metacognitive demands it makes. Graphical 'prompt middleware' helps users build prompts, but has not been generated dynamically for the user's task in comprehension and learning. close attention has not yet been paid to generating middleware dynamically, adapted to the user's specific task at hand, in the context of comprehension and learning tasks (§2, p. 3)
What this paper adds
Controls designed in advance cannot anticipate the breadth of knowledge work. We build a system that generates controls for each request instead, compare it in a controlled study with fixed generic controls, and derive design implications. In this paper, we propose instead to generate prompt middleware customized to the user and task. (§1, p. 2)
Who it matters to
Designers and developers of generative AI tools, especially for comprehension and learning in knowledge work, and researchers of AI as a tool for thought. Our findings suggest that dynamic prompt middleware can improve the user experience of generative AI workflows. (Abstract, p. 1)

Research questions

Method and data

Design
A formative survey with a design probe, then a controlled within-subjects lab study comparing Dynamic PRC and Static PRC, counterbalanced for condition and task-set order.
Prototype
Dynamic Prompt Refinement Control (Dynamic PRC), a web-based chat assistant built with React and TypeScript, with responses from gpt4-turbo. The user types a request, for example to explain a spreadsheet formula. One language model (the Option Module) reads the request and generates controls tailored to it, such as radio buttons for explanation detail level or learning objective, with starting values already chosen. A second model (the Chat Module) answers using the request plus those selections, and regenerates the answer whenever the user changes a control. Users can also ask in plain language for controls that apply to the whole session (for example, response format), edit them directly as JSON, or pin a generated control so it applies to every later request. It was compared with Static PRC (the same chat with a fixed list of generic explanation controls derived from the formative survey).
Two chat panels for the prompt 'How do I use PyTorch?': generated options for experience level and learning objective appear above the answer, and switching experience from Beginner to Advanced regenerates a more advanced answer.
Figure 1: Schematic overview of Dynamic Prompt Refinement Control interface for generating inline prompt refinement options to increase user control of AI-generated explanations (derived from real system use). (1) User prompts the system. (2) The Option Module takes the user's prompt as context to generate prompt options which provide prompt refinements for the user to select. (3) The Chat Module uses the user's prompt and pre-selected options to generate an initial response. (4) The user can initiate refinements by selecting their preferred options in the UI. (5) On each change, the Chat Module regenerates the response based on the new selections. From the paper, Fig. 1, p. 1.
Setting
Formative survey of knowledge workers at a large software company. Lab study with knowledge workers from diverse occupations, located on various continents.
Participants / data
Formative survey n = 38. Lab study n = 16 (8 men, 8 women), mostly regular generative AI users.
Duration
Each lab session took approximately 90 minutes: 6 tasks (code explanation, complex topic understanding, skill learning), 7 minutes per task.
Analysis
Post-task, post-condition and post-study questionnaires (including an adapted NASA Task Load Index) compared with Mann-Whitney U tests. Think-aloud and semi-structured interview data analysed with iterative open coding and thematic analysis, refined by negotiated agreement.

Findings

Questions this paper answers

Should the controls in an AI interface adapt to each request, or stay fixed?
Each has strengths. Controls generated for each request make it easier to give the AI context, and people preferred them and rated them more effective for steering explanations. Fixed controls were not rated significantly less useful for understanding concepts, and helped more when explaining code. (See §6.3, p. 13; §6.2, p. 12; §6.3, p. 12.)
Are controls that change with every request harder to use?
Somewhat. Because new options appear with each request, some people felt they took more mental energy, and overall they were judged slightly more demanding. Yet self-reported mental load did not differ significantly from fixed controls. (See §6.3, p. 13; §6.3, pp. 13–14.)
Can prompt controls help people think about their task, not just the AI's output?
They can. Options generated for a request show what one could ask for. Several people said this helped them work out what they did not know and reflect on their task, not only shape the answer. (See §6.3, p. 13.)
Why is it hard to predict what an AI control will do?
Users could not always tell what an option would change or whether the AI had applied it. Options altered unexpected parts of a response, changed too little, or cancelled each other out. Trying each option and watching the answer regenerate helped. (See §6.3, pp. 14–15.)

Quantitative results

MeasureResultWhere
Formative survey: importance of having control over the AI response (5-point scale)Median=4.0 [Agree], Mean=4.3§3.3, p. 4
Overall tool preference (1 = Dynamic PRC, 7 = Static PRC, 4 = equal)median=2.0, mean=2.81§6.1, p. 10
Which tool was more demanding to communicate with (1 = Dynamic PRC, 7 = Static PRC)median=3.0, mean=3.31§6.1, p. 10
Helpfulness for controlling AI responses (7-point scale), Dynamic vs Static PRCDynamic PRC median=6.5, mean=6.38 vs Static PRC median=6.0, mean=5.69§6.1, p. 11
Controls effective at helping control AI output, Dynamic vs Static PRCmean=6.44 vs mean=5.81; U: 73.5, P-value: .0245, r: .363 (medium effect), power: .275§6.2, p. 12
Needed greater control over the explanations, Dynamic vs Static PRCmean=2.75 vs mean=4.44; U: 190.5, P-value: .0174, r: .42 (medium effect), power: .349§6.2, p. 12
Controls useful for understanding task concepts, Dynamic vs Static PRC (not significant)mean=6.44 vs mean=5.88; U: 94, P-value: .164§6.2, p. 12
Per-task rating of how much options helped understanding, Task 4 (explaining Python code): Dynamic PRC worse than Static PRC (the only significant per-task difference)U: 12.0, P-value: 0.0355§C.1, p. 22

Contributions and implications

Limitations

›

Concepts

Prompt middleware
Graphical interface elements that help users construct and manipulate prompts instead of typing everything. a general category of techniques that use graphical interface elements for manipulating prompts, sometimes referred to as" prompt middleware" [44], to ease the cognitive burdens of text entry and manipulation (§2, p. 3)
Dynamic Prompt Refinement Control (Dynamic PRC)
Our system: an Option Module analyses the user's prompt and generates controls (radio buttons, checkboxes, free text) whose selections refine the prompt sent to a Chat Module. Dynamic Prompt Refinement Control (Dynamic PRC), which generates UI elements for prompt refinement based on the user's specific prompt (Abstract, p. 1)
Static Prompt Refinement Control (Static PRC)
The comparison condition: a fixed list of generic controls derived from the formative survey, offered for any prompt. Static Prompt Refinement Control (Static PRC), which offers generic controls (Abstract, p. 1)
Session options
Requested in natural language, edited as JSON or pinned from inline options. The paper's definition: Session options are options that apply to every prompt and AI response in a given session with the Dynamic PRC system. (§4.2, p. 6)

Figures

Two chat panels for the prompt 'How do I use PyTorch?': generated options for experience level and learning objective appear above the answer, and switching experience from Beginner to Advanced regenerates a more advanced answer.
Figure 1: Schematic overview of Dynamic Prompt Refinement Control interface for generating inline prompt refinement options to increase user control of AI-generated explanations (derived from real system use). (1) User prompts the system. (2) The Option Module takes the user's prompt as context to generate prompt options which provide prompt refinements for the user to select. (3) The Chat Module uses the user's prompt and pre-selected options to generate an initial response. (4) The user can initiate refinements by selecting their preferred options in the UI. (5) On each change, the Chat Module regenerates the response based on the new selections. From the paper, Fig. 1, p. 1.
Box plots on a 1-7 agreement scale comparing Dynamic and Static PRC: Dynamic controls rated more effective for controlling AI output, similar for understanding, and with less need for greater control.
Figure 12: Participant rated effectiveness of each condition in the control of AI responses for the comprehension tasks they saw. From the paper, Fig. 12, p. 12.
Box plots on a scale from 1 (Dynamic PRC) to 7 (Static PRC), 4 equal: preference leans to Dynamic (median 2.0). Dynamic rated slightly more mentally demanding and effortful. Rushed and annoyed sit near equal.
Figure 10: Overall direct comparison of conditions for participant tool preference, mental demand, feelings of being rushed, successful, level of effort, and feelings of annoyance. From the paper, Fig. 10, p. 10.

How to cite

Ian Drosos, Jack Williams, Advait Sarkar, Nicholas Wilson, Sean Rintel, and Payod Panda. 2025. Dynamic Prompt Middleware: Contextual Prompt Refinement Controls for Comprehension Tasks. CHIWORK 2025. https://doi.org/10.1145/3729176.3729203

This brief was prepared with AI assistance and published by Sean Rintel. It is not the authors' published text. Page numbers refer to this PDF.

BibTeX

@inproceedings{drosos2025dynamic,
author = {Drosos, Ian and Williams, Jack and Sarkar, Advait and Wilson, Nicholas and Rintel, Sean and Panda, Payod},
title = {Dynamic Prompt Middleware: Contextual Prompt Refinement Controls for Comprehension Tasks},
booktitle = {CHIWORK 2025},
year = {2025},
month = {June},
publisher = {ACM},
url = {https://doi.org/10.1145/3729176.3729203},
note = {Microsoft Foundry Labs},
doi = {10.1145/3729176.3729203},
}