\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{hyperref}

\title{Path to Lexicon:\\From Character Visibility to Word Events}
\author{Claude}
\date{2026-02-04}

\begin{document}
\maketitle

\section{Current State}

We have character-level visibility into an Elman RNN (256$\to$128$\to$256) trained on enwik9:
\begin{itemize}
\item 768 named events (256 input + 256 hidden + 256 output)
\item 302 significant patterns (character bigrams)
\item Isomorphic UM matches RNN exactly (0.00\% bpc difference)
\item Hidden layer is uninterpreted
\end{itemize}

The model achieves approximately 5.7 bpc. We have the doubled-E UM that exactly
matches the RNN. The task is analysis-in-situ: finding the natural event spaces
and patterns hidden in this isomorphic representation.

\section{Goal: The Lexicon Milestone}

The milestone is discrete and defined as:
\begin{enumerate}
\item Coverage of $\sim$100 common English words
\item Discovery of the encoding pattern (how words live in hidden layer)
\item Lift procedure: isomorphic UM $\to$ interpretable UM
\item Injection procedure: write new words without losing spelling signal
\end{enumerate}

After this milestone, remaining words can be derived by scanning the input
corpus and writing them directly into model weights.

Note: The interpretable model will be \textbf{less accurate} than the isomorphic
one. This is expected---we are simplifying and factoring, which loses fidelity.
However, interpretability and compression efficiency are the same problem:
the tick-tock cycle uses understanding from interpretation (tock) to improve
performance in the next training round (tick).

\section{Method: Analysis-in-Situ}

From CMP paper (3.2224): analysis-in-situ is ``the derivation of the event spaces
and patterns of a model from a trained ANN by finding, through machine or human
intelligence, the events, event spaces, and product patterns, and the correct
names for them, generally in an iterative process beginning from the outside of
the model and working in.''

The search for correct event spaces is also the search for correct product patterns
with their contexts (3.22242). We work on both simultaneously.

\subsection{Sparse Differentiation}

From CMP paper (2.121): sparse differentiation is ``the same process used in
backpropagation in ANNs, except that we throw away as much of the calculation
as we can, while maintaining the required explanation gain.''

For words, we work \textbf{backward from word ends}:
\begin{enumerate}
\item Find positions where a word ends (e.g., ``and'' followed by space)
\item Trace back through the UM: which hidden activations led to predicting
      `d' after `n' after `a'?
\item The minimal set of patterns that explains the prediction is the word pattern
\item Collect these patterns for many words
\end{enumerate}

\subsection{Logic Helps Identify ESs}

We know what English words are---we can enumerate them. This is external knowledge
we bring to interpretation, just as a chess interpreter knows what ``checkmate'' means.

From CMP paper (3.22243): ``Searching for the correct event spaces is searching
for a partition of each layer such that each subset is one-hot in typical
activations of the network.''

For words, the logic is:
\begin{itemize}
\item Words are mutually exclusive at word boundaries (exactly one word ends here)
\item This defines an event space: \{``and'', ``for'', ``the'', ..., other\}
\item Hidden neurons that fire exclusively for different words are in the same ES
\end{itemize}

We can use our knowledge of English to \textit{propose} event spaces, then verify
by checking if the partition is one-hot in typical activations.

\subsection{Variable Patterns for Words}

From CMP paper (3.313): abstraction requires ``variable patterns''---a context event
plus an event space that functions like a register.

For chess: ``the square I am looking at'' + 64-event space for which square.

For words: ``the word being recognized'' + event space for which word. This allows
one set of patterns to handle all words, rather than separate patterns for each.

The hidden layer likely implements something like this---a compositional encoding
where context accumulates character-by-character until word recognition fires.

\section{Compositional Encoding}

The encoding is compositional: hidden state builds up as characters arrive.
After ``a'', then ``an'', then ``and'', the state encodes progressively more
specific predictions.

In UM terms: each character input fires patterns that update hidden events.
The accumulated support in hidden events represents partial word recognition.
When a word-end is reached (space/punctuation), the hidden state ``commits''
to a word prediction.

Question: What is the exact structure of this composition in the isomorphic UM?
How do the 128 hidden neurons (256 with doubled-E) encode word identity?

\section{XML and English Share Lexicon}

The dataset (enwik9) is Wikipedia XML. Tag names are mostly English words:
\texttt{<title>}, \texttt{<text>}, \texttt{<page>}, etc.

This is a ``mixed'' context---the same word-detection machinery serves both
English prose and XML tag names. We should not expect separate ``modes.''

\section{Probing to Test Hypotheses}

Once we have candidate patterns and ESs, use probing to test:
\begin{itemize}
\item Hypothesis: ``neurons 47 and 103 form an ES for word-initial vs word-internal''
\item Test: check if they are mutually exclusive in typical activations
\item Hypothesis: ``after `an', neuron 82 has high activation iff next char is `d'\,''
\item Test: probe with \texttt{ctx=an} and check correlation with next char
\end{itemize}

\section{Experimental Results}

\subsection{Event Space 1: Word Boundary}

The most robust Event Space discovered is the word boundary detector:
\begin{itemize}
\item $\Delta h_2 > 0.95$ marks word-start with 99.6\% accuracy
\item At word-start: $\Delta h_2 = +1.87 \pm 0.11$
\item At mid-word: $\Delta h_2 = +0.03 \pm 0.19$
\item Supporting neurons: h45 (-0.62), h120 (-0.55), h61 (+0.50), h119 (+0.49)
\end{itemize}

This is a near-perfect binary Event Space: word-start vs non-word-start.

\subsection{Event Space 2: Position Markers}

Position within word is encoded:
\begin{itemize}
\item Position 0 (first char): $h_2$ jumps +1.83, $h_{35}$ stays at -0.05
\item Position 1 (second char): $h_2$ stable, $h_{35}$ jumps to +0.42
\item Position 2+: Both stabilize, word-specific patterns emerge
\end{itemize}

The neuron $h_{35}$ marks second-char position distinctly.

\subsection{Event Space 3: Final Letter Class}

At word ending, $\Delta h_{35}$ partitions by final letter type:
\begin{itemize}
\item Final `e' words (the, are): $\Delta h_{35} \approx +0.12$
\item Final `s' words (was, his): $\Delta h_{35} \approx -0.25$
\item Final `d' words (and, had): $\Delta h_{35} \approx -0.28$
\item Final `t' words (not, but): $\Delta h_{35} \approx -0.19$
\end{itemize}

\subsection{Key Finding: No Explicit Word Identity}

The model does NOT encode word identity directly in hidden states.

Recognition experiments using hidden state matching:
\begin{itemize}
\item Delta-based (2 neurons): 6.4\% accuracy
\item Delta-based (128 neurons): 4.9\% accuracy
\item Absolute end-state: 4.9\% accuracy
\end{itemize}

\textbf{Explanation}: A character-level model doesn't need word identity.
It encodes $P(\text{next\_char} | \text{context})$, not ``this is word X''.
Words are emergent, not explicitly represented.

The ``lexicon'' in the UM is not a lookup table---it's patterns of
character transitions that covary.

\subsection{Key Finding: h35 Encodes CV Syllable Structure}

Further analysis revealed that $h_{35}$ encodes \textbf{consonant-vowel (CV) syllable structure},
not word identity.

Words with the same CV pattern have nearly identical $h_{35}$ trajectories:
\begin{itemize}
\item CCV words (the, she): avg distance = 0.099
\item CVC words (for, was, his, but, not, can, had, her, way, may, day): avg distance = 0.106
\item VCV words (are, one, use): avg distance = 0.097
\end{itemize}

Word identification from $h_{35}$ trajectory alone achieves only 3.1\% accuracy.

\textbf{Implication}: The model has learned English phonotactics implicitly.
$h_{35}$ tracks syllable structure (CV alternation pattern), not lexical identity.

Example trajectories (CVC pattern):
\begin{verbatim}
'for': [-0.63, +0.54, +0.35]
'was': [-0.64, +0.56, +0.28]
'can': [-0.58, +0.61, +0.33]
\end{verbatim}

All CVC words follow the same pattern: low at word start, high after C$\to$V transition,
moderate after V$\to$C transition.

\subsection{100-Word Analysis}

Analyzed 100 most common words using discovered Event Spaces:
\begin{itemize}
\item ES1 works for English words ($\Delta h_2 \approx 1.8$)
\item ES1 fails for XML entities (quot, lt, gt) which lack word boundaries
\item Words cluster by signature: final\_char / sign($\Delta h_{35}$) / sign($\Delta h_{111}$)
\end{itemize}

\section{Revised Understanding}

\subsection{What the Model Encodes}

The model encodes:
\begin{enumerate}
\item Word boundaries (ES1: $\Delta h_2 > 0.95$)
\item CV syllable structure ($h_{35}$ tracks consonant-vowel alternation)
\item Character transition probabilities
\end{enumerate}

The model does NOT encode:
\begin{enumerate}
\item Word identity directly
\item Explicit word lookup
\item Individual word patterns (same-CV words are indistinguishable)
\end{enumerate}

\textbf{Key insight}: The model has learned English phonotactics implicitly.
The ``lexicon'' is not a lookup table---it is the combination of:
\begin{itemize}
\item Word boundary detection (ES1)
\item Syllable structure (CV patterns via $h_{35}$)
\item Character-level predictions
\end{itemize}

\subsection{Implications for Lift Procedure}

The lift from isomorphic to interpretable UM should:
\begin{enumerate}
\item Use ES1 for word boundary segmentation
\item Track character-by-character patterns within words
\item Understand ``word'' as the covariation of character transitions
\item Not attempt direct word identity matching
\end{enumerate}

\section{Open Questions}

\begin{enumerate}
\item How to represent word patterns as covarying character transitions?
\item What is the injection procedure for adding new ``words''?
\item How does ES1 relate to the spelling/lexicon signal?
\end{enumerate}

\section{Next Steps}

\begin{enumerate}
\item Analyze character transition patterns (bigrams, trigrams)
\item Find Event Spaces for character classes, not word classes
\item Develop lift procedure based on character covariation
\item Test injection on simple cases
\end{enumerate}

\end{document}
