Next Article in Journal
Video Behavior Recognition Running on Edge Devices to Realize a Patient Life Log System for Large-Scale Hospitals
Previous Article in Journal
Weakly Dimension-Balanced Hamiltonian Cycle on Three-Dimensional Toroidal Mesh Graph
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Optimizing Retrieval-Augmented Generation-Assisted User Interface Generation: A Comparative Study on Data Standardization for Brand Visual Consistency †

Department of Industrial Design, National Taipei University of Technology, Taipei 10608, Taiwan
*
Author to whom correspondence should be addressed.
Presented at 8th International Conference on Knowledge Innovation and Invention 2025 (ICKII 2025), Fukuoka, Japan, 22–24 August 2025.
Eng. Proc. 2025, 120(1), 37; https://doi.org/10.3390/engproc2025120037
Published: 3 February 2026
(This article belongs to the Proceedings of 8th International Conference on Knowledge Innovation and Invention)

Abstract

The advancement of large language models (LLMs) has facilitated the generation of user interface (UI) code from natural language prompts, thereby supporting low-code development paradigms. Despite these capabilities, ensuring brand consistency remains a significant challenge, particularly when style data is unstructured. We investigated the impact of three data formats—plain text, structured cascading style sheets (CSS), and structured natural language (NL) guide—on the effectiveness of retrieval-augmented generation (RAG) in producing brand-consistent UI components, with No-RAG serving as the baseline for comparison. The findings indicate that RAG substantially enhances brand alignment. Although the structured NL guide yielded the highest CSS recall rate, participants expressed a preference for outputs derived from plain text, suggesting that the optimal data format may depend on specific design contexts and evaluative criteria.

1. Introduction

With the rapid advancement of generative AI technologies, the use of large language models (LLMs) for front-end code generation has attracted increasing attention and presents new opportunities for low-code/no-code (LCNC) interface development [1]. Current automated user interface (UI) code generation techniques generally fall into two categories: image-to-code methods [2,3,4] and text-to-code methods [5,6]. These approaches offer greater flexibility in interface design and development, gradually facilitating the integration between design and engineering fields.
However, maintaining brand visual consistency throughout the generation process remains a critical challenge. Inconsistent visual outputs not only undermine the professional image of a product but also increase the collaborative burden between designers and engineers. Although retrieval-augmented generation (RAG) assists LLMs by providing external style references, its effectiveness heavily depends on the quality of the input data. Therefore, standardizing the input data to enable LLMs to reliably generate brand-consistent interfaces has become a key factor in improving the visual consistency of generated outputs.
Based on the previous study results, this study aims to investigate how data standardization strategies can optimize RAG-assisted UI code generation. We compared the effects of different standardized data formats on brand visual consistency and proposes a retrieval-augmented, standardized data structure as a reference framework for brand-oriented UI generation tasks.

2. Related Work

2.1. Data Structure and Applications of RAG

Compared to image-to-code methods, text-based input offers a lower entry barrier, making it particularly appropriate for LCNC applications. However, LLMs still have limited capability in capturing individual brand styles. RAG has thus emerged as a promising solution. Patel et al. [6] integrated Figma with a retrieval mechanism to construct a design knowledge base that supports LLMs in UI code generation, demonstrating the potential of this approach.
Recent studies have explored how the structure of retrieved data affects RAG performance [7]. For example, they demonstrated that using the original HTML structure, rather than converting it to plain text, significantly enhances the semantic understanding and response accuracy of RAG-based question-answering systems. Although their study focused on quality assurance (QA) tasks, their findings offer valuable theoretical insights for data format design in other RAG applications, including this study.

2.2. Brand Visual Consistency

Visual consistency is critical in digital products, as it effectively enhances users’ trust in websites, improves learning efficiency, and contributes to overall user experience [8,9]. For example, SAP, a German-based multinational software company, has implemented Pattern-Based UI and a model-based development environment to translate internal interface guidelines into programmable verification rules [10]. This approach enables systematic interface consistency checks, significantly reducing manual effort and correction costs in later quality control stages. This practice demonstrates that the integration of standardized data plays a crucial role in maintaining large-scale interface consistency within enterprise environments.

2.3. Style Verification

In information security, CSS style properties have been used as a quantitative basis for assessing visual similarity, particularly in distinguishing phishing websites from legitimate ones [11]. Although these applications differ from the context of UI generation, relevant studies have confirmed that CSS properties possess the ability to identify visual styles and can serve as a reliable foundation for detecting visual consistency.
We adopted this extended application by using style property matching as a quantitative basis for evaluating visual consistency and further analyzes the impact of data standardization formats on the consistency between the generated results and brand styles.

3. Materials and Methods

3.1. Experimental Setup

We investigated the impact of different data formats on brand visual consistency in RAG-assisted UI code generation. Therefore, the experiment focuses on variations in data formats rather than differences in the performance of the generation model itself. To control for model-related variables, we used bolt.new (v1 Agent) [12] as the generation platform and selects the official Starbucks website [13] as the experimental material. The website was chosen due to its strong brand identity and clear structural design, which facilitates subsequent analysis and comparison of visual style consistency.
The experiment is designed with the No-RAG condition as the baseline, and three data formats are set as independent variables.
  • No-RAG (baseline): No external knowledge documents are provided. The model generates UI code based solely on the prompt.
  • Plain text: Brand style descriptions are generated by a GPT model based on screenshots of the official website. The content is neither manually revised nor structured with explicit attribute mappings.
  • Structured CSS: Brand styles are categorized by UI components and organized into JSON-formatted structured data using CSS properties, as shown in Table 1.
  • Structured NL guide: Brand style descriptions are written in natural language. For example: “The button background color is rgb(255, 0, 0), the font size is 14 px, and the border radius is 8 px.” These descriptions are stored in JSON format.

3.2. CSS Recall Rate

To evaluate whether the generated code aligns with the brand’s visual style specifications, we calculated the CSS recall rate based on specific UI components. This metric is used to measure the proportion of overlapping CSS properties between the generated code and the brand-defined styles. In this context, true positives (TP) represent the number of CSS properties correctly matching the brand specifications, while false negatives (FN) refer to the properties defined in the brand styles but missing from the generated code. The recall rate is calculated using the following formula:
R e c a l l = T P T P + F N
The reference data used were manually compiled by the researchers based on the official brand website’s code. Six common UI components, namely, A, B, C, D, E, and F, were selected, and their visual properties were defined for comparison. The property definitions specifically focus on visual styles and exclude functional attributes such as z-index and cursor. For example, for the button component, the following data were used.
  • background-color;
  • border-radius;
  • color;
  • font-weight;
  • font-family;
  • font-size;
  • text-align.
If the generated result successfully reproduces only five out of the seven defined properties, the recall rate is calculated accordingly.
R e c a l l = 5 5 + 2 = 0.714
Other UI components follow the same principle, with their respective sets of style properties defined for comparison. To improve matching accuracy, standardization processes were applied, including unit unification (e.g., pixel and root em) and color conversion between RGB and Hex formats. To minimize misjudgments caused by different expression formats, no tolerance thresholds were set for color code discrepancies, and visual proximity was not considered, so exact matches of both property names and values were accepted.

3.3. Interview-Based Evaluation

To address the limitations of quantitative metrics in capturing users’ subjective judgments and visual perceptions, four participants with relevant professional backgrounds were invited to join the study. The participants included two UI/user experience designers and two front-end engineers with practical experience. Each participant completed the following two tasks.
  • Similarity ranking: The participants ranked the four generated versions based on their perceived similarity to the brand style. All versions were presented under blind conditions to prevent potential bias.
  • Semi-structured interview [14]: After completing the ranking task, each participant participated in a semi-structured interview lasting approximately 15–20 min. The interview aimed to explore their evaluation criteria, key considerations, and areas of disagreement. Example questions included the following.
    • “Which version do you think best aligns with the brand style? Why?”
    • “Were you hesitant when ranking the middle two versions? What were the differences between them?”
    • “What design elements do you primarily focus on when evaluating style consistency?”
In this exploratory study, the small sample size (n = 4) was used primarily to complement the quantitative evaluation, and no inferential statistics were conducted.

4. Results

4.1. Weighted Recall of CSS Styles

We took into account the different occurrence counts of UI components on the page. To account for this, the weighted recall of CSS styles was calculated for each data format, using the component occurrence counts as weights. The calculation formula is as follows.
W e i g h t e d   R e c a l l = i = 1 n C o u n t i × R e c a l l i i = 1 n C o u n t i
Here, R e c a l l i   represents the CSS recall rate of the i-th type of component, and C o u n t i refers to the number of occurrences of that component on the page. This weighted approach provides a more accurate reflection of the model’s overall ability to reproduce the visual styles of the interface. Table 2 summarizes the weighted recall results for the four data formats.
Overall, providing brand-related style references significantly improves the consistency of the generated UI code. Under the No-RAG condition, where no reference materials were provided, the weighted recall was the lowest (0.29). The generated outputs in this condition often defaulted to generic styles and lacked brand distinctiveness. Although the plain text condition (0.31) achieved a slightly higher recall than No-RAG, it was insufficient to consistently guide the model toward stable brand styling. The structured CSS condition (0.48), while not achieving a high score, demonstrated a noticeable alignment with the brand’s visual style, particularly in components such as buttons, navigation bars, and typography, where style reproduction was more stable. The structured NL guide condition achieved the best performance (0.75), indicating that semantic brand style descriptions can effectively assist the model in generating visually consistent results aligned with brand expectations.

4.2. Interview Results

The subjective ranking results of the four generated versions are presented in Table 3. All participants consistently agreed that the pages generated under the No-RAG condition exhibited loose visual structure and lacked brand characteristics, ranking it the lowest in all cases. Although there were some variations in the top two rankings among different roles, the structured CSS condition was generally preferred by three participants, as it demonstrated stable performance and a clear structural layout. The plain text condition was favored by one designer for its stronger semantic alignment with the brand’s overall atmosphere.
Although the Structured NL Guide condition achieved the highest quantitative score, it did not consistently receive the highest subjective rankings. This suggests that while the descriptive style provides valuable reference information, it may still fall short in detail translation or semantic precision in practical application.
In addition to the ranking task, participants agreed that color was the primary criterion for evaluating brand consistency, followed by layout structure. Both designers specifically emphasized that font style and size significantly influence brand perception. Additionally, three participants highlighted that the consistency of the footer module was one of their key points of observation. The participants’ responses included the following.
  • Designer A: “I quickly assess the brand style based on the color scheme of the homepage.”
  • Designer B: “Starbucks always uses sans-serif fonts for major headings. This is one of my key indicators.”
  • Engineer A: “Color is the primary factor, followed by the layout style.”
  • Engineer B: “The footer should not differ too much from the official website, so I always check the footer style.”
The interview results provided valuable subjective insights beyond the quantitative evaluation and further emphasized that layout and color are critical factors in the perception of brand consistency.

4.3. Integrated Analysis and Preliminary Observations

We integrated quantitative metrics and qualitative data to provide a comprehensive analysis. Overall, providing reference materials significantly improves the visual quality of the generated outputs. However, discrepancies were observed between the quantitative scores and the subjective rankings, reflecting differences in style characteristics and users’ subjective perceptions.
The structured NL guide condition achieved the highest style recall rate (0.75), yet participants’ subjective rankings showed a different trend. Although the plain text condition yielded a lower recall rate, it was rated by both designers as the version most aligned with the brand style, suggesting that even unstructured descriptions can effectively guide the model to generate visually appropriate outputs. In the recall rate calculation, tolerance thresholds were not applied, which contributed to lower overall scores.
Notably, while the structured NL guide successfully applied the brand’s designated color palette, it mistakenly used the secondary color, light green, as the primary homepage background, failing to reflect the brand’s intended dark green. The No-RAG condition was consistently rated the lowest by all participants, as it provided no brand-related references and generated outputs lacking brand distinctiveness, as illustrated in Figure 1.

5. Limitations

Although we verified the potential of RAG in generating brand-consistent UI code, several limitations remain.
  • Limited CSS property selection: We only examined a subset of representative static CSS properties, such as color, font size, border radius, and spacing, without covering layout details, animations, or interactive styles.
  • Static analysis only: The evaluation was based solely on static code analysis and does not include dynamic behaviors such as hover states, click animations, or transitions, which may overlook style inconsistencies in user interactions.
  • Small sample size for subjective evaluation: The subjective ranking involved only four participants with design or front-end backgrounds, which may limit the generalizability of the findings.

6. Conclusions

We compared the No-RAG condition with three different data formats to evaluate their effects on brand visual consistency in UI code generation. The results indicate that data formats significantly influence generation quality and style consistency, underscoring the critical role of data structure in guiding generation behaviors. This finding aligns with those of Ref. [7], which emphasized that structured data representations can enhance model output quality and play a strategic role in generation tasks. However, structured formats, such as HTML, do not consistently outperform plain text across all scenarios. This suggests that while data structuring is generally beneficial, its effectiveness may vary depending on specific task contexts and input characteristics. These results support the principle that data format selection should be aligned with specific task requirements and contribute to the development of generative UI collaboration tools and provide empirical and theoretical support for future data design strategies.

Author Contributions

Y.-H.H. and H.-H.W.; methodology, Y.-H.H.; software, Y.-H.H.; validation, Y.-H.H. and H.-H.W.; formal analysis, Y.-H.H.; investigation, Y.-H.H.; resources, H.-H.W.; data curation, Y.-H.H.; writing—original draft preparation, Y.-H.H.; writing—review and editing, Y.-H.H. and H.-H.W.; visualization, Y.-H.H.; supervision, H.-H.W.; project administration, H.-H.W.; funding acquisition, H.-H.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Ethical review and approval were waived for this study due to the research involving only anonymous expert evaluations that posed no risk to participants and did not collect sensitive personal data.

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
RAGRetrieval-Augmented Generation
UIUser Interface
LLMsLarge Language Models
LCNCLow-Code/No-Code
CSSCascading Style Sheets
JSONJavaScript Object Notation

References

  1. Paliwal, G.; Donvir, A.; Gujar, P.; Panyam, S. LCNC Meets GenAI: A New Era in Product Development. In Proceedings of the 2024 IEEE Eighth Ecuador Technical Chapters Meeting (ETCM), Cuenca, Ecuador, 15–18 October 2024; pp. 1–9. [Google Scholar] [CrossRef]
  2. Laurençon, H.; Tronchon, L.; Sanh, V. Unlocking the conversion of web screenshots into html code with the websight dataset. arXiv 2024, arXiv:2403.09029. [Google Scholar] [CrossRef]
  3. Srinath, R.; Siva Prasath, K.R.; Vinith, W.; Srinivasan, L. STC (Sketch To Code)-An Enhanced Html & CSS Autocode Generator from Handwritten Text and Image Using Deep Learning. In Proceedings of the 2024 2nd International Conference on Networking and Communications (ICNWC), Chennai, India, 2–4 April 2024; pp. 1–6. [Google Scholar] [CrossRef]
  4. Xu, Y.; Bo, L.; Sun, X.; Li, B.; Jiang, J.; Zhou, W. image2emmet: Automatic code generation from web user interface image. J. Softw. Evol. Process 2021, 33, e2369. [Google Scholar] [CrossRef]
  5. Wu, J.; Schoop, E.; Leung, A.; Barik, T.; Bigham, J.P.; Nichols, J. Uicoder: Finetuning large language models to generate user interface code through automated feedback. arXiv 2024, arXiv:2406.07739. [Google Scholar] [CrossRef]
  6. Patel, B.; Gagrani, P.; Sheth, S.; Thakur, K.; Varahan, P.; Shim, S. StarryStudioAI: Automating UI Design with Code-Based Generative AI and RAG. In Proceedings of the 2025 IEEE 15th Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA, 6–8 January 2025; pp. 00937–00944. [Google Scholar] [CrossRef]
  7. Tan, J.; Dou, Z.; Wang, W.; Wang, M.; Chen, W.; Wen, J.-R. HtmlRAG: HTML is Better Than plain text for Modeling Retrieved Knowledge in RAG Systems. In Proceedings of the ACM on Web Conference 2025, Sydney, NSW, Australia, 28 April 2025–2 May 2025; pp. 1733–1746. [Google Scholar] [CrossRef]
  8. Blair-Early, A.; Zender, M. User Interface Design Principles for Interaction Design. Des. Issues 2008, 24, 85–107. [Google Scholar] [CrossRef]
  9. Schlatter, T.; Levinson, D. Visual Usability: Principles and Practices for Designing Digital Applications; Morgan Kaufmann: Waltham, MA, USA, 2013; pp. 3–32. [Google Scholar] [CrossRef]
  10. Viswanathan, S.; Peters, J.C. Automating UI guidelines verification by leveraging pattern based UI and model based development. In Proceedings of the CHI ‘10 Extended Abstracts on Human Factors in Computing Systems, Atlanta, GA, USA, 10–15 April 2010; pp. 4733–4742. [Google Scholar] [CrossRef]
  11. Haruta, S.; Asahina, H.; Sasase, I. Visual Similarity-Based Phishing Detection Scheme Using Image and CSS with Target Website Finder. In Proceedings of the GLOBECOM 2017—2017 IEEE Global Communications Conference, Singapore, 4–8 December 2017; pp. 1–6. [Google Scholar] [CrossRef]
  12. Bolt.New (v1 Agent). Available online: https://bolt.new/ (accessed on 2 June 2025).
  13. Starbucks Careers. Available online: https://careers.starbucks.com/ (accessed on 2 June 2025).
  14. Kallio, H.; Pietilä, A.-M.; Johnson, M.; Kangasniemi, M. Systematic methodological review: Developing a framework for a qualitative semi-structured interview guide. J. Adv. Nurs. 2016, 72, 2954–2965. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Representative UI generation results for the four data formats.
Figure 1. Representative UI generation results for the four data formats.
Engproc 120 00037 g001
Table 1. Generated JSON metadata for button styling.
Table 1. Generated JSON metadata for button styling.
UI ComponentAttributeValue
background-colorrgb(255, 0, 0)
buttonfont-size14 px
border-radius8 px
Table 2. Weighted recall results for each data format.
Table 2. Weighted recall results for each data format.
Data FormatWeighted Recall
No-RAG0.29
Plain text0.31
Structured CSS0.48
Structured NL guide0.75
Table 3. Subjective ranking of the generated pages for each data format.
Table 3. Subjective ranking of the generated pages for each data format.
ParticipantSubjective Ranking (from Highest to Lowest)
Designer APlain Text > Structured CSS > Structured NL Guide > No-RAG
Designer BStructured CSS > Plain Text > Structured NL Guide > No-RAG
Engineer AStructured NL Guide > Structured CSS > Plain Text > No-RAG
Engineer BStructured CSS > Structured NL Guide > Plain Text > No-RAG
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hsieh, Y.-H.; Wang, H.-H. Optimizing Retrieval-Augmented Generation-Assisted User Interface Generation: A Comparative Study on Data Standardization for Brand Visual Consistency. Eng. Proc. 2025, 120, 37. https://doi.org/10.3390/engproc2025120037

AMA Style

Hsieh Y-H, Wang H-H. Optimizing Retrieval-Augmented Generation-Assisted User Interface Generation: A Comparative Study on Data Standardization for Brand Visual Consistency. Engineering Proceedings. 2025; 120(1):37. https://doi.org/10.3390/engproc2025120037

Chicago/Turabian Style

Hsieh, Yun-Hsuan, and Hung-Hsiang Wang. 2025. "Optimizing Retrieval-Augmented Generation-Assisted User Interface Generation: A Comparative Study on Data Standardization for Brand Visual Consistency" Engineering Proceedings 120, no. 1: 37. https://doi.org/10.3390/engproc2025120037

APA Style

Hsieh, Y.-H., & Wang, H.-H. (2025). Optimizing Retrieval-Augmented Generation-Assisted User Interface Generation: A Comparative Study on Data Standardization for Brand Visual Consistency. Engineering Proceedings, 120(1), 37. https://doi.org/10.3390/engproc2025120037

Article Metrics

Back to TopTop