Code2Video: A Code-centric Paradigm for Educational Video Creation

Yanzhe Chen, Kevin Qinghong Lin, Mike Zheng Shou
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:15370-15396, 2026.

Abstract

While recent generative models can synthesize videos in pixel space, they often fail to produce educational videos with precise structures, domain knowledge, and coherent transitions. We argue that this setting is better served by operating in a renderable environment that is explicitly controlled by code. We propose Code2Video, a code-centric agent framework that generates educational videos by writing executable Python programs. Code2Video includes three agents: a Planner that converts lecture content into a temporal storyboard, a Coder that turns the storyboard into runnable code with scope-guided auto-fix, and a Critic that refines layout using a VLM guided by visual anchor prompting, i.e., mappings from target visual outcomes to code edits. For evaluation, we build MMMC, a benchmark of professionally produced, discipline-specific educational videos. We assess Code2Video using aesthetic scores (VLM-as-a-Judge), code efficiency, and TeachQuiz, an end-to-end metric that measures how well an unlearned VLM can recover knowledge after watching generated videos. Code2Video improves performance by 40% over direct code generation and produces videos comparable to human-crafted tutorials. The code and datasets are available at https://github.com/showlab/Code2Video.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-chen26bx, title = {{C}ode2{V}ideo: A Code-centric Paradigm for Educational Video Creation}, author = {Chen, Yanzhe and Lin, Kevin Qinghong and Shou, Mike Zheng}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {15370--15396}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/chen26bx/chen26bx.pdf}, url = {https://proceedings.mlr.press/v306/chen26bx.html}, abstract = {While recent generative models can synthesize videos in pixel space, they often fail to produce educational videos with precise structures, domain knowledge, and coherent transitions. We argue that this setting is better served by operating in a renderable environment that is explicitly controlled by code. We propose Code2Video, a code-centric agent framework that generates educational videos by writing executable Python programs. Code2Video includes three agents: a Planner that converts lecture content into a temporal storyboard, a Coder that turns the storyboard into runnable code with scope-guided auto-fix, and a Critic that refines layout using a VLM guided by visual anchor prompting, i.e., mappings from target visual outcomes to code edits. For evaluation, we build MMMC, a benchmark of professionally produced, discipline-specific educational videos. We assess Code2Video using aesthetic scores (VLM-as-a-Judge), code efficiency, and TeachQuiz, an end-to-end metric that measures how well an unlearned VLM can recover knowledge after watching generated videos. Code2Video improves performance by 40% over direct code generation and produces videos comparable to human-crafted tutorials. The code and datasets are available at https://github.com/showlab/Code2Video.} }
Endnote
%0 Conference Paper %T Code2Video: A Code-centric Paradigm for Educational Video Creation %A Yanzhe Chen %A Kevin Qinghong Lin %A Mike Zheng Shou %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-chen26bx %I PMLR %P 15370--15396 %U https://proceedings.mlr.press/v306/chen26bx.html %V 306 %X While recent generative models can synthesize videos in pixel space, they often fail to produce educational videos with precise structures, domain knowledge, and coherent transitions. We argue that this setting is better served by operating in a renderable environment that is explicitly controlled by code. We propose Code2Video, a code-centric agent framework that generates educational videos by writing executable Python programs. Code2Video includes three agents: a Planner that converts lecture content into a temporal storyboard, a Coder that turns the storyboard into runnable code with scope-guided auto-fix, and a Critic that refines layout using a VLM guided by visual anchor prompting, i.e., mappings from target visual outcomes to code edits. For evaluation, we build MMMC, a benchmark of professionally produced, discipline-specific educational videos. We assess Code2Video using aesthetic scores (VLM-as-a-Judge), code efficiency, and TeachQuiz, an end-to-end metric that measures how well an unlearned VLM can recover knowledge after watching generated videos. Code2Video improves performance by 40% over direct code generation and produces videos comparable to human-crafted tutorials. The code and datasets are available at https://github.com/showlab/Code2Video.
APA
Chen, Y., Lin, K.Q. & Shou, M.Z.. (2026). Code2Video: A Code-centric Paradigm for Educational Video Creation. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:15370-15396 Available from https://proceedings.mlr.press/v306/chen26bx.html.

Related Material