---
title: "Weighted State Souping for Efficient Long-Context Retrieval"
description: "Weighted state souping learns query-dependent weights for combining independently encoded, cached SSM states for chunks like documents, tool definitions or memory records, fixing the degradation that plain state souping and vanilla SSMs show on long, crowded contexts."
url: "https://swe.quest/articles/weighted-state-souping-for-efficient-long-context-retrieval-78fabcdf96ccbf22"
canonical: "https://machinelearning.apple.com/research/weighted-state-souping"
source: "Apple Machine Learning Research"
published: "2026-11-10"
difficulty: "hard"
kind: "Research"
reading_minutes: 1
tags: ["llms","inference","rag","machine-learning"]
---

# Weighted State Souping for Efficient Long-Context Retrieval

A post on [Apple Machine Learning Research](https://swe.quest/sources/apple-ml.md), published 2026-11-10, 1 min read, Research. Original: [https://machinelearning.apple.com/research/weighted-state-souping](https://machinelearning.apple.com/research/weighted-state-souping)

## Summary

Weighted state souping learns query-dependent weights for combining independently encoded, cached SSM states for chunks like documents, tool definitions or memory records, fixing the degradation that plain state souping and vanilla SSMs show on long, crowded contexts. It substantially improves single- and multi-hop document QA, needle-in-a-haystack retrieval, variable tracking and tool use. A sparse variant keeps encoding cost near-constant in context length while preserving or sometimes improving accuracy, and simple theoretical arguments explain when souping works and when it fails.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [RAG & retrieval](https://swe.quest/tags/rag.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)

## Prerequisites

- state space models
- long-context language modeling
- retrieval-augmented generation

## Keywords

state space models, weighted state souping, state souping, NeurIPS, PALM workshop

## Related posts

- [On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models](https://swe.quest/articles/on-the-importance-of-gating-memorization-vs-in-context-learning-in-state-space-2e03b1cdc6ee0604.md): Apple Machine Learning Research · 2026-11-10 · Hard · 1 min read · LLMs, Machine learning, Model training
  The gating mechanism in State Space Models makes them first learn an in-weights "memorization" solution, which delays or even prevents convergence to a correct in-context learning solution.
- [Accelerate RL rollouts by up to 50% with distribution-aware speculative decoding](https://swe.quest/articles/accelerate-rl-rollouts-by-up-to-50-with-distribution-aware-speculative-decoding-1fa2a300c01f2135.md): Together AI · 2026-04-24 · Hard · 5 min read · Inference & serving, Model training, LLMs, Performance engineering, Data structures
  Distribution-aware speculative decoding (DAS) speeds up the rollout phase of LLM RL post-training, which can consume ~70% of training time due to long-tail straggler generations, while keeping outputs identical to standard decoding.
- [Falcon-H1: A Family of Hybrid-Head Language Models Redefining Efficiency and Performance](https://swe.quest/articles/falcon-h1-a-family-of-hybrid-head-language-models-redefining-efficiency-and-d1a0dda74c9407b8.md): Hugging Face · 2025-05-21 · Hard · 11 min read · LLMs, Model training, Inference & serving, Evaluation
  Falcon-H1 is a family of six open-weight language models (0.5B to 34B, base and instruct, Apache 2.0-based license) built on a parallel hybrid mixer that runs attention and Mamba-2 SSM heads side by side, with a tunable attention/SSM ratio.
- [Building Deep Research: How we Achieved State of the Art](https://swe.quest/articles/building-deep-research-how-we-achieved-state-of-the-art-414ffb743a73bb80.md): Hugging Face · 2025-11-24 · Medium · 7 min read · AI agents, LLMs, Evaluation
  Tavily's deep research agent reached state of the art on DeepResearch Bench while using 66% fewer tokens than LangChain's Open Deep Research, mainly through context engineering.
- [GLM-5.2: Built for Long-Horizon Tasks](https://swe.quest/articles/glm-5-2-built-for-long-horizon-tasks-22484eb2dd0aab06.md): Hugging Face · 2026-06-17 · Hard · 13 min read · LLMs, Inference & serving, Model training, AI for coding, Evaluation
  GLM-5.2 is Z.ai's MIT-licensed flagship model for long-horizon coding-agent work, with a 1M-token context and selectable thinking effort levels.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
