Table of Contents
Fetching ...

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).

HiNS: Hierarchical Negative Sampling for More Comprehensive Memory Retrieval Embedding Model

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).
Paper Structure (38 sections, 13 equations, 2 figures, 5 tables)

This paper contains 38 sections, 13 equations, 2 figures, 5 tables.

Figures (2)

  • Figure 1: The whole pieline of our framework. The top-right corner presents the original persona based on Nemotron-Personashttps://huggingface.co/datasets/nvidia/Nemotron-Personas. Based on the personas, events are generated. Subsequently, natural dialogues between characters are generated according to temporal sequences, followed by topic clustering, query generation, and hierarchical negative sampling.
  • Figure 2: The Hierarchical Negative Sampling process