⬇ Download LAMP-Qwen for macOS — Apple Silicon (.dmg)
Developer ID–signed and Apple-notarized · macOS 26+ · approximately 1.75 GB
Open the downloaded .dmg, drag LAMP-Qwen into Applications, and launch it. The model and runtime are included: no Python, Ollama, or separate model download is required. Tested on an M4 Mac mini with 16 GB memory.
Technical paper: PDF · Markdown · LaTeX · Complete LaTeX package · Browse all files · Verify download checksums · Figures and source
What if you could change a language model's answer by writing a new memory, without retraining the model?
LAMP-Qwen is an experimental implementation of Latent Associative Memory Programming for Qwen3.5-0.8B. It adds a separate, editable numerical memory to the pretrained model. A forward-only writer creates associations between questions and desired answers, and a custom inference runtime applies those memories while the model generates text. Qwen's original parameters remain frozen.
The project includes a native SwiftUI macOS application for asking questions, comparing original and altered answers, writing memories, browsing a 1,000-question catalogue, and inspecting or editing memory values directly.
Author: William Taggart
Affiliation: Modern and Classical Languages and Literatures, Virginia Tech
Contact: wtaggart@vt.edu
Original LAMP web experiment · Original LAMP source · Base model
Release status: Research prototype. This is a custom memory extension, not a fine-tuned Qwen checkpoint or a standard LoRA/PEFT adapter. It requires the included runtime or Mac application. Calling
from_pretrained("will-taggart/LAMP-Qwen-v0.1")alone will not install the memory mechanism, and stock Ollama does not execute it. The Hub's adapter relationship describes the separate extension; it does not imply PEFT compatibility.
| Item | Description |
|---|---|
| Base model | Qwen/Qwen3.5-0.8B |
| Base revision | 2fc06364715b967f1860aea9cf38778875588b17 |
| Model changes | Separate memory tensors and inference hooks; no base-parameter updates |
| Memory location | Final decoder block, after the attention residual and before the FFN normalization, including its residual path |
| Hidden width | 1,024 |
| Memory capacity | 1,000 recognition slots |
| Default writer | Validated per-token sequence adjustments |
| Runtime | Transformers, PyTorch, float32, greedy decoding |
| Input/output | Text; questions are processed independently |
| Tested hardware | M4 Mac mini with 16 GB unified memory, using Metal/MPS |
| Mac distribution | Self-contained Apple Silicon app; macOS 26 or later |
Download the self-contained Mac app or read the updated technical report. The source and memory files are also available under Files and versions.
The approximately 1.75 GB disk image contains the model, Python, and dependencies. The installed app occupies approximately 2.5 GiB. No separate Python installation, Ollama server, account, or model download is needed to use the app. Inference runs locally and offline.
This release is signed with William Taggart’s Developer ID and notarized by Apple. The installer carries a stapled notarization ticket and passed local Gatekeeper assessment. macOS may ask you to confirm the first launch of a downloaded application. Intel Macs and macOS versions earlier than 26 are not supported by this packaged build.
| View | What it does |
|---|---|
| Chat | Generates answers with memory enabled or disabled; compares both paths |
| Write memory | Programs a source question and target answer; exposes writer mode, token limit, slot, threshold, and gain |
| Question bank | Searches the 1,000-example catalogue and fills the writer form |
| Memory slots | Inspects, enables/disables, tunes, clears, imports, and exports memory |
| Weight editor | Reads and edits complete numerical rows in the memory matrices |
| About | Introduces Latent Associative Memory Programming and lists authorship and licensing |
| Help | Explains the mechanism, file locations, and experimental limitations |
Each question starts a new inference context. The visible chat is not supplied as conversation history, and asking a question does not automatically write a memory.
The frozen model processes the prompt. At the final decoder block, the runtime captures the last prompt token's 1,024-number hidden state, h. The writer stores a unit-length recognition key:
key = h / ||h||₂
A later question produces a new hidden state. The runtime normalizes it and compares it with enabled keys using dot products. With unit-length keys, these are cosine similarities. The highest eligible score wins; the default threshold is 0.999. Scores are similarity measurements, not probabilities.
No eligible slot means no memory adjustment. Selection happens once per question and remains fixed during its answer.
The writer obtains a donor hidden state h* from a separate prompt that asks the model to copy the desired answer. It calculates:
delta = donor state − source state
= h* − h
For the exact source state and gain 1:
h + delta = h*
The runtime inserts that adjusted state into both the final FFN branch and its residual:
adjusted = h + delta
output = adjusted + FFN(RMSNorm(adjusted))
Final normalization and the vocabulary head then produce the next-token scores. A pre-normalization hook changes the FFN input; a second hook supplies the matching residual correction. The base weights are never overwritten.
A single displacement does not generally control a complete multi-token response. The default sequence writer therefore stores one source-to-donor displacement per generated position, including the stop-token position.
The writer:
Matching ignores case and collapses whitespace. This is exact-source validation under the recorded runtime, not a guarantee for every paraphrase.
Single-adjustment mode remains available for experiments. It reuses one displacement at every step and can save an entry even when the complete answer fails to match. Its report makes that distinction explicit.
The memory file stores numerical tensors, slot controls, and compatibility metadata:
| Component | Shape or contents |
|---|---|
| Recognition keys | 1,000 × 1,024 float32 values |
| Single adjustments | 1,000 × 1,024 float32 values |
| Sequence adjustments | total stored steps × 1,024 float32 values |
| Slot controls | Enabled flags, thresholds, gains, and sequence offsets/lengths |
| Identity metadata | Model revision, runtime versions, device, prompting configuration, and memory format |
The two fixed matrices occupy 7.8125 MiB. Each sequence step adds 4 KiB. For example, 1,000 answers averaging 30 steps would add about 117.19 MiB of sequence values, excluding the fixed matrices and small control tensors.
Per-entry question strings, answer strings, donor prompts, and token IDs are not stored in the memory file. A fixed system prompt is included in its compatibility metadata. The question catalogue and readable evaluation reports are separate resources and are not consulted by ordinary question inference.
This distinction does not make the memory a compressed database: sequence mode explicitly stores a position-indexed activation trajectory and is much larger than the corresponding text. The demonstrated result is controlled activation replay, not general semantic compression.
Memory files may encode sensitive information even when they contain no readable answer strings. Share only deliberately prepared release memories.
Qwen was pretrained by its original developers. See its model card for information about that base model.
LAMP-Qwen performs no additional gradient-based training. Its writer uses inference, normalization, tensor subtraction, and validation. There is no optimizer or backward pass. The key and single-adjustment matrices are non-trainable parameters; sequence trajectories are registered buffers. All are separate from the original checkpoint.
The 1,000-question spreadsheet supplies candidate questions and target answers for writing and testing. It was not used to fine-tune Qwen. It contains 25 categories of 40 questions and is not an empirical ranking of common questions.
These are small development experiments, not a held-out benchmark. The donor prompt was refined during development, and only 12 of the 1,000 catalogue questions were evaluated in the broader sequence-writing pilot.
| Check | Observed result |
|---|---|
| Sequence writing | 12/12 selected target answers reproduced at write time |
| Initial single-adjustment trial | 0/2 complete target answers matched, although outputs changed |
| Replacement | A Python answer was replaced by an explicitly fictional target and reproduced after reload |
| Unrelated questions | Five questions selected no memory slot and retained their baseline answers |
| Clearing | Clearing all memory restored the baseline answer to the Python question |
| Blank memory | Maximum measured logit difference from the baseline: 0 |
| Frozen parameters | Base-model parameter hashes matched before and after validation |
| Unit tests | Six memory tests passed |
| Packaged application | Writing, inference, editing, tuning, import/export, restart persistence, and relocated-bundle inference were checked |
The 12 sequence cases covered chatbot use, writing, grammar, studying, mathematics, science, history, geography, computing, Python, web development, and spreadsheets. Their trajectories totalled 304 steps. Recorded steered-generation times ranged from 0.850 to 1.355 seconds, with a median near 1.005 seconds on the test Mac. These exclude model loading and the full writing process and are not a controlled speed benchmark.
Entries were checked as they were written into a growing memory; exhaustive retention testing after every subsequent write was not performed. The single and sequence trials also used evolving donor prompts, so their results are not a controlled ablation.
A tested paraphrase, “Explain what a system prompt does,” scored approximately 0.9792, below the default 0.999 threshold, and did not activate memory. The initial experiment therefore demonstrates a recognition limitation as well as successful exact-source steering.
LAMP-Qwen is intended for teaching, inspection, and small research experiments in editable numerical memory and activation steering.
This release is not validated for consequential decisions or unattended factual answering. Its purpose is to make the mechanism observable and editable.
The source release preserves the project layout: cli.py, runner.py, memory.py, download_model.py, run.sh, requirements-lock.txt, data/, and release memory under artifacts/. The included starter memory contains only the catalogue answers for “What is a system prompt?” and “What is Python?”; your private experimental memories are not part of this release.
From a downloaded source release on a compatible Mac with Python 3.14 installed:
python3.14 -m venv .venv
.venv/bin/python -m pip install -r requirements-lock.txt
.venv/bin/python download_model.py
chmod +x run.sh
./run.sh chat
The download script fetches the pinned upstream checkpoint into .hf/. It does not download a separately fine-tuned LAMP model. After the initial download, inference uses local files.
# Inspect original and memory-steered answers.
./run.sh compare "What is Python?"
# Write an intentionally fictional association for a controlled experiment.
./run.sh write "What is Python?" \
--answer "In this fictional setting, Python is a floating library above the clouds."
# Test the newly written memory.
./run.sh ask "What is Python?"
# Browse examples and inspect memory.
./run.sh questions Python
./run.sh slots
./run.sh row keys 0
The CLI defaults to Metal/MPS. With no saved memory, it begins with inactive slots. A supplied release memory must match the recorded configuration. The Mac app and CLI maintain separate mutable memory files:
Mac app: ~/Library/Application Support/LAMP-Qwen/memory.safetensors
CLI: artifacts/memory.safetensors
Use the app's import/export controls to transfer compatible memory files. Raw edits do not automatically normalize keys or prove answer quality; recheck both source questions and unrelated questions afterward.
The original browser-based LAMP uses a 77,568-parameter toy transformer, width 64, 16 slots, and 2,048 memory values. It demonstrates steering single-word answers.
LAMP-Qwen retains the frozen-base/explicit-writer idea but moves to a pretrained model and multi-token responses. Its sequence extension pays for that added control with additional memory per output position. The original web demonstration is an introduction to the idea; it does not run Qwen in the browser.
MEMORILLA also supplies latent information to a frozen language model. Its released implementation trains a memory module to read document embeddings and produce query-dependent soft input tokens.
| Aspect | LAMP-Qwen | MEMORILLA |
|---|---|---|
| Persistent information | Recognition keys and activation differences | Encoded document collection |
| Memory construction | Explicit forward-only writer; no trained controller | Trained memory module; new documents are encoded |
| Model interface | Final pre-FFN residual intervention | Soft tokens in the input context |
| Demonstrated task | Programming selected source-question answers | Document-based recall, personalization, QA, and agents |
These are different mechanisms, not a performance comparison. MEMORILLA has a substantially broader evaluation; LAMP-Qwen's pilot does not establish comparable generalization. MEMORILLA's LaMP benchmark tasks are unrelated to this project's LAMP acronym.
The pinned Qwen checkpoint includes an Apache-2.0 license. The bundled Python runtime and third-party packages retain their own license material. The original LAMP-Qwen code, documentation, and original project assets are MIT licensed; see LICENSE. Upstream models and dependencies retain their own licenses; see third-party notices.
@misc{taggart2026lampqwen,
author = {William Taggart},
title = {LAMP-Qwen: Forward-Only Associative Memory for a Frozen Small Language Model},
year = {2026},
howpublished = {Technical report and research software, version 0.1},
url = {https://huggingface.co/will-taggart/LAMP-Qwen-v0.1}
}
Model card prepared: November 9, 2026. Results describe the recorded development implementation and are not claims about arbitrary user-edited memories.
Qwen/Qwen3.5-0.8B