SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.09499 · NeurIPS · 2025

MindGYM: What Matters in Question Synthesis for Thinking-Centric Fine-Tuning?

Yaliang Li, Zhe Xu, Ying Shen, Daoyuan Chen, Zhenqing Ling

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.09499.json · badge: /api/ran/2503.09499.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
modelscope/data-juicer alias (classifier label)
classifier basis: classifier_2025
5 ran · 2 no recorded run
FunctionStatusWhere it lives
LLMCallUsage Ran
ran on a synthesized input · constructed an object; no result was computed
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("500c2ea8c5d97fe6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LLMCallUsage: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Union

torch.manual_seed(0)

# Construct valid arguments for LLMCallUsage
ARGS = {
    'prompt_tokens': 150,
    'completion_tokens': 50,
    'total_tokens': 200,
    'cost_estimate': 0.0015
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LLMCallUsage — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LLMCallUsage output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
RecordRow Ran
ran on a synthesized input · constructed an object; no result was computed
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("7c85f594570193fe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, RecordRow: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, ConfigDict

torch.manual_seed(0)

class RecordRow(BaseModel):
    """Single row of extracted fields; schema aligns with output_schema keys.

    Use model_validate(d) or RecordRow(**d) for dict -> RecordRow.
    Use row.model_dump() for RecordRow -> dict. Extra keys from output_schema
    are allowed (extra='allow').
    """
    model_config = ConfigDict(extra='allow')

    @classmethod
    def from_schema_dict(cls, d: Dict[str, Any], schema_keys: Optional[List[str]]=None) -> 'RecordRow':
        """Build RecordRow from dict; optionally restrict to schema_keys."""
        if schema_keys is not None:
            d = {k: d.get(k) for k in schema_keys}
        return cls.model_validate(d)

    def to_dict(self) -> Dict[str, Any]:
        return self.model_dump()


# Test data for RecordRow constructor
test_dict = {
    "name": "John Doe",
    "age": 30,
    "email": "john@example.com",
    "score": 95.5,
    "active": True,
    "extra_field": "allowed"
}

schema_keys = ["name", "age", "email"]

ARGS = {
    "d": test_dict,
    "schema_keys": schema_keys
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RecordRow — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RecordRow output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_parse_usage_from_response Ran
ran; our contract draft was wrong, not the code
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("202a1d5c77bcba46")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned LLMCallUsage. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Union

@dataclass
class LLMCallUsage:
    """Token usage (and optional cost) for a single LLM call."""
    prompt_tokens: int = 0
    completion_tokens: int = 0
    total_tokens: int = 0
    cost_estimate: Optional[float] = None

    def to_dict(self) -> Dict[str, Any]:
        d: Dict[str, Any] = {'prompt_tokens': self.prompt_tokens, 'completion_tokens': self.completion_tokens, 'total_tokens': self.total_tokens}
        if self.cost_estimate is not None:
            d['cost_estimate'] = self.cost_estimate
        return d

    @classmethod
    def from_dict(cls, d: Dict[str, Any]) -> 'LLMCallUsage':
        return cls(prompt_tokens=int(d.get('prompt_tokens', 0)), completion_tokens=int(d.get('completion_tokens', 0)), total_tokens=int(d.get('total_tokens', 0)), cost_estimate=d.get('cost_estimate'))

logger = logging.getLogger(__name__)

def _parse_usage_from_response(response: Any, is_api: bool) -> LLMCallUsage:
    """Extract token usage from API response when available."""
    usage = LLMCallUsage()
    try:
        if is_api and hasattr(response, 'usage'):
            u = response.usage
            pt = getattr(u, 'prompt_tokens', 0) or getattr(u, 'input_tokens', 0)
            ct = getattr(u, 'completion_tokens', 0) or getattr(u, 'output_tokens', 0)
            usage = LLMCallUsage(prompt_tokens=pt, completion_tokens=ct, total_tokens=getattr(u, 'total_tokens', 0) or pt + ct)
        elif isinstance(response, dict):
            u = response.get('usage', response)
            if isinstance(u, dict):
                usage = LLMCallUsage(prompt_tokens=u.get('prompt_tokens', u.get('input_tokens', 0)), completion_tokens=u.get('completion_tokens', u.get('output_tokens', 0)), total_tokens=u.get('total_tokens', 0))
    except Exception as e:
        logger.debug('Could not parse LLM usage: %s', e)
    return usage


class MockUsage:
    """Mock usage object for API responses."""
    def __init__(self, prompt_tokens=10, completion_tokens=5, total_tokens=15):
        self.prompt_tokens = prompt_tokens
        self.completion_tokens = completion_tokens
        self.total_tokens = total_tokens


class MockAPIResponse:
    """Mock API response with usage attribute."""
    def __init__(self):
        self.usage = MockUsage(prompt_tokens=10, completion_tokens=5, total_tokens=15)


dict_response = {
    'usage': {
        'prompt_tokens': 20,
        'completion_tokens': 10,
        'total_tokens': 30
    }
}

api_response = MockAPIResponse()

ARGS = {
    'response': api_response,
    'is_api': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LLMCallUsage — a LLMCallUsage output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LLMCallUsage output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
call_llm_sync Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("3efc32e5ec4f3db4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging

class MockLLMModel:
    """Minimal mock LLM model that supports basic calling conventions."""
    def __init__(self):
        self.last_response = None
    
    def __call__(self, messages, **kwargs):
        # Return tuple of (text, response_object)
        response_obj = type('obj', (object,), {
            'usage': type('usage', (object,), {
                'prompt_tokens': 10,
                'completion_tokens': 5,
                'total_tokens': 15
            })()
        })()
        return ("Generated response text", response_obj)


class MockHFModel:
    """Mock Hugging Face model."""
    def __call__(self, messages, return_full_text=False, **kwargs):
        return [{'generated_text': 'HF generated text'}]


class MockVLLMModel:
    """Mock vLLM model."""
    def chat(self, messages, sampling_params):
        usage_obj = type('usage', (object,), {
            'prompt_tokens': 8,
            'completion_tokens': 4,
            'total_tokens': 12
        })()
        output_obj = type('output', (object,), {'text': 'vLLM response'})()
        response_obj = type('response', (object,), {
            'outputs': [output_obj],
            'usage': usage_obj
        })()
        return [response_obj]


# Create mock models
basic_model = MockLLMModel()
hf_model = MockHFModel()
vllm_model = MockVLLMModel()

# Sample messages for LLM input
messages = [
    {"role": "user", "content": "What is 2+2?"},
    {"role": "assistant", "content": "4"}
]

# Sampling parameters
sampling_params = {
    "max_tokens": 50,
    "temperature": 0.7
}

ARGS = {
    'model': basic_model,
    'messages': messages,
    'enable_vllm': False,
    'is_hf_model': False,
    'sampling_params': sampling_params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
data_juicer — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_extract_prompt Ran
ran; our contract draft was wrong, not the code
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("581178da56072d6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from enum import Enum
from typing import Any, Dict, List, Optional, Union

class InferenceStrategy(Enum):
    DIRECT = 'direct'
    COT = 'cot'
    FEW_SHOT = 'few_shot'
    COT_SHOT = 'cot_shot'

ARGS = {
    'input_text': 'The quick brown fox jumps over the lazy dog.',
    'output_schema': {
        'animal': 'The type of animal mentioned',
        'color': 'The color of the animal',
        'action': 'What the animal is doing'
    },
    'knowledge_grounding': 'Background: This is a famous English idiom used to test typing.',
    'strategy': InferenceStrategy.COT_SHOT,
    'examples': '# Example 1\nInput: The red cat runs.\nOutput: {"animal": "cat", "color": "red", "action": "runs"}'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
InferenceStrategy Not yet run
unverified (harvested, no recorded run)
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("58be2ad46dc599f0")
How it ran

no invocation recorded.

extract_one Not yet run
unverified (harvested, no recorded run)
modelscope/data-juicer/data_juicer/utils/llm_semantic_ops.py
code served (permissive licence) · get_code("21e9afc889c14ac4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large foundation models face challenges in acquiring transferable, structured thinking abilities, especially when supervised with rigid templates or crowd-annotated instruction datasets. Unlike prior approaches, we focus on a thinking-centric data synthesis paradigm that enables models to evolve through self-generated, cognitively guided data. We propose MINDGYM, a structured and scalable framework for question synthesis, composed of: (1) Cognitive Thinking Process Injection, which infuses high-level reasoning objectives to shape the model's synthesis behavior; (2) Seed Single-Hop Question Synthesis, generating atomic questions from diverse semantic types to encourage broader thinking; and (3) Challenging Multi-Hop QA Synthesis, composing more complex multi-hop questions based on QA seeds for deeper reasoning. Detailed analysis shows that synthetic data generated by our method achieves 16.7% higher average quality and 67.91% lower quality variance compared to baseline sources, highlighting that both high-quality and selfcontained data are essential for effective, thinking-oriented finetuning. MINDGYM improves performance on six reasoning benchmarks, achieving gains of up to 16% on MathVision using only 400 data samples, and generalizable improvements across different model sizes and architectures. MINDGYM underscores the viability of self-challenging mechanisms in refining large model capabilities while minimizing human intervention and resource demands. Code and data are released to promote data-centric research into self-evolving foundation models driven by their internal reasoning capabilities.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2503.09499")
get_code_for_paper("2503.09499")
have("2503.09499")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2503.09499.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2503.09499.svg)](https://syntology.ai/paper/2503.09499)

Connect an agent — have() is free.