The NSM syntax: 6 element types, one element chosen from eachNSMSYNTAX · Version 0.12.0

The NSM syntax

It breaks up an NSM (Narrow Small Model): one that does a single job and answers with a kind, a span, an item, a number or codes, never with sentences, and leaves the decision to code; narrow is the size of its answer, not of the model. It has 6 element types and 36 elements, and a NSM described in it is one choice of elements from each type.

Instances

  • ungli: a builder: design a task as steps of NSMs (Narrow Small Models) and plain code, and read beside each model what the nearest models already built were measured to do and what their records say to check. Its name is from ungli rakhna, to put a finger on the exact spot, which is all a model here does

Element types and elements

does holds one essential

The one thing the model does. A larger task is split into steps first, each done by its own model or by code.

sorts
puts each thing it reads into one of a few kinds set in advance
points
finds the part of what it reads that answers a question, or says there is none
matches
says which item on a list written in advance the thing it reads goes with
spots
says which of a set of words or sounds recorded in advance occurred
scores
gives each option a number, and code takes the highest
chooses
picks codes from sets, one slot at a time

reads holds one essential

What goes into the model each time it answers.

a sentence
one sentence at a time
two sentences
two sentences read together, such as a question and its answer
a passage
a few sentences up to a page, with a question about it
a whole text
a whole text, shortened to fit the model's window
a second of sound
a second or two of sound from a microphone
numbers
a few whole numbers that describe a situation
codes
numbers that stand for words, never the words themselves

answers with holds one essential

What comes out. Every answer can also be none, which code reads as don’t know.

a kind
one of a few kinds set in advance
yes or no
one of two answers
a span
where an answer starts and ends in what it read
an item
one item from a list written in advance
a number
a number for each option, which code compares
codes
codes chosen from sets, which code turns back into words

starts from holds one essential

The trained model it begins from, before it learns the job.

a pointing reader
MiniLM, 33 million parameters, already trained to find the answer to a question in a passage
an encoder with a new head
MiniLM, 33 million parameters, with a small new layer that picks one of a few kinds
an adapter on a trained model
a small set of added weights trained on top of a model already trained for a nearby job
a multilingual encoder
a small encoder that reads several languages, retrained on Indian languages
a frozen audio encoder
a model trained on sound, kept as it is, with a small scorer trained on top
a keyword spotter
a tiny encoder, tens to hundreds of thousands of parameters, that compares sound with recorded examples
nothing
no trained model: every weight is learnt from the start
a few whole numbers
no neural network: a handful of whole numbers that multiply the inputs

learns from holds one essential

Where the right answers it learns from come from.

your own keys
your own answers, given one item at a time on sheets that show no model’s answer
a rule you stated
answers code works out from a rule you stated in words
rows a model wrote
rows another model wrote for training, the right answer known from how each was made
another model's labels
labels another model gave, used on your word
a dataset's labels
the labels a public dataset came with

runs on holds one essential

Where the model answers once it is trained.

a Raspberry Pi 5
inside a toy or a game, on its processor, with nothing sent anywhere
a phone's browser
in the page itself, with nothing sent to a server
a small server
a server's processor with no graphics card, such as one with 1 CPU and 2 GB
a graphics card
a machine with a graphics card, such as an RTX 3060 with 12 GB

Left out

A model that writes. Anything that writes sentences for people is not an NSM: an NSM answers with a kind, a span, an item, a number or codes, and code decides what follows. Also left out: what the NSM is for in the world, its name, and the keys, which stay with the person who keyed them.

Described in it

The syntax as data: nsm.json. It is read from ungli each time this site is built, so the two never differ.