Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,41 +1,181 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
```python
|
| 10 |
from datasets import load_dataset
|
| 11 |
|
| 12 |
-
# Load a specific dataset
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
# Load all datasets combined
|
| 18 |
all_datasets = load_dataset("BeeGass/permutation-groups", name="all", trust_remote_code=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
```
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## Available Configurations
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
## Dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## License
|
| 40 |
|
| 41 |
-
MIT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
tags:
|
| 8 |
+
- mathematics
|
| 9 |
+
- group-theory
|
| 10 |
+
- permutations
|
| 11 |
+
- symbolic-reasoning
|
| 12 |
+
pretty_name: Permutation Groups Dataset
|
| 13 |
+
size_categories:
|
| 14 |
+
- 100K<n<1M
|
| 15 |
+
configs:
|
| 16 |
+
- config_name: s3_data
|
| 17 |
+
data_files:
|
| 18 |
+
- split: train
|
| 19 |
+
path: data/s3_data/train/*
|
| 20 |
+
- split: test
|
| 21 |
+
path: data/s3_data/test/*
|
| 22 |
+
- config_name: s4_data
|
| 23 |
+
data_files:
|
| 24 |
+
- split: train
|
| 25 |
+
path: data/s4_data/train/*
|
| 26 |
+
- split: test
|
| 27 |
+
path: data/s4_data/test/*
|
| 28 |
+
- config_name: s5_data
|
| 29 |
+
data_files:
|
| 30 |
+
- split: train
|
| 31 |
+
path: data/s5_data/train/*
|
| 32 |
+
- split: test
|
| 33 |
+
path: data/s5_data/test/*
|
| 34 |
+
- config_name: s6_data
|
| 35 |
+
data_files:
|
| 36 |
+
- split: train
|
| 37 |
+
path: data/s6_data/train/*
|
| 38 |
+
- split: test
|
| 39 |
+
path: data/s6_data/test/*
|
| 40 |
+
- config_name: s7_data
|
| 41 |
+
data_files:
|
| 42 |
+
- split: train
|
| 43 |
+
path: data/s7_data/train/*
|
| 44 |
+
- split: test
|
| 45 |
+
path: data/s7_data/test/*
|
| 46 |
+
- config_name: a3_data
|
| 47 |
+
data_files:
|
| 48 |
+
- split: train
|
| 49 |
+
path: data/a3_data/train/*
|
| 50 |
+
- split: test
|
| 51 |
+
path: data/a3_data/test/*
|
| 52 |
+
- config_name: a4_data
|
| 53 |
+
data_files:
|
| 54 |
+
- split: train
|
| 55 |
+
path: data/a4_data/train/*
|
| 56 |
+
- split: test
|
| 57 |
+
path: data/a4_data/test/*
|
| 58 |
+
- config_name: a5_data
|
| 59 |
+
data_files:
|
| 60 |
+
- split: train
|
| 61 |
+
path: data/a5_data/train/*
|
| 62 |
+
- split: test
|
| 63 |
+
path: data/a5_data/test/*
|
| 64 |
+
- config_name: a6_data
|
| 65 |
+
data_files:
|
| 66 |
+
- split: train
|
| 67 |
+
path: data/a6_data/train/*
|
| 68 |
+
- split: test
|
| 69 |
+
path: data/a6_data/test/*
|
| 70 |
+
- config_name: a7_data
|
| 71 |
+
data_files:
|
| 72 |
+
- split: train
|
| 73 |
+
path: data/a7_data/train/*
|
| 74 |
+
- split: test
|
| 75 |
+
path: data/a7_data/test/*
|
| 76 |
+
---
|
| 77 |
|
| 78 |
+
# Permutation Groups Dataset
|
| 79 |
|
| 80 |
+
A comprehensive collection of permutation composition datasets for symmetric and alternating groups, designed for training and evaluating models on group theory operations.
|
| 81 |
+
|
| 82 |
+
## Dataset Description
|
| 83 |
+
|
| 84 |
+
This dataset contains permutation composition problems for various mathematical groups:
|
| 85 |
+
- **Symmetric Groups**: S3, S4, S5, S6, S7
|
| 86 |
+
- **Alternating Groups**: A3, A4, A5, A6, A7
|
| 87 |
|
| 88 |
+
Each dataset consists of sequences of permutations that need to be composed to produce a target permutation. This is useful for:
|
| 89 |
+
- Training models on symbolic reasoning
|
| 90 |
+
- Evaluating mathematical understanding
|
| 91 |
+
- Testing compositional generalization
|
| 92 |
+
- Studying group theory properties in neural networks
|
| 93 |
+
|
| 94 |
+
## Usage
|
| 95 |
|
| 96 |
```python
|
| 97 |
from datasets import load_dataset
|
| 98 |
|
| 99 |
+
# Load a specific group dataset
|
| 100 |
+
s5_dataset = load_dataset("BeeGass/permutation-groups", name="s5_data", trust_remote_code=True)
|
| 101 |
+
|
| 102 |
+
# Load alternating group A5
|
| 103 |
+
a5_dataset = load_dataset("BeeGass/permutation-groups", name="a5_data", trust_remote_code=True)
|
| 104 |
|
| 105 |
# Load all datasets combined
|
| 106 |
all_datasets = load_dataset("BeeGass/permutation-groups", name="all", trust_remote_code=True)
|
| 107 |
+
|
| 108 |
+
# Access the data
|
| 109 |
+
train_data = s5_dataset["train"]
|
| 110 |
+
test_data = s5_dataset["test"]
|
| 111 |
+
|
| 112 |
+
# Example data point
|
| 113 |
+
print(train_data[0])
|
| 114 |
+
# {'input_sequence': '23 45 12', 'target': '67'}
|
| 115 |
```
|
| 116 |
|
| 117 |
+
## Dataset Structure
|
| 118 |
+
|
| 119 |
+
Each example contains:
|
| 120 |
+
- `input_sequence`: A space-separated sequence of permutation IDs to be composed
|
| 121 |
+
- `target`: The ID of the resulting permutation after composition
|
| 122 |
+
|
| 123 |
+
The composition follows standard mathematical convention: for input `[p1, p2, p3]`, the result is `p3 ∘ p2 ∘ p1`.
|
| 124 |
+
|
| 125 |
## Available Configurations
|
| 126 |
|
| 127 |
+
| Configuration | Group Type | Group Order | Elements | Train Samples | Test Samples |
|
| 128 |
+
|--------------|------------|-------------|----------|---------------|--------------|
|
| 129 |
+
| `s3_data` | Symmetric | S3 | 6 | 8,000 | 2,000 |
|
| 130 |
+
| `s4_data` | Symmetric | S4 | 24 | 16,000 | 4,000 |
|
| 131 |
+
| `s5_data` | Symmetric | S5 | 120 | 40,000 | 10,000 |
|
| 132 |
+
| `s6_data` | Symmetric | S6 | 720 | 80,000 | 20,000 |
|
| 133 |
+
| `s7_data` | Symmetric | S7 | 5,040 | 160,000 | 40,000 |
|
| 134 |
+
| `a3_data` | Alternating | A3 | 3 | 4,000 | 1,000 |
|
| 135 |
+
| `a4_data` | Alternating | A4 | 12 | 12,000 | 3,000 |
|
| 136 |
+
| `a5_data` | Alternating | A5 | 60 | 24,000 | 6,000 |
|
| 137 |
+
| `a6_data` | Alternating | A6 | 360 | 64,000 | 16,000 |
|
| 138 |
+
| `a7_data` | Alternating | A7 | 2,520 | 120,000 | 30,000 |
|
| 139 |
+
| `all` | Combined | - | - | 528,000 | 132,000 |
|
| 140 |
|
| 141 |
+
## Dataset Features
|
| 142 |
+
|
| 143 |
+
- **Variable sequence length**: Input sequences range from 3 to 512 permutations
|
| 144 |
+
- **Consistent formatting**: All permutations use space-separated integer IDs
|
| 145 |
+
- **Metadata included**: Each dataset includes a `metadata.json` file mapping IDs to permutation array forms
|
| 146 |
+
- **Train/test split**: 80/20 split for all configurations
|
| 147 |
+
|
| 148 |
+
## Understanding the Data
|
| 149 |
+
|
| 150 |
+
Each permutation is represented by a unique integer ID. The `metadata.json` file in each dataset folder provides the mapping from IDs to permutation array forms.
|
| 151 |
+
|
| 152 |
+
For example, in S3:
|
| 153 |
+
- ID 0 might map to `[0, 1, 2]` (identity)
|
| 154 |
+
- ID 1 might map to `[0, 2, 1]` (transpose elements 1 and 2)
|
| 155 |
+
- etc.
|
| 156 |
+
|
| 157 |
+
## Citation
|
| 158 |
|
| 159 |
+
If you use this dataset in your research, please cite:
|
| 160 |
+
|
| 161 |
+
```bibtex
|
| 162 |
+
@software{permutation_groups_dataset,
|
| 163 |
+
author = {Bryan Gass},
|
| 164 |
+
title = {Permutation Groups Dataset},
|
| 165 |
+
year = {2024},
|
| 166 |
+
publisher = {Hugging Face},
|
| 167 |
+
url = {https://huggingface.co/datasets/BeeGass/permutation-groups}
|
| 168 |
+
}
|
| 169 |
+
```
|
| 170 |
+
|
| 171 |
+
## Acknowledgments
|
| 172 |
+
|
| 173 |
+
This dataset was inspired by the work of [William Merrill](https://github.com/viking-sudo-rm) and his paper ["The Illusion of State in State-Space Models"](https://arxiv.org/abs/2404.08819), which explores the computational properties of state-space models through group theory.
|
| 174 |
|
| 175 |
## License
|
| 176 |
|
| 177 |
+
This dataset is released under the MIT License.
|
| 178 |
+
|
| 179 |
+
## Contact
|
| 180 |
+
|
| 181 |
+
For questions or issues, please open an issue on the [GitHub repository](https://github.com/BeeGass/permutation-groups).
|