system stringclasses 1
value | prompt stringlengths 78 12.9k | chosen stringlengths 370 27.9k | rejected stringlengths 327 28k | category stringclasses 5
values | source stringclasses 8
values |
|---|---|---|---|---|---|
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 output a complete, runnable, self-contained Man... | Create a 30-second Manim scene with moving-camera choreography on a phase-plane style spiral trajectory. Start wide on a number plane, follow a probe as it spirals outward, zoom in on local motion, then zoom back out with staged explanatory captions. | ```python
from manim import *
class MovingCameraPhasePlaneStory(MovingCameraScene):
def construct(self):
title = Text("Following Motion in a Phase Plane", font_size=34).to_edge(UP)
plane = NumberPlane(x_range=[-5, 5, 1], y_range=[-4, 4, 1], background_line_style={"stroke_opacity": 0.3}).shift(DOWN ... | ```python
from manim import *
class MovingCameraPhasePlaneStory(MovingCameraScene):
def construct(self):
title = Text("Following Motion in a Phase Plane", font_size=34).to_edge(UP)
plane = NumberPlane(x_range=[-5, 5, 1], y_range=[-4, 4, 1], background_line_style={"stroke_opacity": 0.3}).shift(DOWN ... | legacy_api_hallucination | synthetic_hard_neg:sebastianboehler/autoresearch-manim |
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 output a complete, runnable, self-contained Man... | I'm learning Bayesian optimization in RL and want a visualization of how a GP-based optimizer guides model-based RL for a robot vision task. Depict the interaction loop: agent collects data from robot-camera observations, a GP surrogate updates, and the acquisition function selects the next experiment. Show a 3D robot ... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class BayesianOptimizationRLScene(VoiceoverScene):
def construct(self):
self.set_speech_service(
GTTSService(voice="alba", cache_dir="voiceover_cache")
)
... | ```python
from manim import *
class BayesianOptimizationRLScene(Scene):
def construct(self):
title = Text('Bayesian Optimization in RL', font_size=44)
subtitle = Text('Efficient Exploration & Exploitation', font_size=26, color=GREY)
subtitle.next_to(title, DOWN, buff=0.3)
title_gro... | narrated_pedagogical_preference | nabin2004/manim-narrated-dpo-400 |
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 output a complete, runnable, self-contained Man... | I'm learning linear algebra to undergraduates and want a visual that unpacks singular value decomposition.
Show how a 2D/3D linear map stretches and rotates vectors into principal axes, with animated ellipsoids and a moving camera.
Include step-by-step intuition, then derive A = U Ξ£ V^T visually, plus a numeric example... | ```python
from manim import *
import math
class SVDGeometricInterpretationScene(Scene):
def construct(self):
title = Text('Singular Value Decomposition', font_size=38)
subtitle = Text('Visualizing Matrix Decomposition', font_size=22, color=BLUE_B)
header = VGroup(title, subtitle).arrange(D... | ```python
from manim import *
import math
class SVDGeometricInterpretationScene(Scene):
def construct(self):
title = Text('Singular Value Decomposition', font_size=38)
subtitle = Text('Visualizing Matrix Decomposition', font_size=22, color=BLUE_B)
header = VGroup(title, subtitle).arrange(D... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/AOS-Manim-SFT |
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 output a complete, runnable, self-contained Man... | I'm teaching an undergrad DL course and want to demonstrate how gradient vanishing is reduced in early layers by adding BN. Animate a stack of layers with gradient arrows; show arrows in early layers growing much stronger after BN is introduced. Provide a before/after comparison and annotate how BN running statistics s... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class BatchNormGradientScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class BatchNormGradientScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | You are a Manim expert. Please convert the Markdown lecture notes into executable Manim CE v0.19.0 code that displays content in English. The page layout must be clear, with no overlapping elements, and you must not output any explanatory or descriptive text outside the code. Pay special attention to avoiding common er... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class SequenceLabelingLecture(Scene):
def construct(self):
main_title = Title('Sequence Labeling and CRF in NLP')
self.play(Write(main_title))
self.wait(0.5)
section_title = Text('Overview of Seq... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class SequenceLabelingLecture(Scene):
def construct(self):
main_title = Title('Sequence Labeling and CRF in NLP')
self.play(Write(main_title))
self.wait(0.5)
section_title = Text('Overview of Seq... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | Create a Manim animation for Grade 12 Economics on National Income Accounting. The video should be in 16:9 aspect ratio.
Start with a title slide displaying "National Income Accounting" in large text with a professional color scheme. Add a subtle background pattern or color gradient.
Next, display the question on scr... | ```python
from manim import *
import numpy as np
import random
import math
class NationalIncomeAccounting(Scene):
def construct(self):
# --- Config & Setup ---
self.camera.background_color = "#0f0f0f"
# Safe bounds tracking
# X: [-6.5, 6.5], Y: [-3.5, 3.5]
... | ```python
from manim import *
import numpy as np
import random
import math
class NationalIncomeAccounting(Scene):
def construct(self):
# --- Config & Setup ---
self.camera.background_color = "#0f0f0f"
# Safe bounds tracking
# X: [-6.5, 6.5], Y: [-3.5, 3.5]
... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | Create a 30-second Manim scene that uses a custom Animation subclass to count upward while the rest of the scene morphs from a small signal into a large signal. Include staged captions, number updates, and a transform-matching style equation transition. | ```python
from manim import *
class Count(Animation):
def __init__(self, number, start, end, **kwargs):
super().__init__(number, **kwargs)
self.start = start
self.end = end
def interpolate_mobject(self, alpha):
value = self.start + alpha * (self.end - self.start)
self.m... | ```python
from manim import *
class Count(Animation):
def __init__(self, number, start, end, **kwargs):
super().__init__(number, **kwargs)
self.start = start
self.end = end
def interpolate_mobject(self, alpha):
value = self.start + alpha * (self.end - self.start)
self.m... | legacy_api_hallucination | synthetic_hard_neg:sebastianboehler/autoresearch-manim |
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 output a complete, runnable, self-contained Man... | The following Manim CE script crashed with this traceback:
```text
ValueError: latex error converting to dvi. Unicode character β (U+2081) not supported.
```
Fix the bug and provide the corrected, fully compilable Manim CE code:
```python
from manim import *
import numpy as np
class ApiValidTangentLine369(Scene):
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
MARGIN = 0.5
class ApiValidTangentLine369(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_width *... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
MARGIN = 0.5
class ApiValidTangentLine369(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_width *... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | Create a Manim animation for a Biology Class 11 video on Aestivation in Flowers. The video should be 16:9 format and follow this structure:
1. Opening Scene: Display the title "AESTIVATION IN FLOWERS" centered on screen with a subtitle "Arrangement of Sepals and Petals in Flower Buds" below it. Use a clean, profession... | ```python
from manim import *
import numpy as np
import math
import random
class AestivationInFlowers(Scene):
def construct(self):
# --- 1. Opening Scene ---
# Title Setup
title = Text("AESTIVATION IN FLOWERS", font_size=54, color="#4a9eff", weight=BOLD)
subtitle = Text("Arrangement... | ```python
from manim import *
import numpy as np
import math
import random
class AestivationInFlowers(Scene):
def construct(self):
# --- 1. Opening Scene ---
# Title Setup
title = Text("AESTIVATION IN FLOWERS", font_size=54, color="#4a9eff", weight=BOLD)
subtitle = Text("Arrangement... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | Can you create an educational animation that visually explains how image formation works with a concave mirror by showing light rays tracing from an object to the mirror and reflecting according to the rules of ray tracing? The animation should include a representation of a concave mirror with a principal axis, focal p... | ```python
from manim import *
class WaveEquationExample(Scene):
def construct(self):
# Displaying the equation
wave_eq = MathTex(r"\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}")
self.play(Write(wave_eq))
self.wait(1)
# Description of Wave Equati... | ```python
from manim import *
class WaveEquationExample(Scene):
def construct(self):
# Displaying the equation
wave_eq = MathTex(r"\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}")
self.play(Write(wave_eq))
self.wait(1)
# Description of Wave Equati... | spatial_layout_overlap | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | I'm learning how single gradient outliers affect training dynamics and want a focused visualization. Animate a bar chart where one gradient spike explodes into a red outlier, tracking its impact on the overall norm. Show the surrounding bars barely budging at first, then the explode event, with a timeline caption. I wa... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class GradientOutliersScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class GradientOutliersScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
... | invalid_axes_kwarg | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | You are a Manim expert. Please convert the Markdown lecture notes into executable Manim CE v0.19.0 code that displays content in English. The page layout must be clear, with no overlapping elements, and you must not output any explanatory or descriptive text outside the code. Pay special attention to avoiding common er... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class WebCrawlerBasics(Scene):
def construct(self):
title = Text('Web Crawler Basics', font_size=34, color=WHITE, weight=BOLD)
title.to_edge(UP, buff=0.5)
title_line = Line(LEFT, RIGHT, color=ORANGE).nex... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class WebCrawlerBasics(Scene):
def construct(self):
title = Text('Web Crawler Basics', font_size=34, color=WHITE, weight=BOLD)
title
title_line = Line(LEFT, RIGHT, color=ORANGE)
title_line.match_... | spatial_layout_overlap | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | I'm learning sequences and want to understand the difference between arithmetic and geometric sequences and their sums. Create visuals that compare term growth, partial sums, and convergence behavior side by side, with intuitive narratives and a quick derivation of the sum formulas, highlighting when each series diverg... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class SequencesScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
# ... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class SequencesScene(VoiceoverScene):
def construct(self):
# [SETUP]
# [LAYOUT]
self.set_speech_service(GTTSService(transcription_model="base"))
# ... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | 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 SciComputeScene755(Scene):
def construct(self):
import sympy as sp
... | ```python
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 SymPyDerivativeScene2(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = co... | ```python
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 SymPyDerivativeScene2(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = co... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | Write a Manim CE visualization using scientific Python libraries (numpy, scipy, sympy) for: Lorenz Attractor Differential Equation with SciPy solve_ivp.
```python
from manim import *
import numpy as np
from scipy.integrate import solve_ivp
class SciComputeScene974(Scene):
def construct(self):
from scipy.i... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
from scipy.integrate import solve_ivp
MARGIN = 0.5
class SciComputeScene974(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
from scipy.integrate import solve_ivp
MARGIN = 0.5
class SciComputeScene974(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | You are a Manim expert. Please convert the Markdown lecture notes into executable Manim CE v0.19.0 code that displays content in English. The page layout must be clear, with no overlapping elements, and you must not output any explanatory or descriptive text outside the code. Pay special attention to avoiding common er... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class GameTheoryDefinitions(Scene):
def construct(self):
title = Text('Formal Modeling Language for Game Theory', font_size=36, weight=BOLD)
subtitle = Text('Basic Definitions of Games', font_size=28, color=BLUE... | ```python
from manim import *
from manim import config
Text.set_default(font='SimHei')
class GameTheoryDefinitions(Scene):
def construct(self):
title = Text('Formal Modeling Language for Game Theory', font_size=36, weight=BOLD)
subtitle = Text('Basic Definitions of Games', font_size=28, color=BLUE... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/manim-sft-10k |
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 output a complete, runnable, self-contained Man... | The following Manim CE script crashed with this traceback:
```text
NameError: name 'undefined_variable_target' is not defined in construct()
```
Fix the bug and provide the corrected, fully compilable Manim CE code:
```python
from manim import *
import numpy as np
class ApiValidRightAngle310(Scene):
def constru... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
MARGIN = 0.5
class ApiValidRightAngleFixedScene2(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import numpy as np
MARGIN = 0.5
class ApiValidRightAngleFixedScene2(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | I'm teaching an undergrad stats course and want a vivid visualization of waiting times for an exponential distribution. Show a Poisson process with interarrival times, emphasizing the memoryless property, and sweep lambda to compare rates. Include scenes of a timeline, a histogram of samples, and a quick derivation cue... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import math
class ExponentialDistributionScene(VoiceoverScene):
def construct(self):
self.set_speech_service(
GTTSService(voice="alba", cache_dir="voiceover_cache")
... | ```python
from manim import *
import math
class ExponentialDistributionScene(Scene):
def construct(self):
title = Text('The Exponential Distribution', font_size=40)
subtitle = Text('Modeling Waiting Times', font_size=24, color=BLUE)
title_group = VGroup(title, subtitle).arrange(DOWN, buff=... | narrated_pedagogical_preference | nabin2004/manim-narrated-dpo-400 |
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 output a complete, runnable, self-contained Man... | 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 SciComputeScene1027(Scene):
def construct(self):
import sympy as sp
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import sympy as sp
MARGIN = 0.5
class SciComputeScene1027(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_width * w_... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
import sympy as sp
MARGIN = 0.5
class SciComputeScene1027(VoiceoverScene):
def fit_in_frame(self, mob: Mobject, w_frac=0.9, h_frac=0.9) -> Mobject:
max_w = config.frame_width * w_... | legacy_api_hallucination | synthetic_hard_neg:nabin2004/qwen3-8b-manimator-gold-sft |
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 output a complete, runnable, self-contained Man... | I'm studying autoregressive language models and want to visualize the evolution of output logits over the vocabulary at each generation step. Show a horizontal bar chart for logits at time t, then animate t+1 with a new set of bars, highlighting the top-1 token. Include a caption describing temperature scaling and a sl... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class AutoregressiveLM(VoiceoverScene):
def construct(self):
self.set_speech_service(
GTTSService(voice="alba", cache_dir="voiceover_cache")
)
... | ```python
from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.gtts import GTTSService
class AutoregressiveLM(VoiceoverScene):
def construct(self):
self.set_speech_service(
GTTSService(voice="alba", cache_dir="voiceover_cache")
)
... | spatial_layout_overlap | synthetic_hard_neg:nabin2004/AOS-Narrated-Manim-400 |
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 output a complete, runnable, self-contained Man... | Create a 12-second Manim scene that explains merge sort by splitting a short unsorted list into halves and then merging it back into sorted order. Keep the list small so the split and merge are visually obvious and easy to follow. | ```python
from manim import *
class MergeSortSplitMergeStory(Scene):
def construct(self):
title = Text('Merge Sort Splits Then Recombines In Order', font_size=28).to_edge(UP)
start_boxes = VGroup(*[RoundedRectangle(corner_radius=0.08, width=0.8, height=0.58, color=BLUE_D, fill_color=BLUE_D, fill_op... | ```python
from manim import *
class MergeSortSplitMergeStory(Scene):
def construct(self):
title = Text('Merge Sort Splits Then Recombines In Order', font_size=28)
start_boxes = VGroup(*[RoundedRectangle(corner_radius=0.08, width=0.8, height=0.58, color=BLUE_D, fill_color=BLUE_D, fill_opacity=0.16) ... | spatial_layout_overlap | synthetic_hard_neg:sebastianboehler/autoresearch-manim |
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
- 63