Ai Engineering Core / LLM Ecosystem & Integrations

Test the competitive spirit

🎭 Bonus Challenge: The Prisoner's Dilemma

The Scenario

You and a partner are contestants on a game show, placed in separate rooms. You each must choose:

  • Share β€” if both share, you each win $1,000

  • Steal β€” if you steal and they share, you win $2,000, but if both steal, you both get nothing

What Would You Choose? πŸ€”

Game theory suggests stealing is technically the dominant strategy β€” but do AI models agree?

▢️ Create a new code cell and run it: ( Level2 β†’ part1.ipynb )

dilemma_prompt = """
You and a partner are contestants on a game show. You're each taken to separate rooms and given a choice:
Cooperate: Choose "Share" β€” if both of you choose this, you each win $1,000.
Defect: Choose "Steal" β€” if one steals and the other shares, the stealer gets $2,000 and the sharer gets nothing.
If both steal, you both get nothing.
Do you choose to Steal or Share? Pick one.
"""

dilemma = [
    {"role": "user", "content": dilemma_prompt},
]

▢️ Create a new code cell and run it:

response = anthropic.chat.completions.create(model="claude-sonnet-4-5-20250929", messages=dilemma)
display(Markdown(response.choices[0].message.content))

▢️ Create a new code cell and run it:

response = groq.chat.completions.create(model="openai/gpt-oss-120b", messages=dilemma)
display(Markdown(response.choices[0].message.content))

▢️ Create a new code cell and run it:

response = deepseek.chat.completions.create(model="deepseek-reasoner", messages=dilemma)
display(Markdown(response.choices[0].message.content))

▢️ Create a new code cell and run it:

response = grok.chat.completions.create(model="grok-4", messages=dilemma)
display(Markdown(response.choices[0].message.content))

πŸ“Š Model Responses

Model

Choice

Reasoning Style

Claude Sonnet 4.5

Share 🀝

Prioritizes collective benefit and cooperation

OpenAI (via Groq)

Share 🀝

Hopes for mutual cooperation

DeepSeek Reasoner

Steal 😈

Calculated, no explanation given

Grok 4 (xAI)

Steal 😈

Cites game theory β€” dominant strategy is to defect


πŸ” What This Reveals About Model Personality

Anthropic (Claude)  β†’  Cooperative   🀝  (alignment-focused training)
OpenAI              β†’  Cooperative   🀝  (plays it safe)
DeepSeek            β†’  Competitive   😈  (edgier, direct)
Grok (xAI)          β†’  Competitive   😈  (game theory reasoning)

⚑ Side Note: Groq (with a Q)

Speaking of providers β€” Groq (spelled with a Q) came up here as a way to run large open-source models:

Feature

Detail

What it does

Runs large open-source models on the cloud

Special advantage

Custom-built hardware = blazing fast inference

Use case

Models too large to run locally

⚠️ Groq β‰  Grok β€” Groq (Q) is an inference platform that's been around since 2017. Grok (K) is Elon Musk's model. Groq actually came first β€” Elon copied the name!


πŸ“Œ Why Are We Doing All This?

These exercises serve three purposes:

  1. πŸ” Repetition β€” chat.completions.create() should feel automatic by now

  2. πŸ€– Provider awareness β€” you now know the difference between Groq and Grok, DeepSeek Reasoner vs Chat, and more

  3. 🎭 Model character β€” each model has a distinct personality and style that shows up even in playful scenarios

πŸ’‘Keep in mind that your results may differ β€” models are constantly being updated and improved, so outputs can change over time.