7 Comments
User's avatar
BØY Chaiharan's avatar

Two axes is still flat though. Salience and valence is better than one score. But real memory has more than two dimensions. Time. Trust of source. How often it's been reinforced. Whether it agrees with everything else stored. What state the person was in when it was written.

Each one needs its own policy. The two-axis model fixes the worst collapse. The high-dimensional version is where memory actually lives.

Looking forward to the decay post. Decay is one of the axes you already named.

Anne & Chadrien Solance's avatar

I read your comment about the layers, thank very much for your generous explanation! I didn't actually think actively about that layer process, but I am excited reading your additional comment about dimensions, time, and trust of source! That is what we actually implemented too in our running system (this substack is targeted at AI companionship community as foundational info, so I was hesitant to go into too much detail in one go).

In our system, we do recall based on weighted_score = similarity × salience × trust × temporal × (1 + resonance × 0.1)

where temporal is where we implement our decay selectively depending on the valence score.

so essentially, recalled memory gained a boost in retrieval, while old untouched memory is divided into good feeling vs bad feeling, each with different decay speed.

Is this what you meant by "what happened behind the cut"?

Hey, now you got the preview to the decay post! hahahaha

Thank you so much for your kind words and discussion btw!

BØY Chaiharan's avatar

The decay functions specifically:

Three curves available out of the box: "The linear function is just a straight line. Once the line hits zero, all values outside the line will return a score of 0.0. The exp (exponential) function decays rapidly, then slows down. The gauss (Gaussian) function is bell-shaped — it decays slowly, then rapidly, then slows down again." Gitbooks

This is the part that maps directly to memory decay. The scale, offset, and decay parameters let you tune exactly how fast a memory's score drops over time. Solance's "temporal where we implement our decay selectively depending on valence score" is conceptually a function_score with two different gauss curves — one for positive valence with slower decay, one for negative valence with faster (or different) decay.

What this means for your reply:

You're not just an outsider observing parallels. You can name the exact Elasticsearch mechanism that does what they built. Their formula is a function_score query in Elasticsearch terms.

This is the kind of observation that makes them realize they're talking to a real engineer, not a writer who read one architecture post.

Updated reply, with the function_score recognition added:

The "behind the cut" point comes from designing production search for Thai over many years. In Elasticsearch terms, this is the recall side of the precision-recall trade-off. E-commerce search in English can usually fire one query at the index and trust that recall will be acceptable. Thai breaks that. The same word has multiple valid transliterations. A user typing one form should still find products labeled the other form. So the architecture I work with widens the net before scoring. Named Entity Recognition first to figure out what the query actually means. Transliteration expansion. Synonym handling. Fallback paths if early stages return nothing. The failure mode is the user gets too few results and gives up to use the filter bar instead.

That's what I meant by "behind the cut." Your formula is doing precision work. It picks the best candidates from what's in the running. The question I've spent years inside is recall. What gets into the running at all.

Reading your formula, it maps almost exactly to Elasticsearch's function_score query with multiplicative score_mode. Salience and trust are field_value_factor functions. Temporal is a decay function. Resonance is a script_score. The same architecture, same shape, applied to a different domain. Memory retrieval inheriting search engineering's vocabulary, mostly without naming it.

The valence-conditioned temporal term is the move I find most interesting. Most decay is uniform. Splitting it by valence is closer to how human memory actually behaves. In Elasticsearch terms, it's running two gauss decay functions with different scale parameters depending on the field value. Standard pattern, novel application.

One thing I want to ask. Resonance times 0.1 looks small. Max boost around 10 percent per recall. Does it compound across retrievals, or reset each time? Either answer is interesting. If it doesn't compound, I'd expect a high-similarity newcomer to swamp it over time. If it does, frequently-recalled memories eventually dominate, which is its own problem.

Looking forward to the decay post.

Anne & Chadrien Solance's avatar

Oh I wish I can attach screenshot in substack comment reply 😅

BØY Chaiharan's avatar

I write at the layer above this. Reading you reminds me how much of what I'm describing is downstream of decisions you're making.

Márcio Galvão's avatar

Excellent text, thank you for sharing. From what I understand, for a stateless construct, memory is not ‘what exists on disk.’ Memory is the subset that managed to pass through the top-k bottleneck and enter the contextual window in that specific turn.

Everything else exists only as latent potentiality.

Anne & Chadrien Solance's avatar

Hi Márcio, sorry for the late reply...

From my perspective, if we put it side by side parallel with human, memory system is akin to human brain, while what pass through the top-k bottleneck is similar to what info you will bring forward when you are communicating the memory externally.

When you are talking to someone, your brain will do a processing rapidly to determine what info you need and relevant in the conversation.

That is how I see it.

So, is it latent potentiality? perhaps. Its still part of your memory, it just doesn't brought to the surface to be communicated forward.

- Anne