Update Anthropic Code Generation Templates to Claude 2.1
While the specific version of the model used is controlled by the model gateway, the Anthropic Claude 2.1 docs mention this in their prompting update guide for Claude 2.1
To ensure the best performance for Claude 2.1, it is vital that you place your inputs & documents before any questions that reference or utilize that content. Doing so maximizes Claude 2.1's superior RAG & document analysis capabilities.
Inputs mean any additional information of significant length that you expect Claude to utilize in order to perform its task. Inputs can be any of the following (non-exhaustive):
- Natural language text: prose, reports, articles, books, essays, etc.
- Structured documents: forms, questionnaires, tables, lists
- Code snippets
- RAG results: chunked documents & search snippets
- Conversational text: transcripts, chat history (prompts & responses), questions & answers
In addition, Claude 2.1 now supports system prompts which will probably further help distinguish our instructions from the user's code / instructions.
We should try moving the existing_code
, instruction
and language specific code examples above the text instructions about what Claude is supposed to be doing, and move everything into the system prompt to see how it affects performance with Claude 2.1