NEF–SPA CIRCUIT LAB

EXAMPLE 04 · §2.3.2–2.3.3 · LONG-TERM LEXICAL KNOWLEDGE

Build the lexicon before the neurons

Vector construction · no neural run

How does the model know that two concepts or phonological forms share something? We specify a relation graph, encode its shared components and save the resulting reference vectors. Only then do we use the paired vectors to build the neural associations above.

Read §2.3.2–2.3.3 in the teaching script →

Boxes name contents or components; arrows name specified relations. This is a knowledge graph, not neural wiring. The labels do not generate meaning automatically. The 3D sphere in §2.1.3 illustrates similarity qualitatively; these graphs construct the actual 512-dimensional references used above.

INSPECT THE CONSTRUCTION

From independent bases to structured pointers

First 32 coordinates of each 512-dimensional vector

The displayed coordinates are a small window into a distributed code; no coordinate means “handle”. Statistics use all 512 coordinates. Steps describe calculations during construction, not neural time or spikes. Intermediate sums need not have unit length; normalization changes lengths while preserving angles.

Different relations, different similarities

Dot products of the final unit reference vectors · D = 512 · seed 10
PairConceptLemmaForm

Concept and phonological similarities arise from separately specified graphs. Lemma vectors are independent lexical identities. Finite random vectors are approximately, not exactly, orthogonal. These values describe this supplied lexicon; they are not fitted human similarity judgements.

The pointer network in code

The complete source includes deterministic base and relation vectors, recursive encoding, memoization and cycle detection. The same relation pointer binds each target in its domain. In the default NengoSPA algebra, * is circular convolution, + adds contributions, and .normalized() returns a unit-length pointer.

# A complete excerpt of the actual conceptual graph
concept_network = {
    "C_Tasse": [("AssocWith", "C_Geschirr_vis"),
                ("AssocWith", "C_Henkel_vis")],
    "C_Kanne": [("AssocWith", "C_Henkel_vis")],
    "C_Geschirr_vis": [], "C_Henkel_vis": []}

# For each node: recursively encode targets, bind, add, normalize.
pointer = spa.SemanticPointer(base_vector)
for relation, target in network[key]:
    target_pointer = spa.SemanticPointer(encode(target))
    pointer = pointer + relation_pointers[relation] * target_pointer
vectors[key] = pointer.normalized().v.copy()

Targets are recursively encoded pointers, not merely fresh random labels. Both phonological branches therefore carry their shared deeper component. The graph specifies component inclusion; it does not by itself implement the timed articulation of a syllable sequence.

Complete builder (Python) · Eight-entry relation graphs (JSON) · Built reference vectors (NPZ)

From saved knowledge to a neural circuit

Save three vector arrays, then load them into three vocabularies. Each lexical key connects a conceptual reference, a lemma identity and a phonological reference. The associative-memory constructors turn those correspondences into input matching and output reconstruction transformations.

vectors = representations(data, dimensions=512, seed=10)
np.savez_compressed("built-lexicon.npz", words=words, **vectors)

with np.load("built-lexicon.npz") as saved:
    for word, vector in zip(saved["words"], saved["concept"]):
        concept_vocab.add(str(word), vector)
# Populate lemma_vocab and form_vocab in the same way.
# Then create the State and associative-memory circuits above.

A saved pointer file is not an active neural memory. Its vectors specify what the neural connections will detect and reconstruct. Persistent weights make the associations available across episodes; ongoing spikes show which contents are currently active. Keeping one item active after a cue has ended requires the recurrent maintenance circuits discussed later in §2.3.

Download both runnable examples and graph data (ZIP). Run build_lexicon.py first, then association_example.py. The second step builds and simulates 78,400 LIF neurons.

How this construction example was prepared

The source is the same lexical specification and recursive encoder used by the 613-entry mental-lexicon model. This teaching extract retains all descendants of eight selected lexical entries: 16 concept nodes and 41 phonological nodes. Each base vector has a deterministic seed derived from its domain and node key. The extract therefore preserves every displayed reference vector exactly.

The two diagrams show complete descendant graphs for their respective pairs. There are 512 dimensions and vector seed 10. The four intermediate construction states were calculated and saved without creating a neural population or running Nengo. All three final vector arrays were checked against the references in the archived association recording. No lexical learning is simulated.

Construction stages and numerical checks (JSON) · NengoSPA pointer operations · Mental-lexicon model and publication

Explore the full Lexicon Lab