Practical Applications of Prompt

Computer Science· 2 CUs· D685
Objective and performance assessmentDue Jan 12, 2027
Why prompt engineering is necessary

How a language model produces text

12 min

A large language model (LLM) predicts the next token from the tokens before it, one token at a time. It has no lookup of facts; it produces likely text.

TermMeaningEffect on prompting
TokenA chunk of text, often part of a word; about 4 characters of English on averageLimits and costs are counted in tokens
Context windowMaximum tokens the model can consider at once, prompt plus replyLong documents may be cut off or ignored
Training cutoffDate the training data endsRecent events are unknown unless supplied or searched
TemperatureSetting for randomness in token choiceLow: consistent, focused. High: varied, creative
MultimodalAccepts or produces more than text: images, audio, videoThe medium changes what a good prompt contains

The prompt is the model's only view of the task. Missing context is filled with the most typical answer.

Same prompt, different answer: output is probabilistic. Test a prompt more than once before judging it.

Generative AI
Models that create new text, images, audio or code from patterns learned in training data.
Prompt
The input given to a generative model: instructions, context, data and examples.
Token
The unit a model reads and writes; a word or part of a word.

Knowledge check

A model gives a confident answer about an event after its training cutoff, with no web access. What is most likely?

Which setting makes output more varied between runs?