Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,18 @@ LongMemEval (Wu et al., ICLR 2025): 500 human-curated questions embedded in ~40
| | Cortex | What it means |
|---|---|---|
| Recall@10 | **98.2%** | The right memory shows up in the top 10 for nearly every question |
| MRR | **0.915** | The correct *memory* is usually ranked first or second — retrieval rank only, no LLM reader |
| MRR | **0.9167** | The correct *memory* is usually ranked first or second — retrieval rank only, no LLM reader |

<sub>n=500, E1 v3 verification campaign — per-row JSONs with code SHAs in `benchmarks/results/ablation/longmemeval-s_v3/`. Re-verified on a clean DB 2026-06-10.</sub>
<sub>n=500, clean-DB run `benchmarks/results/repro/20260714-v4.14.1-pretag/longmemeval-s.json`, code SHA `28145f0b7a113fc06e22568de6feea7f8444eaf5`, dirty=false.</sub>

| Category | MRR | R@10 |
|---|---|---|
| Single-session (assistant) | 1.000 | 100.0% |
| Multi-session reasoning | 0.962 | 100.0% |
| Knowledge updates | 0.925 | 100.0% |
| Temporal reasoning | 0.926 | 98.5% |
| Single-session (user) | 0.814 | 94.3% |
| Single-session (preference) | 0.668 | 93.3% |
| Multi-session reasoning | 0.964 | 100.0% |
| Knowledge updates | 0.932 | 100.0% |
| Temporal reasoning | 0.917 | 97.7% |
| Single-session (user) | 0.841 | 95.7% |
| Single-session (preference) | 0.685 | 90.0% |

Knowledge updates score near-perfect because the retrieval stack's recency signal and update-intent routing push the newest version of a fact above older ones.

Expand All @@ -401,10 +401,10 @@ LoCoMo (Maharana et al., ACL 2024): 1,986 questions across 10 conversations —

| | Cortex | What it means |
|---|---|---|
| Recall@10 | **91.5%** | Right memory in top 10 over 9 times out of 10 |
| MRR | **0.805** | The correct *memory* is typically ranked first — retrieval rank only, no LLM reader |
| Recall@10 | **94.35%** | Right memory in top 10 over 9 times out of 10 |
| MRR | **0.8279** | The correct *memory* is typically ranked first — retrieval rank only, no LLM reader |

<sub>n=1986, BASELINE_NO_CONSOLIDATION, post-plasticity-fix — `docs/benchmarks/e1-v3-locomo-results-post-fix.md`.</sub>
<sub>n=1986, BASELINE_NO_CONSOLIDATION, post-plasticity-fix run at code SHA `2f45bcb39dbe15fa0ef857cc8c8c3783175d05db` — `docs/benchmarks/e1-v3-locomo-results-post-fix.md`.</sub>

| Category | MRR | R@10 |
|---|---|---|
Expand Down
4 changes: 3 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ session(s) appear in the top 10.

- The comparable published baseline is the best retrieval configuration
in the LongMemEval paper itself (Wu et al., ICLR 2025): **Recall@10
78.4%**. Cortex: **98.4%** (n=500).
78.4%**. Cortex: **98.2%**, MRR **0.9167** (n=500; clean-DB run
`results/repro/20260714-v4.14.1-pretag/longmemeval-s.json`, code SHA
`28145f0b7a113fc06e22568de6feea7f8444eaf5`, dirty=false).
- This is **not** the end-to-end QA accuracy that LLM-answering
leaderboards report (an LLM answers from the retrieved context and a
judge scores the answer). Retrieval recall and QA accuracy are
Expand Down
Binary file modified docs/arxiv-context-assembly/main.pdf
Binary file not shown.
13 changes: 9 additions & 4 deletions docs/arxiv-context-assembly/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,10 @@ \subsection{Reciprocal Rank Fusion and Hybrid Search}
Client-side, FlashRank (ONNX cross-encoder) reranks the top-$3k$
candidates to produce the final ranking.

This pipeline is strong at moderate scale: 98.4\% R@10 on
LongMemEval, 94.2\% R@10 on LoCoMo (E1 v3, May 2026). The five-signal fusion
This pipeline is strong at moderate scale: 98.2\% R@10 on
LongMemEval (clean run, July 2026; code SHA \texttt{28145f0}) and
94.35\% R@10 on LoCoMo (E1 v3 post-fix run, May 2026; code SHA
\texttt{2f45bcb}). The five-signal fusion
mitigates any single signal's weakness (\eg, vector similarity
misses lexical matches that trigram catches; FTS misses paraphrases
that vectors catch). But at BEAM-10M scale, all five signals suffer
Expand Down Expand Up @@ -1291,8 +1293,11 @@ \subsection{Baselines}
\paragraph{WRRF baseline.}
Cortex's production pipeline without the assembler: 5-signal
server-side fusion + FlashRank client-side reranking. This is a
strong baseline: 98.4\% R@10 on LongMemEval, 94.2\% R@10 on LoCoMo
(E1 v3, May 2026), and 0.591 MRR on BEAM-100K.
strong baseline: 98.2\% R@10 on LongMemEval (clean run, July 2026;
code SHA \texttt{28145f0}), 94.35\% R@10 on LoCoMo (E1 v3 post-fix
run, May 2026; code SHA \texttt{2f45bcb}), and 0.591 MRR on
BEAM-100K (five-conversation protocol, $n{=}100$; code SHA
\texttt{a071d89}).

\paragraph{LIGHT} \citep{Tavakoli2026}.
The strongest published system on BEAM, achieving 0.266 overall on
Expand Down
Binary file modified docs/arxiv-thermodynamic/main.pdf
Binary file not shown.
204 changes: 104 additions & 100 deletions docs/arxiv-thermodynamic/main.tex

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions docs/benchmarks/arxiv-figure-audit-2026-08-02.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# arXiv benchmark-figure audit — 2026-08-02

This audit records the pre-submission check requested in issue #347. It covers the benchmark figures in `docs/arxiv-thermodynamic/main.tex`, `docs/arxiv-context-assembly/main.tex`, and their Markdown source documents.

## Authoritative run records

| Benchmark | Current figure | Run record | Code / protocol |
|---|---:|---|---|
| LongMemEval-S, current headline | MRR 0.9167, R@10 0.982, n=500 | `benchmarks/results/repro/20260714-v4.14.1-pretag/longmemeval-s.json` | code SHA `28145f0b7a113fc06e22568de6feea7f8444eaf5`, dirty=false, 2026-07-14 |
| LongMemEval-S, E1 v3 ablation snapshot | MRR 0.9124, R@10 0.984, n=500 | `docs/benchmarks/e1-v3-results.md`; `benchmarks/results/ablation/longmemeval-s_v3/` | code SHA `0e858e8db0f8a5dae0879fa0134113d101be19f8`, dirty=false, 2026-05-03; historical protocol-specific decomposition, not the current headline |
| LoCoMo | MRR 0.8279, R@10 0.9435, n=1986 | `docs/benchmarks/e1-v3-locomo-results-post-fix.md` | code SHA `2f45bcb39dbe15fa0ef857cc8c8c3783175d05db`, dirty=false, descendant of `5f737fe` |
| BEAM-100K, flat WRRF | retrieval-proxy MRR 0.591, R@10 0.790, n=100 | `benchmarks/results/a3_beam_100k_post_refactor.md` and `benchmarks/beam/variance/baseline_limit5.txt` | code SHA `a071d89`, five-conversation A/B protocol; result committed by `544abe7` |
| BEAM-100K, assembler | MRR 0.602, n=100 | `benchmarks/beam/variance/assembler_limit5.txt` | same five-conversation A/B protocol |
| BEAM-10M, flat / oracle / temporal | MRR 0.353 / 0.429 / 0.471, n=196 | `benchmarks/beam/variance/baseline_10m_fixed.txt`, `assembler_10m_stagefixed.txt`, `assembler_10m_temporal.txt` | original paired protocol |
| BEAM-10M reproduction, oracle / temporal | MRR 0.496 / 0.523, n=196 | `benchmarks/results/beam10m_paired/RESULTS.md` | later paired code revision; compare within this pair only |
| BEAM-500K / 1M crossover | flat 0.500 / 0.466; assembler 0.570 / 0.535 | `benchmarks/results/beam_crossover/RESULTS.md` | clean DB, 35 conversations per split |

## Findings and resolution

- **LongMemEval:** Opus 5's review found that the first audit had incorrectly promoted the May E1 v3 ablation baseline (MRR 0.9124, R@10 98.4%) to the current headline while `README.md` carried 98.2%. The current headline is now the latest committed clean run with an explicit clean flag: MRR 0.9167, R@10 98.2%, n=500, code SHA `28145f0`. The E1 v3 values remain only inside their named historical ablation snapshot and its per-row analysis.
- **LoCoMo:** the thermodynamic paper's headline, benchmark table, 14-row ablation table, contributor narrative, cadence appendix, and both context-assembly citations still used the pre-fix 0.8278 / 0.942 run. They now use the post-fix 0.8279 / 0.9435 run and its per-row deltas. Pre-fix values remain only in explicitly labelled historical comparisons.
- **Historical 0.794 / 0.926 comparator:** this pair is the April 2026 clean-DB Cortex result (n=1982) first published in commit `b4057a`. Its original per-query artefact is not committed. All active citations now label it as a superseded historical comparator rather than attributing it to the current `CLAUDE.md`.
- **BEAM:** the arXiv LaTeX headline already had the correct 0.591 retrieval-proxy MRR from the named five-conversation / 100-question protocol at code SHA `a071d89`. The standalone Popper appendix's stale 0.543 was replaced, and the thermodynamic Markdown source now matches the LaTeX paper by removing the invalid comparison against BEAM's incommensurable end-to-end 0.329 score. The later 395-question full split remains a separate protocol.
- **Publication surfaces:** the thermodynamic and context-assembly LaTeX sources, their Markdown sources, the Popper/Shannon/Erdős appendices, the README benchmark table, and the arXiv endorsement drafts now use the current LongMemEval and LoCoMo headlines. Historical values are retained only with a named run or an explicit historical label.
- **Noise-floor language:** the post-fix LoCoMo consolidation-only values are all within the stated ±0.002 MRR floor. HOMEOSTATIC_PLASTICITY and SCHEMA_ENGINE end at +0.0017; the papers now describe these as positive-direction observations within noise, not causal contributions outside noise.

## Submission gate

The source-level figure audit passes when:

1. the stale-number grep contains no unlabeled LoCoMo headline (`0.805`, `91.5%`, `94.2%`) or current LongMemEval headline (`97.8%`, `98.4%`), and every retained occurrence is explicitly historical, belongs to a named protocol, or represents a different metric;
2. the two LaTeX sources compile without undefined references or citations;
3. `git diff --check` passes.

**Result: PASS after Opus 5 follow-up on 2026-08-02.** The stale-number grep has no unlabeled current LoCoMo or LongMemEval headline; both PDFs were rebuilt with `pdflatex`/`bibtex` and the final passes contain no undefined references or citations; the 14-row LoCoMo values were checked across the post-fix writeup, Markdown paper, and LaTeX source; `scripts/check_doc_claims.py` and `git diff --check` pass.
20 changes: 12 additions & 8 deletions docs/benchmarks/e1-v3-locomo-results-post-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Headline

- **Cortex BASELINE_NO_CONSOLIDATION (longitudinal-read-path anchor): MRR = 0.8279, R@10 = 0.9435** on LoCoMo (n = 1986).
- vs. CLAUDE.md established LoCoMo baseline (MRR = 0.794, R@10 = 0.926): **+4.3% MRR, +1.7% R@10** — within rounding identical to the pre-fix sweep, as expected (the longitudinal-read-path rows ran with consolidation off in both sweeps and the plasticity bug cannot exercise there).
- vs. the historical April 2026 clean-DB Cortex comparator (MRR = 0.794, R@10 = 0.926; n=1982; provenance below): **+4.3% MRR, +1.75 percentage points R@10** — directionally identical to the pre-fix sweep, as expected (the longitudinal-read-path rows ran with consolidation off in both sweeps and the plasticity bug cannot exercise there).
- **BASELINE_WITH_CONSOLIDATION (consolidation-cadence anchor): MRR = 0.8265, R@10 = 0.941.** ΔvsNO = +0.0014, **identical to the pre-fix value**, within the per-row noise floor. The cadence fix (commit `6c51bce`) re-validated at full n = 1986 a second time on post-`5f737fe` bytes.
- The 14-row two-baseline ablation **re-confirms** the architectural-mismatch resolution from the pre-fix writeup (`docs/benchmarks/e1-v3-locomo-results.md`): RECONSOLIDATION ΔMRR = +0.0091, ADAPTIVE_DECAY ΔMRR = -0.0163. The longitudinal-read-path group is unchanged; the consolidation-only group has small sign flips on three rows (HOMEOSTATIC_PLASTICITY, SCHEMA_ENGINE, SYNAPTIC_PLASTICITY) — see "Pre-vs-post-fix comparison" below.

Expand Down Expand Up @@ -43,13 +43,13 @@ Positive Δ ⇒ mechanism contributes positively (ablating it hurts). Negative
| BASELINE_WITH_CONSOLIDATION | 0.8265 | 0.9410 | 0 | 0 | self | Reference (consolidation-cadence anchor); ΔvsNO = +0.0014, within noise — cadence fix `6c51bce` re-validated |
| CASCADE | 0.8268 | 0.9425 | -0.0002 | -0.0015 | WITH | Within noise floor |
| INTERFERENCE | 0.8271 | 0.9410 | -0.0005 | 0.0000 | WITH | Within noise floor |
| HOMEOSTATIC_PLASTICITY | 0.8248 | 0.9390 | +0.0017 | +0.0020 | WITH | **Sign flipped** vs pre-fix (-0.0025 → +0.0017); positive contribution unmasked once plasticity ran cleanly |
| HOMEOSTATIC_PLASTICITY | 0.8248 | 0.9390 | +0.0017 | +0.0020 | WITH | **Sign flipped** vs pre-fix (-0.0025 → +0.0017); positive direction, within the MRR noise floor |
| SYNAPTIC_PLASTICITY | 0.8269 | 0.9405 | -0.0003 | +0.0005 | WITH | Null contribution (clean: ablation explicitly disables plasticity) |
| MICROGLIAL_PRUNING | 0.8269 | 0.9420 | -0.0004 | -0.0010 | WITH | Within noise floor (sign flipped from +0.0011 but |Δ| at noise floor) |
| TWO_STAGE_MODEL | 0.8267 | 0.9395 | -0.0002 | +0.0015 | WITH | Within noise floor |
| EMOTIONAL_DECAY | 0.8263 | 0.9415 | +0.0002 | -0.0005 | WITH | Within noise floor |
| TRIPARTITE_SYNAPSE | 0.8266 | 0.9415 | -0.0001 | -0.0005 | WITH | Within noise floor |
| SCHEMA_ENGINE | 0.8249 | 0.9395 | +0.0017 | +0.0015 | WITH | **Sign flipped** vs pre-fix (-0.0004 → +0.0017); positive contribution unmasked |
| SCHEMA_ENGINE | 0.8249 | 0.9395 | +0.0017 | +0.0015 | WITH | **Sign flipped** vs pre-fix (-0.0004 → +0.0017); positive direction, within the MRR noise floor |

(Exact 6-decimal values at `benchmarks/results/ablation/locomo_v3_post_plasticity_fix/<MECH>.json::overall_mrr` and `manifest.rows`.)

Expand All @@ -66,15 +66,15 @@ The plasticity result-shape contract bug (commit `5f737fe`) silently dropped pla
| BASELINE_WITH_CONSOLIDATION | 0 (anchor) | 0 (anchor) | — | ΔvsNO = +0.0014 in both runs — cadence fix re-confirmed |
| CASCADE | -0.0008 | -0.0002 | +0.0006 | Within noise; closer to zero |
| INTERFERENCE | +0.0004 | -0.0005 | -0.0009 | Within noise; sign flipped at noise floor |
| **HOMEOSTATIC_PLASTICITY** | **-0.0025** | **+0.0017** | **+0.0042** | **Sign flipped** — plasticity-bug-muted negative reading was an artefact; with clean plasticity, this row contributes positively |
| **HOMEOSTATIC_PLASTICITY** | **-0.0025** | **+0.0017** | **+0.0042** | **Sign flipped** — the between-run movement exceeds the floor, but the post-fix delta remains within the ±0.002 MRR floor |
| SYNAPTIC_PLASTICITY | 0.0000 | -0.0003 | -0.0003 | Within noise; explicitly clean ablation |
| MICROGLIAL_PRUNING | +0.0011 | -0.0004 | -0.0015 | Within noise; sign flipped at noise floor |
| TWO_STAGE_MODEL | -0.0012 | -0.0002 | +0.0010 | Within noise; closer to zero |
| EMOTIONAL_DECAY | +0.0015 | +0.0002 | -0.0013 | Within noise; closer to zero |
| TRIPARTITE_SYNAPSE | -0.0004 | -0.0001 | +0.0003 | Within noise; near-identical |
| **SCHEMA_ENGINE** | **-0.0004** | **+0.0017** | **+0.0021** | **Sign flipped** — small but consistent-direction unmasking, mirrors HOMEOSTATIC_PLASTICITY |
| **SCHEMA_ENGINE** | **-0.0004** | **+0.0017** | **+0.0021** | **Sign flipped** — positive direction after the fix, still within the post-fix MRR noise floor |

**Reading.** Three sign-flips (HOMEOSTATIC_PLASTICITY, SCHEMA_ENGINE, SYNAPTIC_PLASTICITY) of which two (HOMEOSTATIC_PLASTICITY at +0.0042, SCHEMA_ENGINE at +0.0021) move out of noise and toward positive contribution. The longitudinal-read-path group (RECONSOLIDATION, CO_ACTIVATION, ADAPTIVE_DECAY) is essentially identical between runs because those rows ran with consolidation off and the plasticity bug had no opportunity to exercise — exactly as documented in the pre-fix limitations note. The cadence-fix anchor agreement (ΔvsNO = +0.0014) is identical to 4 decimals in both runs.
**Reading.** Three rows change sign (HOMEOSTATIC_PLASTICITY, SCHEMA_ENGINE, SYNAPTIC_PLASTICITY). HOMEOSTATIC_PLASTICITY and SCHEMA_ENGINE move by +0.0042 and +0.0021 between runs, ending at positive-direction ΔMRR = +0.0017; because |+0.0017| < 0.002, both post-fix row effects remain inside the stated MRR noise floor. The longitudinal-read-path group (RECONSOLIDATION, CO_ACTIVATION, ADAPTIVE_DECAY) is essentially identical between runs because those rows ran with consolidation off and the plasticity bug had no opportunity to exercise. The cadence-fix anchor agreement (ΔvsNO = +0.0014) is identical to 4 decimals in both runs.

## Architectural-mismatch hypothesis: re-confirmed on clean bytes

Expand All @@ -96,11 +96,11 @@ The architectural-mismatch hypothesis (longitudinal mechanisms are foreclosed on

**Consolidation-only (anchor: BASELINE_WITH_CONSOLIDATION)**

1. **HOMEOSTATIC_PLASTICITY: ΔMRR = +0.0017** (largest absolute; sign-flipped from pre-fix; positive contribution unmasked).
1. **HOMEOSTATIC_PLASTICITY: ΔMRR = +0.0017** (largest absolute; sign-flipped from pre-fix; positive direction within noise).
2. **SCHEMA_ENGINE: ΔMRR = +0.0017** (tied largest absolute; sign-flipped from pre-fix).
3. **INTERFERENCE: ΔMRR = -0.0005** (within noise floor; reported for completeness).

The consolidation-only group's deltas all sit at or just outside the per-row noise floor (≈ ±0.002 MRR at n = 1986 single-seed). The two newly-unmasked positive contributions (HOMEOSTATIC_PLASTICITY, SCHEMA_ENGINE) sit at the boundary of noise and effect; they are reportable as positive-direction contributions but no single consolidation-time mechanism dominates at LoCoMo's scale, the same calibrated-stack property documented for LME-S and the pre-fix LoCoMo run.
The consolidation-only group's deltas all sit inside the per-row noise floor (≈ ±0.002 MRR at n = 1986 single-seed). HOMEOSTATIC_PLASTICITY and SCHEMA_ENGINE are positive-direction observations, not causal contributions at this precision; no single consolidation-time mechanism dominates at LoCoMo's scale.

## Limitations and honest framing

Expand All @@ -124,6 +124,10 @@ The consolidation-only group's deltas all sit at or just outside the per-row noi
- **Summary CSV:** `summary.csv` (14 rows, anchor assignments, per-row delta_mrr_vs_anchor / delta_r10_vs_anchor).
- **Total artefacts:** 14 row JSONs + 1 manifest + 1 summary = 16.

## Historical comparator provenance

The MRR = 0.794 / R@10 = 0.926 pair is **not the current baseline** and is no longer sourced from `CLAUDE.md`. It is the historical clean-database, per-conversation-isolated LoCoMo result (n=1982) first published in commit [`b4057a`](https://github.com/cdeust/Cortex/commit/b4057a532da9c0eecd63ba72ad4174f5e54dab1c). The original per-query run artefact was not committed, so the pair is retained only as a transparent historical comparator; the post-fix run above is authoritative for current Cortex figures.

## Sources

- LoCoMo (Maharana et al., ACL 2024) — benchmark.
Expand Down
5 changes: 4 additions & 1 deletion docs/benchmarks/e1-v3-locomo-results.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# E1 v3 — LoCoMo Ablation Results (n=1986, 14 rows)

> [!WARNING]
> **Superseded for current figures.** This sweep ran on code SHA `ef178da7418a05bcf7aeb3e66f5b3179fdad2c4d`, before the plasticity result-shape fix `5f737fe`. Use the [post-fix re-run](e1-v3-locomo-results-post-fix.md) (code SHA `2f45bcb39dbe15fa0ef857cc8c8c3783175d05db`) for every current LoCoMo value and per-mechanism delta. This document is retained as historical pre-fix evidence only.

## Headline

- **Cortex BASELINE_NO_CONSOLIDATION (longitudinal-read-path anchor): MRR = 0.8278, R@10 = 0.942** on LoCoMo (n = 1986).
- vs. CLAUDE.md established LoCoMo baseline (MRR = 0.794, R@10 = 0.926): **+4.3% MRR, +1.6% R@10**.
- vs. the historical April 2026 clean-DB Cortex comparator (MRR = 0.794, R@10 = 0.926; n=1982; provenance and limitations in the [post-fix re-run](e1-v3-locomo-results-post-fix.md#historical-comparator-provenance)): **+4.3% MRR, +1.6% R@10**.
- **BASELINE_WITH_CONSOLIDATION (consolidation-cadence anchor): MRR = 0.8264, R@10 = 0.940.** ΔvsNO = +0.0014, within the per-row noise floor. This is the **n=1986 validation that the cadence fix (commit `6c51bce`) holds**: pre-fix smoke had MRR_with_cons collapse to 0.222 because of a wall-clock vs event-time confusion; the post-fix anchor sits indistinguishable from NO_CONSOLIDATION at full scale.
- The 14-row two-baseline ablation **empirically resolves the architectural-mismatch hypothesis from the LME-S §6.3 writeup**: longitudinal mechanisms (RECONSOLIDATION, CO_ACTIVATION, ADAPTIVE_DECAY) that were at the noise floor on isolated-haystack LME-S **do show measurable effect on the longitudinal benchmark whose mechanism-of-action they target**.

Expand Down
Loading