Skip to main content

Best Practices for Natural Language Question Answering Prompts

K
Written by Kay Chen

Let's start by answering the following questions...

What is a Natural Language Question Answering System?

Natural Language Question Answering (NLQA) systems are programs that respond to human questions in natural language. They don't return complete documents as traditional keyword searches do. Instead, users get specific answers to their questions.

Why use a Natural Language Question Answering System?

  • NLQA can process the meaning and understand the sentiment of human language and generate highly relevant answers to queries and questions.

  • NLQA systems are designed to enhance human-computer interaction and make it easier for people to find the information they need more efficiently.

  • NLQA systems understand and process human language in written text or spoken words, making it easy for users to interact with the system using everyday language.

  • NLQA systems can search through large amounts of data and provide succinct answers, which helps users navigate the wealth of information more effectively.

  • Companies can also save costs as NLQA can help new employees get up to speed by providing quick insights about the company and its processes.

General Rules of Thumb

  1. Clear and Specific Requests: The more specific you are with your request, the better the response will be.

  2. One Question at a Time: While the model can understand complex sentences, it’s usually more effective to ask one question at a time. This helps the model provide a more focused response.

  3. Patience with Longer Responses: Sometimes, it may take a bit longer to generate a response, especially for complex queries. Please be patient.

  4. Understanding Limitations: The model doesn't have any personal experiences or emotions, and the responses are based on a large amount of data it was trained on.

How to Write Good Prompts

It is important to note that the quality of the responses you receive is dependent on the prompts you provide. Prompts are the written inputs you submit for the model to respond to.

Without careful prompting, you may get generic, unhelpful responses. Mastering the art of crafting effective prompts is essential to unlocking the model's full potential.

This framework contains six parts that can help you understand the essential elements of a well-structured prompt.

  1. Context

  2. Task

  3. Persona

  4. Format

  5. Tone

Understanding how each building block functions will enable you to consistently obtain the precise results you want from the model.

Provide Relevant Context

Supply key contextual details, documents, and articles to constrain the scope. Helpful questions to consider are:

  • What documents, details, and articles are needed?

  • What does a successful response look like?

  • What are the limitations and constraints?

Since it is not connected to the internet, It can only provide information it has been trained on or has been supplied.

Define the Task

The task is the most critical part of a prompt. Always start by clearly stating the action you want the model to perform using a strong verb — generate, summarize, analyze, rewrite, give, etc.

Articulate your desired end goal. If you don't get the desired results, don't give up. Instead, refine the prompt until you get the response you want. You can request anything from a simple bullet point to a multi-step analysis.

For example: "Give me a numbered list of recommended steps to stay healthy with active Sarcoidosis from the most important starting with number 1. Be detailed."

Specify a Persona

Who you want the model to be can shape the response. If there are specific tasks that require a certain level of expertise, consider treating the model as an expert in that field, such as a scientist or doctor.

Define the Format

Provide a detailed description of the desired format for the final output. Consider the various formats available such as paragraphs, tables, bullet points, and others, and clearly state your preference.

Set the Tone

Adjectives like “friendly” and “professional” convey the desired tone. Or request a “confident yet approachable” voice.

By learning this prompting framework, you can improve your ability to access the full potential of the model.

With practice, anyone can improve their prompting skills. Understanding the critical building blocks - context, task, exemplars, persona, format, and tone - is essential to advance from basic to advanced prompting.

Check out the "Tips for Natural Language Question Answering" article to review some tips with examples.

The Importance of Well-Crafted Prompts

How you phrase your prompts significantly influences the quality and relevance of model's responses. Think of prompts as the keys that unlock the model's full potential.

Here are a few tips to keep in mind:

  • Be specific: Avoid vague or overly broad questions. The more focused your prompt, the better the model can understand your intent.

  • Provide context: If necessary, give some background information to help the model tailor its response.

  • Experiment: Be bold and play around with different wording and phrasing to see how it affects the output.

    • For example: Add "Be detailed" to the prompt for a longer response.

    • Conversely, Add "Be concise" to the prompt for the prompt to give a summary

  • Start with simple requests: start with simpler interactions and gradually move towards more complex ones as you become more comfortable with the process.

Editing and Refining Prompts

When using the model, the initial response may differ from what you intended. To address this issue, you can edit your prompts.

  • Rephrase your question: Try wording your original prompt differently to see if it generates a more relevant result.

  • Add more details: Give the model additional context or refine your request to be more specific.

  • Change the tone: Do you want a factual response, something more creative, or perhaps a humorous take? Adjust the language of your prompt to influence the style of the output.

Regenerating Responses

Sometimes, the model's initial response might miss the mark, or you might want to see another option. That’s where the “Try Again” option comes in handy.

Here are a few reasons to use this feature:

  • Exploring Alternatives: Get multiple perspectives on a topic or discover different creative approaches.

  • Addressing Misunderstandings: If the model misinterpreted your prompt, the “Try Again” option can offer a fresh start.

  • Experimentation: Sometimes, it’s fun to see how the model will respond differently to the same prompt.

Please keep in mind that everyone's experience can be unique. So, don't worry if things don't go exactly as planned. Just take it one step at a time and you'll do great!

Did this answer your question?