Search the guide

Start with a guide

Learn

How Weight Space Programming Methods Differ

Compare inputs, construction, saved programs, execution and preparation across neural compilers and direct weight programming.

A transformer assembled from a formal program, a generated adapter and an edited language model are different ways to encode behavior in weights. Compare them through the task you want to accomplish and the artifact you need to reuse.

Start with the task#

  • An exact sequence operation: count a token, reverse a sequence or implement another explicit rule. Formal source and input/output checks define the computation.
  • A recurring fuzzy function: interpret email urgency across changing wording. The specification and intended labels define the behavior.
  • A model edit: change an existing network’s behavior while preserving the capabilities the application still needs. The original checkpoint supplies the starting point.

Four construction paths#

Follow each method from its construction inputs to the saved artifact and the computation that runs afterward. A formal compiler, a trained neural compiler, per-function optimization, and general-purpose LLM reasoning perform different work before the resulting network is used.

Scroll horizontally to read the figure.

A four-row comparison of Tracr formal compilation, PAW trained neural compilation, Compile by Training per-function optimization, and Sparks general-purpose LLM reasoning. Each row gives construction inputs and procedure, saved program, execution, and evaluation.
Sources: Tracr, Program-as-Weights, Compile by Training, and Sparks of Weight-Space Programming. Link to this figure.Download SVGOpen full-size figure

The full comparison includes hypernetworks, Text-to-LoRA, Code2LoRA, prompting, and fine-tuning. Follow training and construction, available information and feedback, runtime dependencies, and evaluation to compare the same task across methods.

What each method constructs#

MethodWhat the user suppliesHow construction worksWhat is savedWhat runs per inputPreparation
PromptingTask instruction, examples and each new inputPlace the instruction and input in the model’s contextPrompt or conversation configurationThe chosen language modelA pretrained model; task prompt design
Task-specific fine-tuningTraining examples and a base modelOptimize full weights or selected parameters with gradientsUpdated checkpoint or adapterAdapted model or base plus adapterTask data, training procedure and evaluation
HyperNetworksConditioning information for the weight generatorRun a trained network that generates another network’s parametersGenerator checkpoint; generated parameters as required by the applicationThe receiving networkEnd-to-end training of the generator and its receiving computation
TracrRASP source, vocabulary and length boundTranslate source operations into transformer componentsTransformer parameters and their execution configurationThe constructed transformerA supported RASP program and compiler
Text-to-LoRANatural-language task descriptionGenerate an adapter with a trained hypernetworkLoRA parametersCompatible base model with the generated adapterTraining the hypernetwork using task-adapter supervision
Code2LoRARepository snapshot, or a sequence of code changesGenerate repository-specific adapters; update generator state as code evolvesAdapter; evolution state in the evolving-repository variantCode language model with repository-specific adaptationTrain the repository-conditioned generator
Program-as-WeightsNatural-language fuzzy-function specificationProduce task text and generate LoRA weights with a trained compilerHybrid program: task text, adapter and runtime metadataShared compatible interpreter with that programTrain the compiler across specification–input–output tasks
Compile by TrainingFunction specificationGenerate task examples with teachers and optimize the function’s adapterReusable neural functionShared interpreter with the saved functionTeacher access and per-function optimization during compilation
SparksWeights, architecture and task information; tools vary by experimentGeneral-purpose LLM reasoning constructs or edits weightsConstructed weights, edited checkpoint and associated tracesConstructed or edited networkA general-purpose LLM and the experiment’s allowed feedback

Separate training the constructor from constructing a function#

A trained weight generator has two timescales. Its training teaches a mapping across tasks. Later construction supplies a new description to that mapping. Per-task fine-tuning instead runs an optimization procedure for the task being added. Both produce parameters; the steps used to obtain them differ.

PAW specifically trains a compiler to generate LoRA adapters that edit the interpreter’s weights. The approach in Sparks uses a general-purpose LLM (not specifically trained for this purpose) to edit weights. Compile by Training adds task-specific optimization to a saved-function workflow. These differences determine which computation happens before a function becomes available.

Fine-tuning, distillation and compilation describe different decisions#

Fine-tuning updates parameters using training examples. Full fine-tuning updates the base model; LoRA fine-tuning learns low-rank updates while keeping the base fixed. The resulting weights or adapter are then reused on new inputs.

Distillation trains a student to reproduce behavior supplied by a teacher. Teacher probabilities, outputs or other supervision determine what is transferred. It describes a learning objective and source of supervision. A compilation workflow can use distillation to construct its saved program.

Prompting supplies the task in the model’s context. Learned compilation constructs a program that is subsequently executed. The same-task comparison shows the repeated stages and a runnable local prompting alternative.

What information can influence the result?#

A method’s input is more than the phrase describing its goal. A constructor can receive architecture details, examples, names of input channels, source code, current weights, and execution results. These reveal different information about the desired computation.

Execution feedback also has a role: it can help diagnose behavior, select an edit, or guide another construction attempt. Development inputs used for that selection differ from the final inputs used to evaluate the chosen artifact. Keeping the two separate makes a result answer the intended question.

  • For a generated function, ask whether the specification, examples or outputs were used during compiler training.
  • For a formal compiler, identify the supported source language and the vocabulary and length assumptions.
  • For an edited model, identify the feedback seen while choosing the edit and the evaluation of retained capabilities.

What must remain available to run it?#

A complete network requires its architecture and input/output representation. A LoRA adapter requires the matching base model and target modules. A PAW bundle additionally carries the readable task component and runtime metadata. A script that creates an edit requires the original checkpoint and the software environment that executes the script.

Reusing a saved program, rerunning an editing script and recompiling a source program are distinct operations. Preserve the object you intend to reuse: the immutable function identifier or file, the edited checkpoint, or the formal source and compiler version.

Read the result together with its workload#

Counting measures agreement with an exact computation. Email classification measures agreement with the intended policy on new messages. Model editing measures the target change and the behavior retained elsewhere. Their scores answer different questions.

For an implementation comparison, use the same task definition and inputs. Record output quality alongside the hardware, model, construction procedure and feedback budget. Construction time and repeated execution time answer separate deployment questions; the evaluation guide develops these checks.

Sources and resources

Read next