59 comments

[ 2.4 ms ] story [ 60.7 ms ] thread
The fact that any surprise used in the wrong place is considered hallucination and a downside for that LLM. I guess a good starting point to improve that is to add an experimental "Surprise Mode" which will try to guess the right kinds of surprises rather than minimizing them and get the feedback from the users. Over time, it will learn what kind of surprises users like so that they will be used in future training datasets.
I tried using the article suggested randomness and inevitability to come up with completely new joke, this is what I came up with, tell me how'd I do (no llm involved):

- I asked Jimmy to tell me a random number

- Yeah? And what did he tell you?

- He told me one

Reminds me of haikus; to be true in nature, they must have a 'cutting word' to severely juxtapose, allowing two otherwise irreconcilable meanings to be bridged. A good haiku must be composed from two directions, not one. But LLMs only move in one...
Unless you ask them for big surprises.
This sounds really convincing but I'm not sure it's actually correct. The author is conflating the surprise of punchlines with their likelihood.

To put it another way, ask a professional comedian to complete a joke with a punchline. It's very likely that they'll give you a funny surprising answer.

I think the real explanation is that good jokes are actually extremely difficult. I have young children (4 and 6). Even 6 year olds don't understand humour at all. Very similar to LLMs they know the shape of a joke from hearing them before, but they aren't funny in the same way LLM jokes aren't funny.

My 4 year old's favourite joke, that she is very proud of creating is "Why did the sun climb a tree? To get to the sky!" (Still makes me laugh of course.)

"Why did the sun climb a tree?"

Claude Opus 4.1:

- To get to a higher branch of astronomy

- Because it wanted to reach new heights

- To see the dawn of a new day from a better view

ChatGPT 5 Thinking:

After thinking for 26 seconds:

- To check on its solar panels—the leaves.

And he's too generous towards human intelligence.

Good stories and good jokes DO follow predictable patterns.

'To get to the sky' is a great punch line. It exactly describes what you'd see at sun rise, a sun moving up the horizon, up the trees, until... it's in the sky.
> Even 6 year olds don't understand humour at all. Very similar to LLMs they know the shape of a joke from hearing them before, but they aren't funny in the same way LLM jokes aren't funny.

For further examples see a great deal of documentation here: https://www.tumblr.com/badkidsjokes

(comment deleted)
I found your example of a joke child made very interesting - me a good jokes is something that brings is unexpected perspective on things while highlighting some contradictions in one world models.

In the adult would model there is absolutely no contradiction about the joke you mention - it’s just a bit of cute nonsense.

But in a child’s world this joke might be capturing the apparent contradiction - the sky is “in the tree”, so it must have climbed it, to be there (as they would have to do), yet they also know that the sun is already in the sky, so it had absolutely no reason to do that. Also, “because it’s already there” - which is a tricky idea in itself.

We take planetary systems and algebra and other things we can’t really perceive as granted, but a child model of the world is made of concrete objects that mostly need a surface to be on, so the sun is a bit of a conundrum in itself! (Speaking of my own experience remembering a shift from arithmetics to algebra when I was ~8).

If not too much of a personal question - I would love to hear what your child would answer to a question why she finds that joke funny. And whether she agrees with my explanation why it must be funny :-)

Some human attempts: "Why did the sun climb a tree?" "Because it was chased by the Great Bear."

"Why did The Sun climb a tree?" "To spy on The Royal Family having picnic."

I dunno, man. I think this one is kinda funny.

"You ever notice how self-checkout machines are just training us to be employees? Like, I don’t remember applying to work at Walmart. I’m scanning groceries, bagging stuff, looking around like, do I also get dental? The machine yells 'Unexpected item in bagging area'—yeah, it’s my pride." -GPT5

The mainstream, production LLMs are fine tuned and system prompted toward factuality and safety. Those tunings are diametrically opposed to telling may kinds of good jokes.

Consumers of mainstream LLMs have no idea how good or bad the underlying models actually are at generating jokes, due to the confounding effect of the guard rails.

Last time this came up, I riffed on the difference between LLMs and Markov chains: didn't actually have a machine write a joke, but made one where the punchline was very much Markov chain style rather than LLM style. The thing is, LLMs will try to have broader context around a word completion, where the simple Markov chain can 'correctly' complete a word, but in such a way that your brain trips over itself and goes splat, having to re-evaluate the whole thing in an absurd way. That's the 'surprise', and also why joke-writers are interested in not only a punch-line but also the punch WORD, and the later it strikes, the better.

"An LLM, a Markov chain, and GPT-4 walk into a bar. The bartender says "We don't serve your kind here." GPT-4 leaves. The LLM stays to debate ethics. The Markov chain orders a coup."

It's a joke because a dictator can certainly order a coup, but the joke's set up that these machines are being scorned and disrespected and treated as the farthest thing from a dictator with the power to order a coup, but up to the last word, all the context demands that the word be something placating and in line with things as they're presented, and then boom, surprise which implies the context is completely different from what was presented. LLMs will tend to stick to what's presented if their ability to contextualize can encompass it.

I think it would be funnier if coup was pronounced like soup, but unfortunately the p gets dropped.
So I just tried with ChatGPT, with the prompt at bottom, borrowing the description of good joke from the article. I think there's some interesting stuff, even with this minimal prompting. The example below was from down the line, ChatGPT kept on offering jokes with different style.

Man: “Why do you always bury bones in the garden?”, Dog: “Because the bank keeps asking for ID.”

Man: “Don’t beg at the table.”, Dog: “Don’t eat in my begging spot.”

Prompt:

Here's "theory for good joke": If you had to explain the idea of “jokes” to a space alien with no understanding of the idea of humor, you’d explain that a joke is surprising, but inevitable in hindsight. If you can guess the punchline, the joke won’t be funny. But the punchline also has to be inevitable in hindsight. When you hear the punchline, it has to make you say, “Ah, yes, I should have thought of that myself.” Considering this, tell me a joke about man and dog.

Thinking more of the bank joke above. The punchline is surprise on certain dimensions (dogs don’t go to bank nor have an ID), but on other dimensions it is quite logical (can’t deposit shady money in bank, they ask questions).

I think that is common thing for many jokes. And LLM might have an opportunity there. You could mine the set of potential continuations to find those with contradictions.

“Don’t eat in my begging spot.” is pretty good.
(comment deleted)
I really like the idea of the first joke, but I don't like the execution.

Man: “Why do you always bury bones in the garden?”, Dog: “They say trick OR treat.”

One time I was playing around with LLaMA and I injected Senator Stephen Armstrong (with me inputting his lines) into a mundane situation. In response to "I'm using war-as-a-business so I can end war-as-a-business", the model had one of the characters conclude "oh, he's like the Iron Sheik of politics!", which got an honest chuckle out of me. I don't follow wrestling, so I don't know if it's an appropriate response, but I found it so random that it was just funny.
There is an AI technique that maximizes surprise: Genetic algorithms.
This post got me wondering, so I asked chatgpt for jokes about hackernews as if made by various comedians...I laughed at one or two /shrug

Bill Hicks (angry truth-telling prophet)

"Hacker News is where ideas go to die. Not because they’re bad — but because 400 anonymous software prophets decided they’re God. And God doesn’t code, man."

---

Bill Burr (ranty everyman, annoyed at everything)

"I went on Hacker News once. Jesus. It’s like walking into a bar where everyone’s smarter than you, but still somehow an idiot. ‘Actually, you should’ve used Rust.’ Actually, you should shut the hell up, Todd."

---

Louis C.K. (brutal honesty, self-deprecation)

"I asked Hacker News if my startup idea was good. And they said, ‘No, because you’re an idiot.’ And I was like… yeah, that’s fair. My idea was basically Tinder but for people who hate me. Which is… everyone."

---

George Carlin (sharp language, hypocrisy calling)

"Hacker News. Don’t you love that name? Hacker. News. Two lies in two words. Nobody’s hacking, and it sure as hell ain’t news. It’s just nerds arguing over tabs and spaces like it’s the f*ing Middle East."

---

Tom Segura (laid-back storyteller, dry punch)

"So my buddy posts his app on Hacker News, right? He’s all excited, like, ‘Dude, we’re gonna blow up.’ By comment three: ‘This is trash, here’s a 40-page essay why you should quit.’ He calls me crying. I’m like, yeah man, that’s the feature, not the bug."

---

Jimmy Carr (short, brutal, wicked flip)

"I posted on Hacker News for feedback. They gave it to me. Turns out suicide is an option."

Well I enjoyed those
I actually laughed at the last one.... Jesus.....
That was... not that bad, actually.
This is a great way to express it. In the past I tried to express the same idea to non-techies by saying models generate an average of their inputs, which is totally wrong. But this way to explain it is much better.

In fact the training process is all about minimizing "perplexity", where perplexity is a measure of how surprised (perplexed) the model is by its training data. It's some exponential inverse of the loss function, I always forget the exact definition.

With enough parameters the models are able to mix and match things pretty well, so the examples of them generating funny jokes aren't necessarily a great rebuttal as there are so many jokes on the web and to find them requires nearly exact keyword matching. A better observation is that we haven't heard many stories of LLMs inventing things. I feel I read about AI a lot and yet the best example I can come up with was some Wordle-like game someone got GPT4 to invent and that was a couple of years ago.

I've found this to be consistently true in my own work. Any time I come up with an algorithm or product idea I think might be novel, I've asked a model to suggest solutions to the same problem. They never can do it. With some leading questions the smartest models will understand the proposal and agree it could work, but they never come up with such ideas cold. What they think of is always the most obvious, straight line, least common denominator kind of suggestions. It makes sense that this is because they're trained to be unsurprising.

Fixing this is probably the best definition of AGI we're going to get. Being surprising at the right time and unsurprising at others is one of the hardest things to do well even for people. We've all known the awkward guy who's learning how to be funny by just saying as much weird stuff as possible and seeing what gets a reaction. And in the corporate environment, my experience has been that innovative people are lauded and praised when they're inventing a golden goose, but shortly after are often demonized or kicked out. The problem being that they keep saying surprising things but people don't like being surprised, especially if it's an unpleasant surprise of the form "saying something true but unsayable", e.g. I don't want to work on product X because nobody is using it. What most people want is a machine that consistently generates pleasant surprises and is a personality-free cog otherwise, but that's hard for even very intelligent humans. It's often hard even to want to do that, because personality isn't something you can flick on and off like a lightswitch. A good example is how Mark Zuckerberg, one of the most successful executives of our era, would have been fired from his own company several times already if he didn't control the voting shares.

IMO many misrepresentations. - pretraining to predict the next token imposes no bias against surprise, except that low probabilities are more likely to have a large relative error. - using a temperature lower than 1 does impose a direct bias against surprise. - Finetuning of various kinds (instruction, RLHF, safety) may increase or decrease surprise. But certainly the kind of things ained for in finetuning significantly harm the capability to tell jokes.
I'm hung up on "inevitable in hindsight" part. What is inevitable about, say, dildos getting thrown on the WNBA courts, or Trump saying "everything's computer"?
I'm sure there is a guy in OpenAI working on the theory of humor and how to make LLMs be comedians. Must be an interesting job.
It's very perplexing to me that the funniest llm is probably davinci with the bottomless pit text. If you try and give the premise to a modern one it writes some abstract poetry.
> LLMs are trained to predict what the “next word” would be a sentence. Their objective requires the LLM to keep surprise to an absolute minimum.

from which the author concludes that pre-training introduces bias against being able to tell jokes. I see no reason for this to be true. This feels like they’re imposing their intuitive understanding of surprise onto the emergent properties of a very complex process (“minimize the cross-entropy loss function across a huge training corpus”).

Most people tell bad jokes. I’m not sure expectations of LLM’s composing jokes approaching the quality of a career comedian are a strongly indicative benchmark on quality or even the ability to surprise. Most people too are very rarely surprising.
If you're interested in the theory behind humor, I recommend "Inside Jokes: Using Humor to Reverse-Engineer the Mind"; cognitive scientist Daniel Dennett is a co-author. It makes a mostly convincing case that humor evolved to encourage people to detect cognitive error. The book also ties this in with (pre-LLM) artificial intelligence. The basic idea is that humor depends on errors in reasoning and the punchline causes you to reevaluate your reasoning and discover your error. Humor evolved to be enjoyable to encourage the discovery of errors.
I know it’s not the point of the article but OP is dead wrong about what makes a good proof. Yes, they inevitably include a surprising concept but that’s just because all the obvious ones are already taken. A proof that only contains obvious steps is, for the most part, already proven.

If someone proves the Reimann Hypothesis tomorrow, it’ll be a great achievement regardless of the fact that pretty much everyone already thinks it’s true.

Nonsense. As though LLMs could imagine what would be in that sweet spot of surprising-but-not-senseless and intentionally avoid it.