license: mit
task_categories:
- text-generation
language:
- en
tags:
- oeis
- sequence
- sequence-prediction
- numerical-sequences
- mathematics
pretty_name: OEIS Next Term Prediction Dataset
size_categories:
- 100K<n<1M
OEIS Next Term Prediction Dataset
This dataset provides a benchmark for evaluating models on their ability to predict the next term in integer sequences sourced from the Online Encyclopedia of Integer Sequences (OEIS).
Table of Contents
- Introduction
- Dataset Preparation & Schema
- How to Use
- Dataset Fields
- License
- OEIS End-User License
- Acknowledgements
Introduction
This dataset introduces a new benchmark focused on integer sequence prediction, leveraging the vast database of integer sequences from the Online Encyclopedia of Integer Sequences (OEIS). This dataset aims to facilitate the assessment of a model's ability to infer patterns and predict the subsequent term in a given integer sequence.
The dataset includes sequences categorised for two distinct benchmark difficulties: an "easy" benchmark and a "regular" benchmark. For each sequence, the task is to predict the 20th term, or the final term if the sequence is shorter than 20 elements, given its initial terms. This dataset is designed to be readily used by external evaluation scripts to assess model performance.
Dataset Preparation & Schema
The data has been preprocessed from the original OEIS dataset. Duplicate sequence_first_terms have been removed to ensure unicity. Sequences with fewer than 8 elements have also been removed.
The dataset's schema is designed to provide clear inputs and targets for next-term prediction tasks. Here's a breakdown of each column:
sequence_id(string): This is the unique identifier for each sequence, directly corresponding to its "A-number" from the OEIS database (e.g., "A000045"). It's useful for cross-referencing with the original OEIS entries.sequence_name(string): The brief description of the integer sequence as provided by OEIS (e.g., "Fibonacci numbers"). This gives context to the sequence. If included in your model's prompt, it can significantly aid in predicting the next term.sequence_first_terms(list[int]): This is the input for your models. It's a list of integers representing the initial terms of the sequence. These sequences have been pre-processed: they're truncated to a maximum of 19 terms, and only sequences with at least 7 terms in this list are included. This means models will always receive a sufficiently long prefix to make a prediction.sequence_next_term(int): This is the target for your models. It's the single integer value that represents the true next term in the sequence, following directly fromsequence_first_terms.is_easy(bool): A boolean flag indicating the estimated difficulty of the sequence.Truemeans the original OEIS entry for this sequence was tagged with the keyword "easy," whileFalseindicates a "regular" difficulty. This allows you to evaluate model performance on different challenge levels.
How to Use
You can easily load this dataset using the Hugging Face datasets library:
from datasets import load_dataset
dataset = load_dataset("RenaudGaudron/oeis-sequences-benchmark")
print(dataset)
License
- MIT License.
OEIS End-User License
This dataset uses data from the Online Encyclopedia of Integer Sequences (OEIS). Please refer to the OEIS End-User License for terms of use related to the source data: http://oeis.org/LICENSE
Acknowledgements
This project leverages the incredible work of various communities. We extend our sincere gratitude to:
- Hugging Face: For their platform and invaluable datasets library, which hosts and facilitates the use of this benchmark.
- The Online Encyclopedia of Integer Sequences (OEIS): For providing the rich database of integer sequences that forms the basis of this benchmark dataset.
- Christopher Akiki: For uploading the structured OEIS dataset to Hugging Face.
- The Python Community: For the rich ecosystem of libraries that enabled the dataset's creation.