I have a "Projects Inbox" note that I use as a catch-all for project ideas. It includes things like "Real-time absurd slides generator game" and "AI-filtered RSS feed" (which ended up being Patronus). I was revisiting it last night and found "Generate a joke based on the punchline". And that's Punchline.
With Cursor cooking up the simple frontend and workflow in about ten minutes, most of the actual work revolved around getting LLM inferences to reliably generate jokes that were actually funny. Even Claude, a model family that I subjectively find to be far superior to other models in terms of capturing the nuances of language and intent, struggled to make funny jokes out of the box.
Since the whole point of a small project like Punchline is to find humor and surprise in potentially any short and otherwise mundane sentence, I originally wanted the prompts to be the least prescriptive possible: no references to specific comedians, no few-shot examples, no definitions of what makes something funny. With a sufficiently capable (i.e. funny) model, these methods would unnecessarily constrain the space of possible jokes to interpolating between whatever the model has seen in training data, or perhaps cause the model to adopt an excessively analytical persona. Alas, I found the results to be funny only in an absurdist, deadpan sense, with most of the kick coming from the whole joke not making sense in a dry sort of way, or the punchlines being vanilla non-sequiturs that got boring after a few generations.
Ultimately, I opted to trade some of that optimistic hope in emergent humor for what felt like just enough hand-holding to get results that I found funnier: I included examples by Mitch Hedberg and Norm Macdonald, and an outline of a short joke structure and why it's funny. The results still aren't always hilarious, but I find that with just a few runs for a given punchline it'll give me something that actually makes me laugh out loud.
Back to Top