% Self-authored reading deck based on the arxiv-paper-reader Beamer template.
% Original paper: Zhang et al., arXiv:2604.07798v3, CC BY-NC-SA 4.0.
% Build: python3 build_slides.py slides.en.tex
\documentclass[aspectratio=169,11pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,graphicx,booktabs}
\definecolor{AcademicBlue}{RGB}{26,57,86}
\definecolor{AcademicTeal}{RGB}{0,105,112}
\setbeamercolor{structure}{fg=AcademicBlue}
\setbeamercolor{frametitle}{fg=AcademicBlue,bg=white}
\setbeamercolor{title}{fg=AcademicBlue}
\setbeamercolor{alerted text}{fg=AcademicTeal}
\setbeamercolor{block title}{fg=white,bg=AcademicBlue}
\setbeamercolor{block body}{fg=black,bg=AcademicBlue!5}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{itemize items}[circle]
\setbeamertemplate{footline}{\hfill\usebeamerfont{page number in head/foot}\insertframenumber\,/\,\inserttotalframenumber\hspace{4mm}\vspace{3mm}}
\setbeamersize{text margin left=8mm,text margin right=8mm}
\setbeamerfont{frametitle}{size=\Large,series=\bfseries}
\setbeamerfont{title}{size=\LARGE,series=\bfseries}
\newcommand{\papersource}[1]{\par\smallskip{\scriptsize\color{gray}#1\par}}
\newcommand{\takeaway}[1]{\begin{block}{Reading takeaway}#1\end{block}}
\title[LightMem]{Lightweight LLM Agent Memory\\with Small Language Models}
\subtitle{LightMem: bounded online selection, asynchronous consolidation}
\author{Paper by Jiaquan Zhang et al.\\\small Independent paper-reading presentation}
\date{arXiv:2604.07798v3 $\cdot$ revised 22 April 2026\\Read on 27 September 2026 $\cdot$ about 25 minutes + backup}

\begin{document}
\begin{frame}
\titlepage
\end{frame}

\begin{frame}{The expensive part of memory need not run every turn}
\begin{columns}[T,onlytextwidth]
\column{0.47\textwidth}
\begin{block}{Retrieval-driven memory}
Small online overhead, but weak queries and noisy candidates can hurt answer quality.
\end{block}
\column{0.49\textwidth}
\begin{block}{Repeated large-model operations}
Flexible memory decisions, but planning, filtering and writing add online latency.
\end{block}
\end{columns}
\medskip
\begin{itemize}
\item Use small language models for constrained, frequent decisions.
\item Move heavier abstraction and integration to an offline LLM.
\item Improve the retrieval and writing pipeline together.
\end{itemize}
\papersource{Paper, Secs. 1--2, PDF pp. 1--3. This is a system-design contribution.}
\end{frame}

\begin{frame}{The three stores separate information by role}
\begin{block}{STM: immediate context $C_t$}
Recent turns in the prompt. Neither persisted nor externally retrieved.
\end{block}
\begin{block}{MTM: user-specific episodes $M_u^{\mathrm{MTM}}$}
Summaries + embeddings + time/access metadata + user ID. Capacity $B$.
\end{block}
\begin{block}{LTM: shared semantic knowledge $M^{\mathrm{LTM}}$}
De-identified abstractions in a graph; no raw personal episodes or user IDs.
\end{block}
\papersource{Paper, Sec. 3.2, PDF p. 3; Appendix 8.1.1, PDF p. 11. LTM is not a personal transcript archive.}
\end{frame}

\begin{frame}{LightMem separates retrieval, writing and consolidation}
\centering
\includegraphics[width=0.91\linewidth,height=0.67\textheight,keepaspectratio]{figures/fig-02.jpg}
\papersource{Original Fig. 2, PDF p. 4, Zhang et al. (CC BY-NC-SA 4.0). The text defines SLM-3 as online writing, despite its placement in the diagram's OFFLINE area. BM25 details are not specified in the method.}
\end{frame}

\begin{frame}{SLM-1 turns an ambiguous request into a retrieval plan}
\[
\mathcal Q_t=\left\langle\{q_t^{(i)}\}_{i=1}^{n},\phi_t,K\right\rangle
\]
\begin{itemize}
\item Infer intent from user input $x_t$ and recent context $C_t$.
\item Generate hypothetical queries (HQs); route to MTM or LTM.
\item Set metadata filters $\phi_t$ and allocate a final budget $K$.
\end{itemize}
\begin{block}{Paper's example: ``Recommend a dinner spot.''}
MTM: dietary preferences and constraints.\\
LTM: general restaurant knowledge. No claim of live restaurant data.
\end{block}
\papersource{Paper, Sec. 3.3, Eq. (1), PDF p. 3; Table 1, PDF p. 5; prompt in Sec. 10.1, PDF p. 13.}
\end{frame}

\begin{frame}{A bounded candidate pool makes semantic selection practical}
\begin{columns}[T,onlytextwidth]
\column{0.48\textwidth}
\begin{block}{Stage 1: coarse retrieval}
Vector search with metadata filters.
\[
K_1^{(i)}=\frac{2K}{n},\quad C=\bigcup_i C^{(i)}
\]
Target: roughly $2K$ candidates.
\end{block}
\column{0.48\textwidth}
\begin{block}{Stage 2: SLM-2 selection}
Check semantic support for the HQs.
\[
R_t\subseteq C,\qquad |R_t|\le K
\]
Select entries; do not rewrite them.
\end{block}
\end{columns}
\medskip
Algorithm 1 rounds quotas up and truncates excess candidates. Duplicate or missing hits can leave fewer than $2K$ distinct entries.
\papersource{Paper, Sec. 3.4, Eqs. (3)--(5), PDF pp. 3--4; Algorithm 1, p. 11; Sec. 10.2, pp. 13--14.}
\end{frame}

\begin{frame}{SLM-3 converts a completed interaction into reusable episodes}
\[
(x_t,y_t,C_t)\longrightarrow\text{compact summary}\longrightarrow M_u^{\mathrm{MTM}}
\]
\begin{itemize}
\item Write after the response $y_t$ has been generated.
\item Merge redundant records; resolve conflicts using time and evidence.
\item Evict stale or low-utility entries under a capacity bound:
\end{itemize}
\[
\left|M_u^{\mathrm{MTM}}\right|\le B,\qquad B=10^4\text{ entries}.
\]
\takeaway{A fixed number of records bounds storage growth; it does not guarantee that the right facts survive.}
\papersource{Paper, Sec. 3.5, Eq. (6), PDF p. 4; Algorithm 2, p. 12. Utility and conflict thresholds are not specified.}
\end{frame}

\begin{frame}{The offline LLM abstracts episodes into a shared graph}
\begin{enumerate}
\item Select new, reactivated or capacity-flagged MTM records.
\item Abstract and de-identify; find nearby semantic anchors in LTM.
\item Insert, link, merge or update knowledge; decay weak evidence.
\end{enumerate}
\medskip
\begin{columns}[T,onlytextwidth]
\column{0.46\textwidth}
\begin{block}{Reported maintenance}
Every 10--15 turns\\
$\sim$3.5 s per offline batch\\
$\sim$1 new node per 4 turns
\end{block}
\column{0.50\textwidth}
\begin{block}{Cost interpretation}
Asynchronous execution removes a dependency from the response path. It still consumes compute and requires resource scheduling.
\end{block}
\end{columns}
\papersource{Paper, Sec. 3.6, PDF pp. 4--5; Algorithm 3, p. 12; Table 10, p. 16. Specific offline model not reported.}
\end{frame}

\begin{frame}{Query expansion can spend the budget on the wrong intent}
\begin{block}{A recall request}
``What did I decide about the project timeline?''
\end{block}
\begin{columns}[T,onlytextwidth]
\column{0.48\textwidth}
\begin{block}{Useful HQs $\rightarrow$ MTM}
Identify the project.\\
Retrieve the user's actual decision.
\end{block}
\column{0.48\textwidth}
\begin{block}{Distracting HQ $\rightarrow$ LTM}
Retrieve general planning principles.\\
Uses part of the same Top-$K$ budget.
\end{block}
\end{columns}
\medskip
The answer may remain correct but include unnecessary advice. A selector cannot recover evidence absent from its candidate pool.
\papersource{Failure example: Paper, Sec. 9.2, PDF pp. 12--13. Last sentence is the reader's pipeline interpretation.}
\end{frame}

\begin{frame}{Evaluation covers quality, latency and memory failures}
\begin{itemize}
\item \textbf{LoCoMo}: five question categories over long conversations.
\item \textbf{DialSim}: long-running, multi-party dialogue; lexical and semantic scores.
\item \textbf{Baselines}: LoCoMo, ReadAgent, MemoryBank, MemGPT, A-MEM.
\end{itemize}
\medskip
\begin{block}{Reported implementation}
Quantized Llama-3.2-1B (default); Qwen2.5-1.5B variant.\\
384-d MiniLM embeddings; 2,000 LoRA samples for SLM-2.\\
One RTX 4090 (24 GB); remote GPT-4o-mini for latency tests.
\end{block}
\papersource{Paper, Sec. 4.1, PDF p. 5. Protocol caveat: a fixed GPT-4o-mini generator is stated, but Table 2 uses multiple backbone labels without fully clarifying which components vary.}
\end{frame}

\begin{frame}{LightMem improves F1 across the LoCoMo categories}
\centering
\begin{tabular}{lrrr}
\toprule
GPT-4o-mini block & A-MEM F1 & LightMem F1 & Gain \\
\midrule
Single-hop & 44.65 & 45.81 & +1.16 \\
Multi-hop & 27.02 & 28.85 & +1.83 \\
Temporal & 45.85 & 46.28 & +0.43 \\
Open-domain & 12.14 & 13.52 & +1.38 \\
Adversarial & 50.03 & 54.57 & +4.54 \\
\bottomrule
\end{tabular}
\medskip
\begin{itemize}
\item All gains are absolute F1 points, not relative percentages.
\item Full-history LoCoMo still scores \textbf{69.23} on adversarial questions.
\end{itemize}
\papersource{Paper, Table 2, PDF p. 6. Temporal F1 is 46.28 here; the statistical appendix reports 46.20 separately.}
\end{frame}

\begin{frame}{The headline gain is consistent with a simple table average}
\centering
\begin{tabular}{lrrr}
\toprule
Table 2 model label & Mean F1 gain & A-MEM tokens & LightMem tokens \\
\midrule
GPT-4o-mini & +1.868 & 2,520 & 1,150 \\
GPT-4o & +2.084 & 1,216 & 685 \\
Qwen2.5-1.5B & +2.142 & 1,300 & 728 \\
Qwen2.5-3B & +3.116 & 1,137 & 611 \\
Llama-3.2-1B & +2.792 & 1,376 & 754 \\
Llama-3.2-3B & +2.722 & 1,126 & 642 \\
\bottomrule
\end{tabular}
\medskip
\par\textbf{Reader's calculation:} mean gain across 30 cells = \alert{+2.454}.\\
GPT-4o-mini effective context is \alert{54.4\% shorter} than A-MEM.
\papersource{Recomputed from Table 2, PDF p. 6. Equal weighting of cells, not example-weighted F1; tokens describe effective context, not total memory storage. Model-role ambiguity remains.}
\end{frame}

\begin{frame}{On DialSim, lexical and semantic scores both improve}
\centering
\begin{tabular}{lrrr}
\toprule
Metric $\uparrow$ & A-MEM & LightMem & Absolute gain \\
\midrule
F1 & 3.45 & 4.12 & +0.67 \\
BLEU-1 & 3.37 & 3.95 & +0.58 \\
ROUGE-L & 3.54 & 4.20 & +0.66 \\
ROUGE-2 & 3.60 & 4.15 & +0.55 \\
METEOR & 2.05 & 2.48 & +0.43 \\
SBERT & 19.51 & 23.40 & +3.89 \\
\bottomrule
\end{tabular}
\medskip
\par SBERT rises by 19.9\% relative to A-MEM, on the table's score scale.\\
Embedding similarity is not a factual-accuracy or privacy guarantee.
\papersource{Paper, Sec. 4.2 and Table 3, PDF pp. 6--7; GPT-4o-mini. Relative percentage is the reader's calculation.}
\end{frame}

\begin{frame}{MTM and semantic filtering both contribute to the full system}
\centering
\begin{tabular}{lrr}
\toprule
DialSim ablation & F1 $\uparrow$ & Drop from full \\
\midrule
Full LightMem & 4.12 & --- \\
Without semantic reranking & 3.83 & 0.29 \\
Without HQ and routing & 3.87 & 0.25 \\
Without MTM & 3.75 & 0.37 \\
Without offline consolidation & 3.96 & 0.16 \\
\bottomrule
\end{tabular}
\medskip
\begin{itemize}
\item Removing the graph also lowers SBERT: 23.40 $\rightarrow$ 22.82.
\item Component removals support incremental value in this setup; they do not establish interaction effects.
\end{itemize}
\papersource{Exact values from Sec. 4.3, PDF p. 7, Llama-3.2-1B configuration. Fig. 3 on p. 8; both original panels in backup.}
\end{frame}

\begin{frame}{Latency improves over A-MEM, with a quality--speed tradeoff}
\centering
\begin{tabular}{lrr}
\toprule
Method & Retrieval P50/P95 (ms) & End-to-end P50/P95 (ms) \\
\midrule
LoCoMo & 0 / 0 & 2,054 / 3,658 \\
ReadAgent & 34 / 97 & 614 / 1,027 \\
MemoryBank & 16 / 51 & 439 / 1,047 \\
MemGPT & 143 / 451 & 2,087 / 3,451 \\
A-MEM & 856 / 1,583 & 914 / 3,682 \\
LightMem & \textbf{83 / 167} & \textbf{581 / 1,325} \\
\bottomrule
\end{tabular}
\medskip
\begin{itemize}
\item Versus A-MEM: retrieval P50 $-90.3\%$; end-to-end P50 $-36.4\%$.
\item MemoryBank is faster. End-to-end includes the remote API.
\end{itemize}
\papersource{Paper, Sec. 4.4, PDF pp. 7--8; Table 4, p. 8. Percentages recomputed. P50 is a median; offline work is not a zero-cost operation.}
\end{frame}

\begin{frame}{Natural MTM growth widens the advantage over vector search}
\centering
\begin{tabular}{lrrr}
\toprule
MTM entries & Vector retrieval F1 & LightMem F1 & Gain \\
\midrule
$\sim$100 & 3.95 & 3.98 & +0.03 \\
$\sim$1,000 & 3.90 & 4.05 & +0.15 \\
$\sim$5,000 & 3.86 & 4.09 & +0.23 \\
10,000 & 3.83 & 4.12 & +0.29 \\
\bottomrule
\end{tabular}
\medskip
\begin{block}{A useful trend, with a confound}
These are cumulative scores along the same dialogue trajectory. Memory size, dialogue stage and accumulated evidence change together.
\end{block}
\papersource{Paper, Sec. 4.5 and Table 5, PDF p. 8; DialSim, Llama-3.2-1B. This is not an independent memory-capacity sweep.}
\end{frame}

\begin{frame}{Errors can compound across planning, selection and writing}
\centering
\begin{tabular}{lrr}
\toprule
DialSim perturbation & F1 $\uparrow$ & SBERT $\uparrow$ \\
\midrule
Full LightMem & 4.12 & 23.40 \\
50\% irrelevant HQs (SLM-1) & 3.95 & 23.08 \\
No reranking (SLM-2) & 3.83 & 22.56 \\
50\% noisy writes (SLM-3) & 3.78 & 22.45 \\
All three perturbations & \alert{1.85} & \alert{11.20} \\
\bottomrule
\end{tabular}
\medskip
\takeaway{A bounded retrieval budget does not prevent memory pollution. Combined perturbations reduce F1 by 55.1\% relative to full LightMem.}
\papersource{Paper, Sec. 4.6 and Table 6, PDF pp. 8--9. Fixed final Top-$K$. Artificial perturbations, not measured deployment error rates.}
\end{frame}

\begin{frame}{Reading both stores helps bridge offline update gaps}
\centering
\begin{tabular}{lr}
\toprule
LoCoMo retrieval setting & Multi-hop F1 $\uparrow$ \\
\midrule
Full LightMem, normal gap & 28.85 \\
LTM only & 19.45 \\
MTM only & 20.12 \\
MTM noise saturation & 23.10 \\
\bottomrule
\end{tabular}
\medskip
\begin{itemize}
\item Recent unconsolidated episodes and older abstractions can be complementary.
\item Heavy recent noise can still occupy the fixed retrieval budget.
\item Gap duration and the exact saturation construction are underspecified.
\end{itemize}
\papersource{Paper, Sec. 4.7 and Table 7, PDF p. 9; GPT-4o-mini. Mechanism is the authors' interpretation, not a traced causal decomposition.}
\end{frame}

\begin{frame}{The appendix supports two gains, with a numerical mismatch}
\centering
\begin{tabular}{lrrrr}
\toprule
Category & A-MEM F1 & LightMem F1 & $\Delta$ [95\% CI] & $p$ \\
\midrule
Multi-hop & 27.02 & 28.85 & 1.83 [1.24, 2.41] & .001 \\
Temporal & 45.85 & 46.20 & 0.35 [0.12, 0.58] & .008 \\
\bottomrule
\end{tabular}
\medskip
\begin{itemize}
\item Three seeds; 1,000 paired bootstrap resamples over instances.
\item Main Table 2 reports Temporal F1 \textbf{46.28}; Table 8 reports \textbf{46.20}. No reconciliation is given.
\item Evidence is specific to the reported comparisons, not all ablations or latency measurements.
\end{itemize}
\papersource{Paper, Sec. 9.1 and Table 8, PDF p. 12. Values align with the GPT-4o-mini block; Table 8 does not independently name the backbone.}
\end{frame}

\begin{frame}{The strongest conclusions stay within the reported setup}
\begin{enumerate}
\item \textbf{Model roles need clarification.} Multiple backbone labels coexist with the statement of a fixed GPT-4o-mini response generator.
\medskip
\item \textbf{The cost account is partial.} Offline compute, write latency and concurrent resource contention are not fully measured.
\medskip
\item \textbf{Privacy and scale are design goals.} User filters and de-identification have no reported leakage audit; fixed $K$ does not bound all index or model costs.
\end{enumerate}
\papersource{Reader's assessment of Secs. 3--4, 8.1.6 and 10--11. Authors' Sec. 6 (PDF p. 9) notes unexplored consolidation and control alternatives.}
\end{frame}

\begin{frame}{Three ideas are worth carrying into memory-system design}
\begin{block}{1. Match the model to the decision}
Small models can perform structured online control and selection; heavier abstraction can run asynchronously.
\end{block}
\begin{block}{2. Make evidence selection an explicit interface}
Budget coarse candidates, verify semantic support, then expose a compact memory set to the response generator.
\end{block}
\begin{block}{3. Evaluate the full memory lifecycle}
The reported gains over A-MEM are consistent. Error accumulation, update gaps and background costs remain central constraints.
\end{block}
\papersource{Synthesis from the paper's method and results. A useful follow-up is a matched-generator, matched-token-budget replication.}
\end{frame}

\begin{frame}{Source, scope and reproducibility materials}
\textbf{Lightweight LLM Agent Memory with Small Language Models}\\
\smallskip
{\small Jiaquan Zhang, Chaoning Zhang, Shuxu Chen, Zhenzhen Huang, Pengcheng Zheng, Zhicheng Wang, Ping Guo, Fan Mo, Sung-Ho Bae, Jie Zou, Jiwei Wei, Yang Yang.}
\medskip
\begin{itemize}
\item \href{https://arxiv.org/abs/2604.07798v3}{arXiv:2604.07798v3}; revised 22 April 2026. The arXiv record states acceptance to ACL 2026 main.
\item Read from same-version author TeX and the 16-page PDF, including substantive appendices. Locators use PDF page numbers.
\item Original figures credited to the authors, \href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{CC BY-NC-SA 4.0}. Recomputed values are labeled.
\item Companion Chinese notes, figure provenance and editable TeX are archived together. Build with \texttt{python3 build\_slides.py slides.en.tex}.
\end{itemize}
\papersource{This is an independent reading presentation; it is not an author presentation or a reproduction of system experiments.}
\end{frame}

\appendix
\begin{frame}{Backup: narrow interfaces define each model's responsibility}
\begin{description}
\item[SLM-1] Input: query + recent context. Output: HQs/routing in JSON. Does not search or answer.
\medskip
\item[SLM-2] Input: HQs + candidate summaries/metadata. Output: selection in JSON. Does not rewrite or expand memory.
\medskip
\item[SLM-3] Input: current interaction. Output: short reusable summaries. Does not retain full transcripts or perform cross-user abstraction.
\medskip
\item[Offline LLM] Input: selected MTM batch. Output: new/updated LTM units and links. Does not directly modify MTM.
\end{description}
\papersource{Paper, Sec. 10, PDF pp. 13--14. Exact JSON schemas and host-side maintenance interfaces are not fully specified.}
\end{frame}

\begin{frame}{Backup: LTM graph schema and its maintenance footprint}
\begin{columns}[T,onlytextwidth]
\column{0.47\textwidth}
\begin{block}{Schema}
Nodes: Entity, Concept.\\[1ex]
Edges: IsA, HasProperty, RelatedTo, Implies.
\end{block}
\column{0.49\textwidth}
\begin{block}{Reported dynamics}
Update: every 10--15 turns.\\
Growth: $\sim$1 node / 4 turns.\\
Processing: $\sim$3.5 s / batch.
\end{block}
\end{columns}
\medskip
\begin{itemize}
\item Offline-update ablation: F1 4.12 $\rightarrow$ 3.96 (about 3.9\% relative loss).
\item Query-time graph traversal and the offline model are not fully specified.
\item Table 10 calls 83 ms an average; Table 4 explicitly reports P50.
\end{itemize}
\papersource{Paper, Sec. 11 and Tables 9--10, PDF pp. 15--16; F1 values match the DialSim ablation.}
\end{frame}

\begin{frame}{Backup: original Llama-3.2-1B ablation panel}
\centering
\includegraphics[width=0.99\linewidth,height=0.70\textheight,keepaspectratio]{figures/fig-03a.jpg}
\papersource{Original Fig. 3(a), PDF p. 8. Truncated, metric-specific y-axes. SR: semantic reranking; HQ/RR: query generation/routing; OC: offline consolidation. Original figure: Zhang et al., CC BY-NC-SA 4.0.}
\end{frame}

\begin{frame}{Backup: original Qwen2.5-1.5B ablation panel}
\centering
\includegraphics[width=0.99\linewidth,height=0.70\textheight,keepaspectratio]{figures/fig-03b.jpg}
\papersource{Original Fig. 3(b), PDF p. 8. Full system scores highest in each panel; axes are truncated and use different scales. Bars lack printed point values. Original figure: Zhang et al., CC BY-NC-SA 4.0.}
\end{frame}

\begin{frame}{Backup: a fixed item budget is not a complete complexity bound}
\begin{block}{What is explicitly bounded?}
Algorithm 1 forms a candidate pool, truncates it to at most $2K$, then returns at most $K$ entries.
\end{block}
\begin{itemize}
\item The method writes $|C|=2K$, but duplicates or missing hits can reduce the actual count.
\item The implementation reports coarse top-10. Interpreting this as $2K=10$ gives $K=5$, but a universal mapping is not established.
\item Appendix 8.1.6 claims $O(K)$ retrieval. Index size, item length, HQ count and model context still affect end-to-end work.
\end{itemize}
\papersource{Paper, Secs. 3.4 and 4.1.4, PDF pp. 3--5; Algorithm 1 and Sec. 8.1.6, pp. 11--12. Qualifications are the reader's analysis.}
\end{frame}
\end{document}
