Manuscript Offprint

arXiv:2610.28223

Local Inference of LLMs on Long Contexts: A Data Systems Perspective

Mattias Dürrmeier, Alberto Lerner

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language models can solve complex problems across a variety of subjects, such as mathematics and coding. For such complex analytical tasks, models with a long context perform better. Serving models with long context is currently mostly done on powerful systems with multiple GPUs, which are too expensive for most users. An alternative is local inference, or serving a model on a user's own machine, which removes per-token costs and rate limits, besides keeping sensitive data private and giving users full control over the models they run. The common understanding, however, is that local LLMs need compression (e.g., quantization) to run on a single GPU.

In this paper, we set out to study the limitations that prevent serving long-context models for single users, besides the capacity issue. Rather than characterizing a single model on one GPU, we analyze how different models behave across several GPU generations. This lets us uncover not just individual bottlenecks but broader trends in where inefficiencies arise. Our analysis confirms that, as expected, self-attention dominates the runtime for long-context inference. More unexpectedly, our evaluation reveals that the current structure of self-attention leaves key GPU resources significantly underutilized, and the newest GPU is often the least well served. Many of these findings are fundamentally data management problems, from paging the KV cache to improving cache utilization and synchronization in the GPU, which is why we bring this study to the Data Systems community. To engage this community, we present our findings as a series of experimental observations and formulate recommendations for future work.

1 Introduction

Transformers [69] are currently the leading model architecture for a wide range of tasks. This phenomenon is underscored by a study from Jouppi et al., the creators of Google's TPU, that analyzed the relative prevalence of different model architectures [35]. In 2026, transformers accounted for 76% of the models deployed on TPUs, with their share rising steadily since the hardware's introduction. By contrast, all other model architectures saw lower utilization. The second most common, multi-layer perceptrons, comprised only 11%. Much of this success is driven by large language models (LLMs), the transformer's most consequential application [54, 55]. Trained on large corpora, they can solve diverse tasks such as logic and math problems [37, 41], write and run code [28, 31, 34], or evaluate research ideas and write papers [42], to name a few.

Many of these tasks can now be performed with open-weight models, allowing users to run inference on their own hardware [13, 50, 65, 66]. These models, however, have a very high resource consumption. The majority of this demand comes during the decode phase of the LLM, where the conversation is generated one token at a time, each token requiring a full pass through the model (Section 2). It is ultimately the ability to generate large numbers of tokens through the decode phase that allows more complex analytical tasks to be performed. Similarly to the scaling observed during training [36], inference scaling shows that LLMs perform better when they spend more time reasoning about the problem [37].

Despite this, the performance profile of the single-user (i.e., locally run) decode phase has received little attention. Prior characterization work has largely targeted high-throughput, multi-user serving [57, 58], where the aim is to maximize the number of queries processed at once. In that regime, inference is known to be memory-bound [21, 57]. In the single-user setting, memory capacity becomes the main limitation because the model's state might not fit on a single GPU. The typical solution is to either compress the state through quantization [14, 18, 25] or to page parts of the state in and out of the GPU [32, 62]. Doing so, however, prevents the remaining causes of performance loss from being properly understood.

In this paper, we address this gap by providing a performance characterization study of LLMs under a single-user workload. Our central objective is to locate bottlenecks as models and hardware evolve. To achieve this, we examine how performance changes both with different models and model sizes, and as we move across three successive generations of GPUs (Section 3). The measurements we make are at the level of the GPU kernels produced by the most common deep learning library and its compiler, PyTorch [3]. This allows us to introspect not only how each kernel performs, but also whether it reflects an efficient compilation of the model. What we found are many inefficiencies that, if addressed, can unlock further performance of local LLMs.

Our performance characterization study comprises two parts. The observations come first, and are based on how the decode phase behaves across different models and GPUs (Section 4 and Section 5). It finds that, for instance, the newest GPU is often the least well utilized, as its attention kernel fails to translate greater hardware capability into faster decoding. Our study's recommendations follow, addressing the limitations these observations expose. For instance, there are several opportunities to better utilize the GPU's resources under the single-user regime (Section 6).

Taken together, the observations and the recommendations put three larger questions within reach (Section 7). The first is whether the inefficiencies we found are ones this community has met before. We believe they are, as evidenced by the parallels found in this community's prior work on GPU query processing. The second is whether the compression techniques we mentioned above remain necessary once the device is used well. We argue they may not have as important a role as they currently do. As we will see, paging techniques we discuss here may offer a way to fit a model on the device without the loss in downstream performance that compression brings [29]. The third asks what kind of system would be required to implement these recommendations. We argue that developing a system specifically tailored to this workload is more promising than adapting these techniques to systems designed for different purposes.

In summary, this paper makes the following contributions:

  • We profile a single decoder block at the level of its compiled kernels, which makes models larger than the device under study measurable, and apply this across two model families, three GPU generations, and context lengths reaching one million tokens.

  • We find the reasons why no device is overwhelmed by this workload, and that all three have resources to spare, and we establish where that spare capacity lies, in which kernels, on which hardware, and at what context lengths.

  • We derive from these findings four recommendations, which together describe the axes along which a system specialized for this workload could be built.

  • We relate each of those axes to prior work in which this community addressed the same difficulty in GPU query processing.

References (31)