A field guide to local neural networks

Small networks.
Visible decisions.

A neural network is a collection of numbers doing useful math. With ruv-fann, you can train it, look inside it, and test a change before you keep it.

Rust at the coreNode + browserComputation stays local
SPECIMEN 0012 → 2 → 1
A small network with one editable connectionTwo inputs connect to two hidden units and one output. A highlighted connection represents a weight you can inspect and change. This is an explanatory illustration. 10 1 w = 1 a few inputsa little mathan answer a weight is a knob inspect → edit → evaluate → decide
An illustration. A real model is waiting below.
01 / THE IDEA

Small enough to understand.
Useful enough to build with.

Skip to the live experiment

01 — A few numbers go in

Start with something
you can name.

A model takes numbers as inputs. They might describe a sensor reading, a candidate search result, or—in our tiny example—whether two switches are on.

Connections multiply those inputs by weights. A bias adds an offset. An activation function shapes the result. Repeat that across a few layers, and you have a small neural network.

Input
A number you give the model.
Weight
A number that changes a connection’s influence.
Prediction
The result of running the math.

02 — Learn from examples

Training turns
the knobs.

Show a model examples with the answers you want. Compare its predictions with those answers. An optimizer adjusts the weights to reduce the error, then tries again.

The JavaScript SDK supports SGD and AdamW training through real Rust-built WebAssembly. Prepare the resulting checkpoint once, then reuse it for predictions across batches.

A checkpoint is simply a saved model: its structure, weights, biases and activation settings.

03 — Make a precise intervention

Sometimes you want
to turn one yourself.

Weight-space programming means inspecting and directly changing a model’s parameters. A person, an algorithm or an agent can propose the edit.

With ruv-fann-wsp, the edit is a small, structured patch. It names the exact weight or bias to replace and the fingerprint of the model it belongs to.

The patch preserves the network’s structure. It is still a proposal: changing a number does not tell you whether the behavior got better.

One connection0.00 1.00Same network. A different answer.

04 — Measure before you keep it

A change earns
its place.

Run the original model and the candidate on the same evaluation cases. Check the error and your regression limits. Keep the candidate separate while you inspect the result.

Promotion is an explicit action. An accepted, current proposal can become the active checkpoint. Rollback restores a retained checkpoint as a new revision.

For real tasks, keep unseen evaluation cases away from whoever chooses the edits. A passing score describes those cases; it does not prove generalization.

Try the whole loop
THE SAME SMALL NETWORK01 / 04
A prediction, a weight edit and a reviewThis illustrated example has inputs one and zero, two hidden units and an output. Scrolling highlights how training or a direct weight edit changes the result, followed by evaluation. 10 10 0 w = 0 inputshidden unitsoutputwant: 1 compare → adjust → try again one direct edit 4 cases checked · error 0.25 → 0

Two inputs enter. The connections decide how much each one matters.

02 / THE WORKBENCH

Open the model.
Ask a better question.

Version 0.2.0 adds four ways to understand a small model before changing it. Each observation stays tied to the checkpoint it describes.

01

Look at the structure.

See the layer dimensions, activation settings and parameter counts. Get a canonical fingerprint for the checkpoint.

inspectWeightModel()
02

Follow a signal.

Trace the values before and after each activation. Both passes use the actual WASM engine’s calculations.

traceWeightModel()
03

Disconnect one unit.

Zero a hidden neuron’s outgoing connections, then measure what changes. The result is a normal hash-bound patch.

createNeuronAblationPatch()
04

Estimate sensitivity.

Nudge selected parameters up and down, and compare the measured error. This is a local numerical estimate, not autograd.

analyzeWeightSensitivity()
BOUNDED BY DESIGN

Up to 65,536 model parameters, 128 edits per patch and 16 selected sensitivity locations. Traces and probes share aggregate work and storage limits. Read the precise limits

03 / A REAL, LOCAL EXPERIMENT

Make one edit.
See four answers change.

This tiny network answers XOR: “Is exactly one switch on?” One output connection starts at zero. Move it, evaluate the candidate, then choose whether to promote it.

Real WebAssembly · four binary casesReady when you are
0.00

Try 2.00 and evaluate. Then try 1.00. The candidate changes only the preview until you promote it.

Click “Run local demo” to load the local WASM engine.

The XOR model’s editable connectionTwo input nodes feed two ReLU hidden units. The highlighted output connection is the weight controlled by the slider.w = 0
All four cases. “Active” changes only after promotion.
ABWantActivePreview
0000—
0111—
1010—
1100—
Candidate MSE
—
Active weight
0.00
Revision
1

Candidate fingerprint Not evaluated

This example covers the entire binary XOR domain. It demonstrates direct editing and checkpoint control, not generalization. Computation runs in your browser, using self-hosted package files. No model provider, account or data upload is involved.

04 / SHOW THE EVIDENCE

A useful result
includes the losses.

Small networks are useful when they suit the task. We compared five approaches on two real, public classification datasets—and kept every result.

MEAN HELD-OUT ACCURACY
Iris mean held-out accuracyAcross five fixed splits: majority 33.33%, nearest-centroid 84.67%, linear network 80.67%, small MLP 96.00%, ExtraTrees 94.67%. The complete results for both datasets follow in a table.0%255075100Majority33.33%Nearest-centroid84.67%Linear network80.67%Small MLP96.00%ExtraTrees94.67%

On Iris, the small MLP averages 96.00%. That is a result on these splits, not a universal ranking.

Mean held-out accuracy across five predetermined stratified splits
DatasetMajorityNearest-centroidLinearSmall MLPExtraTrees
Iris 150 rows · 4 inputs33.33%84.67%80.67%96.00%94.67%
Wine 178 rows · 13 inputs38.46%97.95%97.44%95.90%99.49%

Training, validation and test rows are separate within each split. Standardization uses training rows only. The splits overlap across seeds; reported confidence intervals are descriptive. These two small datasets establish neither agent-task quality nor state of the art.

A separate controlled experiment disconnects one hidden unit, chosen using validation data, and restores its known original weights. Exact held-out outputs return. This checks the editing tools; it does not show that an agent can discover arbitrary repairs.

46

tests per Node version
Node 22 + 24, plus Chromium

19

hostile-input checks
in installed runtime probes

0

known npm advisories
in the release’s production tree

Recorded for WSP 0.2.0, released 10 November 2026. These checks have a defined scope; they are not a general security certification.

Full benchmark JSON ↗Dependency audit ↗Method + dataset attribution ↗

05 / FIND YOUR ENTRY POINT

A small stack.
A clear place to start.

The npm packages form a simple chain. Choose the workbench for direct edits, the SDK for training and prediction, or the low-level bindings when you need manual control.

ruv-fann-wsp→ruv-fann→ruv-fann-wasmAll run in Node.js and browsers
THE JAVASCRIPT SDK0.1.2

ruv-fann

A typed ESM API for dense models, reusable batch inference, SGD/AdamW training and model serialization.

  • Prepare once; predict across batches
  • Managed, explicit model disposal
  • Automatic SIMD feature detection
View on npm SDK guide ↗
THE RUNTIME BINDINGS0.1.2

ruv-fann-wasm

The Rust-built WASM binaries and wasm-bindgen bindings beneath the SDK, for callers who manage object ownership directly.

  • Scalar and SIMD runtime assets
  • Direct low-level access
  • No runtime package dependencies
View on npm Runtime guide ↗

The published npm packages are ESM and support Node.js 20.9+ or a browser with WebAssembly. TypeScript declarations are included. WSP pins core 0.1.2; core pins WASM 0.1.2. Consuming the npm packages does not require compiling a native addon.

06 / YOUR FIRST CHECKPOINT

Start with a model
you can check.

This complete example traces a one-layer model computing y = 2x + 1. Save it as inspect.mjs and run node inspect.mjs.

1. INSTALL THE WORKBENCH
npm install ruv-fann-wsp

The exact core and WASM dependencies arrive with it. Then create the example file shown here.

2. RUN YOUR FILE
node inspect.mjs

Expected activations: [3, 5, 7]. Tracing observes the model; it does not train or change it.

Next: a complete patch + promotion example ↗
inspect.mjs
import {
  inspectWeightModel,
  traceWeightModel
} from 'ruv-fann-wsp';

const model = {
  schema: 'ruv-fann.dense-layers/1',
  layers: [{
    inputs: 1, outputs: 1,
    weights: [2], bias: [1],
    activation: 'Linear', steepness: 1
  }]
};

const info = await inspectWeightModel(model);
const trace = await traceWeightModel(model, {
  inputs: [1, 2, 3], rows: 3
});

console.log(info.parameterCount); // 2
console.log(trace.layers[0].activations);
// [3, 5, 7]

A FEW USEFUL DISTINCTIONS

Before you
build.

Does weight-space programming replace training?

It gives you another way to create or adapt a checkpoint. Training adjusts parameters using an optimizer and examples. WSP applies explicit parameter edits. The useful choice depends on the task, data and evaluation budget. The package provides the tools; it does not promise direct edits will outperform training.

Is the workbench automatically learning or calling an LLM?

No. A caller supplies the model, edit and evaluation cases. No model provider is built in, and retrieval does not trigger automatic updates. An agent can use the API through its own orchestration, with explicit evaluation and promotion.

What does the fingerprint protect?

A patch’s SHA-256 fingerprint identifies the canonical checkpoint it was written for. A mismatched patch is rejected. Hashes bind content; they are not signatures and do not authorize promotion. A workspace uses its internally retained accepted proposal and current revision for that decision.

Does this page demonstrate GPU acceleration?

The live experiment uses CPU WebAssembly, with SIMD when supported. The repository also has separate optional WebGPU compute paths. Their software-adapter correctness checks do not establish physical GPU throughput. See the core review and feature limits before choosing a backend.

What should I evaluate for an actual application?

Use representative cases, separate model/edit selection from final evaluation, and check regressions that matter to your users. Record dataset provenance, model hashes, runtime and policy. MSE is the WSP workbench’s supplied numeric metric; an application may also need task success, ranking quality, calibration or other criteria.

Can I persist the workspace?

The package’s workspace history is in memory. Save checkpoints yourself or use the AgentDB integration for durable models, proposals and revisions. Keep application access controls and concurrency limits around mutations.

BUILT TO BE OPENED

Keep the model small.
Keep the evidence close.

Explore the source, try a checkpoint, and let the measurements tell you what to keep.