Now serving as Chief AI Officer at Ondaro  ·  Forbes Technology Council Member

All posts
aiprompt-engineeringllmproductivity

Published

Reading Time

3 min read

aiprompt-engineeringllmproductivity

Effective Techniques for Refining Prompt Output

A practical guide to refining and controlling the output of large language models using prompts.

3 min read

When working with large language models (LLMs), it's important to have strategies that help refine and control their output. Without clear guidance, these models may generate overly detailed or lengthy responses, especially for requests that require concise or limited information. By employing targeted techniques such as explicit instructions, formatting requests, and iterative feedback, you can effectively manage how the LLM provides results. These methods ensure that the model delivers the right amount of information, in the right format, making interactions more efficient and aligned with your expectations.

Explicit quantity instructions

  • "Return exactly 5 sentences."
  • "List 3 key points with each point explained in one sentence."
  • "Summarize this text in no more than 3 bullet points."

LLMs are more likely to adhere to explicit guidance if it's placed at the start of the request.

Explicit stop instructions

  • "Provide 5 sentences summarizing the article, then stop."
  • "Generate 3 concise answers and conclude the response after that."

This signals that you want a limited amount of data followed by a stop.

Formatting to enforce structure

  • "Provide 5 points, with each point in a separate bullet."
  • "Return 5 sentences, numbered from 1 to 5."

This can help you enforce boundaries on both the content and structure.

Narrow and specific questions

Instead of asking, "Tell me about X," you could say, "Tell me 3 specific features of X in one sentence each." This helps focus the LLM on delivering concise information.

Word and sentence count constraints

  • "Provide a 5-sentence summary."
  • "In no more than 75 words, explain…"
  • "Stop after the 3rd point."

Conditional stop instructions

  • "Provide 5 sentences. If you generate more, only return the first 5."
  • "Return 5 points. If more than 5 are produced, stop at 5."

This strategy reinforces to the model that it should stop after meeting the conditions.

Iterative feedback

After receiving an initial response: "That was too long. Please summarize in 5 sentences." Or use immediate feedback in the prompt: "Your last response was longer than requested, this time return 3 concise points only." LLMs tend to improve with clear feedback provided across iterations.

Pre-generation planning

  • "First think about 5 main points to include, then return those points in 5 sentences."
  • "Identify 3 key ideas and explain them briefly."

This method encourages the model to "think" before producing excessive detail.

By combining these strategies, you can better enforce constraints on LLM outputs and motivate it to follow your feedback.

B

Written by

Ben Durham-Kilcullen

Chief AI Officer at Ondaro  ·  Forbes Technology Council  ·  Founder, Kilcullen Technologies

Technology executive with a deep foundation in data science and software engineering. Dedicated to translating complex technical insights into impactful business strategies across healthcare, financial services, and enterprise software.