Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,132 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: agpl-3.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: agpl-3.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- pokemon-showdown
|
| 7 |
+
- transformer
|
| 8 |
+
- game-ai
|
| 9 |
+
- monte-carlo-search
|
| 10 |
+
library_name: pytorch
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# AlphaMon
|
| 15 |
+
|
| 16 |
+
AlphaMon is a transformer-based battle policy model for Pokemon Showdown doubles formats, trained on large-scale replay logs and used with a Monte Carlo rollout search layer for decision support.
|
| 17 |
+
|
| 18 |
+
Current repository: https://github.com/davidemodolo/alphamon
|
| 19 |
+
|
| 20 |
+
## Model summary
|
| 21 |
+
|
| 22 |
+
AlphaMon is a decoder-only transformer trained on tokenized Showdown battle logs.
|
| 23 |
+
It predicts:
|
| 24 |
+
|
| 25 |
+
1. Next token (policy head)
|
| 26 |
+
2. Win probability (value head)
|
| 27 |
+
|
| 28 |
+
At inference time, model outputs are combined with structured rollout search to produce ranked battle actions.
|
| 29 |
+
|
| 30 |
+
## What is currently released
|
| 31 |
+
|
| 32 |
+
This model repo currently includes:
|
| 33 |
+
|
| 34 |
+
1. Pretrained checkpoint:
|
| 35 |
+
- checkpoints/alphamon_pretrained_best.pt
|
| 36 |
+
2. Training replay list used for dataset construction:
|
| 37 |
+
- release/training_games_list.txt
|
| 38 |
+
|
| 39 |
+
Finetuned checkpoints are still in progress and may be added later.
|
| 40 |
+
|
| 41 |
+
## Architecture
|
| 42 |
+
|
| 43 |
+
Main model config (current defaults from training code):
|
| 44 |
+
|
| 45 |
+
1. Context length: 2048
|
| 46 |
+
2. Hidden size: 512
|
| 47 |
+
3. Attention heads: 8
|
| 48 |
+
4. Layers: 6
|
| 49 |
+
5. Dropout: 0.1
|
| 50 |
+
|
| 51 |
+
Training objective:
|
| 52 |
+
|
| 53 |
+
1. Cross-entropy loss for policy tokens
|
| 54 |
+
2. MSE loss for value prediction
|
| 55 |
+
3. Combined loss: policy + 0.5 * value
|
| 56 |
+
|
| 57 |
+
## Data
|
| 58 |
+
|
| 59 |
+
Training data is derived from publicly available Pokemon Showdown replay logs, harvested by format and filtered/cleaned before tokenization.
|
| 60 |
+
|
| 61 |
+
Data pipeline includes:
|
| 62 |
+
|
| 63 |
+
1. Replay harvesting from Showdown search endpoint
|
| 64 |
+
2. Metadata extraction (winner, ratings, format)
|
| 65 |
+
3. Quality and format filtering
|
| 66 |
+
4. Tokenization and mmap cache construction
|
| 67 |
+
|
| 68 |
+
## Intended use
|
| 69 |
+
|
| 70 |
+
AlphaMon is intended for:
|
| 71 |
+
|
| 72 |
+
1. Research and experimentation in game AI
|
| 73 |
+
2. Decision support for Pokemon Showdown doubles battle states
|
| 74 |
+
3. Study of sequence modeling + search-based action selection
|
| 75 |
+
|
| 76 |
+
It is not intended for:
|
| 77 |
+
|
| 78 |
+
1. Fully autonomous ladder abuse or platform policy violations
|
| 79 |
+
2. Safety-critical applications
|
| 80 |
+
3. Legal advice or compliance decisions
|
| 81 |
+
|
| 82 |
+
## Limitations
|
| 83 |
+
|
| 84 |
+
1. Strongly domain-specific to Showdown-style tokenized logs
|
| 85 |
+
2. Quality depends on training replay distribution and filtering
|
| 86 |
+
3. Not guaranteed to choose legal-optimal actions in all edge cases
|
| 87 |
+
4. Performance can degrade on unseen formats or mechanics
|
| 88 |
+
|
| 89 |
+
## Inference notes
|
| 90 |
+
|
| 91 |
+
In the main project, inference uses:
|
| 92 |
+
|
| 93 |
+
1. Monte Carlo rollout search for TURN, TEAM_PREVIEW, and FAINT objectives
|
| 94 |
+
2. Optional team-aware logit bias to nudge generation toward known:
|
| 95 |
+
- species tokens
|
| 96 |
+
- move tokens
|
| 97 |
+
- item tokens
|
| 98 |
+
- tera type tokens
|
| 99 |
+
|
| 100 |
+
This bias is additive and does not hard-force outputs.
|
| 101 |
+
|
| 102 |
+
## How to use with the project
|
| 103 |
+
|
| 104 |
+
1. Clone the main repo:
|
| 105 |
+
- https://github.com/davidemodolo/alphamon
|
| 106 |
+
2. Download checkpoint from this HF model repo into:
|
| 107 |
+
- checkpoints/alphamon_pretrained_best.pt
|
| 108 |
+
3. Run server inference from the repo:
|
| 109 |
+
- python server/server.py
|
| 110 |
+
|
| 111 |
+
## License and third-party content
|
| 112 |
+
|
| 113 |
+
This repository is currently marked AGPL-3.0.
|
| 114 |
+
|
| 115 |
+
Important note:
|
| 116 |
+
Pokemon-related names, mechanics, and source replay content may be subject to their own rights and terms by their respective owners/platforms.
|
| 117 |
+
This model card and repository license apply to the released project assets to the extent permitted.
|
| 118 |
+
|
| 119 |
+
## Citation
|
| 120 |
+
|
| 121 |
+
If you use AlphaMon in research, please cite:
|
| 122 |
+
|
| 123 |
+
Modolo, Davide. AlphaMon: Transformer-based Showdown Battle Policy Model.
|
| 124 |
+
|
| 125 |
+
You can also cite the GitHub repository:
|
| 126 |
+
https://github.com/davidemodolo/alphamon
|
| 127 |
+
|
| 128 |
+
## Contact
|
| 129 |
+
|
| 130 |
+
Maintainer: Davide Modolo
|
| 131 |
+
HF: https://huggingface.co/davidemodolo
|
| 132 |
+
GitHub: https://github.com/davidemodolo
|