Small on-device agents inherit memory from larger models, run 3x faster
With DuoMem’s dual-space distillation, a 4B model jumps from 4.3% to 77.9% on ALFWorld using under 10M extra weights and completes tasks over 3x faster than a 72B teacher. Separately, Program-as-Weights compiles “fuzzy” functions into small adapters that a 0.6B interpreter runs at 30 tokens/s on a MacBook M3.
One-Line Summary
Compact, locally runnable agents learn long-horizon skills from bigger models, while “fuzzy” functions get compiled into small neural programs and open-source tooling expands.
Research Papers
DuoMem distills step-by-step memory into 4B on-device agents
DuoMem is a training recipe that teaches a small agent to remember and reuse the right steps from a bigger model so it can solve multi-turn tasks on limited hardware. It transfers procedural problem-solving ability from a large teacher model to compact students and lifts a 4B-parameter student from 4.3% to 77.9% success on the ALFWorld benchmark, approaching the 72B teacher at 87.1%—all while adding fewer than 10 million trainable parameters and only a few megabytes of pre-computed teacher memories. The DuoMem-enhanced 4B model completes tasks over 3x faster than the 72B teacher in wall-clock time, making real-time edge use feasible. 1
The core idea is “dual-space distillation.” In context-space distillation, higher-quality, teacher-generated procedural memories are prepended to the student’s input, replacing what the student would have written. In parameter-space distillation, the student is fine-tuned with lightweight Low-Rank Adaptation (LoRA) adapters on successful teacher trajectories, imprinting good habits directly into the model’s weights. Together, these two spaces reinforce each other: better memories guide inference, and tuned adapters help the model use memories effectively. 1
Across ablations on eight models ranging from 2B to 72B parameters, both distillation axes contribute complementary gains. The results indicate most of the teacher’s gap can be closed with minimal extra storage and compute, pointing to a practical path for memory-augmented agents on phones, robots, and other edge devices where long contexts and repeated calls are costly. 1
Program-as-Weights compiles “fuzzy” functions into small adapters
Some everyday functions don’t fit clean if-else code—like flagging important logs or ranking results by intent—and are often outsourced to Large Language Model (LLM) APIs. Program-as-Weights (PAW) instead compiles a natural-language function spec into a compact, locally executable neural artifact: a 4B “compiler” trained on the 10-million-example FuzzyBench dataset emits parameter-efficient adapters for a frozen, lightweight 0.6B Qwen3 interpreter. On these tasks, the 0.6B interpreter running PAW programs matches direct prompting of Qwen3-32B while using roughly one fiftieth of the inference memory and running at 30 tokens per second on a MacBook M3. 2
PAW reframes a foundation model from a per-input problem solver into a tool builder: invoked once per function definition, it yields a small reusable artifact whose subsequent calls are cheap, offline, and local—improving locality, reproducibility, and cost compared to repeated API calls. 2
Open Source & Repos
Goose agent moves under Linux Foundation, adds multi-provider support
Goose is an open-source, extensible AI agent for code and workflows with a desktop app, a command-line interface (CLI), and an application programming interface (API), designed to work with any Large Language Model (LLM). The project has moved from block/goose to the Agentic AI Foundation (AAIF) at the Linux Foundation and is released under the Apache-2.0 license. 3
The 1.41.0 release (2026-07-03) adds provider integrations including iFlytek Spark and Astron Model-as-a-Service (MaaS), a declarative Fireworks AI provider, OpenRouter request-parameter support, an --edit session flag for revising conversations before forking, and additional interface languages such as French, German, Italian, Portuguese, Indonesian, Malay, and Vietnamese. For teams, this means broader provider choice and smoother iteration when automating workflow steps. 3
Community Pulse
Hacker News (52↑) — Curiosity about the approach is tempered by concerns over generalization beyond the training task families. 4
"This looks cool, but I wonder how well their trained compiler generalizes to new task families . They trained on 29 specific types of tasks, with 800 sub tasks and many rephrasings of each one (the specs). They hold out some specs for validation, but don’t seem to have held out a full task family and maybe not even full sub tasks? If the compiler can’t generalize well to unseen tasks then it’s effectively acting as a fancy router to one of 29/800 predefined LoRAs." — Hacker News 4
Why It Matters
DuoMem shows that long-horizon memory for agents does not have to mean big models, long contexts, and slow loops: pairing teacher-curated memories with small LoRA adapters can deliver near-teacher success rates with a fraction of parameters and over 3x faster wall-clock performance. That makes memory-augmented assistants and embodied agents more plausible on devices where latency and energy matter. 1
PAW points to a complementary pattern: compile once, run many times locally. Turning “fuzzy” functions into small, reusable adapters lets a 0.6B interpreter match a 32B model’s results with about one fiftieth the memory and laptop-class speed, reducing reliance on external APIs for repeated calls. Together with open-source agents like Goose, the tooling stack is evolving toward local-first, multi-provider automation. 23
This Week to Try
- Goose agent (desktop/CLI): Visit the GitHub repo and connect your preferred LLM provider (e.g., via OpenRouter or Fireworks) to automate a small coding or ops task: https://github.com/aaif-goose/goose
Comments (0)