ViviDoc: Generating Interactive Documents through Human-Agent Collaboration
Organizations: State Key Lab of CAD&CG, Zhejiang University · HKUST(GZ) · National University of Singapore · University of Virginia · Cornell University
Abstract
Interactive documents help readers engage with complex ideas through dynamic visualization, interactive animations, and exploratory interfaces. However, creating such documents remains costly, as it requires both domain expertise and web development skills. Recent Large Language Model (LLM)-based agents can automate content creation, but directly applying them to interactive document generation often produces outputs that are difficult to control. To address this, we present ViviDoc, to the best of our knowledge the first work to systematically address interactive document generation. ViviDoc introduces a multi-agent pipeline (Planner, Styler, Executor, Evaluator). To make the generation process controllable, we provide three levels of human control: (1) the Document Specification (DocSpec) with SRTC Interaction Specifications (State, Render, Transition, Constraint) for structured planning, (2) a content-aware Style Palette for customizing writing and interaction styles, and (3) chat-based editing for iterative refinement. We also construct ViviBench, a benchmark of 101 topics derived from real-world interactive documents across 11 domains, along with a taxonomy of 8 interaction types and a 4-dimensional automated evaluation framework validated against human ratings (Pearson r > 0.84). Experiments show that ViviDoc achieves the highest content richness and interaction quality in both automated and human evaluation. A 12-person user study confirms that the system is easy to use, provides effective control over the generation process, and produces documents that satisfy users.
Figures & tables
| Natural language description | |
|---|---|
| “The reader can adjust the radius of a circle using a slider, and as the radius changes, the visualization updates the circle while recalculating and displaying the circumference, diameter, and ratio, allowing the reader to see that the ratio stays roughly the same.” | |
| SRTC Interaction Specification | |
| S | r : slider , default 1; C : derived ; D : derived ; ratio : derived |
| R | A circle whose size reflects ; labels showing , , and ratio |
| T | Dragging the slider changes ; , , ratio update automatically |
| C | ratio regardless of |
| Backbone | Method | CR | IQ | IF | Eff |
|---|---|---|---|---|---|
| Gemini 3 Flash | Naive Agent | 4.00 | 3.24 | 0.85 | 539 |
| ViviDoc | 5.00 | 4.58 | 0.92 | 505 | |
| Mistral Small | Naive Agent | 4.44 | 2.36 | 0.61 | 695 |
| ViviDoc | 5.00 | 3.24 | 0.65 | 562 | |
| Qwen3.5-35B | Naive Agent | 4.11 | 2.76 | 0.70 | 355 |
| ViviDoc | 4.56 | 3.57 | 0.73 | 178 |
| AutoGen | MetaGPT | CAMEL | ViviDoc | |
|---|---|---|---|---|
| CR | 2.79 | 2.51 | 1.60 | 4.43 |
| ID | 3.55 | 1.85 | 1.76 | 4.33 |
| Item | Mean SD | |
| Usability | ||
| Q1 | Easy to learn and use | |
| Q2 | Interface intuitive and satisfying | |
| Controllability | ||
| Q3 | DocSpec gives meaningful control | |
| Q4 | Style Palette gives meaningful control | |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Subject Area | # Topics |
|---|---|
| Algorithms | 25 |
| Mathematics | 24 |
| Tools & Resources | 13 |
| Physics | 10 |
| Science | 9 |
| Other | 6 |
| S | sigma : slider , default 10; rho : slider , default 28; beta : constant 2.667; trajectory : derived numerical integration of |
|---|---|
| R | • A continuously growing 3D phase-space trajectory projected onto a 2D canvas • The trail fades over time to emphasize recent motion • A slow auto-rotation of the view around the vertical axis • Two sliders for and displayed below the canvas |
| T | • Adjusting the slider resets the trajectory and restarts integration from the same initial point • Adjusting the slider resets the trajectory, causing the attractor shape to deform or collapse into a stable orbit |
| C | For classical values ( , , ), the trajectory never repeats and draws a distinctive butterfly-shape—demonstrating sensitive dependence on initial conditions. |
| S | object_x : drag-x ; object_y : drag-y ; f : drag-x ; u : derived ; v : derived ; M : derived ; image_type : derived if : Real Inverted, if : Virtual Upright, if : Undefined |
|---|---|
| R | • A central convex lens whose thickness scales with focal length • An orange draggable object arrow on the left of the lens • Two green draggable focal points and on the optical axis • Three principal rays drawn from the object tip through the lens • A colored image arrow on the right (green for real, blue for virtual) • An instrument dashboard showing live values of , and • A status tag indicating image type and orientation |
| T | • Dragging the orange object arrow horizontally changes and updates all derived optical values • Dragging the object arrow vertically changes the object height and redraws the ray diagram • Dragging a focal point ( or ) changes , reshaping both the lens and all derived values simultaneously |
| C | The thin lens equation is always satisfied. When , the image distance becomes negative (virtual image). When , the image forms at infinity. |
| S | seeds : 15 points initialized at random positions, moving with slow random velocity; mouse_pos : hover; nearest : derived ; min_dist : derived ; cell_region : derived all pixels closest to seeds[nearest] within 150px from mouse_pos |
|---|---|
| R | • An animated canvas of 15 slowly drifting seed points on a dark background • On hover: the hovered Voronoi cell illuminated with a purple radial gradient • On hover: a dashed gold line connecting the cursor to its nearest seed • On hover: a transparent circle of radius min_dist visualizing the nearest-neighbor envelope • The nearest seed highlighted in gold; all others remain purple |
| T | • Moving the mouse over the canvas updates mouse_pos continuously • Each frame recalculates the nearest seed and updates the illuminated cell, connecting line, and envelope circle in real-time |
| C | The illuminated region always corresponds exactly to the Voronoi cell of the nearest seed. Every point within the highlighted region is provably closer to that seed than to any other—demonstrating the core definition of Voronoi partitioning. |
| S | hidden_nodes : click-to-place list of , default ; weights : derived random initialization; activations : derived forward pass (sigmoid); output_val : derived average of output neuron activations |
|---|---|
| R | • Three fixed red input nodes ( ) on the left • Two fixed blue output nodes ( ) on the right • User-placed yellow hidden nodes in the central region • Directed arrows connecting all layers; animate green (input hidden) then orange (hidden output) during forward pass • Activation values displayed on each node • An output activation progress bar and percentage readout • A ’Send Signal’ button and a ’Clear’ button |
| T | • Clicking in the central canvas zone places a new hidden neuron and immediately triggers an animated forward pass • Pressing ’Send Signal’ replays the forward pass with newly randomized weights • Pressing ’Clear’ removes all hidden nodes and resets the output bar to 50% |
| C | Adding more hidden neurons generally introduces more non-linearity. The output activation always falls in due to the sigmoid function, regardless of network topology. |
| S | scroll_progress : scroll-wheel , default 0; partition_y : derived ; particles : 150 red + 150 blue bouncing particles; entropy_S : derived fraction of particles that have crossed to the other side times 100 |
|---|---|
| R | • A dark split-canvas with 300 bouncing particles: red on left, blue on right • A central vertical wall separating the two halves, present only from partition_y downward • A live entropy counter ( ) displayed in red in the top-left corner • A scroll-progress fill bar on the left edge |
| T | • Scrolling downward increases scroll_progress , raising partition_y and shortening the wall from the top, allowing particles to mix • Scrolling upward decreases scroll_progress , lowering partition_y and re-blocking particle passage |
| C | As the wall is removed ( ), particles irreversibly mix—entropy increases monotonically. The constraint maps directly to the unidirectional scroll interaction, visualizing time’s arrow. |
| S | rotX : drag-y , default 0.5; rotY : drag-x , default -0.5; surface : derived parametric mesh |
|---|---|
| R | • A 3D polygon mesh of the Möbius strip rendered using the Painter’s Algorithm • Faces colored with a teal-to-sky-blue gradient mapped to the parameter • Depth shading simulating a diffuse light source • Numeric overlays showing the current rotX and rotY viewing angles |
| T | • Clicking and dragging horizontally on the canvas updates rotY , rotating the strip around the vertical axis • Clicking and dragging vertically updates rotX , tilting the strip forward or backward • Releasing the mouse locks the current orientation |
| C | No matter how the strip is rotated, a continuous path along its surface always returns to the starting point in a mirrored orientation, demonstrating the strip’s single-sidedness. |
| S | orbital_state : segmented-button [ 1s , 2p , 3d ], default 1s ; wavefunction : derived ; density_cloud : derived Monte Carlo sampling, accept point with probability |
|---|---|
| R | • A 2D canvas with coordinate axes and a nucleus dot at the origin • Points progressively sampled and plotted, accumulating into a probability density cloud • A wavefunction equation display that updates to reflect the active orbital state • A segmented button control with options 1s , 2p , and 3d |
| T | • Clicking a segment button sets orbital_state to the selected orbital • Switching state clears all existing sample points and triggers a new Monte Carlo sampling run |
| C | Each orbital state produces a distinct, characteristic spatial density pattern: 1s is spherically symmetric, 2p is a dumbbell shape with a nodal plane, and 3d forms a four-lobed clover pattern—matching theoretical predictions. |
| S | time : playback , default 0; is_playing : toggle, default true; n_harmonics : slider (step 2), default 5; wave : derived last 500 -values of the epicycle tip |
|---|---|
| R | • A chain of rotating circles (epicycles), each at a frequency proportional to its harmonic index • A dot tracing the tip of the outermost epicycle • A reconstructed square wave drawn on the right by recording the tip’s -position over time • A dashed line connecting the epicycle tip to the leading edge of the wave • A Play/Pause button and a harmonic count slider |
| T | • Pressing Play/Pause starts or freezes the rotation of all epicycles • Dragging the harmonic slider adds or removes outer epicycles in odd increments, immediately reshaping the output wave |
| C | As n_harmonics increases toward infinity, the reconstructed wave converges to a perfect square wave, demonstrating Fourier’s theorem that any periodic signal decomposes into sinusoids. |