The MATH Dataset

Overview

Measuring Mathematical Problem Solving With the MATH Dataset

This is the repository for Measuring Mathematical Problem Solving With the MATH Dataset by Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt.

This repository contains dataset loaders and evaluation code.

Download the MATH dataset here.

Download the AMPS pretraining dataset here.

Citation

If you find this useful in your research, please consider citing

@article{hendrycksmath2021,
  title={Measuring Mathematical Problem Solving With the MATH Dataset},
  author={Dan Hendrycks and Collin Burns and Saurav Kadavath and Akul Arora and Steven Basart and Eric Tang and Dawn Song and Jacob Steinhardt},
  journal={arXiv preprint arXiv:2103.03874},
  year={2021}
}
Comments
  • Which version of transformers lib is being used ?

    Which version of transformers lib is being used ?

    Hi, Thanks for the updates. Still unable to run evaluation script.

    
    Traceback (most recent call last):
      File "eval_math_gpt.py", line 373, in <module>
        run_eval(args)
      File "eval_math_gpt.py", line 174, in run_eval
        output_ids = model.generate(
      File "/home/sahmed9/anaconda3/envs/env2020/lib/python3.8/site-packages/torch/nn/modules/module.py", line 947, in __getattr__
        raise AttributeError("'{}' object has no attribute '{}'".format(
    AttributeError: 'GPT2LMHeadModel' object has no attribute 'generate'
    
    
    opened by crazysal 4
  • No module named 'dataset.deepmind'

    No module named 'dataset.deepmind'

    Hi, similar to previous :

    Traceback (most recent call last):
      File "eval_math_gpt.py", line 37, in <module>
        from dataset.deepmind import DeepMindMathDataset
    ModuleNotFoundError: No module named 'dataset.deepmind'
    

    On commenting out the same next error :

    Traceback (most recent call last):
      File "eval_math_gpt.py", line 360, in <module>
        parser.add_argument('--arch', default='gpt2', choices=transformers.GPT2_PRETRAINED_MODEL_ARCHIVE_LIST)
    AttributeError: module 'transformers' has no attribute 'GPT2_PRETRAINED_MODEL_ARCHIVE_LIST'
    
    
    opened by crazysal 3
  • Some latex typos in Math dataset

    Some latex typos in Math dataset

    I try to show the dataset in a pdf file, and most of the latex files are good to transfer. But there are still some latex typos in:

    1. test/intermediate_algebra/44.json

    A URL appears to be mistakenly included in a JSON file, like

        "solution": "... the diagram,\n\nhttp://aops-classroom.s3.amazonaws.com/Algebra3/Algebra3_Putnam1958_Morning1.png\n\n ..."
    

    Is it possible to correct this into a parsable form?

    1. test/prealgebra/1117.json
    "solution": "A $60 coat with a 20$\\%$ discount
    
    1. test/number_theory/407.json something like:
    6 3 _ _ _ _
    
    1. ./test/prealgebra/1645.json
    times $24.50 per square yard, or $\boxed{735}$ dollars.
    
    opened by jinze1994 1
  • File lists for mathematica

    File lists for mathematica

    For pre-training on amps where are the files "no_steps_flist_relative.txt" and "with_steps_flist_relative.txt" .

    Are they the concatenation of all *.txt in folder "data_file_lists" ?

    There is a missing swap file "make_flists.py.swp" in the mathematical root folder. If possible please share the same?

    for eg. is this what is expected :

    filenames = ['no_steps_flist_relative_algebra.txt', 'no_steps_flist_relative_calculus.txt', 'no_steps_flist_relative_counting_and_statistics.txt', 'no_steps_flist_relative_geometry.txt', 'no_steps_flist_relative_linear_algebra.txt', 'no_steps_flist_relative_number_theory.txt']
    with open('./no_steps_flist_relative.txt', 'w') as outfile:
        for fname in filenames:
            with open(fname) as infile:
                for line in infile:
                    outfile.write(line)
    
    opened by crazysal 1
  • ModuleNotFoundError: No module named 'dataset.aops'

    ModuleNotFoundError: No module named 'dataset.aops'

    Traceback (most recent call last):
      File "eval_math_gpt.py", line 36, in <module>
        from dataset.aops import AOPSMathDataset
    ModuleNotFoundError: No module named 'dataset.aops'
    

    Which file is this ??

    opened by crazysal 1
  • Wrap is_equiv in a Python package.

    Wrap is_equiv in a Python package.

    I plan to submit a new metric to Hugging Face that will compute accuracy treating equivalent answers (as defined by is_equiv) as correct. Without this change, Hugging Face users would have to download the math directory and add it to their PYTHONPATH before using the new metric. Instead, they'll be able to install the package from github using pip.

    As part of this change, I've also:

    • Added a line to README with install instructions
    • Renamed equivalent.py to math_equivalence.py (math_equivalence is better as a package name than equivalent)
    • Prefixed the name of private functions with an underscore in math_equivalence.py
    • Moved tests to their own file
    opened by hacobe 0
  • ValueError: not enough values to unpack (expected 2, got 1)

    ValueError: not enough values to unpack (expected 2, got 1)

    Hi, sorry im new in this field.

    !python tune_gpt.py --khan-dataroot /content/amps/khan/ --save-dir /content/drive/MyDrive/model/

    when i using the above code on google colap, i got error

    Traceback (most recent call last): File "tune_gpt.py", line 333, in main() File "tune_gpt.py", line 318, in main train_data = get_dataset(args) File "tune_gpt.py", line 239, in get_dataset len_multiplier, dirname = args.khan_dataroot.split("@") ValueError: not enough values to unpack (expected 2, got 1)

    How to fix this?

    opened by lazir0lufias 2
  • How does custom merges file effect tokenizer ?

    How does custom merges file effect tokenizer ?

    What is the default value used for the tokenizer-merges-file ?

    Do you use the default merges_gpt2.txt or the custom digits removed file merges_gpt2_single_digit_numbers.txt

    My understanding is that the file merges.txt is build during the training of the BBPE (Byte Level BPE) tokenizer on the corpus: it gets a new entry (line) at each iteration of the tokenizer to find the byte pairs most frequent.

    How di you verify for this design decision? I understand the need for the "clean" merges file, but using a new merges file with pre-trained weights, wouldn't that be an error ? Since now there are tokens missing as compared to what the gpt2 was trained with?

    Or should one re-train the tokenizer itself, on the current dataset vocab ?

    opened by crazysal 0
Owner
Dan Hendrycks
PhD student at UC Berkeley.
Dan Hendrycks
MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving.

MWPToolkit is a PyTorch-based toolkit for Math Word Problem (MWP) solving. It is a comprehensive framework for research purpose that integrates popular MWP benchmark datasets and typical deep learning-based MWP algorithms.

null 119 Jan 4, 2023
Incomplete easy-to-use math solver and PDF generator.

Math Expert Let me do your work Preview preview.mp4 Introduction Math Expert is our (@salastro, @younis-tarek, @marawn-mogeb) math high school graduat

SalahDin Ahmed 22 Jul 11, 2022
Official Implementation and Dataset of "PPR10K: A Large-Scale Portrait Photo Retouching Dataset with Human-Region Mask and Group-Level Consistency", CVPR 2021

Portrait Photo Retouching with PPR10K Paper | Supplementary Material PPR10K: A Large-Scale Portrait Photo Retouching Dataset with Human-Region Mask an

null 184 Dec 11, 2022
This is the dataset and code release of the OpenRooms Dataset.

This is the dataset and code release of the OpenRooms Dataset.

Visual Intelligence Lab of UCSD 95 Jan 8, 2023
A large dataset of 100k Google Satellite and matching Map images, resembling pix2pix's Google Maps dataset.

Larger Google Sat2Map dataset This dataset extends the aerial ⟷ Maps dataset used in pix2pix (Isola et al., CVPR17). The provide script download_sat2m

null 34 Dec 28, 2022
Dataset used in "PlantDoc: A Dataset for Visual Plant Disease Detection" accepted in CODS-COMAD 2020

PlantDoc: A Dataset for Visual Plant Disease Detection This repository contains the Cropped-PlantDoc dataset used for benchmarking classification mode

Pratik Kayal 109 Dec 29, 2022
EMNLP 2021: Single-dataset Experts for Multi-dataset Question-Answering

MADE (Multi-Adapter Dataset Experts) This repository contains the implementation of MADE (Multi-adapter dataset experts), which is described in the pa

Princeton Natural Language Processing 68 Jul 18, 2022
EMNLP 2021: Single-dataset Experts for Multi-dataset Question-Answering

MADE (Multi-Adapter Dataset Experts) This repository contains the implementation of MADE (Multi-adapter dataset experts), which is described in the pa

Princeton Natural Language Processing 39 Oct 5, 2021
LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation (NeurIPS2021 Benchmark and Dataset Track)

LoveDA: A Remote Sensing Land-Cover Dataset for Domain Adaptive Semantic Segmentation by Junjue Wang, Zhuo Zheng, Ailong Ma, Xiaoyan Lu, and Yanfei Zh

Kingdrone 174 Dec 22, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
The Habitat-Matterport 3D Research Dataset - the largest-ever dataset of 3D indoor spaces.

Habitat-Matterport 3D Dataset (HM3D) The Habitat-Matterport 3D Research Dataset is the largest-ever dataset of 3D indoor spaces. It consists of 1,000

Meta Research 62 Dec 27, 2022
Repository to run object detection on a model trained on an autonomous driving dataset.

Autonomous Driving Object Detection on the Raspberry Pi 4 Description of Repository This repository contains code and instructions to configure the ne

Ethan 51 Nov 17, 2022
Code, Models and Datasets for OpenViDial Dataset

OpenViDial This repo contains downloading instructions for the OpenViDial dataset in 《OpenViDial: A Large-Scale, Open-Domain Dialogue Dataset with Vis

null 119 Dec 8, 2022
Transfer SemanticKITTI labeles into other dataset/sensor formats.

LiDAR-Transfer Transfer SemanticKITTI labeles into other dataset/sensor formats. Content Convert datasets (NUSCENES, FORD, NCLT) to KITTI format Minim

Photogrammetry & Robotics Bonn 64 Nov 21, 2022
Object Depth via Motion and Detection Dataset

ODMD Dataset ODMD is the first dataset for learning Object Depth via Motion and Detection. ODMD training data are configurable and extensible, with ea

Brent Griffin 172 Dec 21, 2022
[CIKM 2019] Code and dataset for "Fi-GNN: Modeling Feature Interactions via Graph Neural Networks for CTR Prediction"

FiGNN for CTR prediction The code and data for our paper in CIKM2019: Fi-GNN: Modeling Feature Interactions via Graph Neural Networks for CTR Predicti

Big Data and Multi-modal Computing Group, CRIPAC 75 Dec 30, 2022
A python script to lookup Passport Index Dataset

visa-cli A python script to lookup Passport Index Dataset Installation pip install visa-cli Usage usage: visa-cli [-h] [-d DESTINATION_COUNTRY] [-f]

rand-net 16 Oct 18, 2022
Code and model benchmarks for "SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology"

NeurIPS 2020 SEVIR Code for paper: SEVIR : A Storm Event Imagery Dataset for Deep Learning Applications in Radar and Satellite Meteorology Requirement

USAF - MIT Artificial Intelligence Accelerator 46 Dec 15, 2022