Can AI Write Jokes?

In which I try to activate ChatGPT's funny bone

Can AI Write Jokes?

Disclaimer: this is a loooong post. A dive into comedy, writing and AI so deep you might need breathing apparatus to survive it.

The casual reader might like to duck out after…

THE TL;DR:

My method to teach an AI to write jokes was as follows:

  1. Give ChatGPT an example of what I considered jokes (in this case, a 5 minute set from my doomed stand up comedy career).
  2. Ask it to review and rewrite the jokes to see what it knew about jokes.
  3. Correct its rewrites of jokes with the rationale behind the correction so it could learn more about joke structure.
  4. Check how its knowledge of structuring jokes had improved as a result.
  5. Ask it to rewrite the original jokes using that knowledge.
  6. Review its rewrite and provide more examples of joke structure with chain of thought rationale.
  7. Check how its knowledge had improved.
  8. Ask it to create original jokes.
  9. Review the results. They still needed a human to make them actually funny but there was material I could work with.

If you’re in for the long haul, welcome traveller!

Since we’re in the world of jokes,we should start with…

THE SET UP

Why did I call this place ‘Jokes and Pain’?

Because jokes and pain are innately human and being human in an algorithmic world is what this Substack is about.

Where’s the crossover between AI and humans? Where do we differ?

Machines know nothing of jokes and pain.

Or don’t they?

Let’s test that by seeing if I can teach a machine to write jokes.

But first, we need to go back in time to establish…

MY COMEDY CREDENTIALS

I used to get paid to write jokes for Chris Tarrant and Steve Wright (who? Ask your dad) when they were on the radio. The deal was I would write jokes based on the day’s headlines and if 20% or more of my jokes, or a rewrite of my jokes, got used, I would get paid.

That gave me the idea that I wanted to be a stand up comedian. I used to write 10 jokes a day before I got out of bed and went to work. I say ‘jokes’, they weren’t the finished article. There’s a piece of comedy writing advice that suggests calling these first drafts ‘jokoids’. They have a joke-like structure but they’re not fully-fledged jokes and you shouldn’t judge them as such so you don’t kill them before they have life.

Anyway, I distilled my jokoid archive into a ‘best of’ list. These were the ones I thought:

  1. Had the best chance of being honed into actual jokes
  2. Could be connected together to create a 5 minute set.

I would work up a 5 minute set, then perform this set at the Frog and Bucket’s ‘Beat the Frog’ night. If you’re unfamiliar with the format, comedians take the stage and try to last 5 minutes without being voted off by a panel in the audience.

Reader, I lasted less than 2 minutes.

But I’m glad I tried because now I’ll never wonder “what if?” about my lack of stand up comedy career.

I don’t think the material was the problem so much as I failed at the human parts of being a comedian:

  • I was so nervous I could not look the audience in the eye, I did not own the space.

  • I had not rehearsed my material enough.

  • I didn’t deliver the material with any change in tone or pace. There was no ‘colour’.

  • Instead of collaborating and sharing an experience with the audience, I set myself apart from them, both with the material and with my lack of interaction.

    • Side note, I discovered that I hate crowd work: “Who are you and where are you from?” I simply could not care less about the answers to those questions

But the jokes are still sitting around doing nothing.

THE MATERIAL

So, I thought it would be fun to take a look at that set again and test the idea, almost universally held, that machines don’t do jokes.

Here’s the set unedited, don’t @ me. No, I don’t know why I called myself Chris Cobb.

Hello I’m Chris Cobb - this is what 50 looks like

It’s been said I have the body of a Greek god… it’s only of interest to museums and my cock is broken

No, seriously, I’m sexual dynamite...I can destroy a relationship with one bang

Anyway so yeah I’m over 50 and at this age my support network consists almost entirely of country and western songs… and my number one source of physical contact was flying economy class

On the positive, I recently discovered I’ve achieved partial invisibility, yes, it’s true… attractive women can’t see me. They’re out in the crowd now wondering where this voice is coming from.

And I’m comforted by the fact that if I die home alone, at least the dog will have something to eat while my body is waiting to be discovered

I’m exaggerating... my life’s not like that…

My current girlfriend’s a model. Yep true story. An actual model… it took me 6 months to build her

Then there was that time I went travelling with this amazing woman. Unfortunately, the tram stopped and she got off before I could ask her name and introduce myself

My last serious relationship, I was dating this woman, she was a poet. She called me her shining star, “it’s because I light up your life isn’t it?” I asked. She said no. it’s because you’re distant and unreachable”

I knew that relationship wouldn’t last, but I didn’t care. I figured this Conservative government would kill us before we came to resent each other’s breathing.

Then one day I wondered… was this relationship the Monday morning train to work? Because I wished I wasn’t in it. And that, my friends, was that.

A Monday morning is like Mrs Brown's Boys. They keep making them but you never meet anyone who actually likes them

Because Monday is back to work. And yeah so work there’s another thing. When you’re a kid, nobody tells you there’s gonna be so much of it, the alarm goes off I’m like “work again? Didn’t I do that just yesterday?”

It’s not that I’m afraid of hard work, nothing like that... I’ve seen with my own eyes that hard work does bring the rewards. I know if I go out and put in a full day every day, maybe do some evenings and weekends as unpaid extras... then my boss can afford to rent a flat for their side piece and go on holiday somewhere sunny 4 times a year

Living the dream...

So anyway, I get out of bed, I’m in front of the mirror and I want to think my Monday morning style makes me look like I got dressed in a rush because I just left a new lover asleep in bed and I’m running late

In reality, my work clothes are like when you see cling film stretched over a broken car window. You know like when you need something there to cover it but you’re in a hurry and you really don’t want to spend any cash on it?

Some nods from some of the boys there. They know what I’m talking about

Anyway, there’s a bloke at work we call the Elephant - no not because he never forgets, his memory is terrible… his shits are massive

Don’t take life too seriously, play nicely. I’m Chris Cobb thank you very much

Even though I say it myself, objectively this is not terrible material. There are entities recognisable as actual jokes. But there’s an overwhelming lack of joy, this guy doesn’t seem to like himself so why should an audience?

TEACHING A MACHINE TO BE FUNNY

Next I wanted to start training the AI to do jokes.

First, let’s get ChatGPT to review the current set and see what it understands about comedy…

As a comedy writer, review the following 5 minute set from an aspiring comedian. What works? What doesn't work?

Suggest rewrites where you think you can improve the joke and provide the rationale for why you think your version is better. You must use UK cultural references and UK spellings everywhere, no US references or language.

Do not consider stagecraft at this point, focus only on the material. Based solely on the material in front of you, what advice would you give this comedian to improve their joke writing? Provide all notes as a bullet list.

After processing my original set, it came back with:

  • What it classed as ‘working’

  • What it classed as ‘not working’:

    • Too many “invisible and over 50” references

    • “Cock is broken”, “shits are massive” - too crude.

    • Muddled, over complex delivery for some lines

  • And some rewrites of the material

It also had an ‘Overall Writing Advice’ section which suggested including more specificity, more contrast/ incongruity and calling back to earlier jokes. This was very useful. It was the start of a joke writing checklist I could give the LLM so it could write its own jokes.

Then there were ChatGPT’s rewrites. This is where it was weakest.

I’ll break down just one of its rewrites.

ORIGINAL: No, seriously, I’m sexual dynamite...I can destroy a relationship with one bang

CHATGPT REWRITE: I’m sexual dynamite — more like one of those dodgy fireworks from a car boot sale. Goes off once, leaves a terrible smell, and everyone regrets gathering round to watch.

Hmm, I can see what it’s reaching for but there’s no connection between ‘sexual dynamite’ and the ‘dodgy fireworks’. And it takes too long to get to the payoff, too many words.

MY REWRITE: I’m not so much sexual dynamite as a Poundland firework… not much to look at with only smoke and regret for afters.

My RATIONALE for the rewrite: it’s faster to the punchline. Now initial ‘sexual dynamite’ and ‘Poundland firework’ are connected and there’s a good incongruity between the two elements. Lastly, it takes the specificity note from earlier with Poundland.

Next, I went through each of ChatGPT’s rewrites noting:

  • the original,
  • the ChatGPT rewrite
  • how I would rewrite it
  • and my rationale for the rewrite

Then fed those four or five notes back to ChatGPT so it could learn what I considered a good structure for a joke because its next job was to rewrite the existing set.

In AI terms, this would constitute ‘few-shot’ learning. I’ve provided a few examples of the output I want and the chain of thought that goes into it.

I built a prompt containing the checklist so far and the few-shot examples of rewrites and asked it to rewrite my original set.

Here’s ChatGPT’s rewritten set:

Hello, I’m Chris Cobb — this is what 50 looks like.

It’s been said I have the body of a Greek god. Yeah — only of interest to a museum.

I’m not so much sexual dynamite as a Poundland firework: one disappointing bang, then smoke and regret for afters.

Anyway, over 50, your support network changes. Mine is basically Radio 4 and a rescue greyhound. My main physical contact was flying Ryanair in economy.

On the upside, I’ve developed partial invisibility. Attractive women literally can’t see me. They’re sitting there now wondering where this voice is coming from.

But if I die alone, at least the dog will get a decent meal while my body waits for the gas man to discover me.

Look, I exaggerate — it’s not that tragic. I’ve got a girlfriend. She’s a model. True story. It only took me six months to build her.

I’d have brought her tonight, but her batteries were flat.

I did try actual human dating. One time, I went travelling with this amazing woman… then the tram stopped and she got off before I could even ask her name.

I dated a poet once. She called me her shining star. I said, “Because I light up your life?” She said, “No, because you’re distant and unreachable.”

I knew it wouldn’t last. But I didn’t mind — this government will probably finish us all off before we get round to hating each other’s breathing.

Sometimes I wondered if that relationship was like the Northern Rail service on a Monday — guaranteed to make you miserable and never on time.

Speaking of Mondays — they’re like Mrs Brown’s Boys. They keep coming back, but nobody likes them.

No one warns you about work as a kid. The alarm goes off and you think, “Work again? Didn’t I do that yesterday?”

I’m not afraid of hard work. I’ve seen what it brings. You graft every day, throw in some unpaid weekends, and your boss can afford to keep his side piece in a two-bed in Salford and still do four trips to Lanzarote.

Living the dream, eh?

I get out of bed and try to dress like I’m running late from a secret lover’s flat. But honestly, my work clothes are more like cling film over a smashed car window — something to cover the damage so nobody calls environmental health.

Some of the lads here know what I’m talking about.

Anyway, there’s a bloke at work we call The Elephant. Not because he never forgets — he’s thick as mince — but because the disabled loo is out of action for a day after he’s been in it.

Don’t take life too seriously. Play nicely. I’m Chris Cobb, cheers.

Not bad eh? I’ve heard way worse sets at open mics.

I like what it’s done with the specificity, it’s added more conversational links so it’s not just a string of one-liners although it still needs work in that area.

But there are some changes that I don’t like and/ or don't make sense.

So, I needed to give it more examples to train it further.

Here’s one that both doesn’t make sense and I don’t like it:

CHATGPT EDIT: Anyway, there’s a bloke at work we call The Elephant. Not because he never forgets — he’s thick as mince — but because the disabled loo is out of action for a day after he’s been in it.

ME: (reverts back to the original) Anyway, there’s a bloke at work we call the Elephant - no not because he never forgets, his memory is terrible… his shits are massive.

RATIONALE: it’s faster to the punchline. Rewrite doesn’t make sense, why is an elephant using the disabled toilet? And I just want to do a base joke as a sign off, it’s my show.

Again, I fed these back to ChatGPT so the AI could learn more about jokes and their structure.

Then I asked it what it ‘knew’ about writing jokes.

WHAT DOES A MACHINE KNOW ABOUT BEING FUNNY?

Here’s the checklist it came back with:

✅ Is the punchline as close to the setup as possible?

Cut any flab or slow build-ups. Every word earns its place.

✅ Am I using UK language, spellings and references? Poundland, Ryanair, Greggs, Northern Rail — avoid Americanisms.

✅ Is there a specific, relatable detail anchoring the joke? Brand names, local services, realistic examples.

✅ Does the joke set up an expectation and flip it clearly? Use strong contrast or incongruity. Keep the logic easy to follow.

✅ Is the wording simple and conversational? Avoid clunky or overwritten metaphors. Keep the rhythm tight.

✅ If repeating a theme, is there a fresh angle or escalation? Don’t hit the same note twice without adding something.

✅ Does the line stay true to my self-deprecating, honest voice? It should sound like me telling the truth, even if exaggerated.

✅ Can I build in a callback? Look for jokes to reference later (the “model girlfriend” etc.).

✅ Is any base humour justified and simple? Go for a strong visual image; don’t overcomplicate a poo joke.

✅ Does the logic hold up? If it could happen in real life, it should make sense in the joke.

✅ Is every metaphor connected to the setup? Don’t force an analogy that doesn’t track clearly with the premise.

This is pretty neat. I’ve trained the AI to at least have an idea about how to structure a jokoid.

THE MACHINE WRITES JOKES

Now ChatGPT has got a checklist of how I would write, examples of what I consider a good joke structure and why - let’s see if the training has worked and it can write its own jokes using that information.

I asked it to write 10 original jokes that could go into the set.

Here are ChatGPT’s 10 jokes:

  • I’ve reached an age where I’m less ‘Netflix and chill’ and more ‘BBC iPlayer and deep vein thrombosis check’.
    (tight, UK reference, clear contrast)
  • My GP told me to watch my drinking, so now I do — pint after pint, absolutely mesmerised.
    (simple, conversational, relatable)
  • You know you’re over 50 when your idea of a wild weekend is managing to get round Aldi on a Saturday without screaming.
    (strong UK anchor, escalation of age theme)
  • They say you shouldn’t date your type. That’s fine, my type’s never been interested in me anyway.
    (self-deprecating, simple, quick)
  • My dating profile says ‘active outdoors’ — which is technically true, if you count chasing the dog round the garden trying to get a sock back.
    (specific, British, believable)
  • I’ve got a smartwatch. It mainly counts how often I stand up in the night for a wee.
    (relatable, honest voice, no wasted words)
  • I went on a lads’ holiday to Magaluf once. There were three of us, so we called it the tripadvisor one-star review tour.
    (UK holiday culture, quick punchline)
  • I bought one of those fancy memory foam mattresses. Apparently it remembers I’m single and lonely and tries to suffocate me every night.
    (contrast, self-deprecating, relatable)
  • At this age I’m not ghosting anyone — I’m just taking three working days to reply.
    (escalation of dating jokes, modern and relatable)
  • I worry if I ever have a heart attack, people will just think I’m buffering.
    (tight punchline, clear incongruity, modern reference)

You can see it’s also provided a rationale of sorts to explain why it thinks this is a match on the joke structure. That’s a nice feature and would help with further training.

My review, the jokes display a jokoid structure but:

  • Some don’t make sense: dating your type??? Magaluf/ one star??? What is it talking about?
  • Even more are just boring ‘old person’ references that even Last of the Summer Wine writers would baulk at: Netflix and Chill, smartwatch, Aldi, ‘active outdoors’, 3 working days.
  • And one I think I’ve heard before: mesmerised.

But there are two jokoids in there to build an actual joke from: the mattress and the heart attack.

I’d rewrite the mattress as follows:

REWRITE: My ex bought me one of those fancy memory foam mattresses. It remembers why we broke up then tries to suffocate me every night.

RATIONALE: much greater incongruity: a gift Vs attempted murder with a clear justification left to the audience’s imagination.

And the heart attack as:

REWRITE: Now we’ve got virtual reality, how are we going to know what’s real? I worry if I ever have a stroke, people will just think I’m buffering

RATIONALE: without VR or equivalent, no clear justification for why people would think I’m buffering. And I think a stroke is a more ‘top of mind’ reference in the UK.

THE PUNCHLINE

With a little rewriting, I can use 20% of the jokes it created so, applying the criteria of my first joke writing gig, ChatGPT would have got paid.

But too many of the jokes just failed the most basic test, they just weren’t funny.

ChatGPT has shown it can be trained to structure a joke but the machine lacks an ability to take a risk, a distinct voice or point of view and, perhaps most importantly, can’t ground the material in lived experience.

So, for now, jokes remain essentially human.

BONUS: still here? I applaud your stamina. If you’ve got room for even more, you can read the full conversation between ChatGPT and me aka ‘the making of’ this article.

Thanks for reading! Subscribe for free to receive new posts and support my work.