Skip to content

Time and forgetting

Time enters the memory in one place: the hours Δt\Delta t since the previous item. Every statistic of every node is multiplied by λΔt\lambda^{\Delta t}, with λ=2−1/h\lambda = 2^{-1/h} and hh the half-life. Because the factor depends only on the elapsed time, the memory never needs to know when each item arrived: one multiplication brings the whole table up to date.

Lab · Forgetting

A node received one item a day for the last 21 days and then nothing. Each bar is what one of those items still weighs in the node's sums today; the mass N is their sum, and expiry compares it with ε.

With the default half-life of 48 hours, an item weighs half after two days and less than a tenth after a week, so a node’s sums are dominated by its last few days. Push the half-life to a month and the node remembers its whole history; bring it down to a few hours and it remembers only today.

Effect What it does Why it matters
The centre follows the story Within a node, old items weigh less in SS; centre and concentration reflect the last days. The main effect. A changing story is followed without opening new nodes.
The prior empties during pauses Masses shrink and α\alpha does not; after a long pause a new story is more likely. Small in practice, because the prior weighs little against geometry.
Dormant nodes disappear With expiry, a node below the threshold frees its row. Without it, a node is lost only when its row is needed and it has the least mass. Prevents an old, narrow node from capturing items of a new story.

Forgetting does not change the shape of a node that receives nothing: SS, NN and nn are multiplied by the same factor, so μ=S/∥S∥\mu = S/\lVert S\rVert and Rˉ=∥S∥/(N+n)\bar R = \lVert S\rVert/(N+n) do not move. A dormant node only loses weight in the prior. That is exactly why it can still win a read, as the read simulator shows, and why expiry exists. (After about forty half-lives its mass falls below 10−1210^{-12} and a numerical safeguard in the concentration takes over; with a 48-hour half-life, some eighty days of silence.)

Mass of a node that stops receiving items, with a half-life of 48 hours. The dashed line is the expiry threshold ε = 0.1 of the main configuration.

On the Portal stream read with Memory():

summary = history.summary()
life = np.array([(s.last - s.first) / 24 for s in summary])
size = np.array([s.size for s in summary])
print(f"nodes with one item: {np.mean(size == 1):.0%}; with 10 or more: {np.mean(size >= 10):.0%}")
print("days between first and last item, nodes of 10+: median",
round(float(np.median(life[size >= 10])), 1), " longest", round(float(life.max())))
Output
nodes with one item: 10%;  with 10 or more: 9%
days between first and last item, nodes of 10+: median 126.0  longest 1017

Most nodes are small, but the nodes that gather ten items or more stay alive for months: a story that keeps receiving items keeps its node, however long it runs. With the main configuration, expiry clears nodes as soon as they fall silent:

main = Memory.main().fit_projection(reference)
other = main.read(embeddings, hours)
ended = np.array([other.ended.get(s.node, np.inf) for s in other.summary()])
print(f"Memory.main(): {other.node.max() + 1:,} nodes born, "
f"{np.isfinite(ended).sum():,} left the memory, "
f"{len(main.nodes())} active at the end")
Output
Memory.main(): 8,376 nodes born, 8,339 left the memory, 37 active at the end

Memory.main() opens more nodes, 8,376 against 7,075: a story that returns after its node expired starts a new one. It ends the stream holding 37 live nodes instead of a full table of fading ones. When each node left is recorded in History.ended.

The paper’s figure for time also shows the predictor’s time code (right), which vmfstream does not include:

Where Δt enters: forgetting, the mass prior and the predictor's fixed code; curves of λ^Δt for half-lives of 48, 200 and 720 hours.
Where Δt\Delta t enters, and the forgetting curves for half-lives of 48, 200 and 720 hours on a logarithmic time axis.