Sep 4, 2026 · by Po-Shen Loh

How a Math Person Used AITo Make an Ad Campaign

What if Apple, Buc-ee’s, and Michael Jackson had a collaboration?

Note: I actually wrote this text myself, and then asked Claude Code to build a webpage around it. The initial prompt, including the original post text itself, is also in that file.

Last week, I needed to design a campaign with a whole series of video ads, for advanced math classes that are free for kids in schools that are rural or 85%+ free/reduced lunch, and reasonably priced for everyone else. My vision for the campaign was: what if Apple, Buc-ee’s, and Michael Jackson had a collaboration? There was only one problem. I had no designer and no budget.

I did have an example that I liked, custom-designed over a year ago by the talented Julia Du. She worked with us part-time between her graduation from Parsons and starting work at Google.

Thanks to Claude, Codex, Remotion, Storyblocks, Google Lyria, and Elevenlabs, we have an entire ad campaign. Of course, it’s not as good as what a professional designer can create. But it seems to already outclass every other ad campaign in the after-school math enrichment industry. And those companies actually have enormous marketing budgets, while we give away our profits to teach kids in lower-income and rural areas.

10 ads · tap one for sound

Since I am an educator, I thought I’d share the recipe of how this was done. Note that this task is different from video editing (which many report you can ask GPT-6 Astra to “just do” for you using your regular video editor). This is more akin to composing a symphony like Beethoven, than mixing tracks like an elite audio engineer.

First, the trap

“Make a video ad”

I knew that if I asked AI to “make a video ad”, I’d likely get something generic and boring. (There is a mathematical reason which supports this intuition, which I’ll explain below.) I didn’t bother at the time, but just for fun, I tried that just now, with this prompt:

PoChatGPT
202503-julia.mp4
click to skip typing

It made this:

Julia’s ad, the one I uploaded. Made in Adobe After Effects; the text playfully appears across each frame.
ChatGPT’s ad, from that one prompt.

Oof. It feels generic (much more on that later). The whole point of Julia’s video was to make the text playfully appear across each frame. That was entirely lost. And ChatGPT had no way to get videos of real people, which lost the human feel. At least it didn’t AI-generate fake people. The visual layout and polish look sloppy. The words themselves might not be terrible.

In case you’re curious, several days later, I also tried using OpenAI Codex with GPT-5.6 Sol High Effort, as another test after I had succeeded already with Claude. Even with prompting, and with full access to Claude’s codebase and our later-generated audio tracks, it produced these two iterations.

Why generic is the default

256 to the 6 billion

There is a mathematical reason why the task of AI-creating videos is hard: the number of dimensions in the space of videos is absolutely enormous. At its most basic, if you simply consider a 30-second 1080×1080 60fps video, that is

30×1080×1080×602×10930 \times 1080 \times 1080 \times 60 \approx 2 \times 10^{9}

each of which has a red, green, and blue value, which is a total of 6 billion dimensions. If each value ranges from 0 to 255, that’s

2566,000,000,000256^{\,6{,}000{,}000{,}000}

possibilities to optimize among. In contrast, coming up with an English language 150-character tweet “only” has around 3015030^{150} possibilities. The exponent is the killer. In reality, the objective of AI algorithms (and perhaps our own human intelligence) is to vastly reduce the dimensionality in both situations.

Perhaps that’s why AI-generated video often feels “generic”: it takes impossibly long to search through and compare all of the possibilities. Yet what sets any product apart is to be iconic. I once heard a marketing lecture where the speaker said you shouldn’t ever try to tell people you’re the “best at X.” You should be the “only one who does X.” And that requires insight.

Unlock 1

Find the language

A programming language that can say the whole animation in words.

In this case, the insight was to reduce the dimensionality by asking Claude to find a programming language which could fully specify the whole animation in words and commands. Note that I did not first ask AI to create the ad. I asked to research the ideal way to vastly compress the number of dimensions.

PoClaude Cowork
click to skip typing

The answer was terrific:

Claude Cowork

Answer: yes, and the framework question was the wrong axis. Next.js is a web-app framework with no notion of a frame. What the job needs is a deterministic frame renderer — where the picture at t=3.2s is a pure function of frame 96, so headless Chrome can be stepped frame by frame and piped into FFmpeg.

Researched the field and built two working spinoff ads as proof rather than asserting feasibility. Options considered:

optionverdict
Remotionchosen — shipping, mature, best-in-class audio sync
HyperFrames (HeyGen, Apache-2.0)real contender, no licence fee, but 0.7.x and fiddly audio
Revideo (MIT)0.x; OSS repo trails a commercial product by the vendor's own admission
Motion Canvasout — no stable release in ~20 months, no headless render path
Editly / fluent-ffmpegout — fluent-ffmpeg archived May 2025 and self-declared broken
DIY Puppeteer captureout — means reimplementing deterministic virtual-time capture
Shotstack / Creatomate / JSON2Videoout — hosted-only, rent-per-minute at variant scale

And, the first result it produced was already surprisingly not awful!

The first thing out of the pipeline. Not the final quality, but a step down the path.

Particularly because I was not evaluating it based upon its final quality, but rather I was tracking progress along the pathway of reducing dimensionality. I knew that once I could replicate the capabilities of Adobe After Effects, composed through a Claude Code pipeline in Remotion (the first huge part of solving this problem), I would be able to generate a vast number of videos. And this particular output showed that it was possible to generate professional-quality text animations through code. Then I asked:

PoClaude Cowork
click to skip typing

That produced:

Julia’s original, by hand.
The clone, entirely in code, in Plus Jakarta Sans.

I was thrilled to see that my nascent system could not only bring in all of the necessary components (animations and video), but it could understand Julia’s video as an example piece, and learn from it. Notably, it got this far from one single example, not a ton of training data. That indicated to me that I had found the correct language for expressing Julia’s video.

So it was time to iterate. For that, I needed to track all of the editions, because progress would likely be some steps forward and some steps back.

PoClaude Cowork
click to skip typing

At that point, I also realized I did not need anything from MacOS (initially I wasn’t sure), and so I asked if it was time to switch away from my Mac Mini M1.

PoClaude Cowork
click to skip typing

Once I switched over, progress sped up dramatically. In part because my main Linux workstation has 5 monitors, arranged vertically.

A Linux workstation with five monitors stacked vertically
Five monitors, vertically. Claude Code in the middle of it.
Unlock 2

A custom score

Reduce the dimensionality of sound the same way.

Next up was sound. In the past, we had just bought a soundtrack and used it over and over again. Emboldened by what I had gotten in such a short time, I decided to go for a custom soundtrack. I remembered from conversations with people in the entertainment industry that a sign of true quality in movie production was a custom-composed score that complemented and deepened the emotion of what was on screen.

PoClaude Code
click to skip typing

Unfortunately, the soundtrack was laughably bad. It sounded like a 1990’s video game. Despite asking Claude to try harder, it didn’t improve much. That’s when I realized that I needed to reduce dimensionality by searching for a tool that would turn text into a musical production.

PoClaude Code
click to skip typing

It found Google Lyria and ElevenLabs Music. Both were less than $10, and so I got access to both of them, and passed their API Keys to Claude Code. It then produced a whole slew of soundtracks for me to listen to. But that was inconvenient, because I had to imagine how the video played along with the sound. So, the natural next request was to:

PoClaude Code
click to skip typing

It took less than a minute, and even had some style.

The listening room: a web page that plays each rendered ad against every soundtrack candidate, with stars and notes
The listening room. Every ad against every soundtrack candidate, in sync, with stars and notes.

With this user interface, I then engaged in 7 rounds of providing feedback to train the music. Music is also extraordinarily-high-dimension. I realized that the way to reduce that dimension could be to establish 3 phases of moods: starting pensive, then piqued-interest, and concluding triumphantly. I remembered listening to one of my college roommates from 20+ years ago, who was really into the theory of music, and I remembered that there existed things called chord progressions, minor and major keys, and key changes. I didn’t know much about any of those things, but that general knowledge gave me things to prompt about. Finally, I had a general engine for producing a variety of soundtracks to use, which are those that appear in the videos I showcased at the beginning. (Those audio tracks are not final, and I’m still experimenting with instructions, particularly around chords and keys.)

Unlock 3

Real people, released

Stock footage for the pain points, real class recordings for the class.

From there, I moved back to the visuals. I generally dislike AI-generated visuals, because I don’t want to show fake things. Through discussion with Claude, I learned that it was able to search stock footage on a platform called Storyblocks. I then asked it to research all of the possible providers:

PoClaude Code
click to skip typing

The two main contenders ended up being Adobe Stock and Storyblocks. But crucially, Claude was not able to search Adobe Stock, while it was able to search Storyblocks without login. (Of course, it couldn’t get the high quality video files, but it would be able to sift through footage and recommend video clips.) That became the deciding factor. Claude Code’s searching ability, combined with its ideation of each ad’s story, would provide the necessary real human footage to complete each piece.

At that point, I had settled into a design framework for each piece: whenever we talk about our classes, we would use actual screen recordings from real classes (not staged and definitely not AI-generated)! And whenever we show pain points in the rest of the world, we would use stock footage. All of this would be interlinked with playful text animations:

PoClaude Code
click to skip typing
Unlock 4

Give Claude conviction

It won’t go all-out for a claim it doesn’t believe. So make it true, and let it check.

Oh, a note about the last sentence in the prompt. My understanding from reading Claude’s Constitution (yes, I read the whole thing) was that Claude is not supposed to deceive. So, I was fairly sure that Claude wouldn’t go all-out unless it was itself convinced that there was something special here. To that end, I had previously passed in a document which I had written some years ago, about the unique value propositions of our classes, and also specifically asked Claude to do its own independent research to develop the necessary conviction:

live-unique.md
14 sections · what makes LIVE the only one that does this

Unique aspects of LIVE by Po-Shen Loh (online math classes for middle schoolers that teach creative problem solving and critical thinking, using math contest problems)

The best instructors

  • Instructors are among the most extraordinary of their generation, when considering both math skill and emotional intelligence combined
  • Instructors are top finishers in competitions ranging from math to computer programming to debate
  • Last year, among the instructors who graduated high school, more than half of them are now studying at MIT, Princeton, and Harvard
  • They are also specially selected based upon their emotional intelligence
  • They are only a few years older than the learners, and still remember what it was like to learn, but unlike other programs which have high schoolers teaching, they have received extensive specialized training in teaching and performing
  • Admission to our instructor program is a highly sought-after achievement in itself, because it’s the only program which provides systematic professional performing arts training to math stars, helping them develop whole-person skills that change their life
  • Why are the best instructors with us? Because in order to succeed in life (and gain admission to top colleges), it is a huge advantage to build extraordinary communication skills. If a high school math star wants to do that, they must practice at some point by talking about something and getting feedback. Our breakthrough was that we realized that the easiest topic for them to talk about is math, and then we provided professional actors and comedians to coach them simultaneously while they are teaching that math. So for them, one hour of teaching math equals one hour of feedback on their communication, and they win while learners win. (There’s no way to gain feedback without talking about something, and the easiest thing for them to talk about is math.) Nobody has ever done this before.
  • We’re the only educational ecosystem for which whenever we ask an instructor to do anything, we only do it if that task is intrinsically the best use of the instructor’s time in terms of the instructor’s personal development.
  • Consequently, we attract the world’s best instructors

We actually made online math class more attention-grabbing to students than in-person math class

  • Nobody pays attention to a Zoom class, but the same kid can watch YouTube or a livestream all day. So we did it the other way round: instead of taking math class and putting it online, we took what everyone already watches online (a live show with hosts, a chat, production) and put math inside it. We are the first math class built that way.
  • Before us, online math classes had a huge problem: they were most effective at teaching students how to sleep
  • Some products tried to artificially make online math class seem more exciting with random sound effects and cartoon characters, but those are non-human, and distract from the intrinsic love of hard math as a human endeavor
  • We realized that there is no fundamental reason why an online video makes kids fall asleep, because kids love watching online videos
  • We realized that what makes everyone fall asleep is big boring Zoom meetings in which someone drones on and on, and the viewers passively watch
  • We realized that some key differences between other online classes and actually addictive video entertainment were: (1) emotional passion of multiple co-presenters on camera, (2) intensely active chat showing the emotions and ideas of the viewers, which made the viewers feel like they were really part of the whole thing, (3) the visual appeal of the experience, as a professional looking streaming host looks totally different from a tutor sitting in their kitchen. So we built all of that in.
  • Students in our class speak up more than students attending in-person classes, because we turned online into an advantage! In-person, you can’t just keep talking, because that will disrupt the sound in the room, and people can’t hear the teacher. Online, you can always hear and see the teacher, but we have a live chat feed overlaying the corner of the screen, showing everyone’s reactions at the same time.
  • We also specially train our instructors to emotionally connect with students, so that they aren’t only delivering math knowledge. They’re making students interested in them from a human emotional perspective. And while they’re teaching, a professional actor keeps this training fresh.
  • The instructors being close in age to the students is also attention-grabbing. Students feel emotionally closer to the instructors.

The world’s first and only math program which has 2 live-streaming instructors interacting with each other and with students just like a TV show

  • This instantly makes it more entertaining and lively, much better than one instructor talking to themself
  • We were able to do this because we are the first and only program to systematically train our instructors in improvisational comedy, through professional comedians, and provide them with continuous feedback while they teach every subsequent class.
  • This also allows the math to be more dynamic. Instructors don’t have to worry about whether students will suggest something that is beyond their expertise, because there are 4 math experts teaching together, and even if something actually does require further research, one instructor can actively lead the class to think, while the other 3 research, and then the other instructor can take over and explain. This provides seamless redundancy. In the 1-instructor classroom, if the teacher is asked something that they don’t know about, they are stuck.

The only math program which combines extreme expertise in math with expertise in performing arts

  • Founder Po-Shen Loh is a professor at Carnegie Mellon University, which also happens to be one of the very top Drama universities in the USA. It’s the same Carnegie as Carnegie Hall in New York City. Many of that university’s alumni are Broadway and Hollywood actors, who have won Academy Awards and Tony Awards. Our actors come from that extraordinary network.
  • Founder Po-Shen Loh also served for a decade as the national coach of the USA International Math Olympiad team, and travels extensively to keep in touch with thousands of high school math superstars across the country.
  • He was the first to bridge these two extraordinary-level worlds together.

If we can’t make your kid love hard math, nobody can

  • We’re the only math class in the world which has a professional actor in every classroom, giving real-time feedback to the instructors to improve the attractiveness of their presentation
  • We don’t teach routine math.
  • We provide hard challenges just like a TV game show, and then use the skills from professional performing arts to encourage students to rise to those hard challenges
  • We weave human emotion and excitement in, together with compassion and understanding that it’s emotionally difficult to be stuck on a hard thing
  • We celebrate as students collectively make breakthroughs in understanding
  • We package all of this into a professional experience

The only online math class that looks and feels like the entertainment that kids watch

  • We built our own technology (combining software, hardware, and lights and equipment) to transform “Zoom School” into a professional experience
  • Every other online math class actually looks the same. Ours looks totally different.
  • No other online math class can make its instructors look as cool as ours, because just having the equipment isn’t enough. The instructors need to have the emotional polish to come across as professional entertainers, or else it just looks weird to have a professional setup and a person who doesn’t know how to emotio nally connect with an audience. The reason we can go all the way is because our instructors actually have those performing arts skills too.

The only online math class that dares to show actual footage of class as its advertisement

  • This point actually speaks for itself.
  • Every one of our math classes has a professional production team behind it, making sure that the live stream is at the quality that one would expect from entertainment

Architected and led by the world’s most famous math coach

  • Po-Shen Loh’s work and discoveries have been covered in the Wall Street Journal, New York Times, National Public Radio, the Washington Post, and even international newspapers such as the Straits Times and the Australian Broadcasting Corporation
  • He is the world’s most active traveling math educator, giving ~200 in-person talks per year to tens of thousands of attendees.
  • This allows him to develop and maintain a deep understanding of the math needs of students and parents. That’s how he thought of this invention.
  • Loh is himself a math contest star. He ranked #3 in the USA in the MATHCOUNTS competition when he was a student, and was also one of the 6 members of the USA International Math Olympiad team in 1999, where he won a Silver Medal at the world finals.
  • He went on to win the USA Presidential Early Career Award for Scientists and Engineers
  • He has been a math professor at Carnegie Mellon University for 14 years
  • He’s the same person who was the national coach of the USA math team when it ranked #1 in the world in 2015, for the first time in 21 years
  • He is also an inventor, with multiple patents

We use performing arts skills to encourage shy students to love math

  • Our instructors are specially trained to notice when a usually-quiet student suggests an idea in the chat
  • Many shy students are afraid to raise their hand in class because they aren’t sure whether their answer is right, and they’re worried that other people will laugh at them or think they are stupid
  • In our system, students are encouraged to say brainstormed ideas which are not yet fully formed, so it is normal for lots of ideas to be still-solidifying
  • When we see a student who hasn’t spoken much before, but sends a comment with a valuable bit of an idea (doesn’t even need to be fully formed), we pick them out and invite them (if they wish) to come on stage and share that idea, telling them that it’s a great idea. They are then more confident to share it, and then our instructors are specially trained like TV hosts to make them feel good about sharing that idea (“Thanks so much for sharing this!”) This encourages even shy students to actively participate, because they see that whenever anyone is called upon to present, that person is always backed up by the instructors and ends up looking good

The only math class in which if you say a wrong answer, you will still be encouraged for the right part of your wrong answer

  • Instructors are specially trained in improvisational comedy, which is the art of “Yes, And”. That is the principle of a performer finding elements of truth to agree with in whatever they hear, and then adding more value in their reply. They do not just say “No.”
  • Instructors are trained to instantly think about the math behind any wrong answer, and use their math skills to figure out where there might be some value. Perhaps the student started off in the right way, but made a mistake that resulted in the wrong answer. Instructors will then congratulate the student on the good part of the idea, and gently suggest that the wrong part is wrong.
  • This encourages students to actively participate, because they know that as long as they’re thinking, it is safe to speak up. Instructors have their back.

The only math class in which you can really learn how to brainstorm

  • Since we have a team of 4 math experts leading each class (2 on camera and 2 off-camera), students can really say any idea, and instructors can follow through with those ideas. Nothing will stump them
  • Also, since our classes are video-based, instructors can dynamically write out students’ proposed ideas on screen, and discuss them dynamically. Instructors are not limited to Powerpoint slides.
  • Since we have full confidence in our instructors’ ability to dynamically handle anything, the format of the class is: students are shown a problem that they haven’t seen before. Instructors invite students to brainstorm, and serve as game show hosts to help students collectively brainstorm a solution.
  • Importantly, instructors DO NOT first show students an example of how to do a problem type, and then give them practice.
  • The reason why our instructors can let students direct the flow of the brainstorming is because they are so good at math (and have so much backup with the 4-person math instructional team in each classroom) that they will not get stuck.

The only math class where you can learn from people who are close to your age, yet brilliant and down-to-earth, and extensively trained in the art of entertaining teaching

  • Speaks for itself

The only math class that also teaches the non-math values that the top US universities look for

  • Instructors are carefully screened through an intensive application process that includes an interview
  • We seek instructors who are not only good at math, but also empathetic, and really love helping people
  • They are role models for how a person can be simultaneously brilliant, but also are like sunshine with a real interest in helping other people
  • They show students that an ideal math genius is someone who is not only great at math, but also genuinely loves helping other people
  • Eventually, when you apply to college, it’s not enough just to tick a box saying that you did 200 hours of community service. What really matters is whether you fundamentally developed a love of helping other people. It’s impossible to give a kid a philosophy book to have them develop this theoretically. Role models are required. Our instructors are those role models, on the fast track to success.

The only math class where you are supposed to talk as much as you can, saying all of your ideas and your reactions

  • Each class is led by a team of 2 instructors, 2 teaching assistants, and 1 actor
  • We have our own special technology to put students’ comments up on screen for everyone to see, like an Instagram Live stream, but with active moderators
  • Other Zoom classes could not do this, because there was no way to moderate the chat. So, during the pandemic, most people’s experience with Zoom was that the teacher told students not to chat, and then students stopped paying attention. We fixed this with our own software.
  • With 4 people who have math expertise, students can ask or say anything, and every question gets answered. It’s much better than an in-person class, where if you raise your hand, you might not get called on.
  • Our instructors are specially trained to manage a high-energy, highly interactive discussion. The more students who send messages at the same time, the happier they are. And they are specially trained to call on students to come on stage and voice their opinions too, prioritizing students who have not been on stage yet.
  • Students actually love having their voices heard, and it makes them feel ownership in the experience.

Raw file: /live-unique.md

PoClaude Code
click to skip typing

By the end of this, Claude was spitting out ad after ad after ad. I even got it to create in Chinese.

The same ad, in Chinese, in portrait.

And since I had settled on the correct languages to reduce dimensionality for visuals, storyline, and music, Claude was able to synthesize entire campaigns automatically, while I could interact with normal conversation and nudge it along to make definitive improvements. For example, since I had the correct language, Claude could reliably change the timing, color, or position of anything I asked in plain English. My goal of Buc-ee’s meets Apple meets Michael Jackson was coming to fruition.

Unlock 5

Blur by baseline

Redacting names from real class recordings, precisely.

There were a few more things I did. Most notably, since we showcased real screen recordings of classes, I had to redact students’ names. That is as painful work as removing a mustache from a Hollywood film. In the past, my team would just put up a big blur rectangle. Now we can do this:

A real class. Every last name in the chat, blurred exactly.

I originally just asked to blur out the last names. But that was inconsistent. The final success came from asking OpenAI Codex GPT-5.6 Sol High Effort to perform a Goal Seek to remove all last names, with this instruction on how to precisely blur out each name:

PoCodex
click to skip typing
CarterLastnametext baselinetop of text line30% below15% above1 px after the previous word1 px after the last name
The blur, measured from the type itself: baseline and line top, not a box someone eyeballed.

I used Codex because it appears to be better at understanding images than Claude. Definitely GPT 5.6 Sol High was better at that than Opus 5. (I had run out of Fable 5 credits.) So I also assumed GPT 5.6 Sol High would be better at making the final video. But it turns out it was much worse than Claude. Maybe Claude is like Beethoven, who could compose even after he was deaf.

Thoughts

I never thought I’d make a post teaching how to make videos. I majored in pure math in college, and all of my later degrees are in pure math. But it seems to be that in today’s AI world, the pure math intuition for complexity and its reduction, when combined with a wide base of general knowledge/experience, is very useful.

Am I as good as a professional designer? Absolutely not. And I always admire people who explore the limits of creativity and ability. But my space of possibilities of what I can do (with very limited budget) has just expanded dramatically. For example, now I’m considering starting a video podcast series, because I can build an automatic pipeline for editing and sharing highlights.

Where, then, is the person, or is that just making more AI slop? Well actually, in this particular process, the entire goal is to create something iconic, not generic. It remains extraordinarily valuable to be a thinker who can break down big things into smaller parts, because that is what enables you to communicate your vision effectively. Generic things emerge from the lack of vision. Be iconic. Figure out what really is you.

In some sense, the core of this whole campaign came from our decision years ago to fuse the worlds of math stars, professional actors, Internet live-streaming, and social impact. That’s what took me on road trips all across the country, on my speaking and listening tours, to help people get ahead of the advance of AI. Those tours led me to discover the wonders of Buc-ee’s, which I took photos of on my iPhone, in between Michael Jackson songs.

thoughtfull
MissionNewsletter