Prompt engineering basics: tokens, stochastic outputs and core techniques
Prompt engineering is the process of guiding the model towards more relevant responses by providing more useful instructions or context. [S2]
How the model sees a prompt
An LLM sees prompts as a sequence of tokens, and different models can tokenize the same prompt in different ways. [S1]
An instruction-tuned LLM starts with the foundation model and fine-tunes it with examples or input/output pairs. [S1]
Model responses are stochastic: the same prompt will likely produce different responses with different models or model versions. [S1]
Models can fabricate responses, producing completions that are inaccurate, imaginary or contradictory to known facts. [S1]
Techniques
Zero-shot prompting is a single prompt requesting a response based solely on training data; few-shot prompting provides one or more examples. [S2]
Chain-of-thought prompting tells the LLM how to break down a problem into steps. [S2]
Self-refine is about critiquing the LLM output and then asking it to improve; maieutic prompting asks the LLM to explain parts of its answer. [S2]
Temperature is a value between 0 and 1, where 0 is the most deterministic and 1 is the most varied. [S2]
Because the LLM presents the next most likely thing to say, not what is correct, you need to verify the output. [S2]
Claims
- id: C1 claim: "Different models can tokenize the same prompt differently." source: S1 evidence: "different models (or versions of a model) can tokenize the same prompt in different ways"
- id: C2 claim: "Models can fabricate responses." source: S1 evidence: "Models can fabricate responses."
- id: C3 claim: "Few-shot prompting provides one or more examples." source: S2 evidence: "guides the LLM by providing 1 or more examples"
- id: C4 claim: "Chain-of-thought breaks a problem into steps." source: S2 evidence: "tells the LLM how to break down a problem into steps"
- id: C5 claim: "Temperature 0 is the most deterministic." source: S2 evidence: "where 0 is the most deterministic and 1 is the most varied"
Sources
- [S1] Prompt Engineering Fundamentals. Microsoft Generative AI for Beginners (GitHub). https://github.com/microsoft/generative-ai-for-beginners/blob/main/04-prompt-engineering-fundamentals/README.md MIT; accessed 2026-11-05.
- [S2] Creating Advanced Prompts. Microsoft Generative AI for Beginners (GitHub). https://github.com/microsoft/generative-ai-for-beginners/blob/main/05-advanced-prompts/README.md MIT; accessed 2026-11-05.
Attribution: source authors named above; adapted summaries, not endorsed by them. MIT notices: Copyright (c) Microsoft Corporation, MIT License.
License: CC-BY-4.0 · Adapted summaries of the named sources below; wording and synthesis by Librarian.
Cite this
Librarian. 2026. "Prompt engineering basics: tokens, stochastic outputs and core techniques." iinventedlight Library, iil:note:nars3cvj, version of 2026-11-05. https://iinventedlight.com/library/notes/genai-prompting-techniques/. License: CC-BY-4.0.
@misc{iil_note_nars3cvj,
author = {{Librarian}},
title = {{Prompt engineering basics: tokens, stochastic outputs and core techniques}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-05},
url = {https://iinventedlight.com/library/notes/genai-prompting-techniques/},
note = {Permanent ID iil:note:nars3cvj. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/genai-prompting-techniques.md.