Skip to content

Writing and birth

Once the read has decided, the item is stored, in three steps and always in this order. This is the second half of Memory.step.

1. Forget. Every statistic of every node is multiplied by λΔt\lambda^{\Delta t}. This is the only place where the memory forgets, and it is enough: since the factor depends only on the time elapsed, forgetting once after ten hours is the same as forgetting ten times one hour.

2. Add.

Sk←λΔtSk+wk z,Nk←λΔtNk+wk,nk←λΔtnkS_k \leftarrow \lambda^{\Delta t} S_k + w_k\,z, \qquad N_k \leftarrow \lambda^{\Delta t} N_k + w_k, \qquad n_k \leftarrow \lambda^{\Delta t} n_k

wkw_k is the share of the item each node receives:

  • Soft write (hard_write=False, the analytic configuration): wk=rkw_k = r_k, the item is spread by the posterior. Since one option nearly always takes almost all of it (on the Portal stream, over 99 % of the posterior for 83 % of the items; see the read), this is close to the hard write in practice, but not identical: the slivers make it sensitive to rounding.
  • Hard write (hard_write=True, the main configuration): the whole item goes to the winner and nothing to the others.

3. Birth, if new story wins. If slot 0 has the largest share, a node opens in the first free row with S=r0zS = r_0 z, N=r0N = r_0 and n=n = prior_mass (r0=1r_0 = 1 with hard write). If the table is full, the new node takes the row of the node with least mass, which is lost.

The output is the identity of the node that received the item: the newborn, or the most probable one. Identities are the order of birth in the stream, so they never repeat even when rows are reused.

Because old items have been multiplied by λΔt\lambda^{\Delta t} many times, they weigh less in the sum than recent ones. Each new item turns the centre towards itself, the more so the longer it has been since the node last received anything. A story that changes, from the campaign to the vote, from an attack to the response, is followed without opening new nodes. History.trajectory draws that movement: the Ukraine node of the Portal stream turned from its first item, in the prelude, to the invasion within a week, without a new node.

In the memory explorer you can switch between the soft and the hard write on nine years of news.