Skip to content

Projects

Projects
Research2026

BrainPatch

Tiny installable behaviour patches for frozen language models

A portable file format and runtime for reversible activation-space interventions. No fine-tuning, no weight modification, no prompt injection, no hosted service.

//The problem

Changing a model’s behaviour normally means fine-tuning it (gigabytes, permanent, not adjustable at runtime) or prompt engineering (costs context on every single call, and is crude). Neither is removable mid-session or continuously dialable.

//What it does

  • A .brainpatch file holds direction vectors plus the layers to add them to. Installing one applies a behavioural intervention without touching weights.
  • Patch strength is adjustable continuously at runtime, and removable mid-session.
  • Token schedules allow the intervention to change during generation.
  • Verified to execute against real models across Transformers, llama.cpp and vLLM.

//Measured

Artifact size
6,856 bytes vs 3,087,467,144 bytes of weights — a 450,331× ratio
Runtime overhead
−1.3% on Transformers (within noise), +2.2% tok/s on vLLM
Extra VRAM
0.01 MB
Released
PyPI v1.2.0

//Built with

  • PyTorch
  • Transformers
  • vLLM
  • llama.cpp
  • Sparse autoencoders
  • Modal

status: Verified infrastructure, honest negative result on the example patch