Time and forgetting
Time enters the memory in one place: the hours since the previous item. Every statistic of every node is multiplied by , with and 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.
Three effects
Section titled “Three effects”| Effect | What it does | Why it matters |
|---|---|---|
| The centre follows the story | Within a node, old items weigh less in ; 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 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: , and are multiplied by the same factor, so and 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 and a numerical safeguard in the concentration takes over; with a 48-hour half-life, some eighty days of silence.)
How long nodes live
Section titled “How long nodes live”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())))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")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.
In the paper
Section titled “In the paper”The paper’s figure for time also shows the predictor’s time code (right), which vmfstream does not include: