Visualization is central to scientific discovery, yet authoring tools remain split between information and scientific visualization, and expertise in one rarely transfers to the other. Large Language Model (LLM) based systems promise to bridge this gap through natural language, but current approaches generate code non-deterministically, with no guarantee of correctness and no protection against silent data fabrication. We present Raiven, a conversational system that mediates visualization authoring through a formally defined domain-specific language. RaivenDSL unifies scientific and information visualization in a single representation spanning 2D, 3D, and tabular data. The LLM produces a compact RaivenDSL specification under schema-guided constraints, and a deterministic compiler translates it to executable D3 or VTK.js code. Because the LLM operates only on dataset metadata, outputs are deterministic, specifications are verifiable before execution, and data fabrication is impossible by construction. In a 100-task benchmark, Raiven achieves 100% compilation, is up to six times faster and six times cheaper than state-of-the-art LLMs, while improving interaction quality, correctness, and data faithfulness. An expert user study shows that Raiven significantly reduces debugging effort and makes it easier to produce correct visualizations.
翻译:可视化是科学发现的核心,然而创作工具仍割裂为信息可视化与科学可视化两大领域,且某一领域的专业知识极少能迁移到另一领域。基于大语言模型(LLM)的系统有望通过自然语言弥合这一鸿沟,但当前方法非确定性地生成代码,既无法保证正确性,也无法防止静默数据伪造。我们提出Raiven——一种通过形式化定义的领域特定语言来中介可视化创作的对话式系统。RaivenDSL通过单一表示统一了涵盖2D、3D及表格数据的科学可视化与信息可视化。LLM在模式引导约束下生成紧凑的RaivenDSL规约,再由确定性编译器将其转换为可执行的D3或VTK.js代码。由于LLM仅操作数据集元数据,其输出是确定性的,规约可在执行前验证,且从架构上杜绝了数据伪造的可能。在100项任务的基准测试中,Raiven实现100%编译,比当前最优LLM快六倍、成本降低六倍,同时提升了交互质量、正确性与数据忠实度。一项专家用户研究表明,Raiven显著减少了调试工作量,并更易于生成正确的可视化结果。