Giving Language Models LSD

How to make your model more creative

While at work this week, I had a conversation with a colleague about creative coding. There are multiple interpretations of what creative coding precisely is, but my main point of reference is Daniel Shiffman’s videos on The Coding Train. Specifically his generation of the Mandelbrot set, fractal trees, and of course Git for Poets.1 During my studies I had to create fractals and the Mandelbrot set as well, and I always found it fascinating how these simple algorithms can produce what I think is a form of natural art.

However, that’s kind of where my ‘creative coding’ career ended (if it ever really began). I’ve had Nature of Code and Generative Art on my wishlist for years, but never really had the urge to work with any of their frameworks.2 If anything, I would love to understand and use Strudel, but this too is too much of a time investment at the moment. Luckily, my domain of choice can be used for creative coding as well, as you can in theory generate stories, poems and entire books with LLMs (whether they are any good, and whether we even want this, is of course another question).

Creative Models

Anyway, you’re probably wondering what I am on about, and why I want to give LSD to these models. As I explained in last week’s note, an LLM generates text by predicting the most likely next word (or part of a word) over and over again. Now if it would always pick the most likely word, it could repeat itself, fall into loops and in general be overly predictable. If you asked it to “Write a story”, it would always produce the same story, and it would probably be a shitty one at that.

To combat this, these models don’t just pick the most likely word, but rather use other picking strategies over the range of probabilities for the next word. These often come with a knob (you might have heard of changing the temperature of a model) that you can turn to increase or decrease the randomness of the generation.3 While this is not great if you want a deterministic output, it is very useful, especially in creative writing, as it makes your story less predictable.

While looking at the garden path sentences, I saw that the chance of the word accumulates being generated after fat people eat was 1 in 16 million. Now here was my, most likely incredibly stupid, idea. What if instead of always picking the most likely next word, you always pick the least likely one? That might have created this very strange but technically grammatical sentence. I call this decoding strategy Least-likely Sampling Decoding, or LSD for short.

I’m not trying to sound like a broken record, but of course I found out this has been tried before. This time though, it is not just the idea that was tried (although in a different way than I imagined), they even used the same idea for the name. Their XTC (Exclude Top Choices) every so often removes all the most likely words except the least likely of them, which is probably the better idea, as it makes sure your sentences are still comprehensible. However, them forcing the X in the acronym gives them minus points, so I think we’re tied again.

What’s the idea

The method is simple. We give a model the beginning of a text and let it complete the rest. Now, to stick with creative writing (and because I miss playing it), I forced the model to complete my favourite D&D moment from my old campaign, in which I (Ghurkem, a self-absorbed orc) destroyed the most beloved item of Leto (an even more self-absorbed elf). I also thought of asking for some final PhD advice, as I am in my final year right now and could use every piece of help I can get.

Seven people in black T-shirts posing on the steps of a brick canal house, behind a garden of white roses.Seen from the stairwell above: people around a green table, one of them drawing a map on squared paper, next to a round blue table with dice and papers.Four people leaning over the green table in a marble hall full of old portraits while one of them draws in a book.
Our D&D group, during our final session in Museum van Loon.source: Own photos

The model then takes these texts and generates its completion word for word. We can compare the normal way of generating to its LSD counterpart to see what effect it has on the model. I honestly have no idea if it will work, but that’s what these notes are all about in the end.

Where did the banjo go?

Let’s start with poor Leto, and his rebuttal to my actions.

Always the most likely word

While Leto was asleep, Ghurkem took his banjo and threw it in the river. Once Leto woke up, and saw his banjo was missing, he screamed:

"Ghurkem! Where is my banjo?!" Ghurkem replied: "I threw it in the river." Leto said: "I know you threw it in the river, but I don't know where you threw it in the river. I know you threw it in the river, but I don't know where you threw it in the river. I know you threw it in the river, but I don't know where you threw it in the river. I know you threw it in the river, but I don't know where …

First the original model, just generating the most likely next word. It starts off correct (although not really interesting, bad roleplaying IMO), but then gets stuck in a loop. This is precisely why this sampling strategy never really gets used, and you always add some chance over the distribution of the predictions.
Increasing the ‘temperature’ (the usual creativity boost), we already get something much more interesting. But after turning Ghurkem into a male lion for no apparent reason, it goes completely off the rails.
The moment of truth. Will LSD do something interesting? Hmm. Interesting it is, but also completely nonsensical, as I feared. However, this is if it always picks the 1000th most likely word, which is probably a bit too strict to begin with.
If we turn it all the way down to the 5th most likely word, we get back something sort of coherent and arguably very creative too. The Chinese start put into Google Translate becomes: “What does this mean? Let’s say he wakes up, discovers his guitar is gone, and bursts into tears.” So it got some of the semantics right, but just starts rambling in Chinese?
The other plan was to only introduce it every so often (microdosing?), so the model can recover afterwards (hopefully). Now I’m not saying this is great by any means, but it is coherent and at least all in the same language (celebrating the little victories). And even better, this is actually something Ghurkem could’ve said in his constant drunken state, so I’m taking this as a victory.
Finally, introducing it with a 5% chance seems to somehow work the best. I’m glad Leto clarified he knows adjectives and Kyrgyzstan, great work Leto!
I was shocked to see the effect of XTC (the other sampling method), as I absolutely love the ZAAAAAAHTT, as if Leto was some sort of Count Dracula. To my relief though, it isn’t even introduced by their special sampling, but is just the model’s normal generation. Lucky me.

Every ZAAAHT comes from the same roll of the dice

TextSamplingOpeningRank of ‘Z’
BanjoTemperature 1ZAAAHTTTTTTTT!!!!643
BanjoTemperature 1.5ZAAAHT why did they deform ships643
BanjoXTCZAAAHTTTT! Throwing646
PhD adviceTemperature 1.5ZAAAHT why dopamine consumption deform ships1,397
Each run gets a seed: the list of random numbers the sampler draws from. On seed 0 the very first draw lands far down the list of possible words, so ' Z' (about the 640th most likely first word, a 1 in 11,000 chance) comes out whatever the sampler. The normal sampling in the scrolly above uses another seed. Even a third prompt I tried opens with 'Zahn' on this seed.source: Own analysis, Qwen3 1.7B

Can it save my PhD?

I’m feeling very confident in its capabilities, so it must therefore be a great advisor, and provide me with the much-needed help for my PhD.

Always the most likely word

I'm in my final year of my PhD in Computer Science, here is the best advice I could give someone:

1. Don't be afraid to ask for help. 2. Don't be afraid to ask for advice. 3. Don't be afraid to ask for criticism. 4. Don't be afraid to ask for feedback. 5. Don't be afraid to ask for guidance. 6. Don't be afraid to ask for support. 7. Don't be afraid to ask for encouragement. 8. Don't be afraid to ask for motivation. 9. Don't be afraid to ask for inspiration. 10. Don't be afraid to ask for …

Again, super bland, although not terrible advice I guess? You just have to ask for help apparently, which is what I just asked this model for. I should be good.
Putting the temperature all the way up surely boils the model’s brain, and somehow always turns it to just say ZAAAAAHT, which might just be its new catchphrase?
Another seed provided some more solid advice, luckily.
Now we don’t have to try the least likely word anymore, as it will produce just garbage…
…but using it every 10th word seemed to work okay-ish. Now this is more what I’m asking for: going straight for the stone-cold cash seems like perfect advice for a PhD.

Don’t do drugs kids

While it was interesting to dive a bit into tokenisation, a step whose importance I think is often underrated, it turned out LSD ain’t good for a model this size. At least not for practical use cases, although I could’ve probably guessed that doing the opposite of what makes these models so good would make them this bad.

Still, I think it would probably work a lot better if tested on larger models, but I don’t think it’s worth the time and effort (or energy consumption) to test it out. I’ll leave this to the next person to come up with the same idea, which most likely will never happen.

For now it’s mostly a reminder that most good things have already been done, and that I love reminiscing about my old campaign. Don’t do LSD, play D&D.


Technical report

  • Data: two openings of my own (the banjo story and the PhD advice), each completed for 150 tokens with three seeds per sampling strategy
  • Model: Qwen3 1.7B, base version, run locally
  • Sampling: normal sampling is temperature 1 with top-p 0.95; LSD picks the 1000th (or 5th) most likely token, at every token, at every 10th token, or with a 5% chance at each token; XTC with threshold 0.1 and probability 0.5. Highlighted words in the scrollies were picked by LSD or XTC
  • References: Weidmann et al. (2026) for XTC
  • Code: Python (transformers), Astro and GSAP (the scrambling text)
  • Coding agent: Claude Opus 5.5 (in Claude Code), which also wrote this technical report