Welcome.AI
    Skip to content

    Galahad-KV: Efficient Long-Term Memory for Large Language Models

    A recent study explored the capabilities of a memory layer for large language models (LLMs) designed to enhance their efficiency and performance when processing extensive text inputs. This research fo...

    arxiv.org•October 9, 2026•4 min read

    Key Facts

    • Implement memory layers to enhance LLM efficiency and reduce processing time by up to 4.3x.
    • Utilize galahad-kv for secure, encrypted storage of internal key-value states in LLMs.
    • Optimize energy consumption by minimizing the need for recalculating model states with each prompt.
    • Leverage large datasets to test and improve the performance of memory-enhanced LLMs.
    • Invest in advanced GPU technology like NVIDIA H100 for better performance with larger models.

    Summary

    Paper: Real Long-Term Memory for AI: A 50-Million-Token Window That Is Faster and Cheaper Than Recompute

    Authors: Sietse Schelpe

    Executive Summary

    A recent study explored the capabilities of a memory layer for large language models (LLMs) designed to enhance their efficiency and performance when processing extensive text inputs. This research focused on a public package called galahad-kv, which allows the model to save its internal key-value (KV) state to local encrypted storage. Unlike traditional processes where the model recalculates this state with each new prompt, the memory layer enables the model to retrieve the saved state, potentially improving speed and reducing energy consumption.

    The research involved testing this memory layer with a substantial dataset of 50 million tokens of real public text. The experiments were conducted on a single NVIDIA H100 GPU using two versions of the Gemma 4 model: one with 12 billion parameters and another with 31 billion parameters. The results demonstrated that retrieving a stored block of information was significantly faster—between 2.8 to 4.3 times quicker—than recomputing it. Additionally, the energy efficiency was remarkable, with the memory retrieval using 8.8 to 12.3 times less GPU energy compared to traditional methods. Throughout the testing, GPU memory usage remained stable, which is a critical consideration for organizations deploying such models at scale.

    When tested for accuracy in recalling information from the stored blocks, both models performed impressively. The 12 billion parameter model correctly answered questions about facts stored millions of tokens earlier 82 out of 100 times. The larger 31 billion parameter model achieved an even higher accuracy rate, responding correctly 98 out of 100 times. Importantly, neither model fabricated answers, which is essential for maintaining reliability in business applications.

    It is crucial to note the limitations of this approach. The system retains the capacity to reuse stored states, but it does not expand the attention window of the models; only one block of data is accessed at a time. The effectiveness of answering questions can vary depending on the model used. Moreover, while writing to memory incurs a one-time cost, the storage requirements are substantial, necessitating terabytes of local NVMe disk space.

    The research outlines a rigorous testing protocol aimed at minimizing the potential for bias or manipulation in long-context benchmarks, ensuring that the findings are robust and reliable. The implementation details provided indicate that this can be reproduced on a single GPU using publicly available software and licensing, making this approach accessible for organizations looking to enhance their language model capabilities.

    The implications of these findings could be significant for various industries that rely on large-scale language processing, such as customer service, content generation, and data analysis. By improving speed and reducing energy costs, businesses may find it more feasible to deploy advanced language models in real-world applications, potentially leading to greater productivity and efficiency.

    Academic Abstract

    A large language model can only use the text that fits in its context window, and it recomputes its internal key-value (KV) state for a prompt every time the prompt is sent. We test a memory layer, the public package galahad-kv, that saves the KV state of each block of about 16,000 tokens to encrypted local NVMe disk and loads it back later, byte-exact, without recomputing it. We ran it on 50,000,000 tokens of real public text, served through vLLM on one NVIDIA H100, with Gemma 4 12B and Gemma 4 31B. Every block we probed was loaded back from the encrypted store with no recompute (100 of 100, at depths from 0 to 50M tokens) on both models. Loading a block was 2.8x to 4.3x faster than recomputing it and used 8.8x to 12.3x less GPU energy, and GPU memory stayed flat over the whole 50M-token stream. Asked about facts planted millions of tokens earlier, the 12B model gave the right answer 82 times out of 100 and the 31B model 98 times out of 100. Neither model made up an answer. The limits are as follows. This is reuse of stored state, not a wider attention window: one block is loaded at a time, and how well a question is answered depends on the model. Writing the memory is a one-time cost, and the store takes terabytes of local NVMe disk. We describe the test protocol, which is built to resist common ways of gaming long-context benchmarks, and give a single-GPU reproduction that uses public software and a free licence for the package.

    Frequently Asked Questions

    What business problems does this research solve?

    This research addresses challenges related to the efficiency and performance of large language models (LLMs) when processing extensive text inputs. By utilizing a memory layer that allows for the retrieval of saved internal states instead of recalculating them, it could help businesses reduce processing times and energy costs.

    Which industries benefit most from this technology?

    Industries that rely heavily on data processing and natural language understanding, such as technology, finance, healthcare, and e-commerce, may benefit most from this technology due to the enhanced efficiency and performance in handling large volumes of text data.

    What are the practical implementation considerations for businesses?

    Businesses considering implementation should evaluate the integration of the galahad-kv package into their existing workflows. They need to ensure compatibility with their current systems and assess any necessary adjustments to their data storage and management processes to accommodate the memory layer.

    What resources or expertise are needed for adoption?

    Implementing this technology may require access to robust computational resources, such as high-performance GPUs like the NVIDIA H100. Additionally, expertise in machine learning and familiarity with large language models will be important for successful integration and optimization.

    What are the competitive advantages of using this memory layer technology?

    Utilizing this memory layer technology could provide a competitive advantage by significantly improving the speed of data processing and reducing operational costs associated with energy consumption. This efficiency may lead to faster decision-making and enhanced customer experiences, positioning businesses ahead of competitors who rely on traditional processing methods.

    Where AI Leaders Stay Informed

    The latest AI intelligence, case studies, and research — delivered to your inbox every week.

    Free to read. Unsubscribe anytime.