Datasets:
license: mit
task_categories:
- text-generation
language:
- en
tags:
- mathematics
- group-theory
- permutations
- symbolic-reasoning
- algebra
- sequence-modeling
pretty_name: Permutation Groups Composition Dataset
size_categories:
- 10M<n<100M
Permutation Groups Composition Dataset
A comprehensive collection of permutation composition datasets for various mathematical groups including symmetric, alternating, cyclic, dihedral, and special groups, with multiple sequence length variants.
Dataset Description
This dataset contains permutation composition problems across 30 different mathematical groups with 8 different sequence length variants each, totaling 270 distinct configurations.
Supported Groups
Symmetric Groups (Sn)
- S3 to S7: All permutations of n elements (orders: 6, 24, 120, 720, 5040)
Alternating Groups (An)
- A3 to A7: Even permutations of n elements (orders: 3, 12, 60, 360, 2520)
Cyclic Groups (Cn/Zn)
- C3 to C12: Cyclic groups of order n
- Z3 to Z6: Alternative notation for cyclic groups
- Orders: 3, 4, 5, 6, 7, 8, 10, 12
Dihedral Groups (Dn)
- D3 to D8: Symmetries of regular n-gons (orders: 6, 8, 10, 12, 14, 16)
Special Groups
- PSL(2,5): Projective special linear group (order 60)
- F20: Frobenius group F(5,4) (order 20)
Length Variants
Each group is available with 8 different maximum sequence lengths:
- 2², 2³, 2⁴, 2⁵, 2⁶, 2⁷, 2⁸, 2⁹ (4, 8, 16, 32, 64, 128, 256, 512)
Each dataset consists of sequences of permutations that need to be composed to produce a target permutation. This is useful for:
- Training models on algebraic reasoning and symbolic computation
- Evaluating mathematical understanding and compositional generalization
- Benchmarking sequence models on structured mathematical tasks
- Studying group theory properties in neural networks
- Research in abstract algebra and computational mathematics
Usage
from datasets import load_dataset
# NEW: Clean API - just specify group and max_len
s5_data = load_dataset(
"BeeGass/permutation-groups",
name="s5", # Just the group name
max_len=32, # Optional: filter sequences ≤ 32 (default: 512)
trust_remote_code=True
)
# More examples with the clean API
c8_short = load_dataset("BeeGass/permutation-groups", name="c8", max_len=16, trust_remote_code=True)
d4_medium = load_dataset("BeeGass/permutation-groups", name="d4", max_len=64, trust_remote_code=True)
all_short = load_dataset("BeeGass/permutation-groups", name="all", max_len=32, trust_remote_code=True)
# Backwards compatibility - old style still works
s5_data = load_dataset("BeeGass/permutation-groups", name="s5_data", trust_remote_code=True)
s5_len32 = load_dataset("BeeGass/permutation-groups", name="s5_len32", trust_remote_code=True)
# Access the data
train_data = s5_data["train"]
test_data = s5_data["test"]
# Example data point
print(train_data[0])
# {'input_sequence': '23 45 12', 'target': '67'}
Dataset Structure
Each example contains:
input_sequence: A space-separated sequence of permutation IDs to be composedtarget: The ID of the resulting permutation after composition
The composition follows standard mathematical convention: for input [p1, p2, p3], the result is p3 ∘ p2 ∘ p1.
Available Configurations
Efficient Loading (Recommended)
Simply specify the group name and optional max_len parameter:
# Load any group with any max sequence length
dataset = load_dataset("BeeGass/permutation-groups", name="s5", max_len=32, trust_remote_code=True)
All Groups (30 total)
| Group | Type | Order | Example Usage |
|---|---|---|---|
| S3-S7 | Symmetric | 6-5040 | name="s5", max_len=64 |
| A3-A7 | Alternating | 3-2520 | name="a4", max_len=32 |
| C3-C12 | Cyclic | 3-12 | name="c8", max_len=16 |
| Z3-Z6 | Cyclic (alt) | 3-6 | name="z5", max_len=128 |
| D3-D8 | Dihedral | 6-16 | name="d4", max_len=256 |
| PSL25 | PSL(2,5) | 60 | name="psl25", max_len=64 |
| F20 | Frobenius | 20 | name="f20", max_len=32 |
| all | Combined | - | name="all", max_len=16 |
Legacy Configuration Names
For backwards compatibility, old-style names still work:
s5_data(equivalent toname="s5")s5_len32(equivalent toname="s5", max_len=32)- etc.
Dataset Features
- Variable sequence length: Input sequences range from 3 to maximum configured length
- Length-specific variants: 8 different maximum lengths for each group (2² to 2⁹)
- Consistent formatting: All permutations use space-separated integer IDs
- Metadata included: Each dataset includes a
metadata.jsonfile mapping IDs to permutation array forms - Train/test split: 80/20 split for all configurations
- Scaled sample sizes: Shorter sequences have more samples for efficient training
Understanding the Data
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.
For example, in S3:
- ID 0 might map to
[0, 1, 2](identity) - ID 1 might map to
[0, 2, 1](transpose elements 1 and 2) - etc.
Citation
If you use this dataset in your research, please cite:
@software{permutation_groups_dataset,
author = {Bryan Gass},
title = {Permutation Groups Dataset},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/BeeGass/permutation-groups}
}
Acknowledgments
This dataset was inspired by the work of William Merrill and his paper "The Illusion of State in State-Space Models", which explores the computational properties of state-space models through group theory.
License
This dataset is released under the MIT License.
Contact
For questions or issues, please open an issue on the GitHub repository.