Views
No views yet
| Property | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-7B-Instruct |
| Method | QLoRA (4-bit NF4 quantization + LoRA) |
| Task | Real-world scenario → Formal game theory formulation |
| Dataset | Alogotron/GameTheory-Formulator (1,215 examples) |
| Training | SFT, 1 epoch, ~24 minutes on 2x RTX 3090 |
| Eval Accuracy | 100.0% valid formulations on held-out set |
| Phase | Model | Task | Method |
|---|---|---|---|
| Phase 1 | GameTheory-Solver | Solve formal GT problems | SFT on 2,913 problems → 94% accuracy |
| Phase 2 | GameTheory-Reasoner | Enhanced reasoning | GRPO on same dataset |
| Phase 3 | GameTheory-Formulator (this model) | Real-world → formal GT | SFT on 1,215 formulation problems |
| Parameter | Value |
|---|---|
| LoRA rank (r) | 32 |
| LoRA alpha | 64 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Quantization | 4-bit NF4 with double quantization |
| Trainable params | 80.7M / 7.7B (1.05%) |
| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch size (per device) | 2 |
| Gradient accumulation | 4 |
| Effective batch size | 16 |
| Learning rate | 5e-5 (cosine schedule) |
| Optimizer | paged_adamw_8bit |
| Max sequence length | 2048 |
| Packing | Enabled |
| Gradient checkpointing | Enabled |
| Hardware | 2x NVIDIA RTX 3090 (24GB each) |
| Metric | Value |
|---|---|
| Train loss | 1.0992 |
| Eval loss | 0.8492 |
| Training time | 24.3 minutes |
| Dataset size | 1215 examples |
| Train split | 1093 examples |
| Eval split | 122 examples |
| Metric | Score |
|---|---|
| Valid Formulations | 100.0% |
| All sections present | 100.0% |
| All GT elements identified | 100.0% |
| Avg response length | 1821 chars |
| Domain | Valid |
|---|---|
| Business | 8/8 (100%) |
| Security | 5/5 (100%) |
| Politics | 2/2 (100%) |
| Auctions | 2/2 (100%) |
| Technology | 2/2 (100%) |
| Social | 1/1 (100%) |
| Difficulty | Valid |
|---|---|
| Easy | 5/5 (100%) |
| Medium | 9/9 (100%) |
| Hard | 6/6 (100%) |
1from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
2from peft import PeftModel
3import torch
4
5# Load base model in 4-bit
6bnb_config = BitsAndBytesConfig(
7 load_in_4bit=True,
8 bnb_4bit_quant_type="nf4",
9 bnb_4bit_compute_dtype=torch.bfloat16,
10 bnb_4bit_use_double_quant=True,
11)
12
13base_model = AutoModelForCausalLM.from_pretrained(
14 "Qwen/Qwen2.5-7B-Instruct",
15 quantization_config=bnb_config,
16 device_map="auto",
17)
18tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
19
20# Load the Formulator adapter
21model = PeftModel.from_pretrained(base_model, "Alogotron/GameTheory-Formulator-Model")
22model.eval()
23
24# Create a prompt
25messages = [
26 {"role": "system", "content": "You are a game theory expert. Given a real-world scenario, formulate it as a formal game theory model. Identify the players, strategies, payoffs, and information structure. Then solve the game and interpret the results."},
27 {"role": "user", "content": "Two coffee shops on the same street must decide whether to offer a loyalty program. If both offer it, they split customers evenly but incur costs. If neither offers it, they split evenly with no extra cost. If only one offers it, that shop attracts 70% of customers."}
28]
29
30text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
31inputs = tokenizer(text, return_tensors="pt").to(model.device)
32
33with torch.no_grad():
34 outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.3, top_p=0.9)
35
36response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
37print(response)Two airline companies, Stellar and Haven, each control roughly half the market. They are independently deciding their pricing for the upcoming quarter...
Formulation Steps
Step 1 - Stellar and Haven are each making pricing decisions that directly affect each other's profits...Step 2 - Players: Stellar and Haven...Step 3 - Strategies: Each firm can either 'Maintain Prices' or 'Cut Prices'...Formal Game Model
Game Type: Simultaneous Players: Stellar, Haven Strategies: Maintain Prices, Cut Prices Payoffs: Both Maintain: (54, 54), Both Cut: (18, 18)... Solution Concept: Nash EquilibriumSolution
Both firms will cut prices. Cutting is a dominant strategy for each...Real-World Interpretation
This is a classic Prisoner's Dilemma. Both companies rationally choose to cut prices, resulting in lower profits than cooperation would yield...
| Resource | Link |
|---|---|
| Phase 1: Solver Model | Alogotron/GameTheory-Solver |
| Phase 2: Reasoner Model | Alogotron/GameTheory-Reasoner |
| Solver Dataset | Alogotron/GameTheory-Bench |
| Formulator Dataset | Alogotron/GameTheory-Formulator |
1@misc{alogotron-formulator-2025,
2 title={GameTheory-Formulator-Model: Real-World Scenario to Game Theory Formulation},
3 author={Alogotron},
4 year={2025},
5 publisher={HuggingFace},
6 url={https://huggingface.co/Alogotron/GameTheory-Formulator-Model}
7}1@model{alogotron_gametheory_formulator_model_2026,
2 author = {Alogotron},
3 title = {GameTheory-Formulator-Model: Real-World Scenario to Formal Game Theory},
4 year = {2026},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/Alogotron/GameTheory-Formulator-Model},
7 note = {Phase 3 formulation adapter achieving 100\% valid formulation rate}
8}