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/datasets/reasoning-core/rc1

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()

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

Generation

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

Reasoning gym

We use a custom interface, leaner than reasoning-gym (RG). But our tasks, which are all orthogonal to RG, can be imported in it.

import reasoning_gym

from reasoning_core import register_to_reasoning_gym
register_to_reasoning_gym()

specs = [
    # here, leg_counting tasks will make up two thirds of tasks
    DatasetSpec(name='leg_counting', weight=2, config={}),  #from reasoning_gym 🏋
    DatasetSpec(name='arithmetics', weight=2, config={}),  #from reasoning_core ◉
]
D=reasoning_gym.create_dataset('composite', size=10, seed=42, datasets=specs)

Citation

@misc{reasoningcore2025,
      title={Reasoning Core: A Scalable RL Environment for LLM Symbolic Reasoning}, 
      author={Valentin Lacombe and Valentin Quesnel and Damien Sileo},
      year={2025},
      eprint={2509.18083},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2509.18083}, 
}

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.1.tar.gz (206.6 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.1-py2.py3-none-any.whl (218.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: reasoning_core-0.2.1.tar.gz
  • Upload date:
  • Size: 206.6 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.1.tar.gz
Algorithm Hash digest
SHA256 06a522f04a9c3f928c84e103aa57921cf945b1e5cfacaa0be64f4d9851251910
MD5 c1ad4c6fd5b081d6f3c9f46d6cfd1cad
BLAKE2b-256 ff9f62cde856e66d5748470266d9179d46c1bb7662ff9a386a55a2b6f8bfcad4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reasoning_core-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51faec7e5f1219df3cf78a79d7ccff2fa14caea1b8bcb2e0605399a314d88834
MD5 82b61ae985984ac9d6e2ea22041af202
BLAKE2b-256 6354670c6b9651f945859d977946ef0bbf2a5fd6087a1aa88298bee4ea0943cb

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