TL;DR
ViviDoc is a multi-agent framework that automates the creation of interactive, web-based educational documents through human-agent collaboration. By introducing a structured intermediate representation called DocSpec (based on State, Render, Transition, and Constraint), it gives users fine-grained control over both text and complex interactive visualizations without requiring them to write a single line of code.
What Problem Does This Paper Address?
Interactive documents—like those found on Distill.pub or Explorable Explanations—combine text with dynamic visualizations (such as sliders, dropdowns, and direct manipulation interfaces) to help readers build intuition about complex concepts. However, creating them is incredibly difficult. It requires a rare intersection of deep domain expertise and advanced web development skills (HTML/CSS/JavaScript), often demanding days or weeks of effort for a single article.
While Large Language Model (LLM) agents can automate code generation, applying them naively to interactive documents fails. The generation process is largely uncontrollable; agents operate as a "black box," leaving human creators with no meaningful way to review or adjust intermediate design choices. Furthermore, the field has lacked grounded datasets and systematic evaluation frameworks to measure the quality of AI-generated interactive content.
Methods
ViviDoc addresses these challenges by breaking down the generation process into a structured, human-in-the-loop multi-agent pipeline consisting of four specialized agents:
- Planner: Decomposes a topic into sequential "knowledge units" and generates a Document Specification (DocSpec). Crucially, it models visualizations using a novel SRTC Interaction Specification—decomposing them into State (variables), Render (visual mapping), Transition (user actions), and Constraint (invariants)—inspired by Munzner's visualization theory.
- Styler: Analyzes the DocSpec to generate a "Style Palette," allowing users to customize writing tone, text density, and visual complexity.
- Executor: Translates the structured plan and style choices into executable HTML, CSS, and JavaScript code.
- Evaluator: Validates the code structure and functionality, providing a feedback loop to automatically correct errors.
Instead of full automation, ViviDoc exposes three levels of human control: editing the structured DocSpec schema, picking options from the Style Palette, and using natural language chat for iterative post-generation refinement.
Datasets
The authors introduce ViviBench, a benchmark dataset containing 101 topics reverse-engineered from real-world interactive documents across 63 websites and 11 domains (e.g., algorithms, physics, mathematics, and psychology). From these documents, they extracted 482 interaction instances to establish a taxonomy of 8 core interaction types, including Parameter Exploration, Direct Manipulation, State Switching, and Spatial Navigation.
Key Insights and Ideas
- Structured Specs Over Raw Code: The core "aha moment" is that LLMs generate vastly superior interactive code when forced to first create an intermediate, declarative specification (SRTC) rather than jumping straight from a prompt to raw JavaScript.
- The Power of Constraints: By explicitly defining a Constraint (e.g., ensuring that the thin lens equation $1/u + 1/v = 1/f$ is always satisfied during a drag event), the agent understands the educational purpose of the interaction. This prevents it from generating visually pleasing but scientifically inaccurate animations.
- Baking in Human Agency: Rather than fighting the black-box nature of LLMs, ViviDoc exposes the DocSpec to the user. This allows educators to conceptually tweak a slider's range or reorder concepts before code synthesis even begins.
Key Results
- Outperforming Baselines: Across three backbone LLMs (Gemini 3 Flash, Mistral Small, Qwen 3.5-35B), ViviDoc consistently achieved the highest Content Richness and Interaction Quality compared to general multi-agent frameworks like AutoGen, CAMEL, and MetaGPT. General frameworks frequently produced broken, non-functional interactions.
- Efficiency Boost: When using Gemini 3 Flash, ViviDoc's generation throughput (505 characters/second) was 3.3× faster than AutoGen and 9.9× faster than CAMEL, because its structured pipeline drastically reduces code-generation errors and retries.
- Human Alignment & User Study: The paper's automated evaluation metrics showed strong alignment with human raters (Pearson $r > 0.84$). A 12-person user study gave the system perfect usability scores (5.0/5.0) and high satisfaction (4.58/5.0) for creating diverse documents.
Limitations and Future Work
- Lack of Inline Previews: User study participants noted that it was difficult to anticipate how choices in the Style Palette would look without a real-time visual preview component during the styling stage.
- Static Knowledge Base: The current system relies entirely on the LLM's internal weights. For highly specialized, niche, or rapidly evolving scientific topics, incorporating Retrieval-Augmented Generation (RAG) to pull from recent research papers or live datasets is a critical next step.
Summary updated