[论文解读] Chat2VIS: Generating Data Visualisations via Natural Language using ChatGPT, Codex and GPT-3 Large Language Models
Chat2VIS 使用 GPT-3、Codex 和 ChatGPT,通过精心设计的提示将自由形式的自然语言查询转换为渲染数据可视化的 Python 脚本,展示通过 LLM 的端到端 NL2VIS。
The field of data visualisation has long aimed to devise solutions for generating visualisations directly from natural language text. Research in Natural Language Interfaces (NLIs) has contributed towards the development of such techniques. However, the implementation of workable NLIs has always been challenging due to the inherent ambiguity of natural language, as well as in consequence of unclear and poorly written user queries which pose problems for existing language models in discerning user intent. Instead of pursuing the usual path of developing new iterations of language models, this study uniquely proposes leveraging the advancements in pre-trained large language models (LLMs) such as ChatGPT and GPT-3 to convert free-form natural language directly into code for appropriate visualisations. This paper presents a novel system, Chat2VIS, which takes advantage of the capabilities of LLMs and demonstrates how, with effective prompt engineering, the complex problem of language understanding can be solved more efficiently, resulting in simpler and more accurate end-to-end solutions than prior approaches. Chat2VIS shows that LLMs together with the proposed prompts offer a reliable approach to rendering visualisations from natural language queries, even when queries are highly misspecified and underspecified. This solution also presents a significant reduction in costs for the development of NLI systems, while attaining greater visualisation inference abilities compared to traditional NLP approaches that use hand-crafted grammar rules and tailored models. This study also presents how LLM prompts can be constructed in a way that preserves data security and privacy while being generalisable to different datasets. This work compares the performance of GPT-3, Codex and ChatGPT across a number of case studies and contrasts the performances with prior studies.
研究动机与目标
- 通过将自由形式的自然语言转换为可视化来实现端到端的 NL2VIS,借助大型语言模型。
- 评估并比较 GPT-3 变体和 ChatGPT 在从 NL 提示生成正确可视化方面的表现。
- 展示提示工程如何在查询指定不充分或错误时实现鲁棒的可视化生成。
- 评估数据隐私考虑因素以及跨数据集的泛化性。
提出的方法
- 使用三种 OpenAI LLM(text-davinci-003、code-davinci-002 和 ChatGPT 4)从 NL 提示生成 Python 脚本。
- 构建两段式提示(描述提示 Description Prompt 和 代码提示 Code Prompt)来描述数据集并引导代码生成。
- 将提示合并并以固定 API 设置提交给 LLM(温度 0,max_tokens 500,直到 plt.show() 停止)。
- 在基于 Streamlit 的 NL 界面中呈现生成的 Python 脚本,并允许用户对 NL 查询和图表类型进行改进。
- 通过在开头插入 Code Prompt 并在呈现前可选编辑以去除不必要的指令来润色脚本。
实验结果
研究问题
- RQ1RQ1: 现有的 LLM 是否能够从 NL 端到端准确生成可视化?
- RQ2RQ2: 如何有效地利用 LLM 来引导正确且适当渲染的图表?
- RQ3RQ3: 哪些 LLM 对 NL 提示表现得更鲁棒,与最先进方法相比如何?
- RQ4RQ4: 使用 LLM 进行 NL2VIS 的局限性有哪些,以及未来的研究方向?
主要发现
- 在合适的提示下,LLMs 可以有效支持端到端的 NL2VIS,带来效率和潜在的成本节省。
- 使用描述和代码提示的提示工程在多种 LLM 下实现了图表的准确呈现。
- GPT-3、Codex 和 ChatGPT 在案例研究中的表现相似,存在某些模型特定的图表选择差异。
- 错误指定和欠指定的 NL 提示被 LLMs 鲁棒处理,尽管美观性和一致性问题仍然存在。
- 该方法减少了手工设计的符号 NLP 解决方案的需求,并强调数据隐私友好的提示设计。
- 结果在六个案例研究、五个数据集上展示,并与 NL4DV 和 ADVISor 进行了比较。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。