TL;DR
DuoMem is a novel "dual-space" knowledge distillation framework designed to bring advanced procedural memory capabilities from massive LLMs down to compact, edge-deployable models (2B–12B parameters). By combining training-free context-space distillation with lightweight parameter-space LoRA adapters, it boosts a 4B model's task success rate on the ALFWorld benchmark from a dismal 4.3% to an impressive 77.9%. Crucially, the distilled model runs over 3× faster than its 72B teacher, making capable, real-time on-device agents a practical reality.
What Problem Does This Paper Address?
Large Language Model (LLM) agents excel at solving complex, multi-turn procedural tasks by interacting with environments and planning actions. However, state-of-the-art performance typically demands massive models (30B to 70B+ parameters) and extensive context windows to store and process procedural memories.
This high computational footprint creates a massive barrier for deployment on resource-constrained edge devices like smartphones, robots, or embedded systems. While smaller models (2B–12B) are attractive for on-device use due to lower latency, they possess significantly weaker procedural reasoning capabilities and struggle to generate or effectively utilize structured memories on their own. DuoMem addresses this gap by transferring the procedural problem-solving prowess of a large teacher model to compact student models without blowing up the computational or storage budget.
Methods
DuoMem achieves its goals by distilling knowledge across two complementary spaces:
- Context-Space Distillation (CD): Smaller models often write poor memory summaries that miss crucial steps. DuoMem bypasses this by using a powerful teacher model (Qwen2.5-72B-Instruct) offline to extract high-quality procedural scripts from past successful trajectories. At inference time, the most relevant teacher-generated memories are retrieved via embedding similarity and prepended directly to the student's input context. This requires zero training or parameter modifications.
- Parameter-Space Distillation (LoRA): To improve how the student model acts, the authors collect successful task trajectories from the teacher. They then fine-tune lightweight Low-Rank Adaptation (LoRA) modules on the student model using a next-token prediction loss on these expert demonstrations, training the student to mimic the teacher's policy at every decision point.
By combining both spaces, DuoMem creates a powerful synergy: context distillation improves what the model sees, while LoRA fine-tuning improves how the model acts based on that context.
Datasets
The framework was evaluated on ALFWorld, a challenging text-based embodied environment requiring agents to complete multi-step household tasks (e.g., locating, cleaning, heating, and placing objects) through text actions.
- Training: 3,553 standard training tasks, which were oversampled to generate 11,434 successful teacher trajectories.
- Validation: 140 tasks used for hyperparameter selection.
- Test: 134 unseen tasks for final evaluation.
Key Insights and Ideas
- The Power of Synergy: Context-space and parameter-space distillation are far more powerful together than apart. For instance, on a 4B model, context distillation alone adds a modest 1.4% improvement over the baseline memory configuration, but when combined with LoRA parameter distillation, it unlocks a massive synergistic leap to 77.9% success.
- Asymmetric Memory Benefits: Smaller models benefit disproportionately from structured external memory. While the 72B teacher model only saw a 5% performance bump when augmented with procedural memory, the 4B student model saw a staggering 1182% relative improvement, proving that external memory acts as a crucial equalizer for compact models.
- "Thinking" Modes are Too Slow for the Edge: While models with extended internal reasoning chains (like chain-of-thought or "thinking" modes) achieve high accuracy, they incur a severe 5–7× latency penalty. DuoMem allows non-thinking models to recover the accuracy gap while maintaining real-time inference speeds.
Key Results
The main quantitative evaluations demonstrate transformative improvements across multiple small model families:
- Success Rate: DuoMem catapulted the Qwen3-4B-Instruct model from a 4.3% success rate (with no memory) to 77.9%, closing 89% of the absolute gap to the 72B teacher model (87.1%).
- Inference Speed: The DuoMem-enhanced 4B model completed tasks in just 4.89 seconds on average—more than 3× faster than the 72B teacher model, which took 16.69 seconds.
- Minimal Overhead: The additional LoRA parameters are incredibly lightweight, adding fewer than 10M trainable parameters (<0.15% of the backbone) and requiring only ~12MB to ~47MB of storage. The entire offline teacher memory store occupies a mere ~4MB.
Limitations and Future Work
While DuoMem shows immense promise, the authors note several limitations and areas for future exploration:
- Benchmark Variety: Evaluation was restricted to the ALFWorld benchmark. Future work will focus on testing generalizability across other procedural domains like web navigation and code generation.
- Single Teacher Reliance: The current framework utilizes a single teacher model. Investigating ensembles of multiple teachers or iterative self-distillation could push student performance even further.
- Edge Hardware Profiling: Wall-clock efficiency was profiled on server-grade GPUs (2×A100). End-to-end latency profiling on actual edge hardware (like mobile NPUs) is required to fully cement its deployment narrative.
- Static Task Distributions: DuoMem currently assumes a fixed training task distribution for trajectory collection; adapting it to open-domain or continually evolving task streams remains an open challenge.
Summary updated