bench(longhorizon): long-horizon context-management harness (10K→1M, walking skeleton) - #14
Merged
Merged
Conversation
…walking skeleton) Measurement infra for the enterprise Context-Runtime optimizations (F4 sparse retrieval, F2 materialization, F3 pattern memory): each is an arm measured on the quality×cost×latency frontier against the frozen AGPL baseline, as context grows 10K→1M tokens. AGPL, same Store/Embedder/hybrid_search stack as the cube/matrix; the enterprise overlay injects as a treatment arm (not required to run). Design (DESIGN.md): a real Wikimedia haystack (strategywiki dev corpus; a second wiki for independent holdout) with synthetic fact-needles at controlled depths → deterministic substring scoring (no LLM judge, cheap+reproducible at 1M) and exact length control. The answerer is a PLAIN fixed-window consumer (Qwen 32k / Kimi / grok) — deliberately NOT a model that manages context itself (e.g. DeepSeek-V4- Flash), so the frontier is attributable to the arm, not the model. Arms: `full` (whole haystack truncated to the window — the baseline to beat) vs `cr` (top-k retrieved, scoped by document_ids). `--dry` validates the full pipeline (corpus→needles→embed→retrieve→score) with an oracle answerer, no LLM/GPU. Dry smoke (strategywiki, window 32k) already shows the thesis: at 200k tokens `full` collapses to acc 0.0 (needles past the window) while `cr` holds high accuracy at ~4-8k tokens flat; cr's recall is limit-sensitive as the haystack grows — exactly the phenomenon F4 targets. Real LLM runs, 1M horizon, holdout corpus, and the enterprise arm are the next steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long-horizon context-management harness (10K → 1M tokens)
The measurement infra the enterprise Context-Runtime optimizations (F4 sparse retrieval, F2 adaptive materialization, F3 pattern memory) will be judged on. Each optimization is an arm, measured on the quality × cost × latency frontier against the frozen AGPL baseline, as available context grows 10K→1M tokens. AGPL, in
redevops-rag/benchmarks(sameStore/Embedder/hybrid_searchstack as the cube/matrix); the enterprise overlay injects as a treatment arm and is not required to run.Two design constraints (from the program owner)
strategywiki(sha256-pinned, on disk) for dev; a different wiki (e.g. Simple English Wikipedia) as an independent holdout, so the harness isn't tuned to the data it's judged on.Task
Real Wikimedia haystack + synthetic fact-needles at controlled depths → deterministic substring scoring (no LLM judge, so it's cheap and reproducible at 1M) with exact length control and no prior-gameability.
Arms
fullcrhybrid_search, scoped bydocument_ids)cr-enterpriseProven now (dry smoke, no LLM/GPU)
--dryexercises the whole pipeline (corpus → needle insertion → embed → retrieve → score) with an oracle answerer. On strategywiki, window 32k, it already shows the frontier:Files
DESIGN.md,corpus.py(reuses the canonical MediaWiki parser),tasks.py(needle generator),arms.py(strategies + fixed-window answerer),run_longhorizon.py(runner +--dry).Next (not in this PR)
Real fixed-window answerer runs (Qwen/Kimi) at the full 1M horizon; the independent holdout corpus; and the enterprise
cr-enterprisearm once F4 lands. Generated result cells are gitignored (frozen deliberately as a control, likematrix_control/).🤖 Generated with Claude Code