Say you are trying to generate fifty product blurbs for an e-commerce catalog in one afternoon, and you need them to sound like the same brand wrote all of them without sounding like the same sentence copy-pasted fifty times. That was the exact problem sitting on my desk a few months back, and it’s the reason I finally sat down and figured out what temperature and top-p do instead of just nudging the sliders and hoping.
Before that week, my mental model of these two settings was basically “temperature equals randomness, higher number equals spicier output.” That’s not wrong, exactly, but it’s incomplete enough that I kept getting results I couldn’t explain. Some runs were flat and repetitive at settings that should have felt lively. Others went off the rails at settings that seemed conservative. The case study below is the process that got me an actual working answer, and the mechanics fell out of it naturally, which is a more useful way to learn this than reading a parameter table cold.
The Setup
The task: fifty product descriptions, same brand voice, each one needs to sound distinct even though the products themselves are variations on a theme — different colorways of the same three bag styles. Low tolerance for repeated phrasing, because a customer scrolling the category page would notice if six bags all got called “the perfect everyday companion.”
My starting prompt was solid. It had the brand tone, the product attributes, a length constraint, and a formatting spec. The problem wasn’t the prompt. It was that every batch, regardless of how I tweaked the wording, either converged on the same three or four sentence templates, or occasionally produced a description that was oddly specific in a way that made no sense for the product.
That’s the moment I stopped blaming the prompt and started looking at the generation settings instead.
First Attempt: Default Settings, Batch of Ten
Default temperature, no top-p override. Ten descriptions in, and six of them opened with some variation of “Crafted with,” followed by a material and a vague adjective. The model wasn’t wrong, it was just picking the highest-probability opening it had for this kind of copy every single time, because nothing was pushing it away from that default choice.
This is the part that took me longest to internalize: temperature doesn’t add creativity from nowhere. It adjusts how sharply the model favors its single most probable next word over the next few runners-up. At low temperature, the gap between the top choice and everything else gets exaggerated, so the model picks the safe option almost every time — which is exactly why six of my ten blurbs opened identically. There wasn’t randomness being suppressed. There was a strong default being reinforced.
Turning Temperature Up
Second batch, same prompt, temperature pushed up. Immediately, more variety in sentence openers — “Built for,” “Designed around,” “Meet the,” instead of six repeats of “Crafted with.” That part worked as expected.
But two of the ten descriptions drifted. One started describing a laptop sleeve as if it had a shoulder strap it didn’t have. Higher temperature had flattened the probability gap enough that a lower-likelihood, less accurate word got picked at a point in the sentence where accuracy mattered, and the model ran with it from there.
This is the tradeoff temperature makes visible if you push it far enough: you’re not choosing between “creative” and “boring.” You’re choosing how much weight the model gives to its second, third, and tenth-best guesses relative to its first. Turn that dial too far and some of those lower-probability guesses are going to be wrong, not just different.
Bringing Top-p Into the Picture
This is where top-p earned its place in the workflow. Where temperature reshapes the whole probability curve, top-p cuts it off. Set top-p to 0.9, and the model only considers the smallest set of next-word candidates whose combined probability adds up to 90%, discarding the long tail entirely before it even factors temperature into the choice.
Practically, that meant I could keep a moderately high temperature — enough to break the repetitive openers — while using top-p to fence off the genuinely unlikely, off-topic words that had caused the laptop sleeve problem. The tail where “shoulder strap” showed up for a strapless product was exactly the kind of low-probability territory top-p is built to exclude.
Third batch: temperature at a level that had previously caused drift, top-p capped at 0.9. Ten descriptions, no repeated openers, no factual drift. That combination — not either setting alone — was what got the batch usable on the first pass.
Why Neither Setting Alone Solved It
Running temperature back down while leaving top-p untouched brought the repetition straight back, because a narrow probability curve doesn’t need a tail cutoff — there’s barely a tail being considered in the first place. Top-p only matters once temperature has widened the field enough for it to have something to trim.
And running top-p very low while temperature stayed high didn’t fully fix the drift either, because a high enough temperature can still meaningfully favor a candidate near the edge of even a tightly capped set. The two settings interact rather than stack independently, which is the part that made isolated tweaking so unproductive in my first two attempts. Changing one without accounting for the other just moved the problem instead of solving it.
What Finally Worked, and Why It Held Up Across the Full Batch
The combination that got me through all fifty descriptions cleanly was a moderate-high temperature paired with a top-p around 0.9. Moderate-high temperature kept sentence structure and word choice varied enough that the brand voice didn’t collapse into three templates. The top-p ceiling kept the model from reaching for details it had no basis for, since those details tend to live exactly in the low-probability tail that setting was cutting off.
I ran the same combination on a second, unrelated batch — internal FAQ answers instead of product copy — expecting to have to recalibrate from scratch. I didn’t need to change much. The settings that solved “avoid repetition without inventing facts” turned out to generalize across tasks that shared that same underlying tension, which told me the fix wasn’t specific to bags and laptop sleeves. It was specific to that particular failure mode.
A Rough Guide for Where to Start
None of this requires memorizing exact numbers, because the right setting depends on your task, but the general relationship holds across most use cases I’ve tested since:
| If your output is… | Likely cause | Try adjusting |
|---|---|---|
| Repetitive, same phrasing every run | Temperature too low, probability curve too sharp | Raise temperature slightly |
| Inventive but factually loose or off-topic | Temperature too high, tail candidates getting picked | Lower top-p to trim the tail |
| Both repetitive AND occasionally wrong | Settings fighting each other, not tuned together | Adjust temperature and top-p as a pair, not separately |
| Consistent, varied, on-topic | You’ve found the right combination for this task | Save it as your default for similar work |
What I’d Do Differently Next Time
I’d skip the two batches I burned figuring this out the slow way and go straight to testing temperature and top-p together instead of one at a time. Treating them as independent dials was the mistake that cost me the most time — they only make sense as a pair once you’ve seen what happens when you separate them.
If you’re running a repeatable content task through the same prompt over and over, it’s worth running that same small experiment yourself: one low-temperature batch, one high-temperature batch, then a version with top-p capped down while temperature stays elevated. The pattern that emerges will tell you more about your specific task than any general guidance, including this post, ever could.
🔗 Recommended Reading
- Function Calling and Tool Use in LLMs: A Practical Guide
- Prompt Engineering for AI Video Generation: A Sora, Runway, and Pika Guide
- Prompt Engineering for Multimodal AI: Working With Images, Text, and Voice
- AI Prompt Security Best Practices for Enterprise Teams
- Prompt Versioning: How to Track and Manage Changes to Your AI Prompts Over Time