When LLMs Learn to Write Code: Interactive Presentations That Build Themselves
A viral code-generated presentation showed that large language models can act as universal generators of visual and interactive content. This article breaks down the technical layers—rendering, animation, interaction, and audio—explains why code outperforms image generation for dynamic visuals, and offers practical guidance on prompt engineering, cost control, and engineering workflows for building code-driven presentations.
When LLMs Learn to Write Code: Interactive Presentations That Build Themselves
A Viral Demo: Slides That “Rewrite Themselves”
Recently, a work titled “The Last Boring Slide” racked up tens of millions of views on social media. On the surface, it looks like a presentation about the future of AI—but once you open it, it’s nothing like the familiar “title + bullet points + charts” deck: the camera moves like it does in a movie, transitions between pages are complex yet smooth, 3D scenes can be explored interactively, and even the soundtrack is generated in real time.
What’s even more remarkable is how it was created: the author gave the model a single prompt—no visual style specified, no assets provided. In roughly forty minutes, the model delivered the entire piece purely in code—no external images, no video files. Music, graphics, and animation were all generated by code.
The real significance of this isn’t that “some model is powerful.” It’s that it reveals an emerging technical paradigm: large language models, using code as the medium, become universal generators of visual and interactive content.
Why “Code” Is a Stronger Visual Production Method Than “Image Generation”
The conventional assumption is that generating visual content requires diffusion-based image generation. But image generation has inherent limitations: its output is static pixels, poorly suited to expressing interaction, state, and logic. Code-driven visual generation is fundamentally different:
- Interactive: Mouse, keyboard, and scroll events all trigger state changes. The work isn’t just “watched”—it’s “used”;
- Parameterizable: The same code can produce countless variants by changing parameters, naturally suited to batch customization;
- Vector-based and resolution-independent: Code-drawn graphics stay sharp on any screen;
- Composable: Graphics, text, animation, and audio are orchestrated within a single runtime, keeping everything logically consistent;
- Iterative: The model can read code it generated and continue modifying it, forming a “generate—run—feedback—refine” loop.
In other words, an image model outputs a “result,” while a code model outputs “the program that produces the result.” The former is a picture; the latter is a machine. When a model has sufficient coding ability, it can build machines.
Technical Breakdown: How These Works Are Built in Code
A “cinematic,” code-driven presentation is typically composed of the following layers:
1. Rendering Layer: Canvas / WebGL / SVG
2D graphics and effects are generally done with Canvas 2D or SVG; 3D scenes rely on WebGL or libraries built on top of it. Modern browsers have standardized these capabilities, so the model only needs to generate JS/TS code to make them run.
<canvas id="scene"></canvas><script>const canvas = document.getElementById('scene');const ctx = canvas.getContext('2d');function draw(t) {ctx.clearRect(0, 0, canvas.width, canvas.height);const scale = 1 + Math.sin(t * 0.001) * 0.2;ctx.save();ctx.translate(canvas.width / 2, canvas.height / 2);ctx.scale(scale, scale);ctx.beginPath();ctx.arc(0, 0, 80, 0, Math.PI * 2);ctx.fillStyle = '#4f8ef7';ctx.fill();ctx.restore();requestAnimationFrame(draw);}requestAnimationFrame(draw);</script>
These few dozen lines of code produce a breathing, scaling circle. A real production would organize hundreds or thousands of such drawing functions into a scene graph.
2. Animation and Transition Layer
The cinematic feel comes from orchestrated “camera moves” and “transitions.” Common techniques include:
- Easing functions: Use curves like easeInOutCubic to control timing instead of linear changes;
- Scroll-driven storytelling: Map scroll position to a global timeline, so the user’s scrolling advances the “camera”;
- Scene transitions: Stitch multiple scenes into a continuous experience using opacity, scaling, masks, and shader effects;
- Camera systems: In 3D scenes, maintain a virtual camera object and interpolate its position and orientation.
3. Interaction Layer and State Management
Supporting click-to-select, drag-to-rotate, and parameter adjustment requires a clear state model:
const state = {currentScene: 0,selectedObject: null,progress: 0,};function goToScene(index) {state.currentScene = index;timeline.play(index);render();}
Treating “selection” as a metaphor that runs through the entire experience—from selecting a chart, to selecting the Earth or the Sun, to selecting the entire frame—is precisely what makes these works so compelling: the interaction metaphor itself becomes a narrative language.
4. Audio Layer
The soundtrack can also be generated in code: use the Web Audio API to synthesize oscillators, filters, and envelopes, scheduling notes by beat. This means music can be precisely synchronized with visual events—and no audio files or licensing issues are involved.
The Model Side: Prompt Engineering and Coding Ability
The prompt behind that viral work is worth examining. It contained a few key elements:
- Topic: The future of AI, the intelligence explosion;
- Freedom: No visual anchors—“do whatever you like”;
- Quality expectations: The most polished, most stunning result possible;
- Trust and motivation: Belief that the model has taste and capability.
From an engineering perspective, this kind of “delegating prompt” reduces the mediocre solutions that constraints tend to produce, but it also requires the model to have:
- Long-context planning: Maintaining global consistency across a generation process spanning dozens of minutes;
- Code organization: Knowing how to split modules, avoid naming conflicts, and manage complexity;
- Debugging and self-correction: Locating and fixing errors when the code fails to run;
- Aesthetic judgment: Implicit preferences for color, rhythm, and whitespace.
Practical advice: have the model first produce a “scene list + camera-language notes for each scene,” confirm the structure, then generate the full code. This significantly reduces the failure rate of one-shot generation. Also ask it to output a “single runnable HTML file” for easy previewing and iteration.
Cost and Engineering Considerations
That kind of work reportedly consumed compute equivalent to tens of dollars of inference credits and took considerable time. This suggests several things to keep in mind when productionizing this approach:
- Layered generation: First produce an outline and keyframes at low cost, then deepen scene by scene, avoiding a full restart after a single large generation fails;
- Caching and reuse: Once scene code is modularized, similar presentations can reuse verified components;
- Human review: Code-driven output means humans can step in and make adjustments—a major advantage over black-box image generation;
- Runtime validation: Automatically take screenshots and detect errors in a headless browser, and incorporate visual regression checks into the pipeline.
In enterprise settings, this paradigm can be applied to automated marketing material generation, dynamic product reports, data visualization storytelling, and educational courseware. Combined with cloud object storage, function compute, and content moderation services, you can build a complete pipeline of “prompt in, interactive presentation out,” while bringing generated assets into permission and audit systems.
A Sober Look: Capability Boundaries and Risks
Amid the hype, stay clear-headed:
- Consistency still needs verification: Long code generation can produce localized logic breaks; keyframes need manual inspection;
- Aesthetics can’t be fully outsourced: The model can deliver stunning results, but there’s no universally applicable taste—human curation remains essential;
- Performance issues: Heavy shaders and particle effects may drop frames on low-end devices; graceful degradation plans are needed;
- Factual and narrative responsibility: No matter how dazzling a grand narrative about the future is, it can’t replace rigorous fact-checking of the content;
- Cost control: High-quality generation is expensive; establish evaluation and budgeting mechanisms.
Conclusion
“The Last Boring Slide” went viral not because of any particular model’s name, but because it showed people something new: when a large language model masters code, it simultaneously masters graphics, animation, 3D, interaction, and sound. The presentation has evolved from a “static document” into a “runnable experience,” and creation itself is shifting from “layout” to “programming.”
For developers, this is a direction worth validating immediately: start with an interactive, scroll-driven presentation rendered entirely in code, and understand how the four layers—rendering, animation, state, and audio—work together. The future belongs to those who can translate ideas into programs—and right now, the model is willing to write them with you.
