SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.14105 · ICLR · 2025

Distributed Speculative Inference (DSI): Speculation Parallelism for Provably Faster Lossless Language Model Inference

Tomer Galanti, Jonathan Mamou, Moshe Wasserblat, Nadav Timor, Daniel Korat, Moshe Berchansky, Oren Pereg, Michal Gordon, David Harel

arXiv · PDF · Open in the Atlas

Code that ran

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

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.14105.json · badge: /api/ran/2405.14105.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
keyboardAnt/distributed-speculative-inference marked official in Papers with Code
Papers with Code archive
8 ran · 7 no recorded run
FunctionStatusWhere it lives
ConfigDSI Ran
ran on a synthesized input · constructed an object; no result was computed
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("271a632f4512afd2")
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, ConfigDSI: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from math import ceil

# Construct valid arguments for ConfigDSI
# ConfigDSI inherits from ConfigSI, which inherits from _ConfigExperiment
# All parameters must satisfy the constraints defined in the Field() definitions

# Valid configuration that passes all validation checks
ARGS = {
    # From _ConfigExperiment
    "random_seed": 42,
    "num_repeats": 5,
    
    # From ConfigSI
    "c": 0.1,  # latency of drafter (must be > 0 and <= failure_cost)
    "a": 0.9,  # acceptance rate (must be in [0, 1])
    "k": 5,    # lookahead (must be >= 1)
    "failure_cost": 1.0,  # latency of target (must be >= 0)
    "S": 1000,  # number of tokens to generate (must be >= 1)
    
    # From ConfigDSI
    "num_target_servers": 7,  # must be >= 1 or None
}

# Verify the configuration is valid by instantiating it
from pydantic import BaseModel, Field
from math import ceil

class _ConfigExperiment(BaseModel):
    random_seed: int = 42
    num_repeats: int = Field(5, title='The number of times to repeat a single run', description='For example, an experiment can average over multiple single runs.', ge=1)

class DrafterSlowerThanTargetError(Exception):
    def __init__(self, msg: str):
        prefix: str = 'The drafter must be as fast as the target or faster than the target. '
        super().__init__(prefix + msg)

class NumOfTargetServersInsufficientError(Exception):
    def __init__(self, msg: str):
        prefix: str = 'The current analysis supports only simples cases where there are no waits on target servers. For every k drafts that are ready for verification, there must be an idle target server. '
        super().__init__(prefix + msg)

class ConfigSI(_ConfigExperiment):
    c: float = Field(0.1, title='The latency of the drafter', description='c=0 requires infinitly many target servers', gt=0)
    a: float = Field(0.9, title='The acceptance rate', ge=0, le=1)
    k: int = Field(5, title='Lookahead', ge=1)
    failure_cost: float = Field(1.0, title='The latency of the target', ge=0)
    S: int = Field(1000, title='The number of tokens to generate', ge=1)

    def model_post_init(self, __context) -> None:
        if self.c > self.failure_cost:
            msg: str = f'self.c={self.c!r} > self.failure_cost={self.failure_cost!r}'
            raise DrafterSlowerThanTargetError(msg)

class ConfigDSI(ConfigSI):
    num_target_servers: None | int = Field(7, title='The number of target servers', description='The maximal number of target servers at any point in time. None means infinity.', ge=1)

    @property
    def _is_sufficient_num_target_servers(self) -> bool:
        if self.num_target_servers is None:
            return True
        num_target_servers_required: int = ceil(self.failure_cost / (max(1, self.k) * self.c))
        return self.num_target_servers >= num_target_servers_required

    def model_post_init(self, __context) -> None:
        super().model_post_init(__context)
        if not self._is_sufficient_num_target_servers:
            msg: str = f'num_target_servers={self.num_target_servers} < num_target_servers_required={ceil(self.failure_cost / (max(1, self.k) * self.c))}'
            raise NumOfTargetServersInsufficientError(msg)

# Test instantiation
config = ConfigDSI(**ARGS)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConfigDSI — 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 ConfigDSI 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
ConfigSI Ran
ran on a synthesized input · constructed an object; no result was computed
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("dacab08eab0d6559")
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, ConfigSI: 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.

from pydantic import Field, BaseModel

class DrafterSlowerThanTargetError(Exception):
    def __init__(self, msg: str):
        prefix: str = 'The drafter must be as fast as the target or faster than the target. '
        super().__init__(prefix + msg)

class _ConfigExperiment(BaseModel):
    """
    _ConfigExperiment is the base class for all experiment configurations.
    """
    random_seed: int = 42
    num_repeats: int = Field(5, title='The number of times to repeat a single run', description='For example, an experiment can average over multiple single runs.', ge=1)

class ConfigSI(_ConfigExperiment):
    """ConfigSI includes all the parameters needed for an experiment.
    Each experiment simulates an algorithm multiple times.
    """
    c: float = Field(0.1, title='The latency of the drafter', description='c=0 requires infinitly many target servers', gt=0)
    a: float = Field(0.9, title='The acceptance rate', ge=0, le=1)
    k: int = Field(5, title='Lookahead', ge=1)
    failure_cost: float = Field(1.0, title='The latency of the target', ge=0)
    S: int = Field(1000, title='The number of tokens to generate', ge=1)

    def model_post_init(self, __context) -> None:
        """
        Verify that the drafter is not slower than the target.
        """
        if self.c > self.failure_cost:
            msg: str = f'self.c={self.c!r} > self.failure_cost={self.failure_cost!r}'
            raise DrafterSlowerThanTargetError(msg)

ARGS = {
    'random_seed': 42,
    'num_repeats': 5,
    'c': 0.1,
    'a': 0.9,
    'k': 5,
    'failure_cost': 1.0,
    'S': 1000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConfigSI — 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 ConfigSI 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
DrafterSlowerThanTargetError Ran
ran on a synthesized input · constructed an object; no result was computed
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("4e59d13c19539020")
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, DrafterSlowerThanTargetError: 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

torch.manual_seed(0)

ARGS = {
    "msg": "drafter inference speed is 0.5x target speed"
}
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 DrafterSlowerThanTargetError — 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 DrafterSlowerThanTargetError 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
NumOfTargetServersInsufficientError Ran
ran on a synthesized input · constructed an object; no result was computed
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("ec44f925c15ddb73")
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, NumOfTargetServersInsufficientError: 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

# The function's __init__ takes a 'msg' parameter of type str
# The function prepends a prefix to the message and passes it to the parent Exception class
# No complex objects or tensor operations are involved

msg = "Not enough idle target servers available for verification"

ARGS = {
    'msg': msg
}
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 NumOfTargetServersInsufficientError — 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 NumOfTargetServersInsufficientError 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
_ConfigExperiment Ran
ran on a synthesized input · constructed an object; no result was computed
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("d8c80e158adc39c1")
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, _ConfigExperiment: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from pydantic import BaseModel, Field

torch.manual_seed(0)

ARGS = {
    "random_seed": 42,
    "num_repeats": 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _ConfigExperiment — 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 _ConfigExperiment output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
call_target_actual Ran
ran; our contract draft was wrong, not the code
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("7945a734a6fcfc6f")
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
from threading import Thread
from collections import defaultdict

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class SimplePipe:
    def __init__(self):
        self.model = SimpleModel()
    
    def __call__(self, x):
        return self.model(x)

class SimpleExecutor:
    def __init__(self):
        self.tasks = []
    
    def submit(self, fn, *args):
        self.tasks.append((fn, args))
        return self
    
    def shutdown(self, wait=True):
        pass

class Args:
    def __init__(self):
        self.failure_cost = 0.001
        self.failure_cost_sub = 0.0005

args = Args()
draft_tokens = [1, 2, 3, 4, 5]
total_tokens = 10
sim_shared_dict = {
    'correct': True,
    'model_id': False
}
cur_pipe = SimplePipe()
sim_executor = SimpleExecutor()

ARGS = {
    'args': args,
    'draft_tokens': draft_tokens,
    'total_tokens': total_tokens,
    'sim_shared_dict': sim_shared_dict,
    'cur_pipe': cur_pipe,
    'sim_executor': sim_executor
}
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
get_current_thread_name Ran
ran on a synthesized input
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("7feffeae9b19b765")
How it ran

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

import torch
from threading import current_thread
import threading

# The function get_current_thread_name() takes no parameters
# It uses current_thread().getName() which is a built-in threading function
# The function doesn't take any arguments to set up

# To make the function work meaningfully, we can optionally set the thread name
# but since the function takes no parameters, ARGS will be empty

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_target_time Ran
ran, honoured the contract we drafted
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("cc91710f73b2bd08")
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

class Args:
    def __init__(self):
        self.failure_cost = 1.0
        self.failure_cost_sub = 0.5

args = Args()
visited = False

ARGS = {
    'args': args,
    'visited': visited
}
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
ConfigDSIOnline Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("26701e3e474f9fef")
How it ran

no invocation recorded.

SimulType Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("b11aa6140555d2dc")
How it ran

no invocation recorded.

call_target Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("9ee7c56034b83c31")
How it ran

no invocation recorded.

fix_history Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("1514d09de3a360a6")
How it ran

no invocation recorded.

run_generate Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("753922cbd39c3d6d")
How it ran

no invocation recorded.

target_done_callback Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("1ca3289bc87391f4")
How it ran

no invocation recorded.

terminate_process Not yet run
unverified (harvested, no recorded run)
keyboardAnt/distributed-speculative-inference/dsi/online/simul/core.py
code served (permissive licence) · get_code("a4e64bdf694d83db")
How it ran

no invocation recorded.

Also present in other papers' code

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

This paper introduces distributed speculative inference (DSI), a novel inference algorithm that is provably faster than speculative inference (SI) (

For agents

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

get_harvested_code_for_paper("2405.14105")
get_code_for_paper("2405.14105")
have("2405.14105")

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

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

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

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

Connect an agent — have() is free.