WhoBuilt

Building with Anthropic Claude: Prompt Workshop

Aug 17, 2024· 1 h 35 min· 40K views·Watch on YouTube

Speakers

Zack Witten, a prompt engineer at Anthropic, leads a live prompt workshop at AI Engineer, iterating on audience submissions with the Anthropic Console and answering questions from attendees.

Set up a live prompt workshop

Witten invites attendees to share prompt templates and examples of poor results in the AI Engineer Slack channel. He plans to test them in the Anthropic Console, using the Evaluate tab to compare outputs across cases.

Structure prompts and control output

Working on a patient-support prompt, Witten separates information from instructions with XML tags and recommends testing changes rather than assuming a format or order will work. He adjusts the length guidance from a vague request for concision to a more specific one to two sentences, and says instructions often work better near the end. For JSON, he demonstrates assistant prefills and tagged output, with small amounts of code to extract or validate the result.

Use examples to shape tone and quality

For a social media prompt, Witten adds context about the intended account and suggests examples of desired tweets to make qualities like engaging and not cringe more concrete. He recommends building a set from strong examples, including edited model outputs, and says positive and negative examples can work well together. For long documents, he would start with one high-quality example and test whether more are needed.

Choose code and prompt strategies for the task

For multiple personas, Witten suggests routing each request to a separate prompt with application logic when possible. For image analysis, he recommends cropping to relevant details and providing a higher-quality image. For translation grading, he recommends examples across the rating categories and cautions that numerical scores may not be well calibrated; for summaries, he suggests extracting relevant quotes first to help reduce hallucinations.

Takeaways

  • Build a small evaluation set from real cases before changing a production prompt.
  • Replace vague guidance like “be concise” with concrete output constraints, then test them.
  • Use assistant prefills or tags to make structured output easier to parse, and handle simple formatting checks in code.
  • Use clear positive examples to teach tone; add contrasting negative examples where useful.
  • Break complex tasks into smaller steps, such as extracting quotes before writing a summary.

Mentioned in this talk

Search inside this talk

What was claimed 9

  • role at
    Jamie Turner is leads the startup team at Anthropic
    “I'm Jamie, and I lead our startup team at Anthropic.”
    YouTube
    Unverified1 source· Talk
  • uses
    collects prompts for live workshop review
    “I set up a Slack channel in the AI Engineer Slack. It's called Prompt Live Workshop Anthropic.”
    YouTube
    Unverified1 source· Talk
  • uses
    iterates on prompts and tests examples
    “look at them, read them, test them in the Anthropic Console”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Clear section labels and XML tags can help distinguish prompt context and instructions
    “The most important thing is clearly separating the different parts of the prompt.”
    YouTube
    Unverified1 source· Talk
  • feature
    Anthropic Console: Evaluate tab supports running prompt test cases
    “This is the Evaluate tab of the Console.”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Assistant prefills can steer generation toward structured output such as JSON
    “The most reliable way to do that, I feel, is using the assistant prefill.”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Stop sequences can halt generation after a specified closing tag
    “If you add the closing JSON tag ... to the stop sequences, it will hard stop after it outputs that.”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Curated positive examples and contrasting negative examples can improve style guidance
    “Contrasting pairs can be especially powerful.”
    YouTube
    Unverified1 source· Talk
  • feature
    Claude: Extracting relevant quotes before summarizing can help reduce hallucinations
    “The best trick that I know for getting around hallucinations in a case like this is to have the model extract relevant quotes first.”
    YouTube
    Unverified1 source· Talk

Related talks