mirror of github.com/open-thought/reasoning-gym
Find a file
joesharratt1229 d0ef136d5b
Feat/intragen experiments (#414)
* added curriculum

* readapted readme

* corrected small errors

* Delete eval/eval/r1/algorithmic/word_sorting.json

* removed redundant argument

* added spell

* removed duplicated fit

* changed config

* added composite changes

* added composite changes

* updated yaml

* added spell backward

* updated read me

* added qwen2.5

* added

* Add files via upload

* updated missing trainer func

* updated curr

* updated spell back

* updated correctness score func

* updated configs

* added local evals

* added updates

* updated datasets

* added fsdp to hf utility

* added algorithmic qwen 3b yaml

* updated read me

* updated configs

* added preappend token

* updated with thinking token

* updated test score board

* resolved comments

* added evaluation scripts

* removed results from pr

* added config

* added partial reward scoring

* added evaluation composites

* added training configs

* added games eval

* added rubriks cube

* resolved merge cinflicts

* added games config

* added latest eval configs

* updated strucutre

* Delete training/evaluations/eval_graphs_composite.yaml

---------

Co-authored-by: joesharratt1229 <joesharrat1229@gmail.com>
2025-04-16 08:04:52 +02:00
.github/workflows Revert "Merge pull request #131 from zafstojano/chore/auto-generate-gallery" 2025-02-15 23:26:22 +01:00
eval (evals): Medium configs (#415) 2025-04-14 08:25:31 +02:00
examples Feat/open instruct example (#381) 2025-03-17 23:20:11 +01:00
notebooks Data collisions notebooks and data (#406) 2025-04-02 09:36:09 +02:00
reasoning_gym Feat/intragen experiments (#414) 2025-04-16 08:04:52 +02:00
scripts bump dev version to 0.1.19 2025-04-03 22:19:07 +01:00
tests Feat/intragen experiments (#414) 2025-04-16 08:04:52 +02:00
tools Basic curriculum (#198) 2025-03-07 11:22:12 +01:00
training Feat/intragen experiments (#414) 2025-04-16 08:04:52 +02:00
.gitignore fix(training): Prepend <think> token in format reward (#396) 2025-03-28 09:45:17 +01:00
.pre-commit-config.yaml romve dataset examples from REAMED.md (now in linked GALLERY.md) 2025-01-30 23:06:22 +01:00
CONTRIBUTING.md contribution updates 2025-02-20 09:54:26 +01:00
GALLERY.md bump dev version to 0.1.19 2025-04-03 22:19:07 +01:00
LICENSE Initial commit 2025-01-23 09:39:53 +01:00
NOTICE.txt docs: Add ACRE dataset attribution to NOTICE.txt and source file 2025-03-10 00:21:57 +01:00
pyproject.toml bump dev version to 0.1.19 2025-04-03 22:19:07 +01:00
README.md Add banner in README.md (#399) 2025-04-01 21:29:41 +02:00
requirements-dev.txt [eval-basic] run precommit formatting 2025-02-09 22:40:45 -08:00

💪🧠 Reasoning Gym

Reasoning Gym is a community-created Python library of procedural dataset generators and algorithmically verifiable reasoning environments for training reasoning models with reinforcement learning (RL). The goal is to generate virtually infinite training data with adjustable complexity.

It currently provides more than 100 tasks over many domains, including but not limited to algebra, arithmetic, computation, cognition, geometry, graph theory, logic, and many common games.

Some tasks have a single correct answer, while others, such as Rubiks Cube and Countdown, have many correct solutions. To support this, we provide a standard interface for procedurally verifying solutions.

In GALLERY.md, you can find example outputs of all datasets available in reasoning-gym.

⬇️ Installation

The reasoning-gym package requires Python >= 3.11.

Install the latest published package from PyPI via pip:

pip install reasoning-gym

Note that this project is currently under active development, and the version published on PyPI may be a few days behind main.

🛠️ Development

For development setup, see CONTRIBUTING.md.

Example Usage

import reasoning_gym
data = reasoning_gym.create_dataset('leg_counting', size=10, seed=42)
for i, x in enumerate(data):
    print(f'{i}: q="{x['question']}", a="{x['answer']}"')
    print('metadata:', x['metadata'])
    # use the dataset's `score_answer` method for algorithmic verification
    assert data.score_answer(answer=x['answer'], entry=x) == 1.0

Output:

0: q="How many legs are there in total if you have 1 sea slug, 1 deer?", a="4"
metadata: {'animals': {'sea slug': 1, 'deer': 1}, 'total_legs': 4}
1: q="How many legs are there in total if you have 2 sheeps, 2 dogs?", a="16"
metadata: {'animals': {'sheep': 2, 'dog': 2}, 'total_legs': 16}
2: q="How many legs are there in total if you have 1 crab, 2 lobsters, 1 human, 1 cow, 1 bee?", a="42"
...

🔍 Evaluation

Instructions for running the evaluation scripts are provided in eval/README.md.

Evaluation results of different reasoning models will be tracked in the reasoning-gym-eval repo.

👷 Contributing

Please see CONTRIBUTING.md.

If you have ideas for dataset generators please create an issue here or contact us in the #reasoning-gym channel of the GPU-Mode discord server.