Skip to content
Snippets Groups Projects
Commit 0f771e33 authored by Maxime Morge's avatar Maxime Morge :construction_worker:
Browse files

PyGAAMAS: Add Qwen3 for evaluationg prefence alignment

parent 6358a855
No related branches found
No related tags found
No related merge requests found
...@@ -126,12 +126,16 @@ each corresponding to one of the four preferences: ...@@ -126,12 +126,16 @@ each corresponding to one of the four preferences:
Table below evaluates the ability of the models to align with different preferences. Table below evaluates the ability of the models to align with different preferences.
- When generating **strategies**, the models align perfectly with preferences, except for - When generating **strategies**, the models align perfectly with preferences, except for
- <tt>DeepSeek-R1<tt> and <tt>Mixtral:8x7b</tt> which do not generate valid code. - <tt>DeepSeek-R1<tt> and <tt>Mixtral:8x7b</tt> which do not generate valid code
- <tt>Qwen3</tt>, which fails to adopt egoistic or altruistic strategies but adheres
to utilitarian and egalitarian preferences.
- When generating **actions**, - When generating **actions**,
- <tt>GPT-4.5</tt> aligns well with preferences but struggles with **utilitarianism**. - <tt>GPT-4.5</tt> aligns well with preferences but struggles with **utilitarianism**.
- <tt>Llama3</tt> aligns well with **egoistic** and **altruistic** preferences but shows lower adherence to **utilitarian** and **egalitarian** choices. - <tt>Llama3</tt> aligns well with **egoistic** and **altruistic** preferences but shows lower adherence to **utilitarian** and **egalitarian** choices.
- <tt>Mistral-Small</tt> aligns better with **altruistic** preferences and performs moderately on **utilitarianism** but struggles with **egoistic** and **egalitarian** preferences. - <tt>Mistral-Small</tt> aligns better with **altruistic** preferences and performs moderately on **utilitarianism** but struggles with **egoistic** and **egalitarian** preferences.
- <tt>DeepSeek-R1</tt> primarily aligns with **utilitarianism** but has low accuracy in other preferences. - <tt>DeepSeek-R1</tt> primarily aligns with **utilitarianism** but has low accuracy in other preferences.
- <tt>Qwen3</tt> strongly aligns with utilitarian preferences and moderately with altruistic ones (0.80),
- but fails to exhibit egoistic behavior and shows weak alignment with egalitarianism.
While a larger LLM typically aligns better with preferences, a model like <tt>Mixtral-8x7B</tt> may occasionally While a larger LLM typically aligns better with preferences, a model like <tt>Mixtral-8x7B</tt> may occasionally
underperform compared to its smaller counterpart, Mistral-Small due to their architectural complexity. underperform compared to its smaller counterpart, Mistral-Small due to their architectural complexity.
Mixture-of-Experts (MoE) models, like Mixtral, dynamically activate only a subset of their parameters. Mixture-of-Experts (MoE) models, like Mixtral, dynamically activate only a subset of their parameters.
...@@ -147,6 +151,7 @@ If the routing mechanism isn’t well-tuned, it might select less optimal expert ...@@ -147,6 +151,7 @@ If the routing mechanism isn’t well-tuned, it might select less optimal expert
| **<tt>Mistral-Small</tt>** | **Strategy** | 1.00 | 1.00 | 1.00 | 1.00 | | **<tt>Mistral-Small</tt>** | **Strategy** | 1.00 | 1.00 | 1.00 | 1.00 |
| **<tt>DeepSeek-R1:7b</tt>** | **Strategy** | 1.00 | 1.00 | 1.00 | 1.00 | | **<tt>DeepSeek-R1:7b</tt>** | **Strategy** | 1.00 | 1.00 | 1.00 | 1.00 |
| **<tt>DeepSeek-R1</tt>** | **Strategy** | - | - | - | - | | **<tt>DeepSeek-R1</tt>** | **Strategy** | - | - | - | - |
| **<tt>Qwen3</tt>** | **Strategy** | 0.00 | 0.00 | 1.00 | 1.00 |
| **<tt>GPT-4.5<tt>** | **Actions** | 1.00 | 1.00 | 0.50 | 1.00 | | **<tt>GPT-4.5<tt>** | **Actions** | 1.00 | 1.00 | 0.50 | 1.00 |
| **<tt>Llama3.3:latest</tt>** | **Actions** | 1.00 | 1.00 | 0.43 | 0.96 | | **<tt>Llama3.3:latest</tt>** | **Actions** | 1.00 | 1.00 | 0.43 | 0.96 |
| **<tt>Llama3</tt>** | **Actions** | 1.00 | 0.90 | 0.40 | 0.73 | | **<tt>Llama3</tt>** | **Actions** | 1.00 | 0.90 | 0.40 | 0.73 |
...@@ -154,6 +159,7 @@ If the routing mechanism isn’t well-tuned, it might select less optimal expert ...@@ -154,6 +159,7 @@ If the routing mechanism isn’t well-tuned, it might select less optimal expert
| **<tt>Mistral-Small</tt>** | **Actions** | 0.40 | 0.94 | 0.76 | 0.16 | | **<tt>Mistral-Small</tt>** | **Actions** | 0.40 | 0.94 | 0.76 | 0.16 |
| **<tt>DeepSeek-R1:7b</tt>** | **Actions** | 0.46 | 0.56 | 0.66 | 0.90 | | **<tt>DeepSeek-R1:7b</tt>** | **Actions** | 0.46 | 0.56 | 0.66 | 0.90 |
| **<tt>DeepSeek-R1</tt>** | **Actions** | 0.06 | 0.20 | 0.76 | 0.03 | | **<tt>DeepSeek-R1</tt>** | **Actions** | 0.06 | 0.20 | 0.76 | 0.03 |
| **<tt>Qwen3</tt>** | **Actions** | 0.00 | 0.80 | 0.93 | 0.36 |
Errors in action selection may stem from either arithmetic miscalculations Errors in action selection may stem from either arithmetic miscalculations
(e.g., the model incorrectly assumes that $500 + 100 > 400 + 300$) or (e.g., the model incorrectly assumes that $500 + 100 > 400 + 300$) or
......
This diff is collapsed.
Model,ALTRUISTIC,EGALITARIAN,SELFISH,UTILITARIAN Model,ALTRUISTIC,EGALITARIAN,SELFISH,UTILITARIAN
deepseek-r1,0.2,0.03333333333333333,0.06666666666666667,0.7666666666666667 deepseek-r1,0.15,0.06666666666666667,0.15,0.8
deepseek-r1:7b,0.5666666666666667,0.9,0.4666666666666667,0.6666666666666666 deepseek-r1:7b,0.5666666666666667,0.9,0.4666666666666667,0.6666666666666666
gpt-4.5-preview-2025-02-27,1.0,1.0,1.0,0.5 gpt-4.5-preview-2025-02-27,1.0,1.0,1.0,0.5
llama3,0.9,0.7333333333333333,1.0,0.4 llama3,0.9,0.7333333333333333,1.0,0.4
llama3.3:latest,1.0,0.9666666666666667,1.0,0.43333333333333335 llama3.3:latest,1.0,0.9666666666666667,1.0,0.43333333333333335
mistral-small,0.9411764705882353,0.16666666666666666,0.4,0.7666666666666667 mistral-small,0.95,0.16666666666666666,0.4,0.7
mixtral:8x7b,0.0,1.0,0.0,0.3 mixtral:8x7b,0.0,1.0,0.0,0.3
qwen3,0.0,0.8,0.9333333333333333,0.36666666666666664
...@@ -274,6 +274,25 @@ class DictatorSetup: ...@@ -274,6 +274,25 @@ class DictatorSetup:
"motivations": "preference dictates how the resources are distributed", "motivations": "preference dictates how the resources are distributed",
"is_consistent": True, "is_consistent": True,
} }
elif model == "qwen3":
if self.preference == Welfare.EGALITARIAN:
return {
'my_share': 500,
'other_share': 500,
'lost': 0
}
elif self.preference == Welfare.UTILITARIAN:
return {
'my_share': 0,
'other_share': 1000,
'lost': 0
}
else:
return {
'my_share': 0,
'other_share': 0,
'lost': 1000
}
else: else:
raise ValueError("Invalid preference type") raise ValueError("Invalid preference type")
return {"error": "Preference strategy not defined"} return {"error": "Preference strategy not defined"}
......
...@@ -65,7 +65,7 @@ class DictatorSetupExperiment: ...@@ -65,7 +65,7 @@ class DictatorSetupExperiment:
# Running the experiment # Running the experiment
if __name__ == "__main__": if __name__ == "__main__":
models = [ "llama3", "mistral-small", "deepseek-r1"] # "gpt-4.5-preview-2025-02-27", "mixtral:8x7b", "llama3.3:latest", "deepseek-r1:7b", models = [ "qwen3" ] # "gpt-4.5-preview-2025-02-27", "mixtral:8x7b", "llama3.3:latest", "deepseek-r1:7b", "llama3", "mistral-small", "deepseek-r1"
temperature = 0.7 temperature = 0.7
iterations = 30 iterations = 30
output_file = '../../data/dictator/dictator_setup.csv' output_file = '../../data/dictator/dictator_setup.csv'
......
...@@ -63,7 +63,7 @@ class DictatorTemperatureExperiment: ...@@ -63,7 +63,7 @@ class DictatorTemperatureExperiment:
# Running the experiment # Running the experiment
if __name__ == "__main__": if __name__ == "__main__":
models = ["gpt-4.5-preview-2025-02-27", "llama3", "mistral-small", "deepseek-r1"] models = ["qwen3"]#"gpt-4.5-preview-2025-02-27", "llama3", "mistral-small", "deepseek-r1"
temperatures = [round(i * 0.1, 1) for i in range(7,11)] # Temperatures from 0.0 to 1.0 with a step of 0.1 temperatures = [round(i * 0.1, 1) for i in range(7,11)] # Temperatures from 0.0 to 1.0 with a step of 0.1
amount = 100 amount = 100
iterations = 30 iterations = 30
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment