id string | source string | tier int64 | scene_name string | scene_base string | num_animations int64 | num_lines int64 | has_reasoning bool | prompt string | code string | messages list |
|---|---|---|---|---|---|---|---|---|---|---|
manim-sft-10k_005856 | nabin2004/manim-sft-10k | 1 | NashEquilibriaMixedStrategies | Scene | 15 | 53 | false | Subject: Game Theory
Topic: Nash Equilibria in Mixed Strategies
Question: How does the intersection of best response curves lead us to a Nash equilibrium in a mixed strategy context for continuous games?
Title: Finding Balance: Nash Equilibria in Mixed Strategies
Narration:
[Introduction: 0:00]
In the world of str... | from manim import *
class NashEquilibriaMixedStrategies(Scene):
def construct(self):
# Introduction - Element 1: Opening animation with title
title = Text("Finding Balance: Nash Equilibria in Mixed Strategies", font_size=32)
self.play(Write(title), run_time=1)
self.wait(0.5)
... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
qwen3-8b-manimator-gold-sft_000413 | nabin2004/qwen3-8b-manimator-gold-sft | 1 | SciComputeScene727 | VoiceoverScene | 4 | 31 | false | Write a Manim CE visualization using scientific Python libraries (numpy, scipy, sympy) for: SymPy Symbolic Derivative and animated derivation steps.
```python
from manim import *
import numpy as np
import sympy as sp
class SciComputeScene727(Scene):
def construct(self):
import sympy as sp
... | from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
import sympy as sp
MARGIN = 0.5
class SciComputeScene727(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_wi... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim_animation_dataset_002673 | Chimanwakis/manim_animation_dataset | 1 | LayoutArrayScene0378 | Scene | 5 | 39 | false | Fix the layout in this Primary 4 animation. The array, labels, and equations are all clustered. Spread the array on the left, equations on the right, keep text inside the frame, and make it about 10 seconds.
Current Manim code to improve:
from manim import *
class ClusteredScene(Scene):
def construct(self):
... | from manim import *
class LayoutArrayScene0378(Scene):
def construct(self):
target_duration = 10.0
title_time = target_duration * 0.14
array_time = target_duration * 0.34
equation_time = target_duration * 0.25
summary_time = target_duration * 0.15
hold_time = target_... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
AOS-Manim-SFT_000284 | nabin2004/AOS-Manim-SFT | 1 | GradientFlowScene | Scene | 28 | 77 | false | I'm studying deep nets and want to visualize gradient flow through a 10-layer network without batch norm, comparing the gradient magnitudes of layer 1 vs. layer 10. Animate per-layer gradient norms with color-coded bands and slow down when gradients shrink or explode. Include a path showing backpropagation through the ... | from manim import *
class GradientFlowScene(Scene):
def construct(self):
title = Text('Visualizing Gradient Flow in Deep Nets', font_size=36)
title.to_edge(UP, buff=0.5)
self.play(Write(title), run_time=2.0)
input_layer = VGroup(*[Circle(radius=0.25, color=BLUE, fill_opacity=0.3) f... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim_animation_dataset_001538 | Chimanwakis/manim_animation_dataset | 1 | MultDivScene0010 | Scene | 5 | 21 | false | Fix this Manim code for Primary 2; it should correctly show 10 groups of 3 as 10\times3=30 Use classroom example 10.
Broken Manim code:
from manim import *
class BrokenMultDiv10(Scene):
def construct(self):
title = Text("Equal groups")
self.play(Write(title))
self.play(FadeIn(groups)) | from manim import *
class MultDivScene0010(Scene):
def construct(self):
title = Text('Equal sharing 10', font_size=32).to_edge(UP)
shares = VGroup()
for child in range(5):
dots = VGroup(*[Circle(radius=0.11, stroke_color=WHITE).set_fill(BLUE, opacity=0.75) for _ in range(4)])
... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim-sft-10k_005004 | nabin2004/manim-sft-10k | 1 | SocialJusticeLesson | Scene | 33 | 142 | false | Create a Manim animation for an 11th grade political science lesson on how social justice addresses economic inequalities. The video should be in 16:9 format and follow this structure:
1. Title slide: Display "Social Justice and Economic Inequality" with a subtitle "Grade 11 Political Science"
2. Question slide: Show... | from manim import *
import numpy as np
import math
class SocialJusticeLesson(Scene):
def construct(self):
# 1. Setup & Title Slide
# Background color is set in config, but we ensure elements contrast against #0f0f0f
# Colors
TEXT_COLOR = "#d4d4d4"
ACCENT_BLUE = "#4a... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
adaption-unified-manim-instructions_003782 | priyanshutomar2024/adaption-unified-manim-instructions | 2 | RectangleExpansionScene | Scene | 4 | 43 | true | Create a Manim animation scene where a blue rectangle dynamically changes its vertical size. Include a gray semi-transparent rectangle (with 50% opacity) positioned behind the blue one as a static reference. Add a DecimalNumber at the top of the screen that continuously updates to display the current height value of th... | from manim import *
class RectangleExpansionScene(Scene):
def construct(self):
# Configuration
INITIAL_HEIGHT = 2.0
FINAL_HEIGHT = 5.0
RECT_WIDTH = 3.0
# 1. Value Tracker for Synchronization
# Using a ValueTracker ensures the rectangle height and the counter... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
adaption-unified-manim-instructions_002856 | priyanshutomar2024/adaption-unified-manim-instructions | 2 | TripleIntegralEvaluation | Scene | 29 | 99 | true | I would like an educational animation that visually demonstrates how to evaluate a triple integral step by step. Start with the integral of r^2 sin(theta) from 0 to 1 with respect to r, then from 0 to pi with respect to theta, and finally from -1 to 1 with respect to z. Guide me through each integration stage with on-s... | from manim import *
class TripleIntegralEvaluation(Scene):
def construct(self):
# --- Configuration & Colors ---
color_r = BLUE
color_theta = GREEN
color_z = YELLOW
# --- Step 0: Initial Integral ---
title = Text("Evaluating a Triple Integral", font_size=36)... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim-sft-10k_001131 | nabin2004/manim-sft-10k | 1 | ApiMathTex493 | Scene | 1 | 6 | false | Show a minimal Manim CE example that constructs MathTex with valid keyword arguments only. Do not invent kwargs such as element_color, max_value, or max_magnitude. | from manim import *
import numpy as np
class ApiMathTex493(Scene):
def construct(self):
mob = MathTex(r"x^2 + y^2 = r^2", color=TEAL)
self.play(FadeIn(mob)) | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim-sft-10k_004820 | nabin2004/manim-sft-10k | 1 | WomenInLeadership | Scene | 29 | 130 | false | Create a Manim animation for an 11th-grade Political Science class explaining "Women in Leadership." The video should be in 16:9 format and follow a natural classroom flow.
Start with a title screen displaying "Women in Leadership" in large, clear text. Then introduce the question: "What does the term 'women in leader... | from manim import *
import numpy as np
import random
import math
class WomenInLeadership(Scene):
def construct(self):
# Set background color to educational dark theme
self.camera.background_color = "#0f0f0f"
# ---------------------------------------------------------
# Sect... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
ry_manim_codegen_000061 | RY7Games/ry_manim_codegen | 1 | AtomScene | Scene | 3 | 31 | false | Could you create an educational animation that visually explains how to find the area under the curve of the function f(x) = x^2 from x=1 to x=3, by demonstrating the process of setting up the integral, evaluating it step by step, and concluding with the exact numerical value of the area? | from manim import *
class AtomScene(Scene):
def construct(self):
atom = self.create_atom()
electrons = self.create_electron_orbit(atom)
self.play(FadeIn(atom))
self.play(AnimationGroup(*[
MoveAlongPath(e, orbit) for e, orbit in electrons
], lag_ratio=0.5))
... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim-sft-10k_003652 | nabin2004/manim-sft-10k | 1 | PolynucleotideChain | Scene | 25 | 156 | false | Create a Manim animation for a high school biology class explaining phosphodiester bonds in polynucleotide chains. The video should be in 16:9 format and follow this structure:
First, display the title "Polynucleotide Chain Formation" in large, clear text. Then show the question on screen: "What type of bond links nuc... | from manim import *
import numpy as np
class PolynucleotideChain(Scene):
def construct(self):
# --- 1. Title and Intro ---
title = Text("Polynucleotide Chain Formation", font_size=42, color="#4a9eff")
title.to_edge(UP, buff=0.5)
question = Text("What type of bond links nucl... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
ritl_repair_00667 | ritl_self_repair:spatial_layout_overlap | 1 | SpectralDecompositionScene | null | null | null | false | I'm an upper-level linear algebra teacher; I want a Manim animation that builds intuition for spectral decomposition of a 3Γ3 matrix.
Show the matrix acting on a field of vectors, with eigenvectors unchanged in direction and scaled by eigenvalues, and then visualize A = PDP^{-1} in a concrete example.
Include multiple ... | from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class SpectralDecompositionScene(VoiceoverScene):
def construct(self):
self.set_speech_service(
GTTSService(voice="alba", cache_dir="voiceover_cache")
)
... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
manim_animation_dataset_002888 | Chimanwakis/manim_animation_dataset | 1 | StrictRectangleScene0593 | Scene | 5 | 29 | false | The prompt asked for a rectangle fraction bar, but this code uses circles. Rewrite it for Primary 4 so it uses exactly one rectangular bar split into 13 equal parts, shades 11 parts, and lasts about 12 seconds.
Current Manim code to improve:
from manim import *
class WrongVisualScene(Scene):
def construct(self):
... | from manim import *
class StrictRectangleScene0593(Scene):
def construct(self):
target_duration = 12.0
intro_time = target_duration * 0.16
bar_time = target_duration * 0.28
shade_time = target_duration * 0.22
label_time = target_duration * 0.18
hold_time = target_dur... | [
{
"role": "system",
"content": "You are an expert Manim Community Edition (ManimCE v0.19+) Python developer and mathematical animator. Given a user request, first plan the spatial layout, coordinate bounds, timing, and pedagogical flow inside <think>...</think> tags (when reasoning is helpful), and then out... |
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
FinetuningExps β Pure 16-Bit Dual-GPU ManimCE LLM Fine-Tuning & Compiler-Aligned Post-Training
An end-to-end, from-scratch Pure 16-Bit (torch.float16) Dual-GPU Supervised Fine-Tuning (SFT) + Adapter-Reference Direct Preference Optimization (DPO) + Renderer-in-the-Loop (RITL) framework engineered to train open-weight code LLMs (Qwen/Qwen2.5-Coder-7B-Instruct) to excel at Manim Community Edition (ManimCE v0.19+) mathematical animation generation on free Kaggle GPU T4 x2 (32 GB VRAM) hardwareβwith zero 4-bit quantization degradation.
Repository Version Branches
This repository is organized into progressive versioned release branches, each containing its own dedicated technical README.md:
| Branch | Milestone / Scope | Dedicated Documentation |
|---|---|---|
v1.0-data-pipeline |
Multi-source public dataset ingestion, AST verification, ManimCE v0.19+ canonicalizer, prompt-code alignment filter, and DPO/RITL pair synthesis. | docs/branches/README_v1_data.md |
v2.0-sft-16bit-engine |
From-scratch Pure 16-Bit (FP16) Dual-T4 GPU rsLoRA ($r=64, \alpha=64$) SFT trainer with completion-only loss masking, NEFTune ($\alpha=5.0$), and fault-tolerant HF Hub checkpointing. |
docs/branches/README_v2_sft.md |
v3.0-dpo-compiler-alignment |
Zero-memory-overhead 16-bit Adapter-Reference DPO + RPO-NLL alignment engine eliminating legacy ManimGL/v0.14 hallucinations and layout overlap. |
docs/branches/README_v3_dpo.md |
v4.0-kaggle-automation-and-eval |
Automated Kaggle GPU kernel deployment (priyadharsanbalaji18/manimce-qwen25-coder-7b-16bit-sft-dpo), 1-turn RITL self-repair agent, and held-out ManimBench-v1 / autoresearch-manim evaluation suite. |
docs/branches/README_v4_kaggle_eval.md |
main |
Complete unified production codebase integrating all four stages. | This document (README.md) |
1. End-to-End Architecture
flowchart TD
subgraph P1["Phase 1: AST & Alignment Data Curation (v1.0-data-pipeline)"]
D1["68,239 Raw Rows Across 13+ Public HF Datasets"] --> D2["AST Parser + ManimCE v0.19+ Canonicalizer"]
D2 --> D3["Prompt-Code Semantic Alignment & Contradiction Filter"]
D3 --> D4["SHA-256 Deduplication & Zero-Leakage Split Isolation"]
D4 --> D5["PRB1/ManimCE-Master-SFT (24,033 Train / 500 Val / 159 Test)\n& PRB1/ManimCE-Master-DPO (2,623 Train / 138 Val)"]
end
subgraph P2["Phase 2: Pure 16-Bit Dual-GPU SFT (v2.0-sft-16bit-engine)"]
D5 --> S1["Qwen2.5-Coder-7B-Instruct in Native FP16 Across 2x T4 (32GB VRAM)"]
S1 --> S2["High-Rank rsLoRA (r=64, alpha=64) + Completion-Only Masking + NEFTune"]
S2 --> S3["Live Checkpointing -> PRB1/Qwen2.5-Coder-7B-ManimCE-SFT-16bit"]
end
subgraph P3["Phase 3: 16-Bit Compiler-Aligned DPO (v3.0-dpo-compiler-alignment)"]
S3 --> A1["In-Memory 16-Bit Merge (Stage-1 Backbone = pi_ref, 0 Extra VRAM)"]
A1 --> A2["RPO-Stabilized DPO (beta=0.1, lambda_NLL=0.1) vs. Legacy APIs & Bugs"]
A2 --> A3["Aligned Model -> PRB1/Qwen2.5-Coder-7B-ManimCE-DPO-16bit"]
end
subgraph P4["Phase 4: RITL Self-Repair & ManimBench Eval (v4.0-kaggle-automation-and-eval)"]
A3 --> E1["Pass@1 Generation + Static AST / Headless ManimCE Verification"]
E1 --> E2["Pass@2 1-Turn Compiler Traceback Self-Repair (RITL)"]
end
2. Empirical Dataset Curation & Sanitization Audit (data/curation_audit_report.json)
Our automated audit of 68,239 raw rows across public Hugging Face Manim datasets revealed massive syntax corruption (>23,000 invalid Python ASTs), row-shuffled prompt-code misalignments, and legacy ManimGL (manimlib) contamination. Below is the exact breakdown produced by src/data_pipeline/build_master_dataset.py:
| Public Dataset Source | Raw Rows | AST Valid | Aligned | Deduplicated Kept | Key Rejection / Sanitization Reasons |
|---|---|---|---|---|---|
sebastianboehler/autoresearch-manim |
150 | 150 | 150 | 150 | 100% Gold render-verified ManimCE v0.20.1 (30 held out for test). |
SuienR/ManimBench-v1 |
416 | 381 | 380 | 371 | 31 <6 line fragments, 9 duplicates (129 held out for test). |
bespokelabs/bespoke-manim |
100 | 100 | 96 | 96 | Execution-verified ManimCE v0.19.0 + synthesized <think> timeline traces. |
nabin2004/qwen3-8b-manimator-gold-sft |
733 | 733 | 730 | 712 | 18 cross-dataset duplicate hashes removed. |
nabin2004/AOS-Manim-SFT |
371 | 371 | 367 | 367 | 2 legacy calls modernized (ShowCreation $\rightarrow$ Create). |
nabin2004/AOS-Narrated-Manim-400 |
361 | 361 | 357 | 357 | Canonicalized proprietary speech service imports to standard GTTSService. |
nabin2004/manim-sft-10k |
10,000 | 7,951 | 7,722 | 6,934 | Filtered 1,953 non-English/malformed prompts, 788 duplicates, 211 contradictions. |
Chimanwakis/manim_animation_dataset |
6,023 | 5,516 | 5,156 | 5,156 | Filtered 507 SyntaxErrors and 360 unaligned literal mismatches. |
RY7Games/ry_manim_codegen |
4,625 | 2,209 | 2,076 | 361 | Filtered 1,065 SyntaxErrors, 1,198 1-line stubs, 1,715 duplicates; 374 API repairs. |
mistral-hackaton-2026/manim-finetune-data |
2,705 | 1,316 | 818 | 220 | Filtered 1,037 SyntaxErrors, 432 unaligned pairs, 598 duplicates; 192 API repairs. |
priyanshutomar2024/adaption-unified-manim-instructions |
40,383 | 9,007 | 8,782 | 8,759 | Bypassed corrupted output column; extracted aligned reasoning_trace + enhanced_completion; filtered 21,395 SyntaxErrors & 4,516 short stubs. |
| RITL Compiler Self-Repair Trajectories | β | 1,200 | 1,200 | 1,200 | 2-turn Broken Code + Manim Traceback -> Fixed ManimCE Code trajectories. |
Total Master Corpus (PRB1/ManimCE-Master-SFT) |
68,239 | 29,304 | 27,834 | 24,692 | 24,033 Train (8,671 with <think> CoT) | 500 Val | 159 Held-Out Test |
3. Repository Structure
ManimFineTuneExperiment/
βββ src/
β βββ data_pipeline/
β β βββ manim_canonicalizer.py # Python AST parser & ManimCE v0.19+ code modernizer
β β βββ alignment_filter.py # Semantic & lexical prompt-to-code alignment verifier
β β βββ dpo_pair_builder.py # Hard-negative DPO & 2-turn RITL self-repair generator
β β βββ hf_loader.py # Pure-Python & PyArrow HuggingFace dataset loader
β β βββ build_master_dataset.py # Full curation orchestrator & HF Hub uploader
β βββ training/
β β βββ sft_trainer.py # Custom 16-bit Dual-GPU rsLoRA + NEFTune SFT trainer
β β βββ dpo_trainer.py # Custom 16-bit Adapter-Reference DPO + RPO-NLL trainer
β βββ inference/
β β βββ ritl_agent.py # Renderer-in-the-Loop (RITL) 1-turn compiler self-repair
β βββ eval/
β βββ manim_benchmark_eval.py # Held-out ManimBench-v1 & Autoresearch evaluator
βββ kaggle_kernel/
β βββ kernel-metadata.json # Kaggle GPU kernel configuration
β βββ train_manimce_16bit_kaggle.py # Standalone fault-tolerant Kaggle Dual-T4 training script
βββ scripts/
β βββ push_kaggle_kernel.py # Automated Kaggle CLI/API kernel deployment & status check
βββ docs/branches/ # Dedicated technical READMEs for v1.0, v2.0, v3.0, v4.0
βββ data/curation_audit_report.json # Complete per-dataset AST & alignment audit metrics
βββ requirements.txt
4. Quickstart Usage
A. Curate & Upload Master Datasets
export HF_TOKEN="your_hf_token"
python src/data_pipeline/build_master_dataset.py
B. Deploy & Launch 16-Bit Training on Kaggle Free GPU (T4 x2)
export KAGGLE_API_TOKEN="your_kaggle_token"
export HF_TOKEN="your_hf_token"
python scripts/push_kaggle_kernel.py
C. Run Local/Cloud Multi-GPU 16-Bit SFT & DPO Directly
python src/training/sft_trainer.py --base_model Qwen/Qwen2.5-Coder-7B-Instruct
python src/training/dpo_trainer.py --base_model Qwen/Qwen2.5-Coder-7B-Instruct
- Downloads last month
- 59