Skip to content
#small language model Open access

What Actually Fits: Context Selection for Local-First Retrieval on Memory-Constrained Hardware

Sep 2026 · Zenodo (CERN European Organization for Nuclear Research)

Abstract

Running a language model on your own machine keeps your files private, but consumer hardware imposes a context budget that server deployments never feel. We report measurements from a deployed local-first system that indexes a user's files and answers questions over them. Early versions injected whole-project content into every turn: roughly 59K tokens, prompt evaluation in the minutes, mitigated by truncating context to the trailing 8,000 characters. Three findings. First, retrieval-based selection recovers most of the available answer coverage at a small fraction of the prompt: on real repositories a 2,500-character budget reaches 0.79 topic recall against whole-project injection's 1.00, using 23 times fewer tokens with 14.9 times faster prompt evaluation. Second, the trailing-window truncation that several local tools ship is close to worthless on real corpora, 0.12 recall on one repository and 0.00 on another, against 1.00 on a synthetic benchmark, where its apparent success is an artifact of file ordering. Third, and the reason for this paper's framing: a diversity-aware selection rule that improved recall from 0.62 to 0.93 on our synthetic benchmark is corpus-dependent. It gains 0.64 to 0.78 on a document corpus but slightly loses on both code repositories. We give a predictor computable from retrieval alone: where a flat top-k already spans more than about 1.5 clusters, forcing further spread costs relevance; where it concentrates below that, diversifying pays. It separates all four corpora. We also report two measurement faults that each produced a confident false positive in our own results before real corpora exposed them: prompt-prefix caching, which inverts latency comparisons by more than 500 times, and substring-based recall scoring, which under-reports on any corpus whose files exceed one chunk.

View source

Similar papers

#small language model Dataset Open access Oct 2026

Socratic guiding questions in synthetic arithmetic data: matched LoRA runs (revision v2)

Supporting data, adapters, predictions and code for the article *Low-Cost LoRA Fine-Tuning of Small Language Models for Multi-Step Arithmetic Reasoning* by Jake O'Grady, Asena Isik Gürhan, Chee Fong Ting and Effirul Ramlan (University of Galway). We generated 20,000 GSM8K-derived arithmetic problems with step-by-step s...

O'Grady, Jake, Gürhan, Asena Isik, Chee, Fong Ting et al. · 465 citations
#computer vision Open access Jun 2016

Software Development in Startup Companies: The Greenfield Startup Model

The results are packaged in the Greenfield Startup Model (GSM), which explains the priority of startups to release the product as quickly as possible, and the need to shorten time-to-market, by speeding up the development through low-precision engineering activities.

Carmine Giardino, Nicolò Paternoster, M. Unterkalmsteiner et al. · 178 citations · ⚡14
#computer vision Open access Oct 2016

Software Startups - A Research Agenda

Software startup companies develop innovative, software-intensive products within limited timeframes and with few resources, searching for sustainable and scalable business models.

M. Unterkalmsteiner, P. Abrahamsson, Xiaofeng Wang et al. · 157 citations · ⚡17
#machine learning Review Open access Oct 2016

“Failures” to be celebrated: an analysis of major pivots of software startups

This study conducts a case survey study based on the secondary data of the major pivots happened in 49 software startups, and demonstrates that customer need pivot is the most common among all pivot types.

Sohaib Shahid Bajwa, Xiaofeng Wang, Anh Nguyen-Duc et al. · 127 citations · ⚡15
#computer vision Review Open access May 2015

A survey study on major technical barriers affecting the decision to adopt cloud services

The comparison of adopter and non-adopter sample reveals three potential adoption inhibitor, security, data privacy, and portability, which underlines the importance of the technical and security perspectives for research investigating the adoption of technology.

Nattakarn Phaphoom, Xiaofeng Wang, S. Samuel et al. · 111 citations · ⚡8
#computer vision Open access Feb 2018

Lean Internal Startups for Software Product Innovation in Large Companies: Enablers and Inhibitors

This study investigates how Lean internal startup facilitates software product innovation in large companies and identifies its enablers and inhibitors, and shows the potential of the method-in-action framework to investigate the Lean startup approach in non-startup context.

Henry Edison, Nina M. Smørsgård, Xiaofeng Wang et al. · 78 citations · ⚡6

Related blog posts

MIT News · Artificial Intelligence Oct 15, 2026

AI model decodes the language cells use to communicate

A new computational approach reveals how cells communicate to assemble into tissues. This could accelerate stem cell engineering, improve disease models, and inform therapies.

Microsoft Research Blog Oct 15, 2026

Proof-based general-purpose computing with Magnetar

Zero-knowledge proofs can verify computing results without rerunning workloads or exposing sensitive data. Magnetar helps bring them into the mainstream with support for standard programming languages, major speed gains, and quantum-resistant security. The post Proof-based general-purpose computing with Magnetar appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.