SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.16322 · NeurIPS · 2025

AdaSTaR: Adaptive Data Sampling for Training Self-Taught Reasoners

Se-Young Yun, Taehyeon Kim, Joonkee Kim, Junghyun Lee, Woosung Koh, Wonbeen Oh, Hyeongjin Kim, Jaein Jang, Minhyung Lee, Ah Kim

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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2505.16322.json · badge: /api/ran/2505.16322.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
reiss-koh/AdaSTaR community
Papers with Code archive
6 ran · 1 no recorded run
FunctionStatusWhere it lives
MinHeap Ran
ran on a synthesized input
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("a6d6d7ff3972893a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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 heapq
import pickle
import tempfile
import os

class MinHeap:

    def __init__(self):
        self._heap = []

    def push(self, priority1, priority2, item):
        heapq.heappush(self._heap, (priority1, priority2, item))

    def pop(self):
        if not self._heap:
            return None
        priority1, priority2, item = heapq.heappop(self._heap)
        return (priority1, priority2, item)

    def peek(self):
        if not self._heap:
            return None
        priority1, priority2, item = self._heap[0]
        return (priority1, priority2, item)

    def __len__(self):
        return len(self._heap)

    def save(self, filename):
        with open(filename, 'wb') as f:
            pickle.dump(self._heap, f)

    @classmethod
    def load(cls, filename):
        with open(filename, 'rb') as f:
            heap_data = pickle.load(f)
        instance = cls()
        instance._heap = heap_data
        return instance


INIT_ARGS = {}

ARGS = {
    'priority1': 1,
    'priority2': 2,
    'item': 'test_item'
}

METHOD = 'push'

if __name__ == '__main__':
    heap = MinHeap(**INIT_ARGS)
    heap.push(**ARGS)
    
    result = heap.pop()
    print(f"Popped: {result}")
    
    heap.push(3, 1, 'another_item')
    heap.push(2, 5, 'third_item')
    
    peeked = heap.peek()
    print(f"Peeked: {peeked}")
    
    print(f"Heap length: {len(heap)}")
    
    with tempfile.TemporaryDirectory() as tmpdir:
        filepath = os.path.join(tmpdir, 'heap.pkl')
        heap.save(filepath)
        loaded_heap = MinHeap.load(filepath)
        print(f"Loaded heap length: {len(loaded_heap)}")
        print(f"Loaded heap peek: {loaded_heap.peek()}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
add_idx_to_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("7663e0bcb6d98319")
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 torch

torch.manual_seed(0)

batch = {
    'data': torch.randn(2, 4),
    'labels': torch.tensor([0, 1]),
}

indices = torch.tensor([5, 7])

ARGS = {
    'batch': batch,
    'indices': indices,
}
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 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
heap_to_custom_order Ran
ran on a synthesized input
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("046ee920485a2d52")
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 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 copy

class Args:
    def __init__(self, method):
        self.method = method

# Create a heap with tuples that match the expected format
# The function pops tuples with 3 elements: (_, _, item)
# where item is a string like 'prefix_INDEX'
heap = [
    (1.0, 0, 'item_0'),
    (2.0, 1, 'item_5'),
    (3.0, 2, 'item_12'),
    (4.0, 3, 'item_7'),
]

args = Args(method='adastar_new_square')

ARGS = {
    'args': args,
    'heap': heap,
}
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 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
initialize_heap_new Ran
ran; our contract draft was wrong, not the code
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("d7ea3ea6d044de45")
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 MinHeap. 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 tempfile
import os

# Create a temporary directory for file operations
temp_dir = tempfile.mkdtemp()
output_file = os.path.join(temp_dir, "heap.pkl")

# Construct the winlose dictionary
# This represents win/loss statistics for different keys
winlose = {
    "player_1": {
        "iter": 5,
        "win": 3,
        "total": 10
    },
    "player_2": {
        "iter": 2,
        "win": 0,
        "total": 0
    },
    "player_3": {
        "iter": 8,
        "win": 7,
        "total": 9
    }
}

# args is not actually used in the function body, so we can pass None or empty dict
args = None

# rank parameter - 0 means this process will save the heap
rank = 0

ARGS = {
    "args": args,
    "output_file": output_file,
    "winlose": winlose,
    "rank": rank
}
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 MinHeap — a MinHeap output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinHeap 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
initialize_winlose_new Ran
ran; our contract draft was wrong, not the code
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("5f0726e2bb4b9826")
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 torch
import json
import tempfile
import os

torch.manual_seed(0)

# Create a minimal dataset - the function only calls len() on it
class MinimalDataset:
    def __init__(self, size=5):
        self.size = size
    
    def __len__(self):
        return self.size

# Create a temporary file for output
temp_dir = tempfile.gettempdir()
output_file = os.path.join(temp_dir, "winlose_test.json")

# Construct arguments
ARGS = {
    'args': {},  # The function doesn't use args, so empty dict is fine
    'output_file': output_file,
    'dataset': MinimalDataset(size=5),
    'rank': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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
preprocess_function Ran
ran on a synthesized input
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("dde8b1b7d023f127")
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 torch
import numpy as np
from types import SimpleNamespace

torch.manual_seed(0)

class MockTokenizer:
    """Minimal tokenizer that returns the required structure."""
    def __call__(self, texts, padding=None, truncation=None, max_length=None):
        batch_size = len(texts)
        return {
            'input_ids': [[101, 2054] + [0] * (max_length - 2) for _ in range(batch_size)],
            'attention_mask': [[1, 1] + [0] * (max_length - 2) for _ in range(batch_size)],
        }

# Create args object with task and max_length
args = SimpleNamespace(
    task='arc_challenge',
    max_length=128
)

# Create examples dict for arc_challenge task
examples = {
    'question': ['What is 2+2?', 'What color is the sky?'],
    'choices': [
        {'label': ['A', 'B', 'C', 'D'], 'text': ['3', '4', '5', '6']},
        {'label': ['A', 'B', 'C', 'D'], 'text': ['red', 'blue', 'green', 'yellow']}
    ],
    'answerKey': ['B', 'B']
}

tokenizer = MockTokenizer()
split = 'train'

ARGS = {
    'args': args,
    'examples': examples,
    'tokenizer': tokenizer,
    'split': split
}
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 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
get_dataloader_adastar Not yet run
unverified (harvested, no recorded run)
reiss-koh/AdaSTaR/utils_adastar.py
code served (permissive licence) · get_code("d28c2505a1798a71")
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-24.

Repositories linked to this paper

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

Abstract

Self-Taught Reasoners (STaR), synonymously known as Rejection sampling Fine-Tuning (RFT), is an integral part of the training pipeline of self-improving reasoning Language Models (LMs). The self-improving mechanism often employs random observation (data) sampling. However, this results in trained observation imbalance; inefficiently over-training on solved examples while under-training on challenging ones. In response, we introduce Adaptive STaR (AdaSTaR), a novel algorithm that rectifies this by integrating two adaptive sampling principles: (1) Adaptive Sampling for Diversity: promoting balanced training across observations, and (2) Adaptive Sampling for Curriculum: dynamically adjusting data difficulty to match the model's evolving strength. Across six benchmarks, AdaSTaR achieves best test accuracy in all instances (6/6) and reduces training FLOPs by an average of 58.6% against an extensive list of baselines. These improvements in performance and efficiency generalize to different pre-trained LMs and larger models, paving the way for more efficient and effective self-improving LMs. github.com/reiss-koh/AdaSTaR

For agents

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

get_harvested_code_for_paper("2505.16322")
get_code_for_paper("2505.16322")
have("2505.16322")

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

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

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

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

Connect an agent — have() is free.