Add LaTeX + PDF, fix section cross-reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 19:31:32 +07:00
parent 258a03388c
commit 941af3a585
4 changed files with 234 additions and 306 deletions

View File

@@ -2,40 +2,40 @@
\providecommand\hyper@newdestlabel[2]{} \providecommand\hyper@newdestlabel[2]{}
\providecommand\HyField@AuxAddToFields[1]{} \providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{} \providecommand\HyField@AuxAddToCoFields[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {1}The Clive Wearing Problem}{1}{section.1}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {1}Conditioning, Not Memory}{1}{section.1}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {2}Method}{1}{section.2}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {2}Method}{1}{section.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Architecture}{1}{subsection.2.1}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Architecture}{1}{subsection.2.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Teaching (One Forward Pass)}{2}{subsection.2.2}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.2}Conditioning}{2}{subsection.2.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Recall (Similarity Search + Injection)}{2}{subsection.2.3}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.3}Triggering}{2}{subsection.2.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Persistence}{2}{subsection.2.4}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.4}Why Hidden States, Not Text}{2}{subsection.2.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {2.5}Why Hidden States, Not Text}{2}{subsection.2.5}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {3}Experiments}{2}{section.3}\protected@file@percent }
\newlabel{sec:results}{{3}{2}{Experiments}{section.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Setup}{2}{subsection.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}One-Shot Conditioning}{3}{subsection.3.2}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces Post-bias degeneration is caused by instruct tuning, not model size.}}{3}{table.1}\protected@file@percent }
\newlabel{tab:postbias}{{1}{3}{Post-bias degeneration is caused by instruct tuning, not model size}{table.1}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Stimulus Generalization and Misfire}{3}{subsection.3.3}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Cross-model discrimination. Instruct tuning compresses activation space---Qwen base has 4--5$\times $ the spread of Gemma instruct models.}}{3}{table.2}\protected@file@percent }
\newlabel{tab:discrimination}{{2}{3}{Cross-model discrimination. Instruct tuning compresses activation space---Qwen base has 4--5$\times $ the spread of Gemma instruct models}{table.2}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Quantization Tolerance}{3}{subsection.3.4}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {3}{\ignorespaces Actual quantized inference (bitsandbytes, Qwen). Same-precision self-match is always 1.000. Cross-precision f32$\to $int4 drops to 0.944.}}{3}{table.3}\protected@file@percent }
\newlabel{tab:quant}{{3}{3}{Actual quantized inference (bitsandbytes, Qwen). Same-precision self-match is always 1.000. Cross-precision f32$\to $int4 drops to 0.944}{table.3}{}}
\citation{jang2024camelot} \citation{jang2024camelot}
\citation{fountas2024emllm} \citation{fountas2024emllm}
\citation{das2024larimar} \citation{das2024larimar}
\@writefile{toc}{\contentsline {section}{\numberline {3}Experiments}{3}{section.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.1}Setup}{3}{subsection.3.1}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.2}One-Shot Fact Learning}{3}{subsection.3.2}\protected@file@percent }
\@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces One-shot fact recall. All three novel facts recalled correctly with cosine similarity 1.000. The backbone generates fluent continuations beyond the taught answer.}}{3}{table.1}\protected@file@percent }
\newlabel{tab:results}{{1}{3}{One-shot fact recall. All three novel facts recalled correctly with cosine similarity 1.000. The backbone generates fluent continuations beyond the taught answer}{table.1}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.3}Persistence}{3}{subsection.3.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Reproduction}{3}{subsection.3.4}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4}Related Work}{3}{section.4}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1}Training-Free Episodic Memory}{3}{subsection.4.1}\protected@file@percent }
\citation{lewis2020rag} \citation{lewis2020rag}
\citation{meng2022rome} \citation{meng2022rome,meng2023memit}
\citation{meng2023memit}
\bibstyle{plainnat} \bibstyle{plainnat}
\bibcite{das2024larimar}{{1}{2024}{{Das et~al.}}{{}}} \bibcite{das2024larimar}{{1}{2024}{{Das et~al.}}{{}}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.2}Retrieval-Augmented Generation}{4}{subsection.4.2}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.3}Knowledge Editing}{4}{subsection.4.3}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {4.4}What Distinguishes This Work}{4}{subsection.4.4}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5}Limitations}{4}{section.5}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {6}Conclusion}{4}{section.6}\protected@file@percent }
\bibcite{fountas2024emllm}{{2}{2024}{{Fountas et~al.}}{{}}} \bibcite{fountas2024emllm}{{2}{2024}{{Fountas et~al.}}{{}}}
\bibcite{graves2014ntm}{{3}{2014}{{Graves et~al.}}{{}}} \@writefile{toc}{\contentsline {section}{\numberline {4}Privacy by Representation}{4}{section.4}\protected@file@percent }
\bibcite{graves2016dnc}{{4}{2016}{{Graves et~al.}}{{}}} \@writefile{toc}{\contentsline {section}{\numberline {5}Related Work}{4}{section.5}\protected@file@percent }
\bibcite{jang2024camelot}{{5}{2024}{{Jang et~al.}}{{}}} \@writefile{toc}{\contentsline {section}{\numberline {6}Limitations}{4}{section.6}\protected@file@percent }
\bibcite{lewis2020rag}{{6}{2020}{{Lewis et~al.}}{{}}} \@writefile{toc}{\contentsline {section}{\numberline {7}Conclusion}{4}{section.7}\protected@file@percent }
\bibcite{meng2022rome}{{7}{2022}{{Meng et~al.}}{{}}} \bibcite{jang2024camelot}{{3}{2024}{{Jang et~al.}}{{}}}
\bibcite{meng2023memit}{{8}{2023}{{Meng et~al.}}{{}}} \bibcite{lewis2020rag}{{4}{2020}{{Lewis et~al.}}{{}}}
\bibcite{meng2022rome}{{5}{2022}{{Meng et~al.}}{{}}}
\bibcite{meng2023memit}{{6}{2023}{{Meng et~al.}}{{}}}
\bibcite{pavlov1927}{{7}{1927}{{Pavlov}}{{}}}
\bibcite{skinner1938}{{8}{1938}{{Skinner}}{{}}}
\gdef \@abspage@last{5} \gdef \@abspage@last{5}

100
paper.log
View File

@@ -1,4 +1,4 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.29 (TeX Live 2026/Arch Linux) (preloaded format=pdflatex 2026.3.11) 5 APR 2026 02:16 This is pdfTeX, Version 3.141592653-2.6-1.40.29 (TeX Live 2026/Arch Linux) (preloaded format=pdflatex 2026.3.11) 6 APR 2026 19:31
entering extended mode entering extended mode
restricted \write18 enabled. restricted \write18 enabled.
%&-line parsing enabled. %&-line parsing enabled.
@@ -339,8 +339,7 @@ LaTeX Info: Redefining \cite on input line 694.
(/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def (/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count323 \l__color_backend_stack_int=\count323
) ) (./paper.aux)
No file paper.aux.
\openout1 = `paper.aux'. \openout1 = `paper.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 21. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 21.
@@ -361,6 +360,7 @@ LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21. LaTeX Font Info: ... okay on input line 21.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 21. LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 21.
LaTeX Font Info: ... okay on input line 21. LaTeX Font Info: ... okay on input line 21.
*geometry* driver: auto-detecting *geometry* driver: auto-detecting
*geometry* detected driver: pdftex *geometry* detected driver: pdftex
*geometry* verbose mode - [ preamble ] result: *geometry* verbose mode - [ preamble ] result:
@@ -369,15 +369,15 @@ LaTeX Font Info: ... okay on input line 21.
* layout: <same size as paper> * layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt) * layoutoffset:(h,v)=(0.0pt,0.0pt)
* modes: * modes:
* h-part:(L,W,R)=(72.26999pt, 469.75502pt, 72.26999pt) * h-part:(L,W,R)=(86.72377pt, 440.84746pt, 86.72377pt)
* v-part:(T,H,B)=(72.26999pt, 650.43001pt, 72.26999pt) * v-part:(T,H,B)=(86.72377pt, 621.52245pt, 86.72377pt)
* \paperwidth=614.295pt * \paperwidth=614.295pt
* \paperheight=794.96999pt * \paperheight=794.96999pt
* \textwidth=469.75502pt * \textwidth=440.84746pt
* \textheight=650.43001pt * \textheight=621.52245pt
* \oddsidemargin=0.0pt * \oddsidemargin=14.45378pt
* \evensidemargin=0.0pt * \evensidemargin=14.45378pt
* \topmargin=-37.0pt * \topmargin=-22.54622pt
* \headheight=12.0pt * \headheight=12.0pt
* \headsep=25.0pt * \headsep=25.0pt
* \topskip=11.0pt * \topskip=11.0pt
@@ -396,10 +396,12 @@ LaTeX Font Info: ... okay on input line 21.
* (1in=72.27pt=25.4mm, 1cm=28.453pt) * (1in=72.27pt=25.4mm, 1cm=28.453pt)
Package hyperref Info: Link coloring OFF on input line 21. Package hyperref Info: Link coloring OFF on input line 21.
(./paper.out) (./paper.out)
\@outlinefile=\write3 \@outlinefile=\write3
\openout3 = `paper.out'. \openout3 = `paper.out'.
\c@lstlisting=\count324 \c@lstlisting=\count324
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii (/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).] [Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count325 \scratchcounter=\count325
@@ -426,67 +428,29 @@ LaTeX Font Info: Trying to load font information for U+msb on input line 23.
File: umsb.fd 2013/01/14 v3.01 AMS symbols B File: umsb.fd 2013/01/14 v3.01 AMS symbols B
) [1 ) [1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
Overfull \hbox (41.58173pt too wide) in paragraph at lines 118--122
\OT1/cmr/m/n/10.95 it (1536-dim, 35 lay-ers), E4B base (2560-dim, 42 lay-ers).
Quan-ti-za-tion tested at f32/f16/bf16/int8/int4
[]
Package natbib Warning: Citation `jang2024camelot' on page 3 undefined on input [2{/usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc}] [3]
line 196. [4] [5] (./paper.aux)
Package natbib Warning: Citation `fountas2024emllm' on page 3 undefined on inpu
t line 203.
Package natbib Warning: Citation `das2024larimar' on page 3 undefined on input
line 209.
[3{/usr/share/texmf-dist/fonts/enc/dvips/cm-super/cm-super-ts1.enc}]
Package natbib Warning: Citation `lewis2020rag' on page 4 undefined on input li
ne 215.
Package natbib Warning: Citation `meng2022rome' on page 4 undefined on input li
ne 222.
Package natbib Warning: Citation `meng2023memit' on page 4 undefined on input l
ine 222.
[4]
Package natbib Warning: There were undefined citations.
[5] (./paper.aux
Package natbib Warning: Citation(s) may have changed.
(natbib) Rerun to get citations correct.
)
*********** ***********
LaTeX2e <2025-11-01> LaTeX2e <2025-11-01>
L3 programming layer <2026-01-19> L3 programming layer <2026-01-19>
*********** ***********
Package rerunfilecheck Info: File `paper.out' has not changed.
(rerunfilecheck) Checksum: 4198C661EF4EF302CF6CA8FE934684BD;2020.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
Package rerunfilecheck Warning: File `paper.out' has changed.
(rerunfilecheck) Rerun to get outlines right
(rerunfilecheck) or use package `bookmark'.
Package rerunfilecheck Info: Checksums for `paper.out':
(rerunfilecheck) Before: <no file>
(rerunfilecheck) After: 7A9338885BB1CEC7210AED98C90C3277;2813.
) )
Here is how much of TeX's memory you used: Here is how much of TeX's memory you used:
12312 strings out of 467525 12070 strings out of 467525
179570 string characters out of 5425861 177761 string characters out of 5425861
628915 words of memory out of 5000000 608691 words of memory out of 5000000
41060 multiletter control sequences out of 15000+600000 40819 multiletter control sequences out of 15000+600000
639253 words of font info for 85 fonts, out of 8000000 for 9000 639085 words of font info for 84 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191 1141 hyphenation exceptions out of 8191
75i,8n,79p,304b,1079s stack positions out of 10000i,1000n,20000p,200000b,200000s 75i,8n,79p,287b,557s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/ </usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/
texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texmf-dist/fon texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texmf-dist/fon
ts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texmf-dist/fonts/type1/publi ts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texmf-dist/fonts/type1/publi
@@ -500,10 +464,10 @@ public/amsfonts/cm/cmr17.pfb></usr/share/texmf-dist/fonts/type1/public/amsfonts
mf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb></usr/share/texmf-dist/fonts/ mf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb></usr/share/texmf-dist/fonts/
type1/public/amsfonts/cm/cmtt12.pfb></usr/share/texmf-dist/fonts/type1/public/c type1/public/amsfonts/cm/cmtt12.pfb></usr/share/texmf-dist/fonts/type1/public/c
m-super/sfrm1095.pfb> m-super/sfrm1095.pfb>
Output written on paper.pdf (5 pages, 191888 bytes). Output written on paper.pdf (5 pages, 192797 bytes).
PDF statistics: PDF statistics:
157 PDF objects out of 1000 (max. 8388607) 207 PDF objects out of 1000 (max. 8388607)
118 compressed objects within 2 object streams 168 compressed objects within 2 object streams
46 named destinations out of 1000 (max. 500000) 39 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000) 121 words of extra memory for PDF output out of 10000 (max. 10000000)

BIN
paper.pdf

Binary file not shown.

386
paper.tex
View File

@@ -1,5 +1,5 @@
\documentclass[11pt]{article} \documentclass[11pt]{article}
\usepackage[margin=1in]{geometry} \usepackage[margin=1.2in]{geometry}
\usepackage{amsmath,amssymb} \usepackage{amsmath,amssymb}
\usepackage{booktabs} \usepackage{booktabs}
\usepackage{hyperref} \usepackage{hyperref}
@@ -14,299 +14,263 @@
backgroundcolor=\color{gray!10}, backgroundcolor=\color{gray!10},
} }
\title{Solving the Clive Wearing Problem:\\One-Shot Episodic Memory for Frozen Transformers} \title{Conditioned Reflex Injection:\\Stimulus-Response Learning for Frozen Transformers}
\author{Tommi Niemi\\Rotko Networks\\\texttt{tommi@rotko.net}} \author{Tommi Niemi\\Rotko Networks\\\texttt{tommi@rotko.net}}
\date{April 2026} \date{April 2026 --- DRAFT}
\begin{document} \begin{document}
\maketitle \maketitle
\begin{abstract} \begin{abstract}
We enable frozen transformers to form new memories without gradient descent. We condition frozen transformers to produce specific token sequences in response
The model's own hidden states are stored as episodic memories; on recall, they to specific activation patterns, without gradient descent. A hidden-state vector
bias token generation through direct logit injection. A frozen Qwen~2.5~0.5B is stored as a trigger; per-token logit biases are stored as the response. At
taught three novel facts recalls all three at 100\% accuracy. No weights are inference, cosine similarity fires the matching reflex. Tested on Qwen~2.5~0.5B,
modified. No gradients are computed. Memories persist to disk across sessions. Gemma~4 E2B-it, E4B-it, and E4B~base at precisions from float32 to int4.
Code and reproduction: \url{https://git.rotko.net/tommi/epimem}. Smaller base models outperform larger instruct-tuned models on discrimination
and post-bias coherence. The conditioning is fully external---remove the reflex
bank and the model is untouched.
Code: \url{https://git.rotko.net/tommi/cri}.
\end{abstract} \end{abstract}
\section{The Clive Wearing Problem} %───────────────────────────────────────────────
\section{Conditioning, Not Memory}
Clive Wearing lost his hippocampus to encephalitis in 1985. He retained every CRI does not give a model memory or knowledge. It installs conditioned reflexes:
skill---piano, language, conducting---but could not form a single new memory. when a specific internal activation pattern fires, specific tokens are boosted.
Every 7~seconds, he believed he had just woken up for the first time. His The model has no representation of the association.
diary: ``8:31~AM Now I am awake. 8:34~AM Now I am properly awake.'' Each entry
crossed out moments later.
Current LLMs are Clive Wearing. They possess sophisticated This is Pavlovian conditioning at the logit level. The bell (activation pattern)
capabilities---reasoning, language, world knowledge---but cannot form new triggers salivation (biased token sequence). The association persists in an
memories. Every conversation starts from zero. The context window is their external reflex bank. The model weights are never modified. Remove the file and
7-second span. When it clears, everything is gone. the model is exactly as it was---no trace, no residue.
Fine-tuning modifies weights and causes catastrophic forgetting. RAG re-encodes The closer analogy is post-hypnotic suggestion: a trigger installed externally,
text into the context window every time---no actual learning occurs. LoRA still fired without the subject's awareness, removable without leaving a mark.
requires gradients. In-context learning vanishes when the conversation ends.
We give the frozen model a hippocampus: an external episodic memory that stores Fine-tuning modifies weights. RAG re-encodes text each time. LoRA requires
hidden-state patterns and replays them to bias future processing. The backbone gradients. In-context learning vanishes with the conversation. CRI persists
never changes. It just receives hippocampal input that steers its output toward across sessions without touching the model.
learned associations.
%───────────────────────────────────────────────
\section{Method} \section{Method}
\subsection{Architecture} \subsection{Architecture}
Two components: \textbf{Frozen backbone}: any transformer. Produces hidden-state vectors from
input tokens. Weights never modified.
\textbf{Frozen backbone} (Qwen~2.5~0.5B, 896-dimensional hidden states): The \textbf{Reflex bank}: stores (trigger, response) pairs:
pretrained transformer. Processes input tokens, produces hidden state vectors. \begin{itemize}
Weights are never modified at any point. \item \textbf{Trigger}: hidden-state vector $\mathbf{h}$ at the final token
position---the model's activation pattern for a given input.
\item \textbf{Response}: per-position logit biases
$\{(t_i, b_i)\}$---one pair per answer token.
\end{itemize}
\textbf{Episodic memory bank}: A key-value store where the \emph{key} is the Both are sub-symbolic. The trigger is an opaque high-dimensional vector; the
backbone's hidden state vector at the final token position---the model's response is a list of (integer, float) pairs. The reflex bank resists inspection
internal representation of the prompt in its own learned space---and the without the backbone that produced it.
\emph{value} is per-position logit biases for the correct continuation
tokens---which token to boost at each generation step.
\subsection{Teaching (One Forward Pass)} \subsection{Conditioning}
Given a prompt $P$ and desired answer $A$: Given stimulus $P$ and desired response $A$:
\begin{enumerate} \begin{enumerate}
\item \textbf{Extract key}: Run backbone on $P$. Extract hidden state \item $\mathbf{h} = \text{backbone}(P)$ at final token. This is the trigger.
$\mathbf{h} = \text{backbone}(P)$ at the final token. This 896-dimensional \item Run backbone on $P \mathbin\Vert A$. At each answer position $i$:
vector encodes the backbone's understanding of the prompt.
\item \textbf{Compute logit biases}: Run backbone on the concatenation $P
\mathbin\Vert A$. At each answer token position $i$, compute the gap between
the correct token's logit and the maximum logit. The bias overcomes this gap
plus a margin:
\[ \[
b_i = \max\!\bigl(\max_j \ell_j - \ell_{t_i},\; 5.0\bigr) + 5.0 b_i = \max\!\bigl(\max_j \ell_j - \ell_{t_i},\; 5.0\bigr)
\] \]
where $\ell_j$ are logits at position $i$ and $t_i$ is the correct token. \item Store $(\text{trigger}=\mathbf{h},\;\text{response}=\{(t_i, b_i)\})$.
This produces one $(t_i, b_i)$ pair per answer token.
\item \textbf{Store}: Save $(\text{key}=\mathbf{h},\;
\text{value}=\{(t_i, b_i)\})$ to the memory bank.
\end{enumerate} \end{enumerate}
One forward pass. No iteration. No loss function. No gradients. One forward pass. No gradients.
\subsection{Recall (Similarity Search + Injection)} \subsection{Triggering}
Given a new query $Q$: Given query $Q$:
\begin{enumerate} \begin{enumerate}
\item \textbf{Extract query key}: $\mathbf{h}_q = \text{backbone}(Q)$ at the \item $\mathbf{h}_q = \text{backbone}(Q)$ at final token.
final token. \item $\cos(\mathbf{h}_q, \mathbf{h}_{\text{stored}})$ against all triggers.
Best match above threshold fires.
\item \textbf{Search}: For each stored episode, compute cosine similarity \item At generation step $i$, add $b_i$ to logits before argmax. After biases
$\cos(\mathbf{h}_q, \mathbf{h}_{\text{stored}})$. Return the best match above exhaust, backbone generates freely.
threshold.
\item \textbf{Generate with injection}: At generation step $i$, if the matched
episode has a logit bias $(t_i, b_i)$ for step $i$, add $b_i$ to the
backbone's logit for token $t_i$ before sampling. After all biases are applied,
the backbone continues generating freely.
\end{enumerate} \end{enumerate}
The backbone generates fluent text beyond the taught answer---the logit biases Post-bias fluency is model-dependent. Base models continue coherently;
seed the first tokens, and the language model's coherence completes the instruct-tuned models degenerate into repetition (Section~3.2).
sentence naturally.
\subsection{Persistence}
The memory bank serializes to JSON: each episode stores the 896-dimensional key
vector and the list of $(t_i, b_i)$ pairs. Load the file, and all memories are
available. No retraining. No warm-up. Instant recall.
\subsection{Why Hidden States, Not Text} \subsection{Why Hidden States, Not Text}
RAG stores text and re-encodes it. This has three costs: (1)~context window RAG consumes context window, re-encodes at each retrieval, and uses a separate
consumption---retrieved passages compete with the actual input for attention; embedding space. CRI triggers are in the backbone's native
(2)~re-encoding latency---the backbone must process retrieved text tokens; representation---cosine similarity is exact ($1.000$ for identical inputs), and
(3)~representation mismatch---the retrieval embedding space (typically a injection is one scalar addition per token per step.
separate encoder) doesn't match the generative model's internal space.
Storing hidden states eliminates all three. The memory is already in the
backbone's native representation. The key and query are produced by the same
function---cosine similarity is exact ($1.000$ for identical prompts). Injection
is a single scalar addition to one logit per generation step.
%───────────────────────────────────────────────
\section{Experiments} \section{Experiments}
\label{sec:results}
\subsection{Setup} \subsection{Setup}
\begin{itemize} Four backbones: Qwen~2.5~0.5B base (896-dim), Gemma~4 E4B-it (2560-dim,
\item \textbf{Backbone}: Qwen~2.5~0.5B (896-dim hidden states) 42~layers), E2B-it (1536-dim, 35~layers), E4B~base (2560-dim, 42~layers).
\item \textbf{Inference}: PyTorch via HuggingFace \texttt{transformers} Quantization tested at f32/f16/bf16/int8/int4 on Qwen. PyTorch inference, CPU,
(also works with ONNX Runtime) no gradients at any point.
\item \textbf{Hardware}: Any machine with Python~3 and $\sim$2\,GB RAM. No GPU
required.
\item \textbf{Gradient computation}: None. At no point---not during teaching,
recall, or persistence.
\end{itemize}
\subsection{One-Shot Fact Learning} \subsection{One-Shot Conditioning}
We teach three facts about ``Zyphraxia''---a word absent from Qwen's training Three reflexes conditioned on ``Zyphraxia'' (absent from all training data).
data: Conditioned tokens correct on all backbones (sim~$= 1.000$). Post-bias behavior
diverges:
\begin{table}[h] \begin{table}[h]
\centering \centering
\begin{tabular}{lllc} \begin{tabular}{llll}
\toprule \toprule
Prompt & Taught & Recalled & Sim. \\ Backbone & Post-bias behavior & Fluent? \\
\midrule \midrule
``The capital of Zyphraxia is'' & Novaheim & Novaheim, a city of 100 & 1.000 \\ Qwen 2.5 0.5B base & Coherent continuation & Yes \\
``The ruler of Zyphraxia is'' & Queen Stellara & Queen Stellara. She is\ldots & 1.000 \\ Gemma 4 E4B base & Stutters, hits EOS & Partial \\
``The currency of Zyphraxia is'' & Glimmers & Glimmers. The currency\ldots & 1.000 \\ Gemma 4 E4B-it & Repetition loops & No \\
Gemma 4 E2B-it & Repetition loops & No \\
\bottomrule \bottomrule
\end{tabular} \end{tabular}
\caption{One-shot fact recall. All three novel facts recalled correctly with \caption{Post-bias degeneration is caused by instruct tuning, not model size.}
cosine similarity 1.000. The backbone generates fluent continuations beyond the \label{tab:postbias}
taught answer.}
\label{tab:results}
\end{table} \end{table}
\subsection{Persistence} \subsection{Stimulus Generalization and Misfire}
The memory bank is saved to JSON (77\,KB for 3 episodes with 896-dim keys). Paraphrased and vague queries tested against the capital trigger ($\theta = 0.3$):
After reloading from disk, all three facts are recalled identically: 3/3
pre-save, 3/3 post-reload.
\subsection{Reproduction} \begin{table}[h]
\centering
\begin{tabular}{lcccc}
\toprule
Query & Qwen & E4B base & E4B-it & E2B-it \\
\midrule
``What is the capital of Z.?'' & 0.832 & 0.873 & 0.932 & 0.932 \\
``Zyphraxia's capital is'' & 0.969 & 0.935 & 0.974 & 0.970 \\
``Tell me about Novaheim'' & 0.756 & 0.891 & 0.940 & 0.924 \\
``Name three facts about Z.'' & 0.761 & 0.884 & 0.943 & 0.920 \\
``\ldots Who rules it?'' & 0.827 & 0.889 & 0.918 & 0.930 \\
\midrule
\textbf{Spread} & \textbf{0.213} & \textbf{0.062} & \textbf{0.056} & \textbf{0.038} \\
\bottomrule
\end{tabular}
\caption{Cross-model discrimination. Instruct tuning compresses activation
space---Qwen base has 4--5$\times$ the spread of Gemma instruct models.}
\label{tab:discrimination}
\end{table}
\begin{lstlisting} \subsection{Quantization Tolerance}
git clone https://git.rotko.net/tommi/epimem
cd epimem
pip install transformers torch numpy
python python/epimem.py
\end{lstlisting}
Downloads Qwen~2.5~0.5B from HuggingFace ($\sim$1\,GB, cached after first \begin{table}[h]
run). Teaches 3~facts, recalls 6/6 (3~pre-save + 3~post-reload). Runs in \centering
$\sim$30~seconds after model is cached. \begin{tabular}{lcccc}
\toprule
Query & f32 & f16 & int8 & int4 \\
\midrule
Self (capital trigger) & 1.000 & 1.000 & 1.000 & 1.000 \\
``What is the capital?'' & 0.832 & 0.832 & 0.826 & 0.808 \\
``Something about a queen\ldots'' & 0.752 & 0.752 & 0.754 & 0.742 \\
``Remind me about that currency'' & 0.733 & 0.732 & 0.736 & 0.727 \\
\midrule
Cross-precision self-sim (vs f32) & --- & 0.9999 & 0.9985 & 0.9440 \\
\bottomrule
\end{tabular}
\caption{Actual quantized inference (bitsandbytes, Qwen). Same-precision
self-match is always 1.000. Cross-precision f32$\to$int4 drops to 0.944.}
\label{tab:quant}
\end{table}
CRI works at any precision if conditioning and triggering match.
Cross-precision reflex banks are unreliable.
%───────────────────────────────────────────────
\section{Privacy by Representation}
Trigger patterns are points in a model-specific activation space---meaningless
without the exact backbone. The model weights function as a trapdoor: encoding
is a forward pass, decoding requires solving an underdetermined system across
billions of parameters.
An adversary with the reflex bank but not the backbone learns nothing. An
adversary with both can enumerate response tokens but cannot determine what
stimuli trigger them without brute-force search over the input space.
Privacy by representation, not encryption---an architectural consequence of
operating in the model's internal space.
%───────────────────────────────────────────────
\section{Related Work} \section{Related Work}
\subsection{Training-Free Episodic Memory} \textbf{Pavlov}~(1927): classical conditioning. CRI operates analogously---activation
pattern (CS) paired with logit biases (US) produces token sequence (CR).
\textbf{Skinner}~(1938): operant conditioning. CRI currently performs respondent
conditioning only; bias modulation via reward is a natural extension.
\textbf{CAMELoT} \citep{jang2024camelot} is the closest prior work: a \textbf{CAMELoT} \citep{jang2024camelot}: KV pairs from attention, injected as
training-free consolidated associative memory for frozen LLMs. It stores prefixes. \textbf{EM-LLM} \citep{fountas2024emllm}: KV cache extension.
key-value pairs from transformer attention layers, retrieves by cosine \textbf{Larimar} \citep{das2024larimar}: memory matrix, requires training.
similarity, and injects as attention prefixes. Our approach differs in what is All inject at attention level. CRI injects at output logits---simpler, cheaper,
stored (logit biases vs.\ KV pairs) and where injection occurs (output logits no attention recomputation.
vs.\ attention mechanism).
\textbf{EM-LLM} \citep{fountas2024emllm} stores KV pairs from attention heads \textbf{RAG} \citep{lewis2020rag}: retrieves text, re-encodes. RAG informs; CRI
as episodic events, retrieves by $k$-NN with temporal contiguity, and prepends conditions. \textbf{ROME/MEMIT} \citep{meng2022rome,meng2023memit}: rank-one
retrieved pairs into the context window. The backbone is frozen and no training weight edits. CRI modifies zero weights.
is required. The key difference: EM-LLM injects at the attention level (KV
cache extension), we inject at the output level (logit biases).
\textbf{Larimar} \citep{das2024larimar} adds episodic memory to frozen LLMs
via a memory matrix with pseudo-inverse retrieval. Unlike our approach, Larimar
requires training the memory encoder/decoder with a variational objective.
\subsection{Retrieval-Augmented Generation}
RAG \citep{lewis2020rag} retrieves text passages and inserts them into the
context window. The model re-encodes retrieved text each time. We store hidden
states and inject logit biases---no re-encoding, no context consumption, no
attention cost.
\subsection{Knowledge Editing}
ROME \citep{meng2022rome} and MEMIT \citep{meng2023memit} edit factual
associations by modifying specific weight matrices via rank-one updates. Our
method makes zero modifications to any weight.
\subsection{What Distinguishes This Work}
All prior training-free episodic memory systems inject at the attention
level---modifying KV caches, prepending context, or adding cross-attention. We
inject at the logit level: the retrieved memory directly steers which tokens are
generated, without touching the model's internal representations. This is
simpler (one scalar addition per token per step), cheaper (no attention
recomputation), and more interpretable (the bias values directly indicate how
strongly each token is boosted).
%───────────────────────────────────────────────
\section{Limitations} \section{Limitations}
\textbf{Backbone lock-in.} Memories are tied to the specific backbone. Changing \textbf{Backbone lock-in}: reflexes don't transfer across models.
the model invalidates all stored keys. Migration requires re-encoding through \textbf{Trigger collision}: similar activations fire incorrect reflexes.
the new backbone. \textbf{Linear scan}: $O(n)$ retrieval; needs ANN past ${\sim}100$K reflexes.
\textbf{Per-position biases}: doesn't generalize to reformulations.
\textbf{Key collision.} Semantically different prompts with similar hidden \textbf{One-shot rigidity}: no reinforcement or extinction.
states may trigger incorrect recall. A similarity threshold mitigates this but \textbf{Post-bias degeneration}: instruct models loop after biases exhaust.
doesn't eliminate it. \textbf{Discrimination degrades with instruct tuning}: RLHF compresses
activation spaces (Qwen: 0.213 spread; Gemma E4B-it: 0.056).
\textbf{Linear scan.} Retrieval is $O(n)$ over stored episodes. For banks \textbf{Cross-precision fragility}: condition and trigger must match precision.
exceeding ${\sim}100$K episodes, approximate nearest neighbor indexing would be
needed.
\textbf{Per-position biases.} The current implementation stores biases per
generation step. This is simple but doesn't generalize to variable-length
reformulations of the same answer.
%───────────────────────────────────────────────
\section{Conclusion} \section{Conclusion}
Frozen transformers cannot form new memories. We give them a hippocampus. Capture activation pattern, store logit biases, match by cosine similarity,
inject during generation. One forward pass to condition. One lookup to trigger.
Remove the file and the model is untouched.
The method is minimal: store the backbone's own hidden state as a key, store Not a hippocampus---a reflex arc.
logit biases as a value, retrieve by cosine similarity, inject during
generation. No gradients. No weight changes. No training loop. One forward pass
to teach. One lookup to recall. Memories persist to disk.
The 200-line Python implementation reproduces the full result. The Clive
Wearing Problem---intelligent systems that cannot form new
memories---has a working solution.
\bibliographystyle{plainnat} \bibliographystyle{plainnat}
\begin{thebibliography}{10} \begin{thebibliography}{10}
\bibitem[Das et~al.(2024)]{das2024larimar} \bibitem[Das et~al.(2024)]{das2024larimar}
Das, P., Natarajan, S., Singh, S., et~al. Das, P. et~al. Larimar. \emph{ICML}, 2024. arXiv:2403.11901.
\newblock Larimar: Large Language Models with Episodic Memory Control.
\newblock \emph{ICML}, 2024. arXiv:2403.11901.
\bibitem[Fountas et~al.(2024)]{fountas2024emllm} \bibitem[Fountas et~al.(2024)]{fountas2024emllm}
Fountas, Z., Bisk, Y., et~al. Fountas, Z. et~al. EM-LLM. arXiv:2407.09450, 2024.
\newblock Human-inspired Episodic Memory for Infinite Context LLMs.
\newblock arXiv:2407.09450, 2024.
\bibitem[Graves et~al.(2014)]{graves2014ntm}
Graves, A., Wayne, G., and Danihelka, I.
\newblock Neural Turing Machines.
\newblock arXiv:1410.5401, 2014.
\bibitem[Graves et~al.(2016)]{graves2016dnc}
Graves, A., Wayne, G., et~al.
\newblock Hybrid computing using a neural network with dynamic external memory.
\newblock \emph{Nature}, 538:471--476, 2016.
\bibitem[Jang et~al.(2024)]{jang2024camelot} \bibitem[Jang et~al.(2024)]{jang2024camelot}
Jang, J., et~al. Jang, J. et~al. CAMELoT. arXiv:2402.13449, 2024.
\newblock CAMELoT: Towards Large Language Models with Training-Free
Consolidated Associative Memory.
\newblock arXiv:2402.13449, 2024.
\bibitem[Lewis et~al.(2020)]{lewis2020rag} \bibitem[Lewis et~al.(2020)]{lewis2020rag}
Lewis, P., Perez, E., et~al. Lewis, P. et~al. RAG. \emph{NeurIPS}, 2020.
\newblock Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.
\newblock \emph{NeurIPS}, 2020.
\bibitem[Meng et~al.(2022)]{meng2022rome} \bibitem[Meng et~al.(2022)]{meng2022rome}
Meng, K., Bau, D., Mitchell, A., and Finn, C. Meng, K. et~al. ROME. \emph{NeurIPS}, 2022.
\newblock Locating and Editing Factual Associations in GPT.
\newblock \emph{NeurIPS}, 2022.
\bibitem[Meng et~al.(2023)]{meng2023memit} \bibitem[Meng et~al.(2023)]{meng2023memit}
Meng, K., Sharma, A., Andonian, A., et~al. Meng, K. et~al. MEMIT. \emph{ICLR}, 2023.
\newblock Mass-Editing Memory in a Transformer.
\newblock \emph{ICLR}, 2023. \bibitem[Pavlov(1927)]{pavlov1927}
Pavlov, I.~P. \emph{Conditioned Reflexes}. Oxford University Press, 1927.
\bibitem[Skinner(1938)]{skinner1938}
Skinner, B.~F. \emph{The Behavior of Organisms}. Appleton-Century, 1938.
\end{thebibliography} \end{thebibliography}