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.
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#
| Method | What the user supplies | How construction works | What is saved | What runs per input | Preparation |
|---|---|---|---|---|---|
| Prompting | Task instruction, examples and each new input | Place the instruction and input in the model’s context | Prompt or conversation configuration | The chosen language model | A pretrained model; task prompt design |
| Task-specific fine-tuning | Training examples and a base model | Optimize full weights or selected parameters with gradients | Updated checkpoint or adapter | Adapted model or base plus adapter | Task data, training procedure and evaluation |
| HyperNetworks | Conditioning information for the weight generator | Run a trained network that generates another network’s parameters | Generator checkpoint; generated parameters as required by the application | The receiving network | End-to-end training of the generator and its receiving computation |
| Tracr | RASP source, vocabulary and length bound | Translate source operations into transformer components | Transformer parameters and their execution configuration | The constructed transformer | A supported RASP program and compiler |
| Text-to-LoRA | Natural-language task description | Generate an adapter with a trained hypernetwork | LoRA parameters | Compatible base model with the generated adapter | Training the hypernetwork using task-adapter supervision |
| Code2LoRA | Repository snapshot, or a sequence of code changes | Generate repository-specific adapters; update generator state as code evolves | Adapter; evolution state in the evolving-repository variant | Code language model with repository-specific adaptation | Train the repository-conditioned generator |
| Program-as-Weights | Natural-language fuzzy-function specification | Produce task text and generate LoRA weights with a trained compiler | Hybrid program: task text, adapter and runtime metadata | Shared compatible interpreter with that program | Train the compiler across specification–input–output tasks |
| Compile by Training | Function specification | Generate task examples with teachers and optimize the function’s adapter | Reusable neural function | Shared interpreter with the saved function | Teacher access and per-function optimization during compilation |
| Sparks | Weights, architecture and task information; tools vary by experiment | General-purpose LLM reasoning constructs or edits weights | Constructed weights, edited checkpoint and associated traces | Constructed or edited network | A 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
- HyperNetworks
- Tracr: Compiled Transformers as a Laboratory for Interpretability
- Text-to-LoRA
- Code2LoRA
- Program-as-Weights: A Programming Paradigm for Fuzzy Functions
- Compile by Training
- Sparks of Weight-Space Programming
- LoRA: Low-Rank Adaptation of Large Language Models
- Distilling the Knowledge in a Neural Network