- Blog
- Guide to Requesting Rewrites with Claude
Guide to Requesting Rewrites with Claude
Guide to Requesting Rewrites with Claude
Sometimes, even with a well-crafted prompt, Claude's response might not quite hit the mark or be completely accurate. In these cases, you can leverage Claude's ability to revise its own work by asking for a rewrite. By providing clear instructions and a rubric for the desired output, you can guide Claude to generate content that better aligns with your goals.
When to ask for a rewrite
Consider requesting a rewrite when:
- The response is close to what you need but lacks specific details or formatting
- The output doesn't fully adhere to the constraints outlined in your initial prompt
- You are unsure if the result is accurate and want Claude to double-check (consider it a mini one-off LLM-graded eval)
Rewrites are particularly useful when your prompt contains multiple constraints, such as a specific format (e.g., a poem or list) and specific content topics. Sometimes, Claude may prioritize one constraint over another, especially if there are many complex steps to follow. Asking for a rewrite allows you to emphasize the importance of whatever constraints Claude initially missed.
How to request a rewrite
When sending requests through the API (including the functions in Claude for Sheets), you must always include the previously generated text in your prompt. Here's an example prompt template:
plaintext
Rewrite the following paragraph to meet these instructions: {{INSTRUCTIONS}} {{PARAGRAPH}}
For lower volume use cases, you can paste the paragraph to be rewritten in place of {{PARAGRAPH}}
. To automate this process, consider setting up a prompt chain so that Claude's response to a previous prompt gets substituted for the {{PARAGRAPH}}
placeholder.
When using Claude for Sheets, you can structure your Sheet so that each row contains a different set of instructions to be substituted for the {{INSTRUCTIONS}}
placeholder. This allows you to generate multiple types of rewrites simultaneously.
Crafting effective rewrite instructions
To get the most out of Claude's rewrite capabilities, provide clear and specific instructions that outline your expectations for the revised content. Consider including:
- The desired format (e.g., paragraph, list, dialogue)
- The target tone or style (e.g., formal, conversational, humorous)
- Any additional information or context to include
- Specific areas of the original response to focus on or modify
- A rubric for Claude to assess the quality and accuracy of its previous response, and to understand what a high-quality result entails
Here's an example of how you might request a rewrite to emphasize certain constraints:
plaintext
Rewrite the following paragraph to be in bullet point format and include data from the 2023 report: {{PARAGRAPH}}
By breaking down the prompt into sequential steps and providing targeted rewrite instructions, you can guide Claude to generate output that better meets your specific needs.
A note on fact-checking
If you're asking Claude to rewrite a response to ensure factual accuracy, consider utilizing the "I don't know" technique to prevent hallucinations. This approach encourages Claude to acknowledge when it lacks the necessary information to make a correction rather than generating a potentially inaccurate "fix."
Iterative rewrites
Sometimes, a single rewrite may not be enough to achieve the perfect output. In these cases, consider engaging in an iterative process, requesting multiple revisions based on evolving criteria. With each round of feedback, Claude can learn more about your preferences and refine its responses accordingly.
Remember, the key to successful rewrites is providing clear, actionable guidance. The more specific your instructions, the more likely Claude is to generate content that aligns with your vision.
Allow Claude to say "I don't know"
One effective way to reduce hallucinations is to explicitly give Claude permission to say "I don't know," especially when asking fact-based questions (also known as "giving Claude an out"). This allows Claude to acknowledge its limitations and avoid generating incorrect information.
Here's an example prompt that encourages Claude to admit when it doesn't have the answer:
plaintext
Answer the following question, but if you're unsure, say "I don't know": {{QUESTION}}
By giving Claude an explicit "way out," you can reduce the likelihood of it generating inaccurate information.
Reminder
While Claude has read a lot on the internet and knows things about the real world, it does not have internet access. Claude was trained on data that can be over a year out of date. It also does not know anything about current events.