The Art of Asking Questions in the Age of AI

The art of formulating questions is key to unlocking the full potential of LLMs. This article explores how to master the skill of asking effective queries to get the most valuable responses from AI.

Abstract image of asking AI questions

In an era where artificial intelligence is becoming increasingly prevalent in our daily lives, a crucial skill is often overlooked: the art of asking questions. As we interact more frequently with AI-powered tools and chatbots,  the quality of our inquiries directly impacts the value of the information we receive. From our own experience with our ApostropheCMS documentation chatbot, we’ve observed that refining inquiries can lead to much more helpful and insightful responses. This blog post explores why learning to ask effective questions is more important than ever and how it can elevate our interactions with AI.

The Relationship Between Questions and Answers

The old computing adage "garbage in, garbage out" has never been more relevant than in the age of AI. We inevitably receive subpar answers when we pose poorly formulated questions to AI systems. Conversely, well-crafted questions can unlock the full potential of these powerful tools, leading to insights and solutions we might not have discovered otherwise.

Consider this: any time saved by hastily asking a question is often lost many times over when dealing with inadequate or irrelevant responses. The key to maximizing the benefits of AI lies not just in the sophistication of the algorithms but in our ability to engage with them effectively through thoughtful questioning.

Any time saved by hastily asking a question is often lost many times over when dealing with inadequate or irrelevant responses.

Open-ended Questions vs. Constrained Queries: Balancing Creativity and Accuracy


An important consideration when formulating questions for AI systems is the balance between open-ended inquiries and more constrained queries. This balance can significantly impact the likelihood of AI hallucinations – instances where the AI generates plausible but incorrect or nonsensical information.

LLMs don’t have the self-awareness to know what they don’t know. This means that while fully open-ended questions can lead to more creative and diverse responses, they also increase the risk of the LLM returning information not included in their training set. Introducing constraints or "guardrails" within questions (or through prompt engineering) can mitigate these risks. For instance, by framing questions with clear parameters, such as explicitly requesting citations or limiting the scope of the response, users can significantly reduce the likelihood of AI-generated misinformation.

However, it's crucial to strike a balance. Overly constrained questions limit the AI's ability to provide novel insights or solutions. The art lies in crafting questions specific enough to guide the AI toward accurate information yet open enough to allow for creative and comprehensive responses.

The Art of Asking Good Questions

Now that we understand the crucial relationship between question quality and AI-generated answers let's explore how to craft effective questions, particularly in the context of computer science and software development.

Clarity and Specificity

One of the fundamental aspects of a good question is clarity. AI systems, despite their sophistication, can't read between the lines or infer unstated intentions. Therefore, it's essential to be as clear and specific as possible in your queries.

Instead of asking, "How do I optimize my code?" a more effective question would be, "What are some strategies to optimize the performance of a React component that renders a large list of items?" This level of specificity helps the AI provide a more targeted and useful response.

Context and Background Information

Providing relevant context can significantly enhance the quality of AI-generated answers. By giving background information, you're priming the AI with the necessary framework to formulate a more accurate and relevant response. Popular tools like Cursor provide your code base as context to inform the question.

For instance, when asking about a complex topic like serverless architecture, you might start with: "Given a Node.js application using Express.js that currently handles user authentication and manages a product catalog, what considerations should be taken into account when migrating to a serverless architecture using AWS Lambda and API Gateway?"

Open-ended vs. Closed Questions

As discussed earlier, there's a balance to strike between open-ended and closed questions. Open-ended questions can elicit more comprehensive and creative responses, while closed questions are useful for obtaining specific information or confirming facts.

An open-ended question might be: "How might the adoption of WebAssembly affect JavaScript's role in web development over the next five years?" This allows for a broad, analytical response.

A closed question, on the other hand, could be: "Does using async/await in a Node.js application improve performance compared to using Promises for handling asynchronous operations?" This targets a specific piece of information.

The key is to use a mix of both types, depending on your information needs and the complexity of the topic at hand.

The Importance of Follow-up Questions

While crafting an initial question is crucial, the art of asking questions doesn't end there. Follow-up questions are vital in extracting maximum value from AI interactions, especially in complex fields like computer science and software development. They help:

1. Refine and Clarify Responses: Narrow down general answers to specific applications.

For example, if you asked about optimizing a database query in MongoDB and received a general response about indexing, you might follow up with: "How can compound indexes improve performance for queries with multiple field filters and sorting in a large MongoDB collection?"

2. Deepen Understanding: Explore different aspects of a topic or solution implications.

After receiving a general explanation of how ApostropheCMS handles caching, you might ask: "What strategies can I implement to optimize caching for a site with frequently updated dynamic content, especially in relation to piece-pages?"

3. Challenge Assumptions: Uncover important nuances in the AI's or your assumptions.

For example, "In the previous answer about implementing browser-side interactivity, you assumed I was using a widget. How would the recommended approach change if we need to support interactivity for a page?"

4. Enable Iterative Problem Solving: Refine your approach incrementally.

In software development and computer science, problems are often solved through an iterative process. Follow-up questions can mirror this approach, as shown in this example sequence:

  1. "What are the best practices for creating custom widgets in ApostropheCMS?"
  2. "How can I make my custom widget reusable across different page types?"
  3. "What's the most efficient way to handle data fetching for this reusable widget, considering performance implications in a large ApostropheCMS site?"

By mastering follow-up questions, you can transform AI interactions into productive dialogues, leading to deeper insights and more effective problem-solving.

Practical Tips for Question-Asking Skills

Developing the ability to ask good questions is a skill that can be honed over time. Here are some practical tips to help you improve your question-asking abilities, particularly when interacting with AI in the context of JavaScript and web development.

1. Define Your Goal

Before asking a question, clearly define what you're trying to achieve. Are you looking to solve a specific problem, understand a concept, or explore potential solutions? Having a clear goal will help you frame your question more effectively.

Example: Instead of: "Can you explain modules in ApostropheCMS?" Try: "Can you explain how custom modules in ApostropheCMS can be used to extend functionality and create reusable components across multiple projects?"

2. Provide Context

Give relevant background information to help the AI understand your specific situation. This might include your tech stack, project constraints, or previous attempts to solve the problem.

Example: "I'm working on an ApostropheCMS 4.x project that uses multiple piece types for different content categories. We're experiencing performance issues when querying across these piece types. What strategies could we employ to optimize querying in this scenario?"

3. Be Specific

The more specific your question, the more targeted and useful the response will be. Use precise technical terms and provide concrete examples where possible.

Example: Instead of: "How do I make my ApostropheCMS site faster?" Try: "What techniques can I use to reduce the initial load time of an ApostropheCMS site that uses many custom widgets and has many pieces across multiple piece types?"

4. Break Down Complex Problems

If you're dealing with a complex issue, consider breaking it down into smaller, more manageable questions before you begin communicating to the AI. This can help you tackle the problem step-by-step and avoid overwhelming responses.

Example: Instead of: "How do I build a multi-language e-commerce site with ApostropheCMS?" Try a series of questions:

  1. "What are the key components needed for implementing multi-language support in ApostropheCMS 3.x?"

  2. "How can I implement product variants and pricing in ApostropheCMS using piece types and relationships?"

  3. "What's the most efficient way to handle currency conversion and region-specific pricing in ApostropheCMS?"

5. Use the Rubber Duck Technique

Before asking an AI chatbot, try explaining your problem out loud as if you're explaining it to someone else (or a rubber duck, as the technique suggests). This process helps clarify your thoughts and might even lead you to the solution.

6. Leverage Code Snippets

When dealing with code-related questions, provide relevant code snippets. This gives concrete context and allows for more precise answers. Many popular tools like CoPilot and Cursor make this easy.

Example: "I'm trying to optimize this ApostropheCMS widget that renders a large list of pieces. Here's my current implementation:

module.exports = {
  extend: '@apostrophecms/widget-type',
  // current code
};

What techniques could I use to improve its performance when dealing with thousands of items?"

7. Ask About Trade-offs

In software development, many solutions involve trade-offs. Asking about these can lead to more nuanced and valuable responses.

Example: "When implementing custom field types in ApostropheCMS, what are the trade-offs between creating a new field type from scratch versus extending an existing field type?"

8. Follow Up and Iterate

Don't be afraid to ask follow-up questions or to rephrase your question if the initial response doesn't fully address your needs. Treat the interaction as a dialogue rather than a one-off query.

By applying these tips, you can significantly improve the quality of your questions and, consequently, the value of the responses you receive from AI. Remember, the art of asking good questions is a skill that improves with practice. Each interaction with AI is an opportunity to refine this skill and enhance your problem-solving capabilities.

Mastering the Art of Inquiry in the AI Era

As we've explored throughout this article, the ability to ask good questions is a crucial skill in the age of AI, particularly for those working in fast-evolving fields like JavaScript development and web technologies. The quality of our questions directly impacts the value we derive from AI interactions, influencing everything from code optimization to architectural decisions.

  1. Question Quality Matters
    The clarity, specificity, and context provided in our questions significantly affect the relevance and usefulness of AI-generated responses.

  2. Thoughtful Questioning is an Investment
    While it may require more upfront time, crafting well-formulated questions leads to more efficient problem-solving and learning in the long run.

  3. Follow-up Questions are Crucial
    They help refine understanding, challenge assumptions, and facilitate iterative problem-solving.

  4. Practical Techniques Exist
    From providing code snippets to leveraging the rubber duck technique, there are concrete strategies we can employ to improve our questioning skills.

The Evolving Landscape of AI and Development

As AI continues to advance, its role in software development is likely to grow. We're already seeing AI-powered code completion, bug detection, and even code generation. In this evolving landscape, the developer who can effectively communicate with AI tools – primarily by asking good questions – will have a significant advantage.

Remember, in the age of AI, knowing how to ask might become just as important as knowing the answers themselves. So, what's your next question?