Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,41 +1,161 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
```python
|
| 10 |
from datasets import load_dataset
|
| 11 |
|
| 12 |
-
# Load a specific
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
| 19 |
```
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
## Available Configurations
|
| 22 |
|
| 23 |
-
|
| 24 |
-
- `
|
| 25 |
-
- `
|
| 26 |
-
- `s6_data`: Symmetric Group S6
|
| 27 |
-
- `s7_data`: Symmetric Group S7
|
| 28 |
-
- `a5_data`: Alternating Group A5
|
| 29 |
-
- `a6_data`: Alternating Group A6
|
| 30 |
-
- `a7_data`: Alternating Group A7
|
| 31 |
-
- `all`: All datasets combined
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
Each dataset
|
| 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 |
+
- algebra
|
| 13 |
+
- sequence-modeling
|
| 14 |
+
pretty_name: Permutation Groups Composition Dataset
|
| 15 |
+
size_categories:
|
| 16 |
+
- 10M<n<100M
|
| 17 |
+
---
|
| 18 |
|
| 19 |
+
# Permutation Groups Composition Dataset
|
| 20 |
|
| 21 |
+
A comprehensive collection of permutation composition datasets for various mathematical groups including symmetric, alternating, cyclic, dihedral, and special groups, with multiple sequence length variants.
|
| 22 |
+
|
| 23 |
+
## Dataset Description
|
| 24 |
+
|
| 25 |
+
This dataset contains permutation composition problems across 30 different mathematical groups with 8 different sequence length variants each, totaling 270 distinct configurations.
|
| 26 |
+
|
| 27 |
+
### Supported Groups
|
| 28 |
+
|
| 29 |
+
#### Symmetric Groups (Sn)
|
| 30 |
+
- **S3** to **S7**: All permutations of n elements (orders: 6, 24, 120, 720, 5040)
|
| 31 |
+
|
| 32 |
+
#### Alternating Groups (An)
|
| 33 |
+
- **A3** to **A7**: Even permutations of n elements (orders: 3, 12, 60, 360, 2520)
|
| 34 |
+
|
| 35 |
+
#### Cyclic Groups (Cn/Zn)
|
| 36 |
+
- **C3** to **C12**: Cyclic groups of order n
|
| 37 |
+
- **Z3** to **Z6**: Alternative notation for cyclic groups
|
| 38 |
+
- Orders: 3, 4, 5, 6, 7, 8, 10, 12
|
| 39 |
+
|
| 40 |
+
#### Dihedral Groups (Dn)
|
| 41 |
+
- **D3** to **D8**: Symmetries of regular n-gons (orders: 6, 8, 10, 12, 14, 16)
|
| 42 |
+
|
| 43 |
+
#### Special Groups
|
| 44 |
+
- **PSL(2,5)**: Projective special linear group (order 60)
|
| 45 |
+
- **F20**: Frobenius group F(5,4) (order 20)
|
| 46 |
+
|
| 47 |
+
### Length Variants
|
| 48 |
|
| 49 |
+
Each group is available with 8 different maximum sequence lengths:
|
| 50 |
+
- 2², 2³, 2⁴, 2⁵, 2⁶, 2⁷, 2⁸, 2⁹ (4, 8, 16, 32, 64, 128, 256, 512)
|
| 51 |
+
|
| 52 |
+
Each dataset consists of sequences of permutations that need to be composed to produce a target permutation. This is useful for:
|
| 53 |
+
- Training models on algebraic reasoning and symbolic computation
|
| 54 |
+
- Evaluating mathematical understanding and compositional generalization
|
| 55 |
+
- Benchmarking sequence models on structured mathematical tasks
|
| 56 |
+
- Studying group theory properties in neural networks
|
| 57 |
+
- Research in abstract algebra and computational mathematics
|
| 58 |
+
|
| 59 |
+
## Usage
|
| 60 |
|
| 61 |
```python
|
| 62 |
from datasets import load_dataset
|
| 63 |
|
| 64 |
+
# Load a specific group with default length (512)
|
| 65 |
+
s5_data = load_dataset("BeeGass/permutation-groups", name="s5_data", trust_remote_code=True)
|
| 66 |
+
|
| 67 |
+
# Load a specific length variant
|
| 68 |
+
s5_short = load_dataset("BeeGass/permutation-groups", name="s5_len32", trust_remote_code=True)
|
| 69 |
+
|
| 70 |
+
# Load cyclic group dataset
|
| 71 |
+
c8_data = load_dataset("BeeGass/permutation-groups", name="c8_data", trust_remote_code=True)
|
| 72 |
+
|
| 73 |
+
# Load dihedral group with specific length
|
| 74 |
+
d4_len64 = load_dataset("BeeGass/permutation-groups", name="d4_len64", trust_remote_code=True)
|
| 75 |
+
|
| 76 |
+
# Load all groups combined
|
| 77 |
+
all_data = load_dataset("BeeGass/permutation-groups", name="all", trust_remote_code=True)
|
| 78 |
+
|
| 79 |
+
# Load all groups with specific length
|
| 80 |
+
all_len16 = load_dataset("BeeGass/permutation-groups", name="all_len16", trust_remote_code=True)
|
| 81 |
+
|
| 82 |
+
# Access the data
|
| 83 |
+
train_data = s5_data["train"]
|
| 84 |
+
test_data = s5_data["test"]
|
| 85 |
|
| 86 |
+
# Example data point
|
| 87 |
+
print(train_data[0])
|
| 88 |
+
# {'input_sequence': '23 45 12', 'target': '67'}
|
| 89 |
```
|
| 90 |
|
| 91 |
+
## Dataset Structure
|
| 92 |
+
|
| 93 |
+
Each example contains:
|
| 94 |
+
- `input_sequence`: A space-separated sequence of permutation IDs to be composed
|
| 95 |
+
- `target`: The ID of the resulting permutation after composition
|
| 96 |
+
|
| 97 |
+
The composition follows standard mathematical convention: for input `[p1, p2, p3]`, the result is `p3 ∘ p2 ∘ p1`.
|
| 98 |
+
|
| 99 |
## Available Configurations
|
| 100 |
|
| 101 |
+
### Configuration Format
|
| 102 |
+
- Base: `{group}_data` (default length 512)
|
| 103 |
+
- Length variants: `{group}_len{n}` where n ∈ {4, 8, 16, 32, 64, 128, 256, 512}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
+
### All Groups (30 total)
|
| 106 |
+
| Group | Type | Order | Configurations |
|
| 107 |
+
|-------|------|-------|----------------|
|
| 108 |
+
| S3-S7 | Symmetric | 6-5040 | s3_data, s3_len4, ..., s3_len512 |
|
| 109 |
+
| A3-A7 | Alternating | 3-2520 | a3_data, a3_len4, ..., a3_len512 |
|
| 110 |
+
| C3-C12 | Cyclic | 3-12 | c3_data, c3_len4, ..., c3_len512 |
|
| 111 |
+
| Z3-Z6 | Cyclic (alt) | 3-6 | z3_data, z3_len4, ..., z3_len512 |
|
| 112 |
+
| D3-D8 | Dihedral | 6-16 | d3_data, d3_len4, ..., d3_len512 |
|
| 113 |
+
| PSL25 | PSL(2,5) | 60 | psl25_data, psl25_len4, ..., psl25_len512 |
|
| 114 |
+
| F20 | Frobenius | 20 | f20_data, f20_len4, ..., f20_len512 |
|
| 115 |
+
| all | Combined | - | all, all_len4, ..., all_len512 |
|
| 116 |
+
|
| 117 |
+
**Total configurations**: 270 (30 groups × 9 length variants)
|
| 118 |
+
|
| 119 |
+
## Dataset Features
|
| 120 |
+
|
| 121 |
+
- **Variable sequence length**: Input sequences range from 3 to maximum configured length
|
| 122 |
+
- **Length-specific variants**: 8 different maximum lengths for each group (2² to 2⁹)
|
| 123 |
+
- **Consistent formatting**: All permutations use space-separated integer IDs
|
| 124 |
+
- **Metadata included**: Each dataset includes a `metadata.json` file mapping IDs to permutation array forms
|
| 125 |
+
- **Train/test split**: 80/20 split for all configurations
|
| 126 |
+
- **Scaled sample sizes**: Shorter sequences have more samples for efficient training
|
| 127 |
+
|
| 128 |
+
## Understanding the Data
|
| 129 |
|
| 130 |
+
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.
|
| 131 |
+
|
| 132 |
+
For example, in S3:
|
| 133 |
+
- ID 0 might map to `[0, 1, 2]` (identity)
|
| 134 |
+
- ID 1 might map to `[0, 2, 1]` (transpose elements 1 and 2)
|
| 135 |
+
- etc.
|
| 136 |
+
|
| 137 |
+
## Citation
|
| 138 |
+
|
| 139 |
+
If you use this dataset in your research, please cite:
|
| 140 |
+
|
| 141 |
+
```bibtex
|
| 142 |
+
@software{permutation_groups_dataset,
|
| 143 |
+
author = {Bryan Gass},
|
| 144 |
+
title = {Permutation Groups Dataset},
|
| 145 |
+
year = {2024},
|
| 146 |
+
publisher = {Hugging Face},
|
| 147 |
+
url = {https://huggingface.co/datasets/BeeGass/permutation-groups}
|
| 148 |
+
}
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
## Acknowledgments
|
| 152 |
+
|
| 153 |
+
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.
|
| 154 |
|
| 155 |
## License
|
| 156 |
|
| 157 |
+
This dataset is released under the MIT License.
|
| 158 |
+
|
| 159 |
+
## Contact
|
| 160 |
+
|
| 161 |
+
For questions or issues, please open an issue on the [GitHub repository](https://github.com/BeeGass/permutation-groups).
|