Skip to content
Skills Library
AI & agents · Building & coding

weight-space-programming

/weight-space-programming

Analyze, inspect, diagnose, directly edit, construct, and test neural-network weights with reproducible comparisons and verified rollback. Use for checkpoint inspection, tensor or circuit analysis, behavioral failures such as repetition loops, sparse weight surgery, and weight-space programming. Applies to LLMs, policies, and other neural networks; ordinary prompting, optimizer-based fine-tuning, and generic application debugging are separate tasks.

Licence
MIT
Last repository change
03.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 03.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Analyze, inspect, diagnose, directly edit, construct, and test neural-network weights with reproducible comparisons and verified rollback. Use for checkpoint inspection, tensor or circuit analysis, behavioral failures such as repetition loops, sparse weight surgery, and weight-space programming. Applies to LLMs, policies, and other neural networks; ordinary prompting, optimizer-based fine-tuning, and generic application debugging are separate tasks.

Original author description

Analyze, inspect, diagnose, directly edit, construct, and test neural-network weights with reproducible comparisons and verified rollback. Use for checkpoint inspection, tensor or circuit analysis, behavioral failures such as repetition loops, sparse weight surgery, and weight-space programming. Applies to LLMs, policies, and other neural networks; ordinary prompting, optimizer-based fine-tuning, and generic application debugging are separate tasks.

How it works

  1. Select the task and evidence budget
  2. Preserve and characterize the baseline
  3. Analyze before editing
  4. Make one reversible candidate
  5. Evaluate, decide, and roll back
  6. Hand off verifiable evidence
  7. Resources and self-check
Original SKILL.md headings · 83 lines, 1,379 words
SKILL.md preview
---
name: weight-space-programming
description: Analyze, inspect, diagnose, directly edit, construct, and test neural-network weights with reproducible comparisons and verified rollback. Use for checkpoint inspection, tensor or circuit analysis, behavioral failures such as repetition loops, sparse weight surgery, and weight-space programming. Applies to LLMs, policies, and other neural networks; ordinary prompting, optimizer-based fine-tuning, and generic application debugging are separate tasks.
---

# Weight-Space Programming

Turn a natural-language behavioral goal into an evidence-backed analysis or a small, testable change to neural-network parameters. Preserve the original and accept a candidate only when measured results justify it. This skill is portable across agents; it does not depend on a particular LLM, MCP server, or cloud service.

Based on [Sparks of Weight-Space Programming](https://rikiyat.github.io/blog/weight-space-programming/) and its [released experiments](https://github.com/RikiyaT/lm_understand-logs). The findings are early and model-specific. Reading weights suggests hypotheses; it does not prove behavior. A sparse edit can still cause broad regressions. No skill guarantees that arbitrary weight changes are harmless.

## Select the task and evidence budget

Use the user's requested mode:

| Mode | Work | Deliverable |
|---|---|---|
| Inspect | Inventory parameters, numerical health, architecture, differences | Read-only report with provenance and uncertainty |
| Diagnose | Trace a failure from behavior through components | Falsifiable hypothesis, evidence, competing explanations |
| Edit | Modify a supported mechanism in an existing checkpoint | Separate candidate, deterministic edit, tensor diff, evaluation, rollback |
| Construct | Implement a specified computation within a network architecture | Weight-construction script and behavioral tests |
| Reproduce | Recreate a particular published experiment | Pinned inputs, matched protocol, results and deviations |

Establish what is available: checkpoint and exact revision, architecture/forward code, tokenizer or input encoding, output/action semantics, permitted tools and inference, compute/time budget, and intended behavior. Infer routine details from local files. Ask only when a missing fact changes the experiment or risks touching the wrong model. If weights are absent, provide the analysis/experiment design and identify the missing artifact; never invent inspected tensors or measured scores.

An inspection request authorizes reading, not changing weights. Work on an isolated candidate for an edit request; deployment, uploading data, or replacing a live checkpoint requires the user's corresponding authorization. Keep model weights, prompts, and datasets local unless their transfer is explicitly allowed.

Distinguish **weights-only**, **activation-assisted**, and **behavior-assisted** evidence. Respect an explicitly specified zero-forward-pass constraint, including synthetic inputs and individual-layer calls. Matrix algebra on weights is not a forward pass. Agree on what counts as one inference call/batch, then track samples, tokens, time and calls as well as the nominal pass count. Ordinary repair should include inference tests when available; published restrictions are reproduction settings, not universal rules. No optimizer, backpropagation, or gradient-free fitting loop is part of direct weight-space programming unless the user changes the method.

## Preserve and characterize the baseline

1. Read architecture code and checkpoint metadata before interpreting tensor names. Record matrix orientation, nonlinearities, normalization, residual paths, tied weights, quantization, positional encoding, and sharding. Include preprocessing, tokenizer, chat template and generation settings in the baseline.
2. Record exact source/revision and file hashes, tool versions, hardware, seeds and evaluation split IDs. For a mutable local checkpoint, make a verified independent copy before editing. For a pinned immutable store, verify that its exact bytes remain recoverable; do not treat a moving branch or URL as a backup. Check available disk/RAM first.
3. Reproduce the failure and measure a baseline using the existing evaluator. Check prompt/template, tokenizer, decoding, stop conditions, truncation, dtype and runtime bugs before attributing a failure to weights. Store raw per-example outputs, not just aggregate scores.
4. Inspect tensor keys, shapes, dtypes and non-finite values. Read summaries and relevant slices instead of dumping a large checkpoint into context. Preserve original bytes; read-only inspection does not need a duplicated model.

Use [checkpoint-tools.md](references/checkpoint-tools.md) for the bundled tools, supported formats, exact commands and limitations. They audit artifacts; they do not certify model quality or replace the model's own loader/evaluator.

## Analyze before editing

Read [analysis-and-edits.md](references/analysis-and-edits.md) for weight algebra, circuit hypotheses, direct construction, quantization and tied-weight pitfalls.

For each hypothesis, connect **observed failure → candidate mechanism → discriminating probe → predicted intervention effect**. Separate measured facts from plausible explanations. For example, repeated answers may implicate a residual direction, but a large singular value alone does not establish that direction's semantics.

Use the smallest relevant view: selected rows/columns, per-head blocks, weight products, singular values, norms and comparisons against a matched baseline. Compare coordinates only when checkpoints share the same parameterization; hidden-unit permutations or different architectures invalidate naive subtraction. Label ablation/activation evidence explicitly. If the evidence cannot distinguish hypotheses, return that uncertainty or use an allowed probe instead of declaring a diagnosis.

## Make one reversible candidate

Before writing, specify exact tensor names/slices, the operation and mechanism, invariants, primary improvement threshold, regression tolerances, and budget. Choose these before looking at candidate results. Derive each candidate from the same baseline, or record its parent hash explicitly; do not silently accumulate notebook edits.

- Write a deterministic patch/construction script bound to baseline hashes. Preserve shapes, dtype, key set, metadata and untouched tensor values. Use explicit index/shape assertions and finite checks. Reopen the saved candidate and inspect the serialized values; casting can erase or amplify an edit.
- Do not hard-code the blog's layers 15/19, columns, direction or percentage into another model. The mechanism and architecture must justify them.
- For a task requiring no training, implement the proposed computation directly. Searching coefficients against a loss is fitting even without gradients.
- Save into a new directory. Do not overwrite the source, edit a shared cache, use hard links for mutable candidates, or switch a serving process during experimentation. A verified rollback means the original artifact and settings can actually be loaded again.
- Gate the tensor diff against the exact allowed names and separately assert allowed slices. The bundled comparator checks names, not the semantics or intended slices of an edit.

## Evaluate, decide, and roll back

Read [evaluation.md](references/evaluation.md) before an edit or a behavioral claim. Use the same loader, prompts, seeds, decoding, precision and budget for baseline and candidate; record unavoidable differences. Keep discovery/practice data separate from validation and held-out final evaluation. Once final tests influence selection, they are no longer untouched tests.

Check in this order: serialized integrity → clean reload → smoke inference → target behavior → unrelated capability/operational regressions → restore and replay baseline. A failed gate prevents promotion. An inconclusive improvement is an inconclusive result; retaining the baseline is a valid outcome. Stop at the agreed budget, when evidence contradicts the mechanism, or when the next experiment needs resources not available.

For repeated or stochastic runs, use paired examples/seeds and report uncertainty. Measure both desired behavior and potential collateral effects, including output validity, answer completion, throughput/memory and domain-appropriate capability tests. A successful file load or a smaller edit fraction is not a behavioral safety test.

Promotion is a separate operation after validation. For a user-authorized deployment, test the actual packaged checkpoint and runtime, use the project's normal atomic switch, and retain the prior version. Restore to a fresh directory first, verify every hash, reload, and replay the baseline probe. Do not delete backup evidence as cleanup.

## Hand off verifiable evidence

For inspection, report what was actually inspected and the remaining uncertainty. For an edit/construction, deliver:

- The candidate checkpoint and unchanged original/backup location with hashes.
- The deterministic patch or construction script plus file/tensor diff (names, slices, changed count, norms, maximum delta).
- An experiment record: hypothesis, permitted evidence, commands/working directories, inputs, versions, literal outputs/exit statuses, sample counts, settings, metrics, uncertainty, budget used and pass/fail decisions. Preserve relevant raw outputs without credentials or private text in public reports.
- A runnable rollback command/script and its executed verification result.

State separately what passed, what failed, and what was not run. Do not claim replication of the blog, universal interpretability, or compatibility with all models from a toy test. Answer in the user's language; keep reproducible code and tensor identifiers exact.

## Resources and self-check

- [analysis-and-edits.md](references/analysis-and-edits.md): analytical methods and intervention mechanics.
- [evaluation.md](references/evaluation.md): experiment design and acceptance gates.
- [checkpoint-tools.md](references/checkpoint-tools.md): backup, integrity and tensor-audit commands.
- [source-notes.md](references/source-notes.md): reported results, negative findings and precise provenance.
- [evals/evals.json](evals/evals.json): realistic agent evaluation tasks and expected observable behavior; these are not a claim of cross-model evaluation.

Test the bundled tools from this skill's directory with `python -m unittest discover -s tests -v`. Run the executable miniature edit/restore experiment with `python scripts/demo_experiment.py --output <new-directory>`. Python 3.10+ is required; `checkpoint_guard.py` uses only the standard library. The tensor tools/demo additionally need PyTorch, NumPy and safetensors in the chosen environment. Use existing compatible installations; do not modify the user's global environment just to run a check.
Files in this package (4)
  • .gitignore 1 KB
  • LICENSE 1 KB
  • README.md 9 KB
  • SKILL.md 11 KB

Versions

RepositoryScoreLicence
This page · GofMan5/weight-space-programming100MIT
xero00000/weight-space-programming100MIT
di37/weight-space-programming-skill95MIT
fursund/weight-space-harness95MIT

Database snapshot: 13.11.2026 · package version 4c110fd3eafa (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100weight-space-surgery
    Diagnose neural network failure modes and repair them via targeted, minimal weight edits without gradient descent. Use when fixing reasoning/repetition loops in language models, repairing stalled RL policies, or grafting bypass circuits into trained weights.
  • 100weight-space-debugger
    Inspect neural-network checkpoints, investigate reproducible model failures, and test authorized reversible weight edits. Use for PyTorch, transformer, or RL checkpoint comparisons, numerical anomalies, causal circuit investigations, and targeted repairs; supports…
  • 100weight-space-writing
    Compile symbolic algorithms, spatial filters, and control policies directly into neural network weights from scratch without training or gradient descent. Use when synthesizing game-playing networks, board evaluators, or explicit neural circuits using the edits DSL or WSP sandbox.
  • 100weight-surgery
    Diagnose a fault in a trained neural network by reading its weights, then fix it with a small edit written by reasoning (no optimizer, no gradient descent, a small budget of forward passes) and prove the fix on held-out data. Use when a model has a specific, repeatable failure…
  • 100building-neural-networks
    Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin. it should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance... Use when…
  • 100building-neural-networks
    Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin. it should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance... Use when…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.