Paper commentary
Retrieval Supersedes Scale: Efficient Log Level Prediction via Multiplex Socio-Technical Context
Socio-technical retrieval improves LLM log level prediction
- Problem Random in-context examples leave LLM log level predictors short, because logging conventions differ across components and teams. Off-the-shelf LLMs using random examples reach median AUCs of only 0.56 to 0.76.
- Method Multiplex retrieval ranks examples from a file's cluster by functionality and ownership.
- Results Median AUCs reach 0.83 to 0.97 across ten Java projects, up 0.07 over random retrieval. The method also beats DeepLV by a median AUC of 0.12 to 0.19.

Fig. 4 : Overview of multiplex clustering and retrieval. Nodes are Java files, present in both layers. The layers differ only in their edges, whose weight reflects functional similarity or co-ownership strength. Dashed outlines mark the community containing the target fileF t. The multiplex partition is obtained by optimizing modularity jointly over both layers, and the top-k candidates are then ranked within the resulting community.
Original paper · CC BY 4.0 · Youssef Esseddiq Ouatiti, Mohammed Sayagh, Bram Adams, Ahmed E. Hassan · Retrieval Supersedes Scale: Efficient Log Level Prediction via Multiplex Socio-Technical Context · Original paper figure · Extracted the figure area from page 5 of the original PDF.Why random examples stall
Random in-context examples leave LLM log level predictors short because they ignore how logging conventions differ across components and teams. The paper reports that off-the-shelf LLMs using random examples reach median AUCs of only 0.56 to 0.76 across evaluated projects. That range leaves room for improvement without fine-tuning the model, which is the gap this work targets.
Current LLM-powered predictors rely on random or stratified sampling, which implicitly favors data diversity over contextual relevance. The authors argue that this approach overlooks key aspects of logging practice, because projects don't follow a single, consistent logging strategy. Distinct components often log differently, shaped by code functionality and by developer ownership.
Hadoop's RetryInvocationHandler and Yarn's RequestHedgingRMFailoverProxyProvider implement the same retry duty in different components. Both log each attempt at DEBUG before escalating once retries are exhausted. They differ only in the terminal severity that each component's failure warrants, so a random example pool can mislead the model.
The authors therefore treat functionality and ownership as a complementary pair rather than an exhaustive model of socio-technical context.
The authors keep the LLM frozen and change only the in-context examples, so the gap comes from retrieval rather than model training. Their RQ1 asks whether combining functionality and ownership via multiplex clustering improves LLM-powered predictors. Their approach reaches a median AUC between 0.83 and 0.97 across the evaluated projects, against the random baseline's 0.56 to 0.76.
Two socio-technical signals as retrieval keys
Functionality and ownership together identify the right examples because each signal captures a different reason logging conventions repeat. The authors select these two as a complementary pair, not as an exhaustive model of socio-technical context. Files in different components can share logging conventions because the same people write them, which is the case for SIG-Auth files in Kubernetes.
Hadoop's RetryInvocationHandler and Yarn's RequestHedgingRMFailoverProxyProvider implement the same retry duty, so functionality alone can link them.
The method models a project as a two-layer multiplex graph, where nodes are files and each layer holds one relationship type. The functionality layer connects files with high functional similarity, computed as cosine similarity between file embeddings.
At inference time, the approach finds the multiplex cluster of the file that contains the logging statement and retrieves the top k candidates from it. The authors set k to 5 because performance flattens beyond that point, while k equal to 10 gave no statistically significant improvement at roughly double the prompt length. Inside the cluster, each candidate c receives the score s(c) = α·cos_func(f*, c) + (1 − α)·cos_own(f*, c).
The authors chose α = 0.7 by grid search in increments of 0.1 on a held-out validation set, since it maximized the downstream AUC. That choice gives functional similarity more influence while ownership acts as a secondary refinement, and practitioners can adjust α.
How the clusters are built
Each source file is first embedded with CodeXEmbed, which yields one 2,304-dimensional vector per file. CodeXEmbed supports input sequences of up to 32K tokens, so most source files fit in a single pass. Their per-method embeddings are mean-pooled into a single file-level vector, so every file stays eligible for clustering. UMAP then projects the 2,304-dimensional vectors into a 50-dimensional space, because direct clustering is expensive and sensitive to noise.
HDBSCAN is chosen over partitional methods because it labels low-density files as noise instead of forcing them into an incoherent cluster.
For each project, a grid search tunes the minimum cluster size and the minimum number of samples. The configuration with the highest Silhouette score among those with a Davies–Bouldin index below 1.0 is kept, which favours compact, well-separated clusters. Because these indices don't measure robustness, the authors re-cluster 30 bootstrap samples and report the ARI values against the original clustering.
The ownership layer starts from an author-file ownership matrix mined from the Git history of each project. Each cell counts how often an author modified a file, and an exponential time-decay factor gives recent edits more weight. Cosine similarities between the rows of this matrix give a file-to-file graph, and each file connects only to its k = 20 nearest neighbours.
The authors chose k = 20 empirically, because lower values isolated too many files and higher values merged distinct groups. Weighted Leiden detection runs on this k-NN graph, and the resolution is tuned to keep modularity above 0.7 for all projects. Leiden is preferred to Louvain because it avoids the disconnected communities that Louvain can produce.
The multiplex graph uses the same file nodes in both layers, and each layer keeps its own edge set. The functionality layer connects files by cosine similarity of their code embeddings, while the ownership layer uses the k-NN file graph. The multiplex variant of Leiden optimizes modularity jointly over both layers, so a strong tie in one layer can keep files together that the other layer would separate.
At inference, the target file's multiplex cluster supplies the candidates, and the authors set k = 5 because performance flattens beyond that point. The candidates are then ranked by s(c) = α·cos func + (1 − α)·cos own, with α = 0.7 chosen on a held-out validation set.
Ranking candidates and building the prompt
At inference time, the target file's multiplex cluster is looked up first, and only its files are eligible as examples. Each candidate statement in that cluster then gets a combined score, s(c) = α·cos_func(f*, c) + (1 − α)·cos_own(f*, c). Here f* is the file holding the logging statement, and c is a candidate example. The score doesn't decide membership; it only orders the candidates the cluster has already selected.
The top k = 5 candidates become the prompt examples, because performance flattens beyond that point. Using k = 10 gave no statistically significant improvement, while roughly doubling the prompt length. The weight α was set by a grid search on a held-out validation subset of the retrieval data, in increments of 0.1. The authors selected α = 0.7 because it maximized the downstream log level prediction AUC.
With α = 0.7, functional similarity has more influence, and ownership acts as a secondary refinement.
If no suitable multiplex cluster exists for the target file, the approach falls back in a fixed order. The fallbacks are functionality cluster retrieval, then ownership community retrieval, then random retrieval from the entire project. A cluster with fewer than k candidates uses all available candidates, and no fallback is triggered. The examples are then placed into one fixed prompt template, so strategies differ only in which examples fill it.
CodeLlama-7B-Instruct is the frozen predictor, and the authors chose it as the consumer-grade baseline. The level is read from the normalized probabilities of the first generated token over the candidate log levels. Each retrieval strategy runs with the same underlying LLM, prompting protocol, and inference configuration.
Does multiplex retrieval beat random and prior predictors
The random baseline keeps CodeLlama-7B, the prompting protocol and the inference setup fixed, so only the example selection changes. Multiplex retrieval raises AUC from 0.83 on Wicket to 0.97 on Elasticsearch. Its median AUC gain over random retrieval is 0.07, and the project gains range from 0.02 to 0.17. The authors checked these gains with a paired Wilcoxon test at alpha 0.01, and Cohen's d stayed above 0.7.
Accuracy improves by a median of 0.11 and AOD by 0.05 over random retrieval.
Flat similarity retrieval also beats random retrieval on all ten projects, by a median of 0.05 AUC. Multiplex retrieval adds a further median of 0.02 AUC over flat similarity on all ten projects. The authors read this gap as the ownership layer adding value beyond functional similarity alone. Retrieval runs with FAISS at a median latency of 8.9 ms per retrieval, which the authors judge fast enough for IDEs.
In the RQ1 comparison, multiplex retrieval exceeds the AUC of DeepLV by 0.12. The same comparison puts multiplex retrieval 0.19 AUC above Ordinal Regression. Multiplex retrieval also beats the established baselines for log level prediction at a statistically significant level. Averaged over the projects, DeepLV reaches an AUC of 0.76 and Ordinal Regression reaches 0.69.
Which signal carries the gain
The ablation study isolates each retrieval signal and compares it against random retrieval for CodeLlama-7B. Functionality-only retrieval selects examples solely by vector embedding similarity, as described in Section 3.1. Ownership-only retrieval selects examples only from the developer's collaboration network, as described in Section 3.2.
The authors use these two baselines to ask whether the signals are complementary or whether one dimension dominates.
Functionality-only retrieval improves the median AUC by 0.05 over random retrieval, and by up to 0.12. Ownership-only retrieval improves AUC by a median of 0.02 over random retrieval, reaching 0.10. Both gains are statistically significant under a Wilcoxon test at alpha 0.01. Ownership-only retrieval trails random retrieval by 0.005 AUC on one project, and that deficit isn't statistically significant.
Functionality-only retrieval also beats documentation-based retrieval by 0.05 to 0.06 AUC.
Functionality-only retrieval beats ownership-only retrieval by a median of 0.02, and by up to 0.06. Combining both signals outperforms the stronger single signal on all ten projects. The combined approach reaches median AUCs of 0.83 to 0.97, so the two signals add to each other. The authors read this pattern as evidence that the signals are complementary information channels.
Functionality clustering yields between 13 and 59 clusters per project. HDBSCAN marks 17% to 49% of files as noise, so some target files can fall back to other retrieval routes. The CodeLlama-34B results sit in the appendix, so this section doesn't compare model sizes.
Small local model versus commercial APIs
Across the studied projects, the 7B model averages 0.89 AUC, surpassing GPT-4o at 0.79 by 0.10 and DeepSeek-V3.2 at 0.73 by 0.16. The gap widens on Elasticsearch, where the 7B model reaches 0.97 AUC against 0.76 for GPT-4o. The authors read this as evidence that precise retrieval matters more than raw parameter count, since the commercial models are estimated to be 20 to 100 times larger.
The comparison is deliberately uneven, because the commercial models run zero-shot while CodeLlama receives five retrieved examples. Five retrieved examples would multiply the commercial models' input tokens and cost, so those models get no retrieval. Model size is tested separately, with CodeLlama-7B and 34B under identical retrieval.
Batched local inference costs $0.18 per 1k logs, while GPT-4o costs $2.44 and DeepSeek-V3.2 costs $0.066 per 1k logs. DeepSeek-V3.2 is the cheapest option, but it trails the 7B model by 18% in AUC. It also requires sending proprietary code to external servers, which the self-hosted 7B model avoids. The authors call the 7B model's small cost premium over the cheapest API negligible for high-value CI pipelines.
Scaling to CodeLlama-34B reaches 0.90 AUC, a gain of 0.9% over the 7B model. That gain comes with 4.1 times slower batch throughput and a 322% rise in cost, from $0.18 to $0.76 per 1k logs. For CI/CD workloads where throughput is critical, the authors choose the 7B model as the more efficient option.
What the results do not establish
The evaluation measures how closely predictions match the levels that maintainers assigned, not whether debugging or observability improves. Maintainer-assigned levels serve as a reference label rather than a certified optimum, so a match doesn't prove the prediction is right. Comparing the diagnostic coverage of an instrumented system would be another design for that goal.
HDBSCAN marks 17% (Karaf) to 49% (Hadoop) of files as noise, so their statements can fall back to other retrieval. A median of 7.3% of test statements needs a fallback route. Only a median of 0.4% of statements reaches project-wide random retrieval. Adjacent-level confusions make up 54% (Wicket) to 81% (Karaf) of mispredictions.
The embedding model CodeXEmbed is never varied, so its biases and their effect on the clusters remain untested. The authors name exploring other embedding approaches as future work for generalizability. All evaluation covers ten Java projects and four LLMs, so other languages and codebases aren't covered. The authors take levels from stable releases because logging statements are often revised after they are introduced.
Paper info
- Authors
- Youssef Esseddiq Ouatiti, Mohammed Sayagh, Bram Adams, Ahmed E. Hassan
- Venue
- arXiv · Preprint
- First published
- 2026-11-4
- Added
- 2026-11-6
- Updated
- 2026-11-4
- Version
- v1
- arXiv
- 2611.05901
- Category
- cs.SE · cs.LG
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Developers insert logging statements in source code to record its execution, and the resulting logs are essential for detecting and troubleshooting system anomalies. A key part of these statements is the log level (e.g., DEBUG, INFO, WARN, ERROR), which determines whether a message is recorded. Choosing it is a trade-off: levels set too low mask important information in production, while levels set too high create noisy logs and extra I/O and storage overhead. Recent work uses Large Language Models (LLMs) with In-Context Learning (ICL) to predict log levels, but typically augments the prompt with randomly sampled examples. We argue that this overlooks the socio-technical nature of logging, where conventions vary by component and development team. Off-the-shelf LLMs using random examples are reported to achieve median AUCs of only 0.56 to 0.76, leaving room for improvement without fine-tuning. In this paper, we propose a retrieval approach for LLM-powered log level prediction that prioritizes context relevance over random selection and basic similarity. Our method retrieves logging examples relevant along two socio-technical dimensions: (i) functionality (code performing similar operations) and (ii) ownership (code maintained by the same developers). Evaluating four LLMs across ten popular Java projects, we find that this retrieval improves AUC over random baselines by 0.07 (median), and combining both signals yields median AUCs of 0.83 to 0.97. Our ablation studies show that each signal improves on random retrieval, and that combining them outperforms the stronger of the two on all ten projects. Our results also significantly exceed state-of-the-art supervised predictors (e.g., DeepLV) by a median AUC of 0.12 to 0.19. Our findings highlight the importance of socio-technical signals such as code functionality and ownership for LLM-powered log level prediction.
Figures from the paper

Fig. 1 : Overview of our Ownership-Functionality Aware retrieval approach for log level prediction.
Original paper · CC BY 4.0
TABLE 1 : Summary of the studied projects
Original paper · CC BY 4.0
TABLE 2 : Summary of the performance of the multiplex retrieval compared to other approaches (metrics are obtained from five bootstrap runs and for CodeLlama-7B)
Original paper · CC BY 4.0
TABLE 9 : Ownership-based clustering quality metrics. A dash indicates too few non-empty two-month windows for a reliable stability estimate.
Original paper · CC BY 4.0
TABLE 10 : Functionality-based clustering quality metrics
Original paper · CC BY 4.0
Fig. 6 : Prompt creation process for the LLM-powered log level prediction. The candidate log levels listed in the instruction are those the project actually uses, and therefore vary across projects.
Original paper · CC BY 4.0
TABLE 6 : Summary of Large Language Models Selected for Evaluation
Original paper · CC BY 4.0
TABLE 7 : Coverage of each retrieval step, per project (CodeLlama-7B, five in-context-learning examples). Percentages are computed once over the unique test logging statements of each project.†:the file that contains the statement lacks one of the two signals, so one of the two cosine similarities is undefined and the examples are drawn uniformly from the same multiplex cluster.‡: the cluster holds fewer thankcandidates, so all of them are used. Step 2 (single-signal retrieval) is never invoked across our studied projects, as the multiplex assignment fully subsumes what functionality-only or ownership- only retrieval would have covered.
Original paper · CC BY 4.0
TABLE 8 : Overview of the mispredictions using multiplex retrieval
Original paper · CC BY 4.0
Fig. 7 : Sensitivity of multiplex retrieval to the number of in-context-learning examplesk(AUC, CodeLlama-7B, five bootstrap runs). Grey lines are individual projects; the black line is the median across the ten studied projects. Gains are statistically significant up to five examples and flatten beyond it.
Original paper · CC BY 4.0
TABLE 11 : Summary of the performance of the ownership-only retrieval compared to other approaches (metrics are obtained from 5 bootstrap runs and for CodeLlama-7B). Documentation-based retrieval is only applicable to the two projects that define components in their documentation; a dash indicates the configuration is not applicable for that project.
Original paper · CC BY 4.0
TABLE 12 : Summary of the performance of the functionality-only retrieval compared to other approaches (metrics are obtained from 5 bootstrap runs and for CodeLlama-7B). Documentation-based retrieval is only applicable to the two projects that define components in their documentation; a dash indicates the configuration is not applicable for that project.
Original paper · CC BY 4.0
TABLE 13 : Impact of the different retrieval strategies on the CodeLlama-34B performance. The purpose of the 34B evaluation is to establish how our results scale with model size, and that question is answered by the multiplex row, which is the configuration we recommend. The ablation of the individual retrieval signals is a question about the retrieval mechanism rather than about model capacity, and we therefore answer it on the CodeLlama-7B model (Tables 11 and 12). A dash indicates the configuration was not evaluated for that project.
Original paper · CC BY 4.0Quote from the paper
Youssef Esseddiq Ouatiti, Mohammed Sayagh, Bram Adams, Ahmed E. Hassan (2026). Retrieval Supersedes Scale: Efficient Log Level Prediction via Multiplex Socio-Technical Context. arXiv:2611.05901v1. https://arxiv.org/abs/2611.05901v1
BibTeX
@misc{ouatiti2026retrieval,
title = {{Retrieval Supersedes Scale: Efficient Log Level Prediction via Multiplex Socio-Technical Context}},
author = {Youssef Esseddiq Ouatiti and Mohammed Sayagh and Bram Adams and Ahmed E. Hassan},
year = {2026},
eprint = {2611.05901},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.05901v1}
}