Large language models (LLMs) are remarkably good at writing code. A particularly valuable case of human-LLM collaboration is code-based UI prototyping, a method for creating interactive prototypes that allows users to view and fully engage with a user interface. We conduct a formative study of GPT Pilot, a leading LLM-generated code-prototyping system, and find that its inflexibility towards change once development has started leads to weaknesses in failure prevention and dynamic planning; it closely resembles the linear workflow of the waterfall model. We introduce DIDUP, a system for code-based UI prototyping that follows an iterative spiral model, which takes changes and iterations that come up during the development process into account. We propose three novel mechanisms for LLM-generated code-prototyping systems: (1) adaptive planning, where plans should be dynamic and reflect changes during implementation, (2) code injection, where the system should write a minimal amount of code and inject it instead of rewriting code so users have a better mental model of the code evolution, and (3) lightweight state management, a simplified version of source control so users can quickly revert to different working states. Together, this enables users to rapidly develop and iterate on prototypes.
翻译:大型语言模型(LLM)在代码编写方面表现出卓越的能力。人机协作中一个特别有价值的案例是基于代码的用户界面(UI)原型设计,该方法能够创建交互式原型,使用户能够查看并完全参与用户界面的交互过程。我们对当前领先的LLM生成代码原型系统GPT Pilot进行了形成性研究,发现该系统在开发启动后对变更缺乏灵活性,导致其在错误预防和动态规划方面存在不足;其工作流程与瀑布模型的线性流程高度相似。本文提出了DIDUP,一个遵循迭代螺旋模型的基于代码的UI原型设计系统,该系统能够充分考虑开发过程中出现的变更与迭代需求。我们为LLM生成代码原型系统提出了三种创新机制:(1)自适应规划——规划应具备动态性并反映实施过程中的变更;(2)代码注入——系统应编写最少量代码并通过注入方式集成,而非重写代码,从而帮助用户更好地建立代码演进的心理模型;(3)轻量级状态管理——这是源代码控制的简化版本,使用户能够快速回退到不同的工作状态。这些机制共同支持用户快速开发和迭代原型。