SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.00428 · 2024

LayerKV: Optimizing Large Language Model Serving with Layer-wise KV Cache Management

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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; 6 failures of our instrument; 5 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/2410.00428.json · badge: /api/ran/2410.00428.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
intelligent-machine-learning/glake community (classifier label)
classifier basis not recorded on the link
9 ran · 5 no recorded run
FunctionStatusWhere it lives
async_request_deepspeed_mii Ran
ran on a synthesized input
intelligent-machine-learning/glake/GLakeServe/benchmarks/backend_request_func.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thu-keg/seakr, is pointer only (licence: GPL-3.0) · get_code("5109c385e92b727e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from thu-keg/seakr, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

async_request_tgi Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/benchmarks/backend_request_func.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from YaoJiayi/CacheBlend, is pointer only (licence: NONE) · get_code("23a62a462a38f854")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from YaoJiayi/CacheBlend, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

async_request_trt_llm Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/benchmarks/backend_request_func.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thu-keg/seakr, is pointer only (licence: GPL-3.0) · get_code("fa581ebc13cb414d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from thu-keg/seakr, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_served_model_name Ran
ran on a synthesized input
intelligent-machine-learning/glake/GLakeServe/vllm/config.py
code served (permissive licence) · get_code("355e5d19707b7c81")
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
import torch.nn as nn
from typing import Optional, Union, List

ARGS = {
    "model": "gpt2",
    "served_model_name": ["model-v1", "model-v2"]
}
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
run Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/collect_env.py
code served (permissive licence) · get_code("6b73fe0480a96ad9")
How it ran

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

import locale
import subprocess
import sys

# The function 'run' takes a single parameter 'command'
# which can be either a string (shell=True) or a list (shell=False)
# It executes the command and returns (return_code, stdout, stderr)

# Valid arguments for the run function:
ARGS = {
    'command': ['echo', 'hello world']  # List form - will execute with shell=False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
run_and_parse_first_match Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/collect_env.py
code served (permissive licence) · get_code("ce7a62e37fe78c0d")
How it ran

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

import re

def mock_run_lambda(command):
    """Mock run_lambda that simulates running a shell command."""
    # Simulate successful execution with output containing a match
    if command == "test_command":
        return (0, "The version is 1.2.3 and other info", None)
    else:
        return (1, "", None)

def test_run_lambda_failure(command):
    """Mock run_lambda that returns non-zero exit code."""
    return (1, "error output", None)

def test_run_lambda_no_match(command):
    """Mock run_lambda that returns output with no regex match."""
    return (0, "output without version pattern", None)

# Define ARGS dict with all parameters
ARGS = {
    "run_lambda": mock_run_lambda,
    "command": "test_command",
    "regex": r"version is ([0-9.]+)"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
run_and_read_all Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/collect_env.py
code served (permissive licence) · get_code("5ae630bfc3821b6e")
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
import torch.nn as nn

def create_run_lambda():
    """Create a mock run_lambda function that returns (rc, stdout, stderr)"""
    def mock_run_lambda(command):
        # Simulate successful command execution
        if "error" in command:
            return 1, "", "error occurred"
        else:
            return 0, "command output", ""
    return mock_run_lambda

ARGS = {
    "run_lambda": create_run_lambda(),
    "command": "echo 'test command'"
}
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
run_vllm Ran
ran on a synthesized input
intelligent-machine-learning/glake/GLakeServe/benchmarks/benchmark_throughput.py
code served (permissive licence) · get_code("f44718a5d7ec296f")
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 time
from typing import List, Optional, Tuple

# Build minimal stand-in classes and objects
class MockTokenizer:
    def __init__(self):
        self.vocab_size = 32000
    
    def encode(self, text: str):
        return [1, 2, 3]
    
    def decode(self, tokens: List[int]):
        return "mock output"

class MockLLM:
    def __init__(self, **kwargs):
        self.model = kwargs.get('model')
        self.tokenizer = kwargs.get('tokenizer')
        self.quantization = kwargs.get('quantization')
        self.tensor_parallel_size = kwargs.get('tensor_parallel_size', 1)
        self.seed = kwargs.get('seed', 0)
        self.trust_remote_code = kwargs.get('trust_remote_code', False)
        self.dtype = kwargs.get('dtype', 'float16')
        self.max_model_len = kwargs.get('max_model_len')
        self.gpu_memory_utilization = kwargs.get('gpu_memory_utilization', 0.9)
        self.enforce_eager = kwargs.get('enforce_eager', False)
        self.kv_cache_dtype = kwargs.get('kv_cache_dtype', 'auto')
        self.quantization_param_path = kwargs.get('quantization_param_path')
        self.device = kwargs.get('device', 'cpu')
        self.enable_prefix_caching = kwargs.get('enable_prefix_caching', False)
        self.download_dir = kwargs.get('download_dir')
        self.enable_chunked_prefill = kwargs.get('enable_chunked_prefill', False)
        self.max_num_batched_tokens = kwargs.get('max_num_batched_tokens', 512)
    
    def generate(self, prompts: List[str], sampling_params: List, use_tqdm: bool = False):
        # Mock generate that returns quickly
        return [{"text": f"output for {p}"} for p in prompts]

class MockSamplingParams:
    def __init__(self, n: int = 1, temperature: float = 1.0, top_p: float = 1.0, 
                 use_beam_search: bool = False, ignore_eos: bool = False, max_tokens: int = 128):
        self.n = n
        self.temperature = temperature
        self.top_p = top_p
        self.use_beam_search = use_beam_search
        self.ignore_eos = ignore_eos
        self.max_tokens = max_tokens

# Monkey-patch vllm module for testing
import sys
from types import ModuleType

vllm_module = ModuleType('vllm')
vllm_module.LLM = MockLLM
vllm_module.SamplingParams = MockSamplingParams
sys.modules['vllm'] = vllm_module

# Construct ARGS
ARGS = {
    'requests': [
        ("What is the capital of France?", 1, 50),
        ("Explain quantum mechanics in simple terms.", 1, 100),
    ],
    'model': 'meta-llama/Llama-2-7b-hf',
    'tokenizer': 'meta-llama/Llama-2-7b-hf',
    'quantization': None,
    'tensor_parallel_size': 1,
    'seed': 42,
    'n': 1,
    'use_beam_search': False,
    'trust_remote_code': False,
    'dtype': 'float16',
    'max_model_len': 2048,
    'enforce_eager': False,
    'kv_cache_dtype': 'auto',
    'quantization_param_path': None,
    'device': 'cpu',
    'enable_prefix_caching': False,
    'enable_chunked_prefill': False,
    'max_num_batched_tokens': 512,
    'gpu_memory_utilization': 0.9,
    'download_dir': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
vllm — 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
sample_requests Ran
ran; our contract draft was wrong, not the code
intelligent-machine-learning/glake/GLakeServe/benchmarks/benchmark_throughput.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from YaoJiayi/CacheBlend, is pointer only (licence: NONE) · get_code("f55439b30be97107")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from YaoJiayi/CacheBlend, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

awq_dequantize Not yet run
unverified (harvested, no recorded run)
intelligent-machine-learning/glake/GLakeServe/vllm/_custom_ops.py
code served (permissive licence) · get_code("c382c6353e8cccb0")
How it ran

no invocation recorded.

awq_gemm Not yet run
unverified (harvested, no recorded run)
intelligent-machine-learning/glake/GLakeServe/vllm/_custom_ops.py
code served (permissive licence) · get_code("f3fcfeaca594c86f")
How it ran

no invocation recorded.

gptq_gemm Not yet run
unverified (harvested, no recorded run)
intelligent-machine-learning/glake/GLakeServe/vllm/_custom_ops.py
code served (permissive licence) · get_code("4def2cf22c36f4e8")
How it ran

no invocation recorded.

run_hf Not yet run
unverified (harvested, no recorded run)
intelligent-machine-learning/glake/GLakeServe/benchmarks/benchmark_throughput.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from YaoJiayi/CacheBlend, is pointer only (licence: NONE) · get_code("0745e2813903bd8d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from YaoJiayi/CacheBlend, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

sample_requests Not yet run
unverified (harvested, no recorded run)
intelligent-machine-learning/glake/GLakeServe/benchmarks/benchmark_serving.py
code served (permissive licence) · get_code("8abfc7dfff3ebb06")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 0 the same month, 3 later) and 3 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
run_and_parse_first_match 14 other papers
8 dated earlier, 6 later
2109.04003 (2021-09)
Improving Deep Metric Learning by Divide and Conquer
2109.08267 (2021-09)
CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation Models
and 11 more not named here
run_and_read_all 14 other papers
8 dated earlier, 6 later
2109.04003 (2021-09)
Improving Deep Metric Learning by Divide and Conquer
2109.08267 (2021-09)
CompilerGym: Robust, Performant Compiler Optimization Environments for AI Research
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation Models
and 11 more not named here
run 6 other papers
2 dated earlier, 4 later
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2406.19215 (2024-06)
SeaKR: Self-aware Knowledge Retrieval for Adaptive Retrieval Augmented Generation
2411.04750 (2024-11)
SpectraFM: Tuning into Stellar Foundation Models
and 3 more not named here
run_hf 3 other papers
3 dated earlier
2402.01799 (2024-02)
Faster and Lighter LLMs: A Survey on Current Challenges and Way Forward
2402.01869 (2024-02)
InferCept: Efficient Intercept Support for Augmented Large Language Model Inference
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
async_request_deepspeed_mii 2 other papers
2 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2406.19215 (2024-06)
SeaKR: Self-aware Knowledge Retrieval for Adaptive Retrieval Augmented Generation
async_request_trt_llm 2 other papers
2 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2406.19215 (2024-06)
SeaKR: Self-aware Knowledge Retrieval for Adaptive Retrieval Augmented Generation
awq_dequantize 2 other papers
2 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2408.15792 (2024-08)
Efficient LLM Scheduling by Learning to Rank
awq_gemm 2 other papers
2 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2408.15792 (2024-08)
Efficient LLM Scheduling by Learning to Rank
gptq_gemm 2 other papers
2 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
2408.15792 (2024-08)
Efficient LLM Scheduling by Learning to Rank
async_request_tgi 1 other paper
1 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion
sample_requests 1 other paper
1 dated earlier
2405.16444 (2024-05)
CacheBlend: Fast Large Language Model Serving for RAG with Cached Knowledge Fusion

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

The expanding context windows in large language models (LLMs) have greatly enhanced their capabilities in various applications, but they also introduce significant challenges in maintaining low latency, particularly in Time to First Token (TTFT). This paper identifies that the sharp rise in TTFT as context length increases is predominantly driven by queuing delays, which are caused by the growing demands for GPU Key-Value (KV) cache allocation clashing with the limited availability of KV cache blocks. To address this issue, we propose LayerKV, a simple yet effective plug-in method that effectively reduces TTFT without requiring additional hardware or compromising output performance, while seamlessly integrating with existing parallelism strategies and scheduling techniques. Specifically, LayerKV introduces layer-wise KV block allocation, management, and offloading for fine-grained control over system memory, coupled with an SLO-aware scheduler to optimize overall Service Level Objectives (SLOs). Comprehensive evaluations on representative models, ranging from 7B to 70B parameters, across various GPU configurations, demonstrate that LayerKV improves TTFT latency up to 69x and reduces SLO violation rates by 28.7%, significantly enhancing the user experience.

For agents

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

get_harvested_code_for_paper("2410.00428")
get_code_for_paper("2410.00428")
have("2410.00428")

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

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

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

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

Connect an agent — have() is free.