SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.01307 · 2025

Cognitive Behaviors that Enable Self-Improving Reasoners, or, Four Habits of Highly Effective STaRs

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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.01307.json · badge: /api/ran/2503.01307.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
kanishkg/cognitive-behaviors canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_completions_metrics Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/behavioral_evals/process_data.py
code served (permissive licence) · get_code("71d5fbb13555643e")
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 torch

torch.manual_seed(0)

# Construct valid completions list with diverse entries
completions = [
    {
        'score': 0.85,
        'generated': 'This is a test response with several words'
    },
    {
        'score': 0.92,
        'generated': 'Another completion example'
    },
    {
        'score': 0.78,
        'generated': 'Short text'
    },
    {
        'generated': 'Response without score field'
    },
    {
        'score': 0.88
    },
    {
        'score': 1.0,
        'generated': 'Perfect answer with more words included here'
    }
]

ARGS = {
    'completions': completions
}
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 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_completion_files Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/behavioral_evals/api_eval.py
code served (permissive licence) · get_code("236383c3f64bc48e")
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 list, ndim 2, 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 os
import re
import tempfile
import json

# Create a temporary directory with mock completion files
temp_dir = tempfile.mkdtemp()

# Create some sample completion files
completions_data = [
    {"text": "completion 1"},
    {"text": "completion 2"}
]

# Write test files with different step numbers
for step_num in [0, 5, 10]:
    filepath = os.path.join(temp_dir, f'completions_step{step_num}.jsonl')
    with open(filepath, 'w') as f:
        for item in completions_data:
            f.write(json.dumps(item) + '\n')

# Also add a file that should be ignored (wrong naming)
ignored_file = os.path.join(temp_dir, 'completions_other.jsonl')
with open(ignored_file, 'w') as f:
    f.write(json.dumps({"text": "ignored"}) + '\n')

ARGS = {
    'completions_dir': temp_dir
}
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 list, ndim 2, 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
load_all_results Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/behavioral_evals/process_data.py
code served (permissive licence) · get_code("9c83e3e6e06264ea")
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 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 os
import json
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_root = tempfile.mkdtemp()

# Create subdirectory 1 with all_results.json
subdir1 = os.path.join(temp_root, "condition_1")
os.makedirs(subdir1, exist_ok=True)
results_data_1 = {"metric1": 0.95, "metric2": 0.87}
with open(os.path.join(subdir1, "all_results.json"), "w") as f:
    json.dump(results_data_1, f)

# Create subdirectory 2 with all_results.json
subdir2 = os.path.join(temp_root, "condition_2")
os.makedirs(subdir2, exist_ok=True)
results_data_2 = {"metric1": 0.92, "metric2": 0.89}
with open(os.path.join(subdir2, "all_results.json"), "w") as f:
    json.dump(results_data_2, f)

# Create subdirectory 3 without all_results.json (to test warning)
subdir3 = os.path.join(temp_root, "condition_3")
os.makedirs(subdir3, exist_ok=True)

ARGS = {
    "root_dir": temp_root,
    "single": False,
}
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 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
read_completions Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/behavioral_evals/process_data.py
code served (permissive licence) · get_code("8c5d18a9e7a574a1")
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 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 os
import json
import tempfile

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a valid JSON completions file
completions_data = [
    {"id": 1, "text": "completion 1"},
    {"id": 2, "text": "completion 2"},
    {"id": 3, "text": "completion 3"}
]

completions_file = os.path.join(temp_dir, "completions.json")
with open(completions_file, 'w') as f:
    json.dump(completions_data, f)

ARGS = {
    "completions_path": completions_file
}
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 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
remove_think_content Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/generate_cot_datasets/generate_empty_cot.py
code served (permissive licence) · get_code("b72bb46f62bd47cf")
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 re

def remove_think_content(text):
    pattern = '<think>.*?</think>'
    return re.sub(pattern, '<think> </think>', text, flags=re.DOTALL)

# Setup code
ARGS = {
    'text': 'This is a test <think>some internal reasoning here</think> and more text <think>another thought</think> end.'
}
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 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
replace_think_tags Ran
ran on a synthesized input
kanishkg/cognitive-behaviors/generate_cot_datasets/generate_dots_cot.py
code served (permissive licence) · get_code("ea1fe462b951a92d")
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 re

# Analyze the function:
# - text: a string that may contain <think>...</think> tags
# - replace_with: a string to replace content with (default ' .')
# - num_repeats: optional integer parameter (not fully implemented in shown code)

# The function uses:
# - re.compile() and pattern matching
# - re.DOTALL flag for multiline matching
# - m.group(1), m.group(2), m.group(3) for regex groups
# - len() on matched content
# - String multiplication and substitution

text_with_think_tags = "This is some text <think>this is a thought with multiple words</think> and more text."

text_without_think_tags = "This is some text without any think tags."

text_multiple_think_tags = "Start <think>first thought here</think> middle <think>second thought</think> end."

ARGS = {
    'text': text_with_think_tags,
    'replace_with': ' .',
    'num_repeats': None
}
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 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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-22.

Repositories linked to this paper

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

Abstract

Test-time inference has emerged as a powerful paradigm for enabling language models to ``think'' longer and more carefully about complex challenges, much like skilled human experts. While reinforcement learning (RL) can drive self-improvement in language models on verifiable tasks, some models exhibit substantial gains while others quickly plateau. For instance, we find that Qwen-2.5-3B far exceeds Llama-3.2-3B under identical RL training for the game of Countdown. This discrepancy raises a critical question: what intrinsic properties enable effective self-improvement? We introduce a framework to investigate this question by analyzing four key cognitive behaviors -- verification, backtracking, subgoal setting, and backward chaining -- that both expert human problem solvers and successful language models employ. Our study reveals that Qwen naturally exhibits these reasoning behaviors, whereas Llama initially lacks them. In systematic experimentation with controlled behavioral datasets, we find that priming Llama with examples containing these reasoning behaviors enables substantial improvements during RL, matching or exceeding Qwen's performance. Importantly, the presence of reasoning behaviors, rather than correctness of answers, proves to be the critical factor -- models primed with incorrect solutions containing proper reasoning patterns achieve comparable performance to those trained on correct solutions. Finally, leveraging continued pretraining with OpenWebMath data, filtered to amplify reasoning behaviors, enables the Llama model to match Qwen's self-improvement trajectory. Our findings establish a fundamental relationship between initial reasoning behaviors and the capacity for improvement, explaining why some language models effectively utilize additional computation while others plateau.

For agents

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

get_harvested_code_for_paper("2503.01307")
get_code_for_paper("2503.01307")
have("2503.01307")

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

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

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

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

Connect an agent — have() is free.