\documentclass{article} \usepackage[eandd]{neurips_2026} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{amsmath,amssymb,amsfonts,amsthm} \usepackage{booktabs} \usepackage{array} \usepackage{graphicx} \usepackage{xcolor} \usepackage{enumitem} \usepackage{hyperref} \usepackage[nameinlink,noabbrev]{cleveref} \usepackage{caption} \usepackage{subcaption} \setlength{\emergencystretch}{3em} \hypersetup{ colorlinks=true, linkcolor=blue!60!black, citecolor=blue!60!black, urlcolor=blue!60!black, } \newtheorem{theorem}{Theorem} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{definition}[theorem]{Definition} \newtheorem{assumption}[theorem]{Assumption} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \theoremstyle{plain} \newcommand{\method}{\textsc{MemAudit}} \newcommand{\compiler}{\textsc{GVT}} \newcommand{\budget}{B} \newcommand{\experiences}{\mathcal{E}} \newcommand{\ground}{\mathcal{U}} \newcommand{\queries}{\mathcal{Q}} \newcommand{\units}{\mathcal{R}} \newcommand{\feasible}{\mathcal{F}} \newcommand{\package}{\mathcal{P}} \newcommand{\opt}{\mathrm{OPT}} \newcommand{\R}{\mathbb{R}} \title{\method:\\ An Exact-Oracle Evaluation Protocol\\ for Budgeted Long-Term LLM Memory Writing} \author{Anonymous} \date{} \begin{document} \maketitle \begin{abstract} Long-term LLM agents must decide what to write into persistent memory before future queries are known, but existing evaluations conflate memory writing, retrieval, and reader reasoning. We introduce \method, a reusable exact-oracle evaluation protocol for budgeted memory writing. A package contains an experience stream, candidate memory representations, storage costs, semantic evidence units, and future-query requirements; together these turn long-term memory writing into an auditable finite optimization problem with a certified denominator. We formalize the objective as concave semantic coverage under a storage budget and a one-representation-per-experience constraint, prove monotone submodularity, and compute package optima with branch-and-bound/MILP. Across controlled, validity-heavy, natural support-sliced, and exported-system packages, \method\ exposes representation, validity, and budget-selection effects that end-to-end QA alone cannot localize. Exported Mem0, A-Mem, and Letta stores show that heterogeneous memory systems can be scored without forcing a shared internal representation. \method\ provides a reusable evaluation layer for measuring what memory writers preserve under a fixed budget. \end{abstract} \section{Introduction} LLM agents increasingly operate across sessions: they converse with users, call tools, edit code, inspect documents, and later need to reuse what happened. A fixed context window makes the naive policy of retaining everything impossible. The agent must compile an experience stream into persistent memory, choosing not only whether to store an item but also which representation should survive: raw span, extracted fact, temporal event, graph edge, summary, rule, skill, current-state update, or tombstone. This paper argues that long-term memory writing should be evaluated as finite semantic compression, not only as an architecture choice. The load-bearing object is an oracle package: for a fixed budget, finite candidate memories, and fixed future-query requirements, how close is a writer to the best package-feasible store? This separates write quality from downstream retrieval and reader behavior. A system may fail because it wrote the wrong memory, because retrieval missed a good memory, or because the reader ignored evidence; final QA accuracy alone cannot identify which layer failed. The distinction matters because most deployed memory systems are evaluated only after several other choices have intervened. A memory writer may extract a useful fact but store it in a form too expensive to keep under the target budget. A retriever may miss the relevant memory even if the writer preserved it. A reader may see the evidence and still answer incorrectly. These are different engineering failures. \method\ isolates the first one by freezing a finite candidate set, a storage accounting rule, and an evidence-unit objective. The resulting denominator is not a claim about all possible memories; it is a reproducible answer to the narrower question ``given this package, how much of the package-feasible semantic value did the writer preserve?'' \begin{figure}[t] \centering \includegraphics[width=0.95\linewidth]{figures/pipeline_schematic.pdf} \caption{\method\ separates write-time memory quality from retrieval and reader reasoning. A finite package defines candidate memories, evidence units, costs, and future-query requirements; exact package optima provide the denominator for the written store.} \label{fig:pipeline} \end{figure} \paragraph{Contributions.} We make four evaluation-and-dataset contributions. (i) We define a finite \method\ package for budgeted memory writing with a package oracle ratio and a union denominator for external stores. (ii) We give a semantic coverage objective and prove monotone submodularity for nonnegative concave coverage. (iii) We provide exact/certified package optima and an oracle reference baseline, with an independent MILP audit. (iv) We release an initial \method\ suite spanning controlled exact packages, validity-heavy stress packages, model-adjudicated natural support slices, and exported-system packages for Mem0, A-Mem, and Letta. \paragraph{E\&D artifact role.} \method\ is designed to complement systems such as Mem0, Letta, A-Mem, MemGPT-style archival memory, and graph-based memories by scoring their exported writes under a shared denominator. The released artifact contains deterministic exact-package generators, certified solvers, cached natural package exports, adjudication summaries, exported Mem0/A-Mem/Letta memory stores, and scripts to reproduce the main tables and figures without additional API calls. API-backed construction is needed only to regenerate natural annotations or rerun external memory exports. \paragraph{Relation to MemSim.} MemSim/MemDaily \cite{zhang2024memsim} automatically constructs reliable QA pairs for evaluating personal-assistant memory through downstream answering. \method\ targets a complementary layer: it evaluates the write-time memory store itself by defining finite candidate representations, costs, evidence units, and an exact budgeted optimum. Thus MemSim asks whether an agent answers generated memory questions correctly, while \method\ asks how close a written memory store is to the best package-feasible semantic store before retrieval and reader reasoning are invoked. This also lets \method\ localize where the problem sits: candidate generation, representation choice, budget-aware selection, retrieval, or reader use. \section{\method\ Package}\label{sec:package} An LLM agent observes experiences $\experiences=(e_1,\ldots,e_T)$. Each experience can generate multiple candidate write choices, such as raw text, an atomic fact, a summary, a graph edge, a rule, a current-state update, or a tombstone. Let \[ \ground=\{(i,j): i\in[T],\ j\in J_i\setminus\{\mathrm{discard}\}\} \] be the virtual ground set of non-discard experience-representation choices. Each element $u=(i,j)$ has cost $c_u>0$, and $G_i=\{(i,j):j\in J_i\setminus\{\mathrm{discard}\}\}$ is the group of choices for experience $i$. A feasible memory store satisfies one storage budget and one choice per experience: \begin{equation} \feasible_\budget= \left\{X\subseteq\ground: \sum_{u\in X}c_u\leq\budget,\quad |X\cap G_i|\leq1\ \forall i \right\}. \label{eq:feasible} \end{equation} Thus the feasibility structure is the intersection of one knapsack constraint and one partition matroid. This virtual-ground-set view makes representation choice explicit instead of treating memory as a homogeneous list of strings. For example, suppose a user first says they prefer vegetarian travel meals and later says they are pescatarian now. A future query asks what meal should be booked. The package may contain a stale vegetarian fact, a current pescatarian fact, a raw span containing both turns, a tombstone invalidating the old preference, and a compound update saying ``vegetarian is superseded by pescatarian.'' These candidates have different costs and cover different evidence units: current truth, invalidation, temporal order, or raw provenance. The constraint $|X\cap G_i|\leq1$ prevents the package optimum from keeping every representation of one experience and makes the denominator comparable to a real writer that must choose one persistent form. The package also fixes storage accounting. In our experiments, costs are word-equivalent or serialized-token-equivalent units, depending on the artifact being scored. This is intentionally simple: \method\ is agnostic to whether a deployed system later stores embeddings, graph nodes, JSON metadata, or archival passages. What matters for the denominator is that every candidate has a declared cost and every compared store obeys the same budget. When external systems export memories outside the package candidate set, those memories are added to a union package with their own measured costs rather than forced into the original candidate taxonomy. The benchmark defines semantic evidence units $\units=\{r_1,\ldots,r_M\}$. A future query $q$ has required evidence units $R(q)\subseteq\units$ and nonnegative importance weights, inducing evidence weights $w_r\geq0$. Each candidate memory has a nonnegative coverage row $a_{ur}\in[0,1]$. The utility of a store is \begin{equation} F(X)=\sum_{r\in\units} w_r\, h_r\!\left(\sum_{u\in X}a_{ur}\right), \label{eq:coverage} \end{equation} where each $h_r$ is concave, nondecreasing, and normalized. The default package objective uses $h_r(z)=\min(1,z)$, so duplicate memories of the same evidence unit have diminishing marginal value. Evidence units are the semantic atoms used by the benchmark. In a synthetic package they are generated from the hidden event graph; in a natural support slice they are source-backed units extracted from the support sessions and then mapped to future-query requirements. A unit can represent a fact, a temporal relation, an entity preference, a deletion, an abstention condition, or a validity-state update. The objective is positive coverage: stale-fact avoidance is represented by covering the evidence unit that says an older fact is no longer current, not by assigning negative utility to stale memories. This keeps the objective monotone while still allowing the benchmark to ask whether writers preserve current-truth information. The concavity in \Cref{eq:coverage} encodes diminishing returns. If two candidates cover the same evidence unit, the second copy should usually help less than the first. If a query requires multiple evidence units, the weights $w_r$ distribute value across those requirements. The objective is therefore a semantic surrogate for write-time preservation, not a replacement for downstream QA. A reader can still fail with a high-$F$ store, and a low-$F$ store might answer an easy question by chance. The point is that $F$ gives a deterministic, package-local target for the writer layer. \begin{theorem}[Semantic coverage is monotone submodular]\label{thm:coverage} Let $w_r\geq0$, $a_{ur}\geq0$, and let each $h_r$ be concave, nondecreasing, and satisfy $h_r(0)=0$. Then $F$ in \Cref{eq:coverage} is normalized, monotone nondecreasing, and submodular on $2^\ground$. \end{theorem} The proof is the standard concave-over-modular diminishing-returns argument and is given in \Cref{app:proofs}. The theorem supports the semantic surrogate; it does not claim black-box LLM answer accuracy is submodular. \begin{definition}[\method\ package and package ratio]\label{def:package} An \method\ package is a tuple \[ \package=(\ground,\mathcal{G},c,\units,A,w,\budget). \] Its exact package optimum and package ratio are \[ \opt_{\package}(\budget)=\max_{X\in\feasible_\budget(\package)}F_{\package}(X), \qquad \rho_{\package}(X)=F_{\package}(X)/\opt_{\package}(\budget). \] \end{definition} \begin{definition}[Union denominator for external stores]\label{def:union} If an external memory system writes memories $Y$ not contained in $\ground$, we evaluate them in the finite union package $\package^+(Y)$ obtained by adding $Y$, their costs, and their adjudicated coverage rows. The external-store ratio is \[ \rho_{\mathrm{union}}(Y)= \frac{F_{\package^+(Y)}(Y)}{\opt_{\package^+(Y)}(\budget)}. \] We also report an analysis-only upper-pruned bound over subsets of $Y$ to separate extraction quality from budget-aware selection. \end{definition} The union denominator is essential for scoring real systems. Suppose Mem0 writes a memory that is not one of our package candidates. Scoring it only against the package candidate optimum would be ambiguous: the system may have created a useful representation that the package did not contain. In $\package^+(Y)$, the exported memory becomes a first-class candidate with an adjudicated coverage row. The numerator scores exactly what the system wrote and retained, while the denominator asks what the best budget-feasible subset could have achieved using both package candidates and system exports. This makes low scores interpretable: a low raw exported-store ratio with a high upper-pruned bound indicates that the system extracted useful content but did not select or compact it well under budget. \section{Exact Optima and Reference Writers}\label{sec:oracles} Exact optimization is central to \method. For small packages, we compute $\opt_{\package}(\budget)$ by branch-and-bound over experience-representation assignments. For the default clipped-coverage objective, we also use a MILP certificate with binary candidate variables $x_u$ and coverage variables $y_r\leq\sum_u a_{ur}x_u$, $y_r\leq1$. Greedy or learned references are never labeled as OPT. The branch-and-bound solver searches over groups rather than over unconstrained candidate subsets. At each group it branches over discard or one representation choice, tracks remaining budget, and uses an optimistic fractional bound over current marginal gains to prune subtrees. The bound is admissible for the clipped coverage objective because future marginal coverage can only decrease as more evidence units are covered. This solver is sufficient for the exact-small and adjudicated natural packages we report. The MILP audit is included to reduce the risk that an implementation detail in the custom solver defines the benchmark. \begin{table}[t] \centering \small \caption{Exact-solver certification. PuLP MILP and pure-Python branch-and-bound were run on the same requested-scope audit instances; equality is objective-value equality, allowing tied optimal stores with different candidate ids.} \label{tab:milp} \begin{tabular}{lccc} \toprule Audit & Rows & Objective matches & Max diff \\ \midrule B\&B vs MILP & $1{,}200$ & $1{,}200/1{,}200$ & $0.0$ \\ \bottomrule \end{tabular} \end{table} The oracle reference baseline is grouped value-threshold (\compiler). For each arriving experience, \compiler\ forms the budget-feasible candidates whose oracle marginal density exceeds a threshold, then inserts the admissible representation with largest raw marginal value. A threshold grid gives a conservative insertion-only constant-factor guarantee under exact marginals and small-item assumptions; the theorem and proof are in \Cref{app:proofs}. \compiler\ is included as a calibration baseline: because it has access to exact package marginals, it helps verify that the package and solver behave sensibly. It is not the proposed deployed writer. Density-only representation choice is included as a negative control. It can be arbitrarily bad even for modular utility: a tiny candidate can have higher density while losing nearly all value. Controlled experiments below show this failure empirically. This calibration role is useful because it makes representation-choice effects visible. A pure density rule may prefer a cheap but narrow memory; a pure value rule may spend the budget too quickly on expensive raw spans. \compiler\ combines a density threshold with within-group value choice, which is well aligned with the one-representation-per-experience structure, while remaining secondary to the benchmark artifact itself. \begin{proposition}[Density-only can be arbitrarily bad]\label{prop:density-bad} For every $\eta>0$, there is a one-experience modular instance satisfying $0