liveBook · Manning

Instruction

As explained in LLMs in Production

The instruction component of a prompt is the task-specific directive that specifies what the language model should do.

An instruction is the task-specific directive inside a prompt: it tells the language model what to do and can range from a brief command to a detailed behavioral template. Structured instructions improve the chance of a useful response. section 7.2.1

From question to directed answer

A basic template uses “Q: How much does the company match for our 401k? A:”. A stronger instruction adds behavior: “Answer the following question and explain it as if the user was a five-year-old.” section 7.2.1

Use instructions to:

  • Encode task-specific information in a reusable prompt template. section 7.5
  • Direct response behavior, such as explanation level, while leaving factual context to retrieved documents or other lookups. section 7.2.1
  • Balance specificity against generality: detailed directions can improve a particular result, while fewer examples and less specialization make prompts more general-purpose. section 7.5

How LLMs in Production covers it

How deep it goes
Defines the instruction’s role and illustrates it with Q&A and audience-level examples, without examining model internals.
Examples
Uses a 401k Q&A template and an instruction that explains the answer as if addressing a five-year-old.
What it assumes
Assumes familiarity with prompts and language-model interactions while distinguishing instruction from input, context, and system directives.
What you can do after
Apply it via a prompt template to specify a model’s task and desired response behavior.
How it connects
Connects instructions with input, context, system prompts, prompt templates, retrieval-augmented generation, and few-shot prompting.

Also explained in

Compare how 5 books explain instruction →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLMs in Production. The section links point to the parts of the book it draws on.