Abstract
This paper introduces Gen-UI-Lang, a compact language designed to express user interfaces as concise abstract syntax trees that can be rendered to multiple targets such as HTML and React. The language prioritizes human readability and predictability for large language model (LLM) generation, reducing token usage while preserving structural clarity and thereby improving the reliability of model-produced UI descriptions. The design centers on a small set of composable factory functions that map to structured “Node” objects, enabling deterministic rendering, straightforward extensibility, and lightweight integration with interactive demo frameworks. A reference implementation demonstrates minimal renderer code, an optional LLM helper that biases outputs toward the language's syntax, and a demo script that exercises key functionality. Evaluation focuses on qualitative analyses of concision, LLM fidelity, and engineering overhead, showing that compact, predictable UI specifications reduce malformed model outputs and lower the development effort required for rapid prototyping. Limitations and avenues for future work include richer interaction semantics, formal verification of generated outputs, and pathways toward production-grade component generation.
The source code is available at
github.com/Pro-GenAI/Gen-UI-Lang.
Keywords: Large language models, LLMs, Generative AI, Generative UI, user interfaces, UI synthesis, Artificial Intelligence, AI.