Anthropic Academy Lesson on Extended Thinking Responses

The article discusses key learnings from Anthropic Academy about handling Extended Thinking responses from the Claude AI model, including understanding the two-block structure, the role of the signature, and best practices for budget and token limits.

💡

Why it matters

Understanding how to properly handle Extended Thinking responses is crucial for developers building applications on top of the Claude AI model.

Key Points

  • 1Extended Thinking responses have two distinct blocks: a thinking block and a text block
  • 2The signature in the thinking block is a cryptographic token to prevent tampering
  • 3Redacted thinking blocks with encrypted data can occur due to safety checks
  • 4The budget_tokens parameter has a minimum of 1,024 tokens, and max_tokens must be greater

Details

The article explains that when using Extended Thinking, the response from the Claude AI model contains two separate blocks - a 'thinking' block that shows the model's internal reasoning, and a 'text' block with the final answer. This is important for streaming parsers to handle correctly. The 'signature' field in the thinking block is a cryptographic token that allows Claude to verify the thinking text has not been modified, as it relies heavily on previous thinking during response generation. Sometimes the thinking block may be redacted with encrypted data due to safety checks. The article also notes that the budget_tokens parameter has a minimum of 1,024 tokens, and the max_tokens parameter must be set higher than budget_tokens to leave room for the final response text.

Like
Save
Read original
Cached
Comments
?

No comments yet

Be the first to comment

AI Curator - Daily AI News Curation

AI Curator

Your AI news assistant

Ask me anything about AI

I can help you understand AI news, trends, and technologies