SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.10273 · 2026

Power-SMC: Low-Latency Sequence-Level Power Sampling for Training-Free LLM Reasoning

Souvik Kundu, Seyedarmin Azizi, Massoud Pedram, Erfan Potraghloo, Minoo Ahmadi

arXiv · PDF · Open in the Atlas

Code that ran

17 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 5 violated it and 1 has no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2602.10273.json · badge: /api/ran/2602.10273.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
ArminAzizi98/Power-SMC community
Papers with Code archive
17 ran · 1 no recorded run
FunctionStatusWhere it lives
SMCSamplingConfig Ran
ran on a synthesized input · constructed an object; no result was computed
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("c11d37553c5a1470")
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, SMCSamplingConfig: 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "max_new_tokens": 3072,
    "alpha": 2.0,
    "n_particles": 32,
    "ess_threshold": 0.5,
    "temperature": 0.25,
    "block_size": 128,
    "force_eos_after_done": True,
    "alpha_ramp_tokens": 400,
    "min_new_tokens": 100,
    "repetition_penalty": 1.0,
    "top_k": 0,
    "top_p": 0.9,
    "min_tokens_to_keep": 1,
    "penalize_prompt": False,
    "hard_truncation": True,
    "soft_truncation_value": -50.0,
    "stop_on_boxed": True,
    "boxed_check_window_tokens": 256,
    "use_cow_cache": True,
    "shared_prompt_cache": True,
}
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 SMCSamplingConfig — 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 SMCSamplingConfig 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
_alpha_ramp Ran
ran, honoured the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("d6bc2e0f740b6af5")
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 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 torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function _alpha_ramp:
# Parameters:
# - t: a numeric value (time step or iteration counter)
# - alpha_final: a numeric value (final alpha value)
# - ramp_T: a numeric value (ramp duration threshold)
# 
# The function uses:
# - Basic numeric comparisons (t < ramp_T, ramp_T <= 1)
# - Arithmetic operations on numeric values
# - float() conversions
# 
# No complex objects are needed - all parameters are simple scalars

ARGS = {
    "t": 5,
    "alpha_final": 0.5,
    "ramp_T": 10
}
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 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
_build_prompt_cache Ran
ran; our contract draft was wrong, not the code
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("7e67fc04f2c413cc")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn

torch.manual_seed(0)

class SimpleLanguageModel(nn.Module):
    """Minimal model that returns logits and past_key_values."""
    def __init__(self, vocab_size=8, hidden_dim=4):
        super().__init__()
        self.embed = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_ids, use_cache=False):
        # input_ids shape: [batch, seq_len]
        x = self.embed(input_ids)  # [batch, seq_len, hidden_dim]
        logits = self.linear(x)    # [batch, seq_len, vocab_size]
        
        # Create a simple output object with logits and past_key_values
        output = type('Output', (), {})()
        output.logits = logits
        
        if use_cache:
            # Simulate cache as nested structure of tensors
            # batch dimension should be first
            batch_size = input_ids.size(0)
            cache_tensor = torch.randn(batch_size, 2, 4)
            output.past_key_values = (
                (cache_tensor, cache_tensor),  # layer 0
                (cache_tensor, cache_tensor),  # layer 1
            )
        else:
            output.past_key_values = None
        
        return output


model = SimpleLanguageModel(vocab_size=8, hidden_dim=4)
input_ids_1 = torch.tensor([[1, 2]], dtype=torch.long)  # shape [1, 2]
N = 3

ARGS = {
    'model': model,
    'input_ids_1': input_ids_1,
    'N': N,
}
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 — a tuple output has no array shape of its own; none is 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
_has_nonempty_boxed Ran
ran, violated the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("d8bd033ef272a63a")
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 bool, 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 re

_BOX_ONLY_RE = re.compile('^[\\s{}]*$')

def _has_nonempty_boxed(text):
    for macro in ('\\boxed', '\\fbox'):
        start = 0
        while True:
            idx = text.find(macro, start)
            if idx < 0:
                break
            j = idx + len(macro)
            while j < len(text) and text[j].isspace():
                j += 1
            if j < len(text) and text[j] == '{':
                depth = 0
                right = None
                for k in range(j, len(text)):
                    c = text[k]
                    if c == '{':
                        depth += 1
                    elif c == '}':
                        depth -= 1
                        if depth == 0:
                            right = k
                            break
                if right is not None:
                    content = text[j + 1:right].strip()
                    while len(content) >= 2 and content[0] == '{' and (content[-1] == '}'):
                        inner = content[1:-1].strip()
                        if inner == content:
                            break
                        content = inner
                    if content and _BOX_ONLY_RE.fullmatch(content) is None:
                        return True
            start = idx + len(macro)
    return False


ARGS = {
    'text': r'Some text with \boxed{answer} in it'
}
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 bool, 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
_logsumexp Ran
ran; our contract draft was wrong, not the code
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("b62267a68fe5a3bd")
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 Tensor, ndim 1, dtype family float, shape (4,) 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 torch

torch.manual_seed(0)

# Create a small tensor for testing logsumexp
# Using shape (2, 4) for batch_size=2, features=4
x = torch.randn(2, 4)

ARGS = {
    "x": x,
    "dim": 0,
}
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 Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) 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
_recursive_expand_batch Ran
ran, honoured the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("81a53e78c7ec3c27")
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 Tensor, ndim 2, dtype family float, shape (5, 4) 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 torch

torch.manual_seed(0)

# Test case 1: obj is a tensor that matches batch size U
obj_tensor = torch.randn(2, 4)  # U=2 batch, 4 features
expand_idx = torch.tensor([0, 1, 0, 1, 1])  # N=5 particles, expand to U=2

ARGS = {
    "obj": obj_tensor,
    "expand_idx": expand_idx,
}
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 Tensor, ndim 2, dtype family float, shape (5, 4) — shape (5, 4) 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
_recursive_reorder Ran
ran, violated the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("6529a7001a27f7fa")
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)

# Test case 1: nested structure with tensors that should be reordered
obj = {
    "tensor_batch": torch.randn(2, 4),
    "nested_list": [
        torch.randn(2, 3),
        {"inner_tensor": torch.randn(2, 5)},
        None
    ],
    "tuple_data": (
        torch.randn(2, 6),
        torch.randn(3, 4),  # different batch size, should NOT be reordered
        "string_value"
    ),
    "scalar_tensor": torch.randn(4),  # 1D but no batch dim match, should NOT be reordered
    "none_value": None,
    "plain_value": 42
}

# Index tensor that selects elements [1, 0] from batch dimension
idx = torch.tensor([1, 0], dtype=torch.long)

ARGS = {
    "obj": obj,
    "idx": idx
}
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
_recursive_select_batch Ran
ran, honoured the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("f59c6097734907cc")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Test case 1: tensor with batch dimension
obj_tensor = torch.randn(2, 4)
idx_tensor = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "obj": obj_tensor,
    "idx": idx_tensor
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
_reorder_tensor_batchdim Ran
ran; our contract draft was wrong, not the code
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("6a048b7ef27a8a82")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Create a small tensor with batch dimension (batch_size=2, feature_dim=4)
t = torch.randn(2, 4)

# Create index tensor to reorder the batch dimension
idx = torch.tensor([1, 0])

ARGS = {
    "t": t,
    "idx": idx,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
apply_repetition_penalty_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("e329fb63ee5d2397")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Construct arguments for apply_repetition_penalty_
logits = torch.randn(2, 4)  # N=2 batch size, V=4 vocab size
prev_tokens = [
    torch.tensor([0, 1, 0]),  # First batch: token indices
    torch.tensor([2, 3])       # Second batch: token indices
]
penalty = 1.2  # Repetition penalty > 1.0

ARGS = {
    "logits": logits,
    "prev_tokens": prev_tokens,
    "penalty": penalty
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
effective_sample_size Ran
ran; our contract draft was wrong, not the code
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("91135083780b8eb9")
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 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 torch

torch.manual_seed(0)

# The function takes a tensor w and an optional eps parameter
# It clamps w to a minimum value, then computes 1 / sum(w*w)
# So w should be a 1D or multi-dimensional tensor of weights

w = torch.tensor([0.1, 0.2, 0.3, 0.4], dtype=torch.float32)

ARGS = {
    "w": w,
    "eps": 1e-12
}
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 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
expand_cache Ran
ran, violated the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("d7e8393192c82317")
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 torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that may have _reorder_cache method
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal past cache object (could be dict, tuple, or custom object)
# Using a dict structure that mimics HF cache format
past = {
    "layer_0": (
        torch.randn(2, 3, 4),  # U=2 batch, 3 seq, 4 dim
        torch.randn(2, 3, 4)   # key-value pair
    ),
    "layer_1": (
        torch.randn(2, 3, 4),
        torch.randn(2, 3, 4)
    ),
    "metadata": {
        "num_layers": 2,
        "cached_seq_len": 3
    }
}

# expand_idx maps N=4 particles to U=2 unique cache entries
# e.g., [0, 1, 0, 1] means particle 0,2 use cache 0; particles 1,3 use cache 1
expand_idx = torch.tensor([0, 1, 0, 1], dtype=torch.long)

# Build model without special reorder_cache method
model = MinimalModel()

ARGS = {
    "model": model,
    "past": past,
    "expand_idx": expand_idx
}
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
reorder_past_key_values Ran
ran, violated the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("ad2d3b7cdbd9e44b")
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 6, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that has a _reorder_cache method
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def _reorder_cache(self, past_key_values, idx):
        # This method will be called by reorder_past_key_values
        # It should handle reordering the cache
        if isinstance(past_key_values, dict):
            return {k: v.index_select(0, idx) if torch.is_tensor(v) else v 
                    for k, v in past_key_values.items()}
        return past_key_values

# Create model instance
model = SimpleModel()

# Create past_key_values as a nested structure with tensors
# Mimicking typical transformer cache structure (tuple of tuples of tensors)
past_key_values = (
    (torch.randn(2, 3, 4, 5), torch.randn(2, 3, 4, 5)),  # layer 1: (key, value)
    (torch.randn(2, 3, 4, 5), torch.randn(2, 3, 4, 5)),  # layer 2: (key, value)
)

# Create reordering index
idx = torch.tensor([1, 0])  # swap batch dimension ordering

ARGS = {
    "model": model,
    "past_key_values": past_key_values,
    "idx": idx
}
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 6, 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
select_cache_subset Ran
ran, violated the contract we drafted
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("dba305efe9f35f05")
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 MinimalCache. 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 torch.nn as nn

torch.manual_seed(0)

# Build a minimal model class
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def _reorder_cache(self, past, idx):
        # Minimal implementation that just returns past
        return past

# Build a minimal past/cache object with reorder_cache method
class MinimalCache:
    def __init__(self):
        self.key_cache = [torch.randn(2, 3, 4)]
        self.value_cache = [torch.randn(2, 3, 4)]
    
    def reorder_cache(self, idx):
        # Simulate reordering by indexing the first dimension
        self.key_cache = [k.index_select(0, idx) for k in self.key_cache]
        self.value_cache = [v.index_select(0, idx) for v in self.value_cache]

# Create instances
model = MinimalModel()
past = MinimalCache()
idx = torch.tensor([0, 1], dtype=torch.long)

ARGS = {
    "model": model,
    "past": past,
    "idx": idx,
}
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 MinimalCache — a MinimalCache output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalCache 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
systematic_resample Ran
ran; our contract draft was wrong, not the code
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("bbe0dd4540175572")
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 Tensor, ndim 1, dtype family int, shape (4,) 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 torch

torch.manual_seed(0)

# Create a small weight tensor
# The function uses w.numel(), w.device, torch.cumsum(w, dim=0)
# So w should be a 1D tensor of weights that sum to approximately 1
w = torch.tensor([0.1, 0.2, 0.3, 0.4], dtype=torch.float32)

# Create a generator for reproducibility
generator = torch.Generator()
generator.manual_seed(42)

ARGS = {
    "w": w,
    "generator": generator
}
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 Tensor, ndim 1, dtype family int, shape (4,) — shape (4,) 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
top_k_filter_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("489f2e186a01ff20")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Create a small logits tensor: batch_size=2, vocab_size=4
logits = torch.randn(2, 4)

# Set top_k to a valid value (less than vocab_size and greater than 0)
top_k = 2

ARGS = {
    "logits": logits,
    "top_k": top_k,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
top_p_filter_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("c1c224463a8b830f")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Create logits tensor with shape (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Define top_p parameter
top_p = 0.9

# Define min_tokens_to_keep parameter
min_tokens_to_keep = 1

ARGS = {
    "logits": logits,
    "top_p": top_p,
    "min_tokens_to_keep": min_tokens_to_keep,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
smc_power_sample_memopt Not yet run
unverified (harvested, no recorded run)
ArminAzizi98/Power-SMC/smc_samp_utils.py
code served (permissive licence) · get_code("eaf72210e30f9e84")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 16 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.

FunctionAlso present inEarliest-datedOthers named
effective_sample_size
brick of this paper's assembly: metric
1 other paper
1 later
2609.12243 (2026-09)
Chopthin-Consensus Power Sampling: A Diversity-Preserving Approach to LLM Decoding
systematic_resample
brick of this paper's assembly: sampler
1 other paper
1 later
2609.12243 (2026-09)
Chopthin-Consensus Power Sampling: A Diversity-Preserving Approach to LLM Decoding

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

Many recent reasoning gains in large language models can be explained as distribution sharpening: biasing generation toward high-likelihood trajectories already supported by the pretrained model, rather than modifying its weights. A natural formalization is the sequence-level power distribution π α (y | x) ∝ p θ (y | x) α (α > 1), which concentrates mass on whole sequences instead of adjusting tokenlevel temperature. Prior work shows that Metropolis-Hastings (MH) sampling from this distribution recovers strong reasoning performance, but at order-of-magnitude inference slowdowns. We introduce Power-SMC, a training-free Sequential Monte Carlo scheme that targets the same objective while remaining close to standard decoding latency. Power-SMC advances a small particle set in parallel, corrects importance weights token-by-token, and resamples when necessary all within a single GPU-friendly batched decode. We prove that temperature τ = 1/α is the unique prefix-only proposal minimizing incremental weight variance, interpret residual instability via prefix-conditioned Rényi entropies, and introduce an exponent-bridging schedule that improves particle stability without altering the target. On MATH500, Power-SMC matches or exceeds MH power sampling while reducing latency from 16-28× to 1.4-3.3× over baseline decoding. The code is available at https://github.com/ArminAzizi98/Power-SMC.

For agents

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

get_harvested_code_for_paper("2602.10273")
get_code_for_paper("2602.10273")
have("2602.10273")

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

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

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

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

Connect an agent — have() is free.