Abstract

Abstract. Small Language Models (1.5B–7B parameters) possess substantial coding capability but are bottlenecked by tiny context windows. As retry attempts, error traces, and diagnostic reasoning accumulate, the context fills — forcing truncation of prior work or exhaustion of reasoning capacity. No mechanism exists to maintain a growing episodic record of the agent's problem-solving journey without consuming the same context tokens needed for active reasoning.

Rune proposes parametric episodic memory for local coding agents: each coding session produces a write-once LoRA adapter encoding procedural knowledge as parameter deltas in the base model's weight space. Adapters are composable, non-destructive, and reversible, enabling selective retrieval without overwriting previously acquired knowledge. This places Rune in the composable weight-space category of memory strategies, distinct from RAG (token-space) and full fine-tuning (destructive weight-space). The system implements a five-phase pipeline (decompose, plan, code, integrate, diagnose/repair) with a two-step diagnose-then-repair pattern that separates error context from domain knowledge to avoid prompt-adapter tension. Development and benchmarking use Gemma 2 2B (google/gemma-2-2b-it) as the evaluation target, with Qwen as the production-scale model.

The proposed mechanism extends Doc-to-LoRA -- a hypernetwork architecture validated on document question-answering -- to code execution trajectories: sequences of generation attempts, execution results, and reflection steps. The hypernetwork maps trajectory inputs to LoRA adapter weights in a single forward pass. This trajectory modality extension has not been empirically validated; Doc-to-LoRA's applicability to code trajectories is the central open research question. An Evolution Operator governs the adapter lifecycle using a fitness function combining pass rate and generalization score, performing consolidate, update, forget, and merge operations. Cross-task transfer via adapter composition is a future research direction enabled by the adapter registry architecture but not the primary mechanism.

The hypernetwork is trained in two rounds. Round-1 distills the hypernetwork against the bare base model on accumulated trajectory corpora. Round-2 distills against 25 per-bin oracle adapters (4 pipeline phases × 6 evaluation benchmarks + 1 pooled diagnose bin) as teacher signals, applied via a functional-LoRA context manager that never structurally mutates the base model. A strict success gate requires ≥ 4/6 benchmarks improved ≥ 2.0% Pass@1 with no regression > 1.0% before a round-2 adapter is promoted. The production base model is Qwen/Qwen3.5-9B with a DeltaCoder (danielcherubini/Qwen3.5-DeltaCoder-9B) warm-start providing GDN-aware target module coverage and DPO alignment on self-correction pairs.

If the Phase 1 kill-switch gate succeeds, Rune is expected to deliver parametric episodic memory that gives SLMs unbounded reasoning depth on coding tasks — enabling local-first AI for data-sensitive environments, massive cost reduction versus cloud LLM APIs, and a foundation for future cross-task knowledge accumulation. The fitness-driven adapter lifecycle is specified in the architecture and will be evaluated empirically against LoRA Soups' composition-by-assumption approach. The trajectory modality extension and the PBB-inspired procedural behavior criterion are proposed and require empirical validation.