All articles Beginner handbook

Temperature vs. Top-P: Tuning Both Settings for Fiction Prose Control

Murdok Published July 24, 2026 Updated July 24, 2026 10 min read

Most people fiddling with AI fiction generation treat temperature like a volume knob. Turn it up, things get weird. Turn it down, things get boring. That mental model isn't wrong exactly, but it's incomplete in a way that costs you hours of frustrated regenerating. The missing piece is top-p (sometimes called nucleus sampling), and once you understand how it interacts with temperature, you stop fighting your model and start actually directing it.

This guide is for anyone who's typed "temperature 0.9" into a settings panel, gotten a paragraph that either reads like a corporate press release or devolves into surreal nonsense by sentence three, and thought: there has to be a better lever than this. There is. It's two levers, used together.

Why Temperature Alone Gives You Inconsistent Results (The Top-P Blind Spot)

Here's what temperature actually does, mechanically: at every single word (technically token) the model generates, it calculates a probability distribution over thousands of possible next words. Temperature reshapes that distribution's sharpness. Low temperature makes the model cling hard to whatever word it thinks is most likely. High temperature flattens things out, giving longer-shot words a real chance of getting picked.

The blind spot is this: temperature reshapes the whole distribution, but it doesn't touch how many words are even in the running. That's a separate parameter — top-p — and if you leave it at its default while cranking temperature, you're often letting in candidate words you never intended to invite.

Top-p works by probability mass, not by count. A top-p of 0.9 means the model only considers the smallest set of words whose combined probability adds up to 90%. Top-k is the blunter cousin — it just caps the number of candidate words at a fixed number, say 40, regardless of how confident the model is. Both exist to trim the tail of the distribution before temperature even gets a chance to reshuffle it.

Here's why that matters for prose specifically. Say you're writing a tense interrogation scene and you bump temperature up to 0.95 hoping for sharper, more unpredictable dialogue. If top-p is sitting at its default of 1.0 (meaning: no trimming, consider every possible word), that high temperature is now free to reach deep into the distribution's tail — the words that showed up in training data maybe a handful of times in bizarre contexts. You get a detective who suddenly says something that reads like it wandered in from a different genre entirely. Not creative. Just wrong.

Temperature decides how boldly the model gambles. Top-p decides which bets are even on the table. Adjust one without the other and you're either gambling with no cash left in the pot, or handing your model an open bar tab.

This is the actual reason so many writers report that the "same" temperature setting feels inconsistent from session to session or model to model. If you're switching between models — say testing options covered in our best AI models for writing comparison — their default top-p values differ, so identical temperature numbers produce wildly different texture. A temperature of 0.8 on one model with top-p locked at 0.85 will read completely differently than 0.8 on a model defaulting to top-p 1.0. You weren't imagining the inconsistency. It was a hidden second variable the whole time.


A Working Map: What Different Temperature + Top-P Combinations Actually Produce in Prose

Forget the abstract math for a second. Here's what these combinations actually feel like on the page, based on the patterns I've seen repeatedly when drafting scenes and comparing outputs.

  • Low temp (0.3–0.5) + High top-p (0.9–1.0): Safe, coherent, occasionally flat. The model plays it straight almost every time, and since top-p is barely trimming anything, there's no wild card hiding in there either. Good for continuity-heavy scenes — transitions, scene-setting, technical explanations inside a fantasy magic system — where you need reliability over flair.
  • Low temp (0.3–0.5) + Low top-p (0.5–0.7): The most conservative combination possible. The model is both confident in its top pick and restricted to a tiny pool of alternatives. This produces prose that can feel repetitive fast — same sentence openers, same verbs — because you've essentially locked it into a narrow rut. Useful in short bursts, exhausting over a full chapter.
  • High temp (0.85–1.1) + High top-p (0.95–1.0): This is the "anything goes" zone. Fun for brainstorming wild plot twists or generating raw material you'll heavily edit, but risky for finished prose. You'll get incoherent word choices, tense slips, and metaphors that don't track. Treat this combo as a idea generator, not a drafting setting.
  • High temp (0.85–1.1) + Low top-p (0.5–0.75): The sweet spot most experienced AI-assisted writers land on for voice-driven prose. Temperature is high enough to push past the most predictable word choice, but top-p keeps the candidate pool tight enough that the model isn't reaching for genuinely bizarre tokens. You get sentences with more rhythm variation, occasional unexpected but still sensible word choices, and fewer flat "safe" verbs — without falling into gibberish.
  • Mid temp (0.6–0.75) + Mid-low top-p (0.75–0.85): A solid all-purpose default for straightforward narrative drafting once you've locked voice. Balanced, not showy, dependable across long stretches.

Top-k, when it's exposed by your model or interface, works as a coarser blunt instrument layered on top of this. Setting top-k to something like 40 alongside a moderate top-p adds an extra hard ceiling — useful if you notice a particular model still occasionally reaches for an odd word even with top-p dialed down. Not every platform exposes top-k separately, so treat top-p as your primary dial and top-k as a backup if your tool offers it.

One more thing worth internalizing: these numbers aren't universal constants. They shift based on model architecture, context length, and even how long your scene has run. A combination that reads perfectly for the first 400 words of a chapter can start drifting by word 1500 as the context window fills with more of its own generated text. That's a separate problem from sampling settings — more about accumulated drift — but it's why testing needs to happen at realistic chapter lengths, not just on a single paragraph.


Prompt Example: Low Temp + High Top-P for Locked-In Voice Consistency Across Chapters

This combination earns its keep in series work, where a character's narrative voice has to stay recognizable across dozens of chapters, sometimes drafted weeks apart. You're not looking for surprise here. You're looking for the model to sound like it remembers who's talking.

Settings: temperature 0.4, top-p 0.95. Continue this chapter in Mira's first-person POV. She is dry, observational, and never uses more than one metaphor per paragraph. She notices physical details before emotional ones and undercuts sincerity with short, clipped sentences immediately after. Match the sentence rhythm from the sample below exactly — average sentence length under 14 words, no semicolons, contractions always used in dialogue and internal thought. Sample voice: "The apartment smelled like burnt coffee and old paper. Figures. He always did run the machine too hot. I didn't say anything. Some habits you just let a man keep." Continue from: Mira steps into the archive room and sees the folder is missing from the shelf.

Why this works: the low temperature keeps the model from wandering toward its "default" narrative voice — the slightly purple, slightly generic tone most base models drift toward under higher settings. The high top-p means you're not artificially restricting vocabulary either; you just want the most probable word choice nearly every time, and with a strong voice sample anchoring the prompt, the most probable choice usually is the on-voice choice. This is exactly the setup you want when you're doing a full continuity pass — the kind of work covered in How to Use AI to Diagnose and Fix Sentence-Level Monotony if you find the voice locking in so hard it starts repeating sentence structures. Tweak the sample paragraph for your own character, and consider dropping the reference sample into your story bible so you're not retyping it every session.


Prompt Example: High Temp + Low Top-P for Controlled Metaphor Risk Without Incoherence

This is the combination for scenes that need heat — a first kiss, a betrayal reveal, a battle's turning point — where flat, predictable prose would undersell the moment, but where you also can't afford the model going off the rails into purple nonsense.

Settings: temperature 0.95, top-p 0.6. Write the moment Teo realizes the letter was a forgery, in third-person limited. He's standing in the greenhouse. I want emotional escalation shown through sensory detail and one unexpected, load-bearing metaphor — not more than one — that ties back to the greenhouse setting (soil, growth, rot, glass). Avoid cliché betrayal language like "world crashing down" or "gut punch." Keep sentences varied in length, but no sentence should be so abstract that a reader loses track of where Teo is standing or what he's physically doing with his hands. End the passage with him setting the letter down, not tearing it.

Why this works: the high temperature is doing the heavy lifting on word surprise — it's what keeps the model from reaching for "his heart sank" on autopilot. But without the low top-p reining in the candidate pool, that same temperature setting can just as easily produce a metaphor that has nothing to do with greenhouses, or worse, a sentence that stops parsing as English. The low top-p keeps the wilder word choices confined to ones the model was already fairly confident about, so the risk stays contained to word-choice novelty rather than structural coherence. Notice the prompt also does real work constraining the metaphor count and banning clichés directly — sampling settings handle texture, but you still need to prompt for constraint. This pairing is also worth testing on physical-detail-heavy scenes in fantasy — if you're working out how a magic system should feel sensorially, pair this setting with the constraints discussed in Fantasy Magic Systems: Constraints AI Will Respect.


Building a Personal Testing Matrix to Find Your Novel's Default Settings

Here's the honest truth: nobody hands you the "right" numbers for your book. Genre, model choice, POV style, even your own prose taste all shift what "good" looks like. The fix isn't finding the perfect published number online — it's running your own small, disciplined test and writing the results down somewhere you'll actually reference again.

Build a simple grid. Five temperature values down one side (0.4, 0.6, 0.75, 0.9, 1.05), four top-p values across the top (0.6, 0.75, 0.85, 0.95). That's twenty combinations, which sounds like a lot until you realize you're not writing twenty chapters — you're generating the same 200-word scene twenty times and reading them side by side.

Generate this exact scene using the settings I specify each time, so I can compare word choice and rhythm across runs. Scene: Detective Alvarez enters the missing woman's apartment for the first time, six days after she disappeared. Third-person limited, past tense, 200 words. Focus on what the apartment tells him before any dialogue happens. Here is the scene: [paste scene once, then run it across your settings grid without changing the prompt itself]

Why this works: holding the prompt completely fixed is the entire point. If you change the scene between tests, you can't isolate what the settings are actually doing — you're just comparing different content. Run all twenty, save the outputs in a doc labeled by their exact settings, and read through them in one sitting. You'll notice patterns fast: maybe your model gets genuinely repetitive below top-p 0.7 regardless of temperature, or maybe anything above temperature 1.0 starts breaking tense agreement. Those are your model's actual failure lines, not the ones from a generic blog post.

Once you've got a feel for your ranges, pick two or three "house settings" rather than one universal number: a conservative pair for connective scenes and continuity-heavy chapters, a bolder pair for emotional peaks and action, and maybe a wildcard pair reserved purely for brainstorming alternate directions you'd never actually keep verbatim. Log these in whatever tool you use to plan structure — if you're already using an AI book outline to scaffold chapters, note the intended "temperature register" for each chapter type right next to the beat. It turns a vague creative instinct into something repeatable.

A few practical notes on running this matrix efficiently:

  • If you're paying per token through an API key rather than a flat subscription, twenty short test generations cost almost nothing — factor this kind of testing into your planning the way BYOK Cost Control: Budget a Full Novel with API Keys recommends budgeting for revision passes generally.
  • Keep your test scene emotionally "medium" — not a quiet transition, not your biggest climax. You want a scene sensitive enough to show texture differences but not so high-stakes that grading it becomes subjective.
  • Re-run your matrix any time you switch models. A setting pair that felt perfect on one model can feel completely different on another, and this is one of the concrete differences worth checking if you're deciding between platforms — see Entangled Text vs ChatGPT for how default sampling behavior varies.
  • Once you've settled on house settings, run a chapter through at full length before trusting the pair completely. Short test scenes don't always reveal drift that shows up over 2,000+ words.

If you want the technical specifics on how a given model exposes these parameters — some platforms hide top-p entirely behind a single "creativity" slider, others expose raw values — check the Entangled Text documentation or explore the full range of free writing tools available for testing before you commit settings to a full draft. And once you've locked in your combination and drafted a chapter, don't skip structural revision just because the prose sounds right — sampling settings control texture, not plot logic, so you'll still want to run scenes through something like The Five-Pass Revision Order for AI-Assisted Novels to catch what good word choice can mask.


Start smaller than you think you need to. Pick one scene from your current work-in-progress, run the twenty-combination grid this week, and write your two house settings on a sticky note above your desk before you touch chapter one again. That's the whole system — not a universal number, just your number, tested against your actual prose instead of someone else's.

Try it yourself

Write your own book with AI — free, no credit card required.

Free · No credit card