使用检索增强生成修复响应式布局失败
Repairing Responsive Layout Failures Using Retrieval Augmented Generation
AI总结:
本文提出基于 RAG 的自动化修复方法 ReDeFix,利用 Stack Overflow 知识和 LLM 生成 CSS 补丁修复响应式布局失败,准确率达 88%,且生成的布局视觉正确且美观。
摘要:
响应式网站在特定屏幕尺寸下经常出现布局扭曲,这被称为响应式布局失败(RLF)。手动修复这些 RLF 需要对 HTML 元素和 CSS 属性进行繁琐的试错调整。本研究提出了一种结合 LLM 与领域知识的自动化修复方法。该方法名为 ReDeFix,是一种基于检索增强生成(RAG)的解决方案,利用 Stack Overflow (SO) 讨论来指导 LLM 进行 CSS 修复。通过用 RLF 特定上下文增强相关的 SO 知识,ReDeFix 创建发送给 LLM 的提示,以生成 CSS 补丁。评估表明,该方法在修复 RLF 时达到 88% 的准确率。此外,软件工程师的研究表明,生成的修复能产生视觉正确的布局,同时保持美观。
英文摘要:
Responsive websites frequently experience distorted layouts at specific screen sizes, called Responsive Layout Failures (RLFs). Manually repairing these RLFs involves tedious trial-and-error adjustments of HTML elements and CSS properties. In this study, an automated repair approach, leveraging LLM combined with domain-specific knowledge is proposed. The approach is named ReDeFix, a Retrieval-Augmented Generation (RAG)-based solution that utilizes Stack Overflow (SO) discussions to guide LLM on CSS repairs. By augmenting relevant SO knowledge with RLF-specific contexts, ReDeFix creates a prompt that is sent to the LLM to generate CSS patches. Evaluation demonstrates that our approach achieves an 88\% accuracy in repairing RLFs. Furthermore, a study from software engineers reveals that generated repairs produce visually correct layouts while maintaining aesthetics.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。