SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.00588 · 2024

Fairness in Serving Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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 2 have no contract verdict; 7 failures of our instrument; 4 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/2401.00588.json · badge: /api/ran/2401.00588.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
s-lora/s-lora canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
ying1123/vtc-artifact canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
benchmark Ran
ran on a synthesized input
s-lora/s-lora/benchmarks/run_exp.py
code served (permissive licence) · get_code("6e238d2d144eed9b")
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 coroutine. 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 asyncio
import time
from typing import List, Tuple

class Request:
    def __init__(self, req_id: str, req_time: float, model_dir: str, adapter_dir: str, prompt: str, prompt_len: int, output_len: int):
        self.req_id = req_id
        self.req_time = req_time
        self.model_dir = model_dir
        self.adapter_dir = adapter_dir
        self.prompt = prompt
        self.prompt_len = prompt_len
        self.output_len = output_len

REQUEST_LATENCY = []

input_requests = [
    Request(
        req_id="req_1",
        req_time=0.0,
        model_dir="/path/to/model1",
        adapter_dir="/path/to/adapter1",
        prompt="This is a test prompt for benchmarking.",
        prompt_len=8,
        output_len=16
    ),
    Request(
        req_id="req_2",
        req_time=0.1,
        model_dir="/path/to/model2",
        adapter_dir="/path/to/adapter2",
        prompt="Another test prompt for the benchmark suite.",
        prompt_len=9,
        output_len=32
    ),
]

ARGS = {
    "backend": "vllm",
    "server": "http://localhost:8000",
    "input_requests": input_requests,
    "debug": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
aiohttp — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
dummy_prompt Ran
ran; our contract draft was wrong, not the code
ying1123/vtc-artifact/benchmarks/trace.py
code served (permissive licence) · get_code("cf380cfb6bd64b21")
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

def dummy_prompt(prompt_len):
    return 'Hello ' * prompt_len

ARGS = {
    'prompt_len': 5
}
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
generate_requests Ran
ran; our contract draft was wrong, not the code
ying1123/vtc-artifact/benchmarks/trace.py
code served (permissive licence) · get_code("2bf66d26ba8a4548")
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 numpy as np

ARGS = {
    'num_adapters': 3,
    'alpha': 1.5,
    'req_rate': 10,
    'cv': 0.5,
    'duration': 2,
    'input_range': (5, 20),
    'output_range': (10, 30),
    'adapter_dirs': [
        ('/path/to/model/0', '/path/to/adapter/0'),
        ('/path/to/model/1', '/path/to/adapter/1'),
        ('/path/to/model/2', '/path/to/adapter/2'),
    ],
    'seed': 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 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
get_lora_config_json Ran
ran; our contract draft was wrong, not the code
s-lora/s-lora/slora/mprophet/lora_config.py
code served (permissive licence) · get_code("5870f80ad0e8422b")
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 re

def get_lora_config_json(name):
    if 'alpaca-lora-7b' in name:
        config = {'base_model_name_or_path': 'decapoda-research/llama-7b-hf', 'bias': 'none', 'enable_lora': None, 'fan_in_fan_out': False, 'inference_mode': True, 'lora_alpha': 16, 'lora_dropout': 0.05, 'merge_weights': False, 'modules_to_save': None, 'peft_type': 'LORA', 'r': 16, 'target_modules': ['q_proj', 'k_proj', 'v_proj', 'o_proj'], 'task_type': 'CAUSAL_LM'}
    elif 'bactrian-x-llama-7b-lora' in name:
        config = {'base_model_name_or_path': 'decapoda-research/llama-7b-hf', 'bias': 'none', 'fan_in_fan_out': False, 'inference_mode': True, 'init_lora_weights': True, 'lora_alpha': 16, 'lora_dropout': 0.05, 'modules_to_save': None, 'peft_type': 'LORA', 'r': 64, 'target_modules': ['q_proj', 'k_proj', 'v_proj', 'o_proj'], 'task_type': 'CAUSAL_LM'}
    elif 'dummy-lora-7b-rank-' in name:
        config = {'base_model_name_or_path': 'huggyllama/llama-7b', 'bias': 'none', 'enable_lora': None, 'fan_in_fan_out': False, 'inference_mode': True, 'lora_alpha': 16, 'lora_dropout': 0.05, 'merge_weights': False, 'modules_to_save': None, 'peft_type': 'LORA', 'r': int(re.search('rank-(\\d+)', name).group(1)), 'target_modules': ['q_proj', 'k_proj', 'v_proj', 'o_proj'], 'task_type': 'CAUSAL_LM'}
    elif 'dummy-lora-13b-rank-' in name:
        config = {'base_model_name_or_path': 'meta-llama/Llama-2-13b-hf', 'bias': 'none', 'enable_lora': None, 'fan_in_fan_out': False, 'inference_mode': True, 'lora_alpha': 16, 'lora_dropout': 0.1, 'merge_weights': False, 'modules_to_save': None, 'peft_type': 'LORA', 'r': int(re.search('rank-(\\d+)', name).group(1)), 'target_modules': ['q_proj', 'k_proj', 'v_proj', 'o_proj'], 'task_type': 'CAUSAL_LM'}
    else:
        raise Exception(f'unrecognized: {name}')
    return config

ARGS = {
    'name': 'alpaca-lora-7b'
}
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
send_request Ran
ran on a synthesized input
s-lora/s-lora/benchmarks/run_exp.py
code served (permissive licence) · get_code("3719da4f729ce737")
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 coroutine. 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 time
import aiohttp

# Mock REQUEST_LATENCY global list
REQUEST_LATENCY = []

# Define ARGS dictionary with all required parameters
ARGS = {
    'backend': 'vllm',
    'server': 'http://localhost:8000',
    'req_id': 'req_001',
    'model_dir': '/models/llama-7b',
    'adapter_dir': '/adapters/lora_1',
    'prompt': 'Hello, how are you doing today?',
    'prompt_len': 10,
    'output_len': 50,
    'debug': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
aiohttp — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
to_dict Ran
ran; our contract draft was wrong, not the code
s-lora/s-lora/benchmarks/exp_suite.py
code served (permissive licence) · get_code("a027792a13b85ec3")
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
from collections import namedtuple

BenchmarkConfig = namedtuple('BenchmarkConfig', ['num_adapters', 'alpha', 'req_rate', 'cv', 'duration', 'input_range', 'output_range'])

def to_dict(config):
    ret = {}
    for i, key in enumerate(BenchmarkConfig._fields):
        ret[key] = config[i]
    return ret

# Create a BenchmarkConfig instance
config = BenchmarkConfig(
    num_adapters=4,
    alpha=0.1,
    req_rate=100,
    cv=0.05,
    duration=60,
    input_range=(0, 1),
    output_range=(0, 10)
)

ARGS = {
    'config': config
}
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
to_dict Ran
ran; our contract draft was wrong, not the code
ying1123/vtc-artifact/fair_bench/exp_suite.py
code served (permissive licence) · get_code("ecdd469e9c7b7443")
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 collections import namedtuple

torch.manual_seed(0)

BenchmarkConfig = namedtuple('BenchmarkConfig', ['num_adapters', 'alpha', 'req_rate', 'cv', 'duration', 'input_range', 'output_range', 'on_off', 'mode'])

# Create a BenchmarkConfig instance with valid values for each field
config = BenchmarkConfig(
    num_adapters=4,
    alpha=0.5,
    req_rate=100,
    cv=0.2,
    duration=60,
    input_range=(0.0, 1.0),
    output_range=(0.0, 10.0),
    on_off=True,
    mode='benchmark'
)

ARGS = {
    'config': config
}
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
to_tuple Ran
ran; our contract draft was wrong, not the code
s-lora/s-lora/benchmarks/exp_suite.py
code served (permissive licence) · get_code("1fb624c4bbfa4098")
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. 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 collections import namedtuple

BenchmarkConfig = namedtuple('BenchmarkConfig', ['num_adapters', 'alpha', 'req_rate', 'cv', 'duration', 'input_range', 'output_range'])

def to_tuple(config):
    keys = BenchmarkConfig._fields
    ret = (config['num_adapters'], config['alpha'], config['req_rate'], config['cv'], config['duration'], tuple(config['input_range']), tuple(config['output_range']))
    return (ret, keys)

ARGS = {
    'config': {
        'num_adapters': 3,
        'alpha': 0.5,
        'req_rate': 10.5,
        'cv': 0.2,
        'duration': 60,
        'input_range': [0, 100],
        'output_range': [0, 1]
    }
}
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 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
to_tuple Ran
ran; our contract draft was wrong, not the code
ying1123/vtc-artifact/fair_bench/exp_suite.py
code served (permissive licence) · get_code("98027d2de0638849")
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. 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 collections import namedtuple

torch.manual_seed(0)

BenchmarkConfig = namedtuple('BenchmarkConfig', ['num_adapters', 'alpha', 'req_rate', 'cv', 'duration', 'input_range', 'output_range', 'on_off', 'mode'])

config = {
    'num_adapters': 4,
    'alpha': 0.5,
    'req_rate': 10.0,
    'cv': 0.2,
    'duration': 60,
    'input_range': [0, 100],
    'output_range': [-50, 50],
    'on_off': True,
    'mode': 'test'
}

ARGS = {
    'config': config
}
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 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
get_all_suites Not yet run
unverified (harvested, no recorded run)
s-lora/s-lora/benchmarks/exp_suite.py
code served (permissive licence) · get_code("03e5db79fc455665")
How it ran

no invocation recorded.

get_all_suites Not yet run
unverified (harvested, no recorded run)
ying1123/vtc-artifact/fair_bench/exp_suite.py
code served (permissive licence) · get_code("3b155d666ec2f922")
How it ran

no invocation recorded.

get_peak_mem Not yet run
unverified (harvested, no recorded run)
s-lora/s-lora/benchmarks/run_exp.py
code served (permissive licence) · get_code("72eaf41bbc94d98b")
How it ran

no invocation recorded.

get_real_requests Not yet run
unverified (harvested, no recorded run)
ying1123/vtc-artifact/benchmarks/trace.py
code served (permissive licence) · get_code("ceccd6265c698888")
How it ran

no invocation recorded.

Also present in other papers' code

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

High-demand LLM inference services (e.g., ChatGPT and BARD) support a wide range of requests from short chat conversations to long document reading. To ensure that all client requests are processed fairly, most major LLM inference services have request rate limits, to ensure that no client can dominate the request queue. However, this rudimentary notion of fairness also results in under-utilization of the resources and poor client experience when there is spare capacity. While there is a rich literature on fair scheduling, serving LLMs presents new challenges due to their unpredictable request lengths and their unique batching characteristics on parallel accelerators. This paper introduces the definition of LLM serving fairness based on a cost function that accounts for the number of input and output tokens processed. To achieve fairness in serving, we propose a novel scheduling algorithm, the Virtual Token Counter (VTC), a fair scheduler based on the continuous batching mechanism. We prove a 2x tight upper bound on the service difference between two backlogged clients, adhering to the requirement of work-conserving. Through extensive experiments, we demonstrate the superior performance of VTC in ensuring fairness, especially in contrast to other baseline methods, which exhibit shortcomings under various conditions. The reproducible code is available at https://github.com/Ying1123/VTC-artifact

For agents

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

get_harvested_code_for_paper("2401.00588")
get_code_for_paper("2401.00588")
have("2401.00588")

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

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

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

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

Connect an agent — have() is free.