HiNS: Hierarchical Negative Sampling for More Comprehensive Memory Retrieval Embedding Model
Motong Tian, Allen P. Wong, Mingjun Mao, Wangchunshu Zhou
TL;DR
HiNS reframes memory retrieval for dialogue agents as a contrastive learning problem with a realistic difficulty spectrum for negatives. It introduces a three-tier Hierarchical Negative Sampling framework, plus cross-conversation sampling and semantic query generation, to match empirical distributions of negative types seen in natural interactions. Training uses an explicit negative set with InfoNCE loss, avoiding in-batch negatives to prevent false negatives, and demonstrates consistent improvements on LoCoMo and PERSONAMEM across MemoryOS and Mem0 frameworks. The results indicate that incorporating structured negative difficulty and dialogue-informed evidence enhances retrieval fidelity and generalization in memory-intensive tasks, with implications for more robust long-horizon agent reasoning and personalization.
Abstract
Memory-augmented language agents rely on embedding models for effective memory retrieval. However, existing training data construction overlooks a critical limitation: the hierarchical difficulty of negative samples and their natural distribution in human-agent interactions. In practice, some negatives are semantically close distractors while others are trivially irrelevant, and natural dialogue exhibits structured proportions of these types. Current approaches using synthetic or uniformly sampled negatives fail to reflect this diversity, limiting embedding models' ability to learn nuanced discrimination essential for robust memory retrieval. In this work, we propose a principled data construction framework HiNS that explicitly models negative sample difficulty tiers and incorporates empirically grounded negative ratios derived from conversational data, enabling the training of embedding models with substantially improved retrieval fidelity and generalization in memory-intensive tasks. Experiments show significant improvements: on LoCoMo, F1/BLEU-1 gains of 3.27%/3.30%(MemoryOS) and 1.95%/1.78% (Mem0); on PERSONAMEM, total score improvements of 1.19% (MemoryOS) and 2.55% (Mem0).
