논문 해설
ManimCode: Learning Visual Self-Correction for Educational Animation
ManimCode: 교육용 애니메이션을 위한 시각적 자기 수정 학습
- 연구 문제 렌더링에 성공한 Manim 교육 애니메이션도 시각 결함이나 설명 누락이 남을 수 있으며, 이를 고치려면 렌더링 결과를 보고 코드를 수정하는 피드백 루프가 필요합니다.
- 연구 방법 ManimData로 렌더링 검증된 수정 궤적을 만들고, 이를 바탕으로 4B 모델 하나를 작성·검토·수정 역할로 지도 학습한 뒤 Reviser를 강화학습합니다.
- 주요 결과 ManimBench와 ManimData-test에서 렌더링 성공률이 크게 올랐고, 장문 교육 영상 생성 시스템에서도 완성 영상 수가 늘었습니다.
렌더링 성공만으로 부족한 교육 애니메이션 생성
교육용 애니메이션을 Manim 코드로 만들면 정밀한 수식과 도형 제어가 가능합니다. 하지만 코드가 오류 없이 렌더링되어도 레이블이 겹치거나, 객체가 화면 밖으로 나가거나, 설명 단계가 빠지는 문제가 남을 수 있습니다. 렌더링 결과는 이런 시각적 결함이 어떤 코드 변경으로 고쳐지는지 직접 알려 주지 않으므로, 생성된 프로그램을 검토하고 다시 수정하는 피드백 기반 절차가 필요합니다. 기존 에이전트 시스템도 실행 오류나 시각 피드백으로 수정하지만 대체로 대형 모델, 특히 상용 모델에 의존하며, 작은 공개 모델에서는 수정 루프의 신뢰성이 떨어진다고 보고됩니다. 기존 Manim 데이터셋은 주로 최종 프로그램만 담고 있어 품질 검증이나 피드백과 수정의 궤적이 부족합니다.
ManimCode 연구는 이 두 간극을 함께 다루어, 작은 4B 모델이 작성·검토·수정을 한 번에 수행하도록 데이터와 학습 절차를 설계합니다.

Table 1 .Comparison with existing Manim datasets and benchmarks. n/a marks a property that does not apply to the evaluation-only long-form benchmarks.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.ManimData의 구축과 레코드 구성
ManimData는 두 입력 원천에서 만들어집니다. 각 버전은 레이아웃 검사를 거치고, 여덟 개 프레임을 바탕으로 요청 정렬, 내용 완결성, 시각적 명료성, 애니메이션 품질을 1에서 5점으로 평가받습니다. 실행 오류나 비평이 나오면 다음 수정 단계로 이어지며, 예산은 입력당 10회 렌더링입니다. 최고 후보의 평균 점수가 3.75 이상인 레코드만 채택되어 최종적으로 24,034개가 남습니다. 각 레코드는 최종 프로그램과 영상뿐 아니라 중간 버전, 오류, 렌더링 프레임, 리뷰와 수정을 담습니다. 이 궤적에서 역할별 지도 학습 예시 305,452개가 만들어집니다.

Figure 1 .ManimData construction pipeline.(1) Request collection: Wikipedia STEM requests, community programs, and the API knowledge base. (2) Render-guided generation: Qwen3.8-27B writes or revises the program from retrieved API cards, and each version is rendered, checked for layout defects, and reviewed on eight frames; an error or a critique (a crash and an overlapping label) starts the next revision. (3) Curation: an input whose best version reaches a mean review score of at least 3.75 is admitted with its code, video, and trajectory.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.
Figure 2 .ManimData statistics. Top: domain shares of the 24,034 records. Bottom: per-record distributions of final program length, video length, and number of renders.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.
Table 5 .ManimData construction by source.1st renders: share of inputs whose first version (the released code for community sources) renders a video.Admitted: inputs whose best version has a mean score≥3.75 .Final: admitted records left after removing overlap with the evaluation sets.Unchanged: share of final records whose first version is the final program.†Most ManimBench inputs whose firstversionrendersnovideoarestaticscenesthatsaveonlyanimage, which ManimBench’s own protocol counts as rendered.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.역할 조건부 SFT와 Reviser 강화학습
ManimCode는 Qwen3.5-4B 하나를 기반으로 두 단계를 거칩니다. 첫 단계는 역할 조건부 지도 학습입니다. 작성 24,034개, 실행 수리 14,587개, 품질 수정 32,683개, 검토 46,965개, 검색 질의 187,183개의 예시를 LoRA로 학습하며, 각 예시는 역할, 문맥, 목표 출력의 세 부분으로 구성됩니다. 둘째 단계에서는 SFT 모델이 스스로 만든 상태에서 Reviser만 강화학습합니다. 렌더링에 실패한 초안은 수리 상태가 되고, 렌더링은 되지만 검토 기준을 만족하지 못한 초안은 비평 상태가 됩니다. 비평 상태에서는 수정본이 렌더링되지 않으면 -1을 받고, 원본과 두 순서로 비교했을 때 두 번 모두 새 버전이 선택되면 +1, 두 번 모두 입력이 선택되면 -1을 받습니다.
학습은 RLOO와 클리핑된 정책 기울기 목적함수에 기존 지도 정책으로의 KL 패널티를 더해 진행됩니다. 추론 시에는 하나의 4B 모델이 세 역할을 모두 맡아 같은 루프를 실행하며, Qwen3.8-27B는 데이터 구축과 학습 보상 계산에만 사용됩니다.

Figure 3 .Overview of ManimCode.(1) Final programs and intermediate steps of ManimData trajectories supervise five tasks of one Qwen3.5-4B model. (2) Reinforcement learning further trains the Reviser on repair and critique states that the supervised model produces itself: the Reviser samples eight revisions per state, Qwen3.8-27B scores each rendered revision (request coverage for repair, two order-swapped comparisons with the draft for critique), and revisions that score above the rest of their group become more likely (Sec. 4.2). The two states shown are real training states; their revisions and scores are illustrative. (3) At inference, our model runs the render–review–revise loop. Qwen3.8-27B is used only to build the data and to compute training rewards.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.
Figure 5 .One revision step of our system on ManimData-test. Our Reviewer flags that the title overlaps the table header; the Reviser moves the table down and places the current-state label below it, and the revised video is kept as the final output. Dashed boxes mark the defect (red) and the repaired region (green). Under each frame are our Reviewer’s mean score and Gemini 3.8 Flash score. More examples are in Appendix C.5.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.
Table 8 .Role-conditioned supervision.Input context, target output, and number of examples for each supervision type extracted from the 24,034 ManimData trajectories.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.
Table 9 .Training hyperparameters.Both stages train LoRA adapters (Hu et al., 2021); the RL adapter starts from the merged supervised model.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.장면 수준 생성과 장문 영상 통합의 결과
장면 수준 평가에서 ManimCode는 ManimData-test와 ManimBench에서 렌더링 성공률을 각각 96.6%와 97.0%로 기록했습니다. 같은 루프와 검색 설정에서 미학습 Qwen3.5-4B는 52.6%와 82.0%였고, 루프를 적용하지 않은 기반 모델은 7.0%와 31.0%였습니다. 궤적 SFT만 적용한 루프는 88.6%와 92.0%로 올라가며, Reviser 강화학습은 여기에 각각 8.0과 5.0 퍼센트포인트를 더합니다. 비디오 품질은 ManimData-test에서 미학습 루프 2.48, SFT 루프 2.89, SFT와 RL 루프 2.94이며, ManimBench에서는 3.00, 3.45, 3.44입니다.
저자들은 궤적 지도 학습이 성공률과 품질을 함께 높이고, 강화학습은 주로 성공률을 높인다고 해석합니다. 비디오 품질은 성공적으로 렌더링된 영상에 대해서만 평균하므로, 성공률이 달라진 모델 사이의 품질 비교에는 이 조건을 함께 읽어야 합니다. 장문 생성에서는 강의 계획과 렌더링 예산을 고정하고 장면 생성기만 바꾸었습니다. Code2Video는 완성 영상 수가 19/117에서 107/117로 늘었고, TheoremExplainAgent 설정은 53/239에서 239/239로 늘었습니다. 데이터 큐레이션 절제에서는 같은 8,416개 커뮤니티 요청에서 큐레이션된 프로그램으로 학습한 Writer가 ManimData-test 렌더링 성공률 57.2%에서 63.2%, VQ 2.65에서 2.86으로 향상되었습니다.

Table 2 .Scene-level animation generation on ManimData-test and ManimBench. VQ is averaged over successfully rendered videos.†71 of the 100 ManimBench requests appear in JanusCoder’s training data.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.
Table 3 .Scene-module substitution in long-form systems. Both runs of a system share one lecture plan written by the untrained Qwen3.5-4B.Native writesandrepairsthesceneswiththesameuntrained model, and+ Oursgenerates them with our system.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.
Figure 4 .Effectofcuration. Onthesame8,416community requests with identical inputs, a Qwen3.5-4B Writer fine- tunedonourcuratedprograms(blue)scoreshigherinsingle- pass RS and VQ on both benchmarks than one fine-tuned on the released programs (gray).
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.판정 방식과 적용 범위의 한계
품질 점수는 Gemini 3.8 Flash가 매긴 값이며, 장문 실험에서는 원래 벤치마크의 판정을 대체했기 때문에 발표된 절대 점수와 직접 비교하기 어렵습니다. 사람 평가는 팀 구성원 한 명이 98쌍을 판단한 결과이며, 자동 판정과의 일치는 VQ 차이가 0.5 이상인 쌍에서 79%였지만 차이가 0.25 미만인 쌍에서는 29%로 낮았습니다. 따라서 품질 차이가 작은 쌍에 대해서는 자동 판정의 신뢰도가 제한적입니다. ManimBench의 100개 참조 프로그램 중 85개는 ManimCE 문서 예제와 거의 중복되어, 해당 실행에서는 검색기가 그 예제를 제외했습니다. 최고 점수 후보를 유지하는 방식은 점수가 떨어지는 회귀를 막지만, Reviser가 남긴 결함을 스스로 고치지는 못합니다.

Table 10 .Human choices by VQ gap.The gap is the absolute difference between the VQ scores that the judge (Gemini) gave the two videos of a pair (98 pairs, one annotator). Among pairs in which both the annotator and the judge chose a side, agreement is the share in which the annotator picked the video the judge scored higher (95% bootstrap interval in brackets). In the 14 pairs with equal judge scores, the annotator answered about the same in 6 and chose a side in 8; in the All row, those 8 count only in the Pairs column.
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.
Table 11 .Human and judge (Gemini) verdicts on the same pairs.Wins, ties, and losses of our system against each opponent; for the judge, a tie means equal VQ scores. The human win rate counts a tie as half (95% bootstrap interval in brackets).
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.
Figure 6 .More revision steps of our system on ManimData-test.Each row is one revision step; the best-candidate rule decides which version the loop returns. From the top: a crash repaired from the renderer’s error message; a wrong sum corrected in the explanation text; an overlap removed by moving the result below the derivation; and two consecutive revisions of the same request. In the last two rows, moving the transaction list down clears the progress bar but pushes the list past the bottom edge, and moving it back up restores the overlap; our Reviewer scores the second revision lower, so the loop keeps the first. Under each frame are our Reviewer’s mean score and the score that the judge, Gemini 3.8 Flash, gives the re-rendered video (1–5).
원문 · CC BY 4.0 · Zhengyang Liang, Lizi Liao · ManimCode: Learning Visual Self-Correction for Educational Animation · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.논문 정보
- 저자
- Zhengyang Liang, Lizi Liao
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2026년 11월 5일
- 등록일
- 2026년 11월 7일
- 수정일
- 2026년 11월 5일
- 버전
- v1
- arXiv
- 2611.08294
- 분류
- cs.CV
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Manim supports precise, programmatic video generation, but a successfully rendered educational animation can still have visual defects, missing explanations, or incorrect content. Rendering does not directly identify the code changes needed to correct these visual failures, so feedback-driven revision is needed. Existing agentic frameworks use iterative rendering and revision but typically rely on large models, often proprietary. Existing Manim datasets primarily contain final programs and often lack quality verification and the trajectories of feedback and revisions needed to learn this refinement process. We introduce ManimData and ManimCode, a data and training framework for feedback-driven educational animation generation. We construct ManimData through a render-guided pipeline that iteratively generates, executes, reviews, and revises Manim programs with retrieved API documentation. Its 24,034 render-verified, quality-filtered records preserve intermediate programs, execution errors, visual critiques, and corrective revisions. We use role-conditioned supervised fine-tuning on these trajectories to train ManimCode, a single 4B model, to write, review, and revise animation programs. To improve correction of errors that differ from those in the collected trajectories, we then train the Reviser with reinforcement learning on self-generated states, using rendering outcomes and reference-free quality feedback. ManimCode achieves 96.6% and 97.0% render success on ManimData-test and ManimBench, compared with 52.6% and 82.0% for the untrained 4B model under the same inference setup, while also improving video quality scores from 2.48 to 2.94 and from 3.00 to 3.44. Integrating ManimCode into two long-form educational video generation systems increases completed videos from 19/117 to 107/117 and from 53/239 to 239/239, alongside improvements in educational effectiveness and visual quality.
원문 인용
Zhengyang Liang, Lizi Liao (2026). ManimCode: Learning Visual Self-Correction for Educational Animation. arXiv:2611.08294v1. https://arxiv.org/abs/2611.08294v1
BibTeX
@misc{liang2026manimcode,
title = {{ManimCode: Learning Visual Self-Correction for Educational Animation}},
author = {Zhengyang Liang and Lizi Liao},
year = {2026},
eprint = {2611.08294},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.08294v1}
}