SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.17104 · ICML · 2026

Scientific Logicality Enriched Methodology for LLM Reasoning: A Practice in Physics

Lei Wang, Nan Xu, Wenji Mao, Kun Chen, Jiahao Zhao, Zhaoxin Yu, Sj Mean

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2605.17104.json · badge: /api/ran/2605.17104.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
ScienceOne-AI/PhysLogic community
Papers with Code archive
6 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_f_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("97a9eff543fca366")
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) 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 numpy as np

# Create a small similarity matrix M with shape (n_nexuses, n_sentences)
# Using distinct dimensions: 4 nexuses, 3 sentences
n_nexuses = 4
n_sentences = 3
M = np.array([
    [0.9, 0.2, 0.1],
    [0.1, 0.8, 0.3],
    [0.4, 0.1, 0.7],
    [0.2, 0.5, 0.2]
], dtype=np.float32)

# Create logical nexuses (ground truth concepts)
logical_nexuses = ["nexus_0", "nexus_1", "nexus_2", "nexus_3"]

# Create weights for each nexus
logical_nexus_weights = [0.5, 0.3, 0.1, 0.1]

# Create reasoning sentences
reasoning_sentences = ["sentence_0", "sentence_1", "sentence_2"]

# Set threshold for matching
threshold = 0.3

ARGS = {
    "logical_nexuses": logical_nexuses,
    "logical_nexus_weights": logical_nexus_weights,
    "reasoning_sentences": reasoning_sentences,
    "M": M,
    "threshold": threshold
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
calculate_o_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("cc77a4cf9c3c56ab")
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) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# Construct arguments for calculate_o_score
logical_nexuses = ["nexus_1", "nexus_2", "nexus_3"]
logical_nexus_weights = [0.5, 0.3, 0.2]
reasoning_sentences = ["sentence_1", "sentence_2", "sentence_3"]

# M is a 3x4 matrix (n=3 logical nexuses, m=4 positions)
# Values represent some kind of score or probability at each position
M = np.array([
    [0.1, 0.3, 0.4, 0.2],
    [0.2, 0.2, 0.3, 0.3],
    [0.4, 0.3, 0.2, 0.1]
], dtype=np.float32)

ARGS = {
    "logical_nexuses": logical_nexuses,
    "logical_nexus_weights": logical_nexus_weights,
    "reasoning_sentences": reasoning_sentences,
    "M": M
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
calculate_p_score Ran
ran, honoured the contract we drafted
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("03a626f3f78b40a5")
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) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 numpy as np

# Create small stand-in data for the function parameters

# logical_nexuses: list of strings representing logical connections
logical_nexuses = [
    "premise_1_connects_to_conclusion",
    "evidence_supports_claim",
    "assumption_underlies_argument"
]

# reasoning_sentences: list of strings representing reasoning steps
reasoning_sentences = [
    "First, we observe that the initial condition holds.",
    "Next, we apply the logical rule to derive an intermediate result.",
    "Finally, we conclude that the statement is true."
]

# M: numpy array representing embeddings/vectors for each reasoning step
# Shape: (n_features, n_steps) where n_features=4, n_steps=3
M = np.array([
    [1.0, 0.8, 0.2],
    [0.5, 0.6, 0.9],
    [0.3, 0.1, 0.7],
    [0.2, 0.4, 0.5]
], dtype=np.float32)

ARGS = {
    "logical_nexuses": logical_nexuses,
    "reasoning_sentences": reasoning_sentences,
    "M": M
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
compute_logicality_metrics Ran
ran; our contract draft was wrong, not the code
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("89478f2bb9585b39")
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) and returned dict. 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 numpy as np
from typing import Any

class MockEncoder:
    """Mock encoder that produces embeddings."""
    def encode(self, texts: list[str]) -> np.ndarray:
        """Return random embeddings for texts."""
        return np.random.randn(len(texts), 4)

# Create small test data
logical_nexuses = [
    "If A then B",
    "B implies C",
    "Therefore C"
]

logical_nexus_weights = [0.5, 0.3, 0.2]

reasoning = "First we observe A. Next we apply the rule. Then we get B. Finally we conclude C."

encoder_model = MockEncoder()

# Pre-compute similarity matrix M
# M[i, j] = similarity between nexus i and reasoning sentence j
# Shape: (3 nexuses, 4 reasoning sentences)
M = np.array([
    [0.8, 0.2, 0.1, 0.05],
    [0.1, 0.7, 0.3, 0.2],
    [0.05, 0.1, 0.8, 0.9]
], dtype=np.float32)

threshold = 0.3

ARGS = {
    "logical_nexuses": logical_nexuses,
    "logical_nexus_weights": logical_nexus_weights,
    "reasoning": reasoning,
    "encoder_model": encoder_model,
    "M": M,
    "threshold": threshold
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
greedy_matching Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("b06941f10c7e4098")
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) and returned list, ndim 2, dtype family int; 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 numpy as np

# Create a small similarity matrix for testing
# Shape: (4, 3) - 4 nexuses, 3 sentences
M = np.array([
    [0.9, 0.2, 0.1],
    [0.3, 0.8, 0.4],
    [0.1, 0.5, 0.7],
    [0.6, 0.2, 0.3]
], dtype=np.float32)

threshold = 0.3

ARGS = {
    "M": M,
    "threshold": threshold
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list 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
split_into_sentences Ran
ran; our contract draft was wrong, not the code
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("82ec6023fe3765ba")
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) and returned list, 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 re

def split_into_sentences(text: str | None) -> list[str] | None:
    """Split reasoning text into sentence-like units with the paper's light rule."""
    if text is None:
        return None
    sentences = re.split('[.!?]+\\s+', text.strip())
    sentences = [s.strip() for s in sentences if s.strip()]
    return sentences

# Test case 1: Normal text with multiple sentences
text_1 = "This is the first sentence. This is the second sentence! And here is the third? Finally, the fourth one."

# Test case 2: None input
text_2 = None

# Test case 3: Single sentence
text_3 = "Just one sentence."

# Test case 4: Text with multiple punctuation marks
text_4 = "First sentence!! Second sentence?? Third sentence..."

ARGS = {
    "text": text_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 list, ndim 1, dtype family float — a list 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
calculate_similarity_matrix Not yet run
unverified (harvested, no recorded run)
ScienceOne-AI/PhysLogic/src/logicality_metrics.py
code served (permissive licence) · get_code("6930ede5fc4b5d27")
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

With the continuous advancement of reasoning abilities in Large Language Models (LLMs), their application to scientific reasoning tasks has gained significant research attention. Current research primarily emphasizes boosting LLMs' performance on scientific QA benchmarks by training on larger, more comprehensive datasets with extended reasoning chains. However, these approaches neglect the essence of the scientific reasoning process-logicality, which is the rational foundation to ensure the validity of reasoning steps leading to reliable conclusions. In this work, we make the first systematic investigation into the internal logicality underlying LLM scientific reasoning, and develop a scientific logicality-enriched methodology, including a set of assessment criteria and data sampling methods for logicality-guided training, to improve the logical faithfulness as well as task performance. Further, we take physics, characterized by its diverse logical structures and formalisms, as an exemplar discipline to practise the above methodology. For data construction, we extract scientific problems from academic literature and sample a high-quality dataset exhibiting strong logicality. Experiments based on three different backbone LLMs reveal that: 1) the training data we constructed can effectively improve the scientific logicality in LLM reasoning; and 2) the enriched scientific logicality plays a critical role in solving scientific problems. Code is available at https://github.com/ScienceOne-AI/PhysLogic.

For agents

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

get_harvested_code_for_paper("2605.17104")
get_code_for_paper("2605.17104")
have("2605.17104")

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

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

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

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

Connect an agent — have() is free.