W-ISA / NCP

Open-source research · v0.1.0

Model weights,
as programmable
state.

Apply a temporary weight edit. Measure what changes.
Restore the original model when you’re done.

W-ISA is an instruction set and transactional runtime for local language models. NCP builds a verification loop on top.

A weight edit, in miniatureBrowser illustration

A 2 × 2 matrix. One key. A temporary change.

W
1234
k
12
Wk
511
InstructionWRITE_KEY key=[1, 2] value=[3, -1]

The original matrix maps [1, 2] to [5, 11]. Save its values before applying the edit.

Illustrates the CLI demo’s arithmetic in JavaScript. The Python runtime executes the actual parameter edits.

Built for local experiments
CPUApple MPSNVIDIA CUDA

PyTorch inference CPU FP64 edits No backpropagation

01 / Execution

Edit the weights.
Keep the experiment under control.

A program says what to change. A scope owns the snapshots and restores them on exit—even after a Python exception or cancellation.

One program. Explicit operations.JSON / v1
{
  "version": 1,
  "instructions": [{
    "op": "SCALE",
    "target": "model.layers.9.self_attn.o_proj.weight",
    "slice": [null, [0, 64]],
    "factor": 0
  }]
}

Example: ablate head 0’s output contribution in SmolLM’s tenth block. Target names and slice dimensions follow the loaded model.

Explore the instruction format
01

Validate before writing

Named parameters, operand shapes, finite values and tensor slices are checked. Instructions execute in source order.

02

Own the temporary state

Request scopes retain snapshots and preserve parameter identity. A shared model lock coordinates participating requests.

03

Restore, rather than invert

Zeroing and projection lose information. Restoration copies the saved parameter values back; it does not try to reverse the algebra.

Six instructions.ADDSCALERANK1PROJECT_OUTWRITE_KEYPRUNE

02 / Neural Control Plane

Temporary edits.
Persistent decisions.

NCP observes behavior, proposes interventions and evaluates the resulting policy. Accepted rules stay in a versioned table. Their weight effects stay inside the request.

  1. 01Observe

    Task results, repetition
    and activation profiles

  2. 02Propose

    Deterministic
    intervention candidates

  3. 03Verify

    Routed tasks and
    forced-action perplexity

  4. 04Admit or archive

    Evidence tied to the rule
    and policy version

A measured decision. In the nine-question SmolLM microbenchmark, the projection reduced validation repetition from 0.4133 to 0.2191. With zero newly correct answers, the gate archived all three candidates and retained the original policy.

Inside NCP

03 / Recorded experiments

Measured, not inferred.

Real local runs on SmolLM-135M and Qwen2.5-1.5B. Saved programs, operands, logits and timing records make the experiments inspectable.

Qwen2.5-1.5B · FP32 · MPS
45timed requests

Original inference, a materialized rank-one update, and an equivalent PyTorch forward hook.

0.000184Maximum prompt-logit difference
between W-ISA and the hook

All three modes produced identical greedy sequences at the measured lengths. Every timed request restored the target weights exactly.

Median request time seconds · setup and restoration included
Output tokensOriginalW-ISAHook
321.18581.23121.1868
1284.74454.85274.7873
51218.711719.373519.4961

51 input tokens. Five repetitions per mode and length, after one warm-up each. Fixed-length greedy decoding, fresh cache, per-token synchronization; mode order rotates.

Read the raw measurements
Snapshot cost and corpus measurements

Qwen rank-one target: 52.5 MiB for one FP32 snapshot; 105 MiB for one full FP64 work buffer. The maximum sampled request RSS increase for W-ISA was 498.94 MiB, sampled every 10 ms. Process RSS and MPS allocation counters overlap in unified memory and are reported separately.

SmolLM, full WikiText-2 test split: the combined head ablation and MLP projection changed perplexity from 22.2353 to 22.3188 (+0.3754%), over 304,985 scored targets. Read the evaluation report.

04 / Try it locally

Start with a matrix.
Then bring a model.

The self-contained CLI demo needs no model download. It changes the output from [5, 11] to approximately [3, −1], then restores [5, 11] exactly.

Python 3.10+ · torch, transformers, numpy
Installation downloads the Python dependencies.

Model setup and full documentation
Terminal · macOS / Linux
git clone https://github.com/eax/w-isa.git
cd w-isa
python3 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/wisa demo
Runs on your machine. Code licensed under MIT.

05 / Research

The work behind the code.

Two companion papers by Ekrem Aksoy. Execution semantics in W-ISA; policy synthesis and verification in NCP.

W-ISAarXiv:2611.13232 · 2026

Transactional Execution of Weight-Space Intervention Programs

Instruction semantics, scoped state restoration, conditional interventions and the local execution benchmarks.

NCParXiv:2611.13236 · 2026

Verifier-Guided Optimization of Weight-Space Control Policies

A versioned neural flow table, candidate synthesis, evidence-bound admission and a reproducible controller microbenchmark.

Built on the weight-space programming perspective of Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab in Sparks of Weight-Space Programming.

Citation & BibTeX