π 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:
π Repetition β
chat.completions.create()should feel automatic by nowπ€ Provider awareness β you now know the difference between Groq and Grok, DeepSeek Reasoner vs Chat, and more
π 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.