BPOI Banner
Image: Anthropic Image: Anthropic

Secret Claude AI System Prompts Revealed–What Can We Learn From Them?

Anthropic, an artificial intelligence company founded by former OpenAI employees, has publicly released the system prompts for its latest Claude AI models. This rare move gives users a rare glimpse into the inner workings of its large language models (LLMs) and makes Anthropic the only major AI company that has officially shared such instructions.

System prompts, typically considered proprietary information, are crucial in shaping an AI’s behavior and capabilities.

The release, published Monday and dated July 12, 2024, includes detailed instructions for Claude 3.5 Sonnet, Claude 3 Opus, and Claude 3 Haiku models. These prompts outline specific guidelines on model behavior, including prohibitions on facial recognition and link access, as well as directives for handling controversial topics in a way Anthropic believes to be objective.

This is not Anthropic’s first step towards transparency. In March, Amanda Askell, the company’s AI director, shared an earlier version of Claude 3’s system prompt on social media platform X (formerly Twitter). She also explains the reasoning behind such conditioning.

“Why do we use system prompts at all? First, they let us give the model ‘live’ information like the date. Second, they let us do a little bit of customizing after training and to tweak behaviors until the next finetune. This system prompt does both,” she said on a Twitter thread.

Anthropic’s decision diverges from the practices of other major AI firms like OpenAI, Meta, or xAI, which maintain the confidentiality of their system prompts. However, hackers and LLM jailbreakers have been able to extract those instructions, with ChatGPT revealed to have a huge 1700-word prompt and Grok-2 being told it was inspired by JARVIS from Iron Man and the Hitchhiker’s Guide to the Galaxy.

Anthropic’s prompts are now accessible through their Claude apps and online platforms. The company has expressed intentions to regularly update and publish these prompts, providing ongoing insights into the evolution of AI instruction methodologies.

How to be a better prompter

The disclosure of Anthropic’s system prompts not only help users know how chatbots work, they can also help people understand how LLMs think and how users can guide their thought process with better input. LLMs, at their core, are basically highly sophisticated text predictors, where each word influences the generation of subsequent content.

So a better-crafted prompt can help users enhance our model’s capabilities and achieve more accurate, contextually appropriate, and targeted results from their interactions with AI models.

1. Contextual enrichment is key

Providing rich context is crucial for guiding AI models towards generating more precise and relevant responses. Anthropic’s prompts demonstrate the importance of detailed contextual information in shaping AI behavior.

Here is a key part of Anthropic’s system prompt:

“The assistant is Claude, created by Anthropic. The current date is {}. Claude’s knowledge base was last updated on April 2024. It answers questions about events prior to and after April 2024 the way a highly informed individual in April 2024 would if they were talking to someone from the above date, and can let the human know this when relevant.”

Notice that Anthropic explains how Claude must reply. So, the language, tone, and knowledge of its prompts will mimic the way society writes in 2024 and not how Romeo and Juliet spoke when Shakespeare was alive.

Framing tasks within a clear context, including relevant background information, helps the model generate responses that are more aligned with specific user needs. This approach avoids generic or off-target answers. By providing a rich context, users enable the model to better understand the task requirements, leading to improved results.

For instance, users can ask a model to generate a horror story, and it will do it. However, providing detailed characteristics of that style can significantly enhance the output quality. Those who take things a step further, adding examples of the desired writing style or content type, can further refine the model’s understanding of an instruction and improve the generated results.

2. Break down complex queries

Anthropic’s prompts also reveal the importance of approaching complex tasks systematically, breaking them down into manageable components instead of solving all parts just as once —as users tend to do when interacting with their favorite chabots.

Here are some quotes from Anthropic that tackle this issue:

“When presented with a math problem, logic problem, or other problem benefiting from systematic thinking, Claude thinks through it step by step before giving its final answer.”

“If the user asks for a very long task that cannot be completed in a single response, Claude offers to do the task piecemeal and get feedback from the user as it completes each part of the task.”

For multifaceted tasks, instructing the model to approach the problem step-by-step can lead to more focused and accurate responses. This segmentation allows for refinement based on feedback at each stage of the task.

The ideal approach, however, is to use a multi-shot technique like Chain of Thoughts or Skeleton of Thoughts, guiding the LLM through a series of interconnected tasks. This method reduces the probability of hallucinations by conditioning the thought process between tasks.

A multi-shot technique involves users interacting with the model with different prompts, guiding the process toward a satisfactory final output.

However, users with no time or patience to deal with many interactions can do the next best thing and prompt the model to articulate its reasoning process before providing a final answer. This can improve the quality of the output, with the model’s own reasoning output influencing the quality of its final response.

While not as effective as direct user guidance, this approach serves as a good compromise for enhancing response quality.

3. Use direct and purposeful language

Anthropic’s prompts are a great example of how important it is to use clear, unambiguous language in AI interactions.

Some quotes from Anthropic encouraging and using clear language:

“Claude ends its response by reminding the user that although it tries to be accurate, it may hallucinate in response to questions like this. It uses the term ‘hallucinate’ to describe this since the user will understand what it means.”

“Claude responds directly to all human messages without unnecessary affirmations or filler phrases like ‘Certainly!’, ‘Of course!’, ‘Absolutely!’, ‘Great!’, ‘Sure!’, etc.”

Using direct, unambiguous language helps avoid misinterpretation and ensures that the model’s responses are straightforward and purposeful. This approach eliminates unnecessary complexity or ambiguity in the AI’s output.

The prompts address potential ambiguities by providing clear guidelines on how the model should handle specific situations. Specifying the desired tone and style ensures that the response matches the intended communication style.

And just as Stable Diffusion used to rely on negative prompts to not generate elements in their images, AI LLMs can also work better if users tell the model what NOT to do and what to avoid doing.

By instructing the model to maintain a specific tone and avoid unnecessary phrases, users can enhance the clarity and professionalism of the AI’s responses. This directive guides the model to focus on delivering substantive content without superfluous language.

It can also help the model reason better if a negative instruction prevents it from taking a specific reasoning path.

Bonus: Separate your instructions with tags

You may have noticed that Claude uses XML tags in its prompts—for example, starting with and ending with . This may feel weird at first, but it’s a practice that will help you understand longer prompts and will make your chatbot more capable of understanding which part of the prompt it is analyzing.

Image: Anthropic

XML (eXtensible Markup Language) tags provide a clear, hierarchical structure to the content, allowing for more precise control over how the AI interprets and utilizes different sections of the prompt. Anthropic uses XML tags to establish distinct “modules” within the prompt, each serving a particular purpose in guiding Claude’s behavior and responses.

Wrapping some instructions inside tags helps the model separate a specific block of text and understand what is about. For example, you can use tags like

Generally Intelligent Newsletter

A weekly AI journey narrated by Gen, a generative AI model.



Source link

Jose Antonio Lanz

https://decrypt.co/246695/claude-ai-system-prompts-anthropic-tips

2024-08-28 00:47:19

bitcoin
Bitcoin (BTC) $ 96,021.73 0.65%
ethereum
Ethereum (ETH) $ 3,335.00 0.81%
tether
Tether (USDT) $ 1.00 0.06%
xrp
XRP (XRP) $ 2.21 1.62%
bnb
BNB (BNB) $ 672.62 1.55%
solana
Solana (SOL) $ 185.62 0.49%
dogecoin
Dogecoin (DOGE) $ 0.316867 0.23%
usd-coin
USDC (USDC) $ 1.00 0.13%
cardano
Cardano (ADA) $ 0.904539 0.19%
staked-ether
Lido Staked Ether (STETH) $ 3,331.02 0.58%
tron
TRON (TRX) $ 0.24989 1.23%
avalanche-2
Avalanche (AVAX) $ 37.21 2.00%
chainlink
Chainlink (LINK) $ 23.14 3.72%
the-open-network
Toncoin (TON) $ 5.48 2.10%
wrapped-steth
Wrapped stETH (WSTETH) $ 3,952.37 0.69%
shiba-inu
Shiba Inu (SHIB) $ 0.000022 0.45%
wrapped-bitcoin
Wrapped Bitcoin (WBTC) $ 95,763.66 0.38%
sui
Sui (SUI) $ 4.34 3.40%
stellar
Stellar (XLM) $ 0.359753 0.35%
polkadot
Polkadot (DOT) $ 7.01 0.78%
hedera-hashgraph
Hedera (HBAR) $ 0.270474 3.90%
hyperliquid
Hyperliquid (HYPE) $ 28.67 15.31%
weth
WETH (WETH) $ 3,333.67 0.61%
bitcoin-cash
Bitcoin Cash (BCH) $ 447.97 1.19%
leo-token
LEO Token (LEO) $ 9.40 0.71%
uniswap
Uniswap (UNI) $ 14.11 2.98%
litecoin
Litecoin (LTC) $ 103.26 2.14%
pepe
Pepe (PEPE) $ 0.000018 3.08%
wrapped-eeth
Wrapped eETH (WEETH) $ 3,516.52 0.64%
near
NEAR Protocol (NEAR) $ 5.17 3.31%
ethena-usde
Ethena USDe (USDE) $ 1.00 0.17%
bitget-token
Bitget Token (BGB) $ 4.14 0.34%
usds
USDS (USDS) $ 1.00 0.43%
aptos
Aptos (APT) $ 9.30 1.67%
aave
Aave (AAVE) $ 337.35 11.19%
internet-computer
Internet Computer (ICP) $ 10.26 1.64%
crypto-com-chain
Cronos (CRO) $ 0.156243 0.62%
polygon-ecosystem-token
POL (ex-MATIC) (POL) $ 0.482153 0.58%
mantle
Mantle (MNT) $ 1.19 3.08%
ethereum-classic
Ethereum Classic (ETC) $ 26.62 1.35%
vechain
VeChain (VET) $ 0.046637 2.08%
render-token
Render (RENDER) $ 7.17 0.53%
monero
Monero (XMR) $ 191.53 1.90%
whitebit
WhiteBIT Coin (WBT) $ 24.47 0.62%
mantra-dao
MANTRA (OM) $ 3.65 0.46%
dai
Dai (DAI) $ 1.00 0.16%
bittensor
Bittensor (TAO) $ 461.97 0.82%
fetch-ai
Artificial Superintelligence Alliance (FET) $ 1.30 2.01%
arbitrum
Arbitrum (ARB) $ 0.766612 1.85%
ethena
Ethena (ENA) $ 1.06 0.12%