SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.11775 · 2026

The Sleeping Agent: What Gist-Based Context Compression Loses and Why

N Kyrkewood

arXiv · PDF

Code that ran

12 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 7 failures of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2608.11775.json · badge: /api/ran/2608.11775.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
kyrkewood/sleeping-agent canonical (classifier label)
classifier basis: census
12 ran · 0 no recorded run
FunctionStatusWhere it lives
aggregate_results Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/scoring.py
code served (permissive licence) · get_code("b59e234b597bb369")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct a minimal list of result dictionaries
rows = [
    {
        'f1': 0.85,
        'tokens': 150,
        'compression_rem_tokens': 50,
        'history_tokens': 30,
        'memory_build_wall_seconds': 1.2,
        'judge_tokens': 20,
        'judge_evaluated': True,
        'judge_parse_failed': False,
        'judge_correct': True,
    },
    {
        'f1': 0.90,
        'tokens': 200,
        'compression_rem_tokens': 60,
        'history_tokens': 40,
        'memory_build_wall_seconds': 1.5,
        'judge_tokens': 25,
        'judge_evaluated': True,
        'judge_parse_failed': False,
        'judge_correct': True,
    },
    {
        'f1': 0.75,
        'tokens': 120,
        'compression_rem_tokens': 40,
        'history_tokens': 25,
        'memory_build_wall_seconds': 0.8,
        'judge_tokens': 15,
        'judge_evaluated': True,
        'judge_parse_failed': True,
        'judge_correct': False,
    },
]

ARGS = {
    'rows': rows,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_f1 Ran
ran, honoured the contract we drafted
kyrkewood/sleeping-agent/src/scoring.py
code served (permissive licence) · get_code("b2bc687a414410e6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

ARGS = {
    "prediction": "The quick brown fox jumps over lazy dog",
    "ground_truth": "A quick brown fox jumps over the lazy dog"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
f1_by_category Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/scoring.py
code served (permissive licence) · get_code("ad7db7e3f8b5a12e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import defaultdict
from typing import Any

# The function f1_by_category takes a list of dicts where each dict has:
# - 'category' (optional, defaults to 'unknown')
# - 'f1' (required, a numeric value)
# It groups by category and returns average f1 per category

rows = [
    {'category': 'A', 'f1': 0.85},
    {'category': 'A', 'f1': 0.95},
    {'category': 'B', 'f1': 0.75},
    {'category': 'B', 'f1': 0.80},
    {'category': 'B', 'f1': 0.70},
    {'f1': 0.88},  # no category, will use 'unknown'
]

ARGS = {
    'rows': rows
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_qa_user_message Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/qa_prompt.py
code served (permissive licence) · get_code("d20258d100d4f4e6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'speaker_a': 'Alice',
    'speaker_b': 'Bob',
    'history': 'Alice: Hello, how are you?\nBob: I am doing well, thank you.\nAlice: That is great to hear.',
    'question': 'What did Bob say about how he is doing?'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_multimodal_qa Ran
ran, violated the contract we drafted
kyrkewood/sleeping-agent/src/dataset.py
code served (permissive licence) · get_code("8262fc4ce5c1e69f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
from typing import Any

_MULTIMODAL_Q_RE = re.compile('\\b(photo|photograph|image|pictures?|screenshots?|videos?|visual)\\b', re.IGNORECASE)

def is_multimodal_qa(qa: dict[str, Any]) -> bool:
    """True if the question text clearly asks about visual / image content."""
    q = qa.get('question') or ''
    return bool(_MULTIMODAL_Q_RE.search(q))


# Setup code to construct valid arguments
ARGS = {
    'qa': {
        'question': 'What is shown in this photograph?',
        'answer': 'A sample answer'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
min_evidence_session Ran
ran, honoured the contract we drafted
kyrkewood/sleeping-agent/src/dataset.py
code served (permissive licence) · get_code("1b89278c4b21518c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def parse_evidence_session(evidence_id: str) -> int:
    """Map 'D1:3' -> session 1."""
    m = re.match('D(\\d+):', evidence_id, re.I)
    if not m:
        return 1
    return int(m.group(1))

def min_evidence_session(evidence: list[str]) -> int:
    if not evidence:
        return 1
    return min((parse_evidence_session(e) for e in evidence))

# Setup code to construct valid arguments
ARGS = {
    "evidence": ["D1:3", "D2:5", "D1:7"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_evidence_session Ran
ran, honoured the contract we drafted
kyrkewood/sleeping-agent/src/dataset.py
code served (permissive licence) · get_code("01b7a6026e5e2bc4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def parse_evidence_session(evidence_id: str) -> int:
    """Map 'D1:3' -> session 1."""
    m = re.match('D(\\d+):', evidence_id, re.I)
    if not m:
        return 1
    return int(m.group(1))

ARGS = {
    "evidence_id": "D1:3"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_yes_no Ran
ran, violated the contract we drafted
kyrkewood/sleeping-agent/src/judge.py
code served (permissive licence) · get_code("a1c7c0dc37ef0b5f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

ARGS = {
    "text": "YES this is valid"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rem_cache_get Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/rem_cache.py
code served (permissive licence) · get_code("b004b1ccc2da5306")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
from pathlib import Path

# Create a temporary directory for cache testing
temp_cache_dir = Path(tempfile.mkdtemp())

# Create a test cache file with some content
session_text = "test_session_content"
cache_file = temp_cache_dir / f'{__import__("hashlib").sha256(session_text.encode("utf-8")).hexdigest()}.txt'
cache_file.write_text("cached_result_data", encoding='utf-8')

ARGS = {
    'cache_dir': temp_cache_dir,
    'session_text': session_text,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rem_cache_path Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/rem_cache.py
code served (permissive licence) · get_code("04171c79b5269391")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned PosixPath. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import hashlib
from pathlib import Path
import tempfile

def _digest(text: str) -> str:
    return hashlib.sha256(text.encode('utf-8')).hexdigest()

def rem_cache_path(cache_dir: Path, session_text: str) -> Path:
    cache_dir.mkdir(parents=True, exist_ok=True)
    return cache_dir / f'{_digest(session_text)}.txt'

# Create a temporary directory for cache_dir
temp_dir = tempfile.mkdtemp()
cache_dir = Path(temp_dir)

# Create session_text
session_text = "example_session_data"

ARGS = {
    "cache_dir": cache_dir,
    "session_text": session_text,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
truncate_for_debug Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/diagnostics.py
code served (permissive licence) · get_code("0d2abaefbf774fd7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Analyze the function: it takes a string and two integers (head and tail)
# It checks the length of the text and truncates if necessary
# Parameters: text (str), head (int, default=10000), tail (int, default=2000)

# Create a test case with a long string that will trigger truncation
long_text = "a" * 20000  # This will be longer than head + tail + 80

ARGS = {
    "text": long_text,
    "head": 10000,
    "tail": 2000,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
write_lightmem_stub Ran
ran; our contract draft was wrong, not the code
kyrkewood/sleeping-agent/src/lightmem_baseline.py
code served (permissive licence) · get_code("f1c2f575210e2fef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned PosixPath. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
from pathlib import Path

ARGS = {
    'results_dir': Path(tempfile.mkdtemp()),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Gist-based context compression-summarising older conversation history into compact representations-is a common approach in long-horizon language model agents, yet its effect on different types of memory retrieval is poorly understood. We use Salience-Weighted Consolidation (SWC), a biologically-inspired compression framework motivated by sleep-based memory consolidation, as a diagnostic probe to study when gist compression helps and when it hurts. SWC scores conversation history by salience, partitions it into priority tiers, and applies structured gist abstraction to mid-priority content. Evaluating four conditions on all ten LoCoMo conversations-1 935 matched text-only questions in total, 1 501 used in the primary aggregate after excluding Category 5 (adversarial) questions-at temperature 0, we find a consistent task-type interaction: gist compression substantially outperforms truncation on multi-hop reasoning and single-hop factual questions, but temporal questions remain substantially harder under compression, with compressed conditions scoring well below the full-context reference on the conversations where both are evaluated. We trace this failure to a specific mechanism: the gist abstraction prompt preserves relational and event structure while discarding dates and times. A preservation analysis across all ten conversations confirms the mechanism: an approximately 20-fold increase in temporal expression preservation (3.05%→62.39%) with a one-sentence prompt modification, while named entity and event preservation rates barely change (×1.02 and ×1.11), demonstrating that the fix is a precision instrument. The prompt modification recovers +0.314 [0.254, 0.375] judge accuracy on category-2 (temporal) questions in the matched set. Code and results: https://github.com/kyrkewood/sleeping-agent.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2608.11775")
get_code_for_paper("2608.11775")
have("2608.11775")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2608.11775.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2608.11775.svg)](https://syntology.ai/paper/2608.11775)

Connect an agent — have() is free.