TL;DR
ViviDoc is a human-agent collaborative system that automates the creation of interactive educational articles from a single topic prompt. By introducing a structured, human-editable intermediate representation called DocSpec, it bridges the gap between pedagogical intent and executable web code, significantly outperforming naive end-to-end LLM generation in content depth and interaction quality.
What Problem Does This Paper Address?
Interactive articles—like those found on Explorable Explanations or Distill.pub—are incredibly effective tools for learning. They allow readers to play with sliders, dropdowns, and animations to build an intuitive understanding of complex concepts. However, creating them is highly resource-intensive, requiring an author to possess both deep domain expertise and advanced web development skills (HTML/CSS/JavaScript).
While Large Language Models (LLMs) are capable of generating code, throwing a single prompt at an LLM to generate a full interactive document typically fails. The process operates as a "black box," making the output uncontrollable, difficult to verify, and prone to shallow content or broken interactions. ViviDoc aims to make this generation process controllable, structured, and collaborative.
Methods
ViviDoc splits the generation task across a multi-agent pipeline coordinated by a novel intermediate representation called DocSpec (Document Specification).
- Planner Agent: Takes a high-level topic (e.g., "What is the rank of a matrix?") and decomposes it into a sequence of "knowledge units" within the DocSpec.
- The DocSpec & SRTC Framework: Instead of jumping straight to code, each knowledge unit defines its interactive elements using the SRTC framework, adapted from visualization theory:
- State (S): The underlying variables and their types (e.g., a slider ranging from 0.5 to 5).
- Render (R): How the state maps to visual elements (e.g., a circle whose size reflects the slider value).
- Transition (T): How user actions change the state.
- Constraint (C): The pedagogical invariant or core rule the user should discover (e.g., the ratio of circumference to diameter remains constant).
- Human Review (Optional but Key): Because the DocSpec is structured and human-readable, educators can reorder sections, adjust variable ranges, or rewrite text descriptions via a UI or a chat assistant before any code is generated.
- Executor Agent: Translates the finalized DocSpec into clean HTML text fragments and interactive JavaScript components.
- Evaluator Agent: Reviews the final document for logical flow and code validity, providing feedback for automatic retries if errors are detected.
Datasets
To evaluate the system and address the lack of standard benchmarks in this space, the authors collected a new dataset of 101 real-world interactive documents sourced from over 60 websites across 11 domains (including mathematics, algorithms, and physics).
Key Insights and Ideas
- The Power of an Intermediate "Contract": Moving from natural language straight to complex interactive code is too large a leap for LLMs. DocSpec acts as a structured contract that isolates the error-prone code-generation step from the conceptual planning step.
- Pedagogical Invariants as Constraints: By explicitly defining a "Constraint" in the SRTC framework, the system gives the Evaluator agent an objective, non-visual metric to verify if the generated simulation actually teaches the correct mathematical or physical concept.
- Code-Free Control: Structuring the intermediate layer allows human authors to alter the behavior of a web simulation simply by editing text fields or adjusting parameters in a UI, completely bypassing the need to write or debug code.
Key Results
The authors conducted a blind expert evaluation comparing ViviDoc (with human intervention disabled to ensure a fair baseline) against a single-call "Naive Agent" using the same underlying model (Gemini 3.0 Flash).
Three domain experts rated the generated documents on a 5-point Likert scale across three dimensions:
- Content Richness: ViviDoc scored 4.17 vs. Naive Agent's 2.07. Without structured planning, standard LLM outputs tended to be shallow and narrowly focused.
- Interaction Quality: ViviDoc scored 4.00 vs. Naive Agent's 2.40, proving that the SRTC framework successfully constrains the model to generate meaningful, working interactions.
- Visual Quality: ViviDoc scored 3.73 vs. Naive Agent's 2.37.
A subsequent user study with researchers in visualization and educational technology confirmed that the DocSpec interface was highly intuitive (scoring 5.0/5.0 for ease of use), allowing participants to effectively shape the final document without coding.
Limitations and Future Work
A dedicated limitations section is not explicitly detailed in the paper. However, some limitations can be inferred: the user study was small-scale (3 participants), and the expert evaluation was performed on a subset of 10 sampled topics. Additionally, while the system handles common interaction patterns well (sliders, dropdowns, toggles), highly bespoke or deeply complex custom simulations might still stretch the limits of the current SRTC schema. The authors conclude by noting that they hope ViviDoc inspires further research into structured human-AI collaboration for complex document authoring.
Summary updated