Skip to main content

A RL env with procedurally generated symbolic reasoning data

Project description

Reasoning Core ◉

reasoning-core is a text-based RLVR for LLM reasoning training. It is centered on expressive symbolic tasks, including full fledged FOL, formal mathematics with TPTP, formal planning with novel domains, and syntax tasks.

🤗 https://hf.co/collections/reasoning-core/datasets

Standalone

pip install reasoning_core

from reasoning_core import list_tasks, get_task, score_answer

T = get_task('arithmetics')()
x = T.generate_example()
assert score_answer(x.answer, x)==1

Parallel generation script

Run bash run_generate.sh for multi-threaded generation to json files (readable by Huggingface Datasets).

Task examples and task authoring guide

GALLERY (names link to task code)
TASK_AUTHORING_GUIDE

Integrations

Prime Environment Hub

#!pip install uv #install uv if needed
!uv tool install prime --with openai  -q
!uv tool run prime -- env install sileod/reasoning-core-env

from verifiers import load_environment
import os; from openai import OpenAI

env = load_environment("reasoning-core-env")

client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key=os.getenv("OPENROUTER_API_KEY")) #🔑
results = env.evaluate(client=client, model="gpt-4.1-mini", num_examples=20, rollouts_per_example=1)
df=env.make_dataset(results).to_pandas()

Reasoning gym integration

We use a custom interface but compatible interface. Our tasks, which are mostly orthogonal to RG, can be imported in it.

import reasoning_gym, reasoning_core
from reasoning_gym.composite import DatasetSpec

reasoning_core.register_to_reasoning_gym() # registers RC tasks into RG

specs = [
    DatasetSpec(name='leg_counting', weight=1, config={}),  #from reasoning_gym 🏋
    DatasetSpec(name='arithmetics', weight=1, config={}),  #from reasoning_core ◉
]
D=reasoning_gym.create_dataset('composite', size=10, seed=42, datasets=specs)

And the other way around:

frm reasoning_core import get_task
t=get_task('reasoning_gym')
t.generate_example(level=1, rg_task='lcm') #or unspecified for random task

Citation and paper

https://arxiv.org/abs/2603.02208

@article{reasoningcore2026,
  title={Reasoning Core: A Scalable Procedural Data Generation Suite for Symbolic Pre-training and Post-Training},
  author={Lacombe, Valentin and Quesnel, Valentin and Sileo, Damien},
  journal={arXiv preprint arXiv:2603.02208},
  year={2026},
  url={https://arxiv.org/abs/2603.02208}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reasoning_core-0.2.3.tar.gz (214.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reasoning_core-0.2.3-py2.py3-none-any.whl (219.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file reasoning_core-0.2.3.tar.gz.

File metadata

  • Download URL: reasoning_core-0.2.3.tar.gz
  • Upload date:
  • Size: 214.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for reasoning_core-0.2.3.tar.gz
Algorithm Hash digest
SHA256 d0d126ed73c33bced45dbf041276d555420ab2098649b22d289613b3e0b063e8
MD5 acb481cf45c170a1012989f8acdc48a6
BLAKE2b-256 d1b2abf216c1aabbe802e2d0d0ceace27f9d5a2d480f459e8649c88e474f65da

See more details on using hashes here.

File details

Details for the file reasoning_core-0.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for reasoning_core-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b7dad2cce4ad8946437446867eca0d03207be8f6b1acb3cc4ee661b039da05c3
MD5 eae306d5f15587e7e621972388f613da
BLAKE2b-256 23983904425bff381442b435039aa7f1ba1bdf6e667fdb8e06e844d3de85638c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page