Skill 2.3.1

Tune generation behavior, such as prompt engineering and adjusting model parameters

Key Concepts

Prompt engineering techniques include a clear role and task in the instructions, delimiters around supplied content, explicit output formats or JSON schemas, a few input-output examples (few-shot prompting), decomposition of complex tasks into steps, and instructions for uncertainty such as "If the sources do not contain the answer, say so". Prompts are versioned and evaluated like code.

Parameters adjust sampling. Temperature (0 to 2) and top_p control randomness; adjust one, not both, and use low values for extraction and factual answers. max_output_tokens bounds length and cost; a truncated response reports an incomplete status. Reasoning models do not accept temperature and instead take a reasoning effort (such as minimal, low, medium, high) that trades quality against latency and cost. When prompting cannot achieve a consistent format or style, fine-tuning is the next option.