Search⌘ K
AI Features

Specifying a Summary Length

Explore how to effectively specify summary length in prompts to control AI-generated text size. Learn why setting length in the prompt is better than trimming after generation and practice writing prompts with concrete length constraints to fit UI spaces precisely, ensuring coherent and usable summaries.

Interfaces have fixed space. A card holds two lines, a badge holds a word, a tooltip holds a phrase. An answer that ignores those limits either overflows or gets cut. Both are decided before the request is sent.

We'll cover the following:

  • Why length is a prompt problem

  • Ways to specify length

  • What happens without a limit

  • Practice

Why length is a prompt problem

Length can be handled in one of two places: in the prompt, or in the interface after the answer arrives.

Handling it in the interface means cutting text that has already been produced. The answer gets shortened by removing its end, which is where a summary usually puts its conclusion. A sentence stops mid-clause. ...