long-context rag retrieval embedding-models agentic-memory latent-memory evolvable-representations segment-batching
Abstract
Existing embedding models are inherently static: they encode text segments in isolation, ignoring their surrounding context and temporal order. This paper introduces EvoEmbedding, a novel embedding model that generates evolvable representations for retrieval. It is tailored for long-context scenarios, where information is dynamic, sequential, and requires continuous state tracking. Our design is simple: EvoEmbedding maintains a continuously updated latent memory as it sequentially processes inputs, and uses it alongside the raw content to jointly generate evolvable embeddings. Consequently, for the same query, our model adapts its representation to retrieve distinct targets based on the evolving context, going beyond static semantic search. To equip the model with this capability, we construct EvoTrain-180K, a diverse dataset for the joint optimization of latent memory and retrieval. Furthermore, we introduce a memory queue to prevent representation collapse during recurrent encoding, alongside segment-batching techniques that tackle significant length variance and accelerate training by 3.8times. Extensive experiments show that our model not only outperforms larger-scale specialists (e.g., Qwen3-Embedding-8B and KaLM-Embedding-Gemma3-12B) across a range of long-context retrieval benchmarks, but also generalizes well to downstream tasks (e.g., personalization) with contexts 10times longer than its training window. Notably, EvoEmbedding seamlessly integrates into agentic workflows to boost performance. For instance, a naive RAG pipeline equipped with our model surpasses dedicated agentic memory systems. Project Page: https://clare-nie.github.io/EvoEmbedding.
한국어 요약
한 줄 요약
EvoEmbedding은 장문 컨텍스트를 고려한 동적으로 변화하는 임베딩을 생성하여 기존 정적 모델을 극복하는 새로운 검색 모델이다.
핵심 기여도
- EvoTrain-180K라는 다목적 데이터셋을 제안하여 잠재 메모리와 검색을 결합한 최적화를 지원.
- 메모리 큐와 세그먼트 배치 기법을 도입하여 학습 효율을 3.8× 향상시키고 표현 붕괴를 방지.
- 기존 대규모 전용 모델(Qwen3-Embedding-8B, KaLM-Embedding-Gemma3-12B)보다 6.4~11.1% 성능 개선.
- LongMemEval-s에서 77.6% 정확도 달성, 기존 메모리 기반 방법 대비 12.4~7.4% 개선.
핵심 아이디어
기존 임베딩 모델은 텍스트를 고립된 상태로 인코딩하여 주변 컨텍스트와 시간 순서를 무시한다. EvoEmbedding은 이를 극복하기 위해 입력을 순차적으로 처리하면서 지속적으로 업데이트되는 잠재 메모리를 유지하고, 이를 원본 콘텐츠와 결합하여 동적으로 변화하는 임베딩을 생성한다. 이는 동일한 쿼리라도 변화하는 컨텍스트에 따라 다른 대상 정보를 검색할 수 있게 한다. 핵심 아이디어는 "임베딩 자체가 컨텍스트에 따라 진화할 수 있어야 한다"는 통찰에 기반하며, 이를 위해 잠재 메모리 큐(Latent Memory Queue)와 세그먼트 배치(Segment-Batching) 기법을 도입한다.
기술적 접근법
- **잠재 메모리 큐**: EvoEmbedding은 입력을 순차적으로 처리하며 K=16 토큰 단위로 메모리를 유지하고, 전체 메모리 용량 C=512를 유지하면서 표현 붕괴를 방지.
- **세그먼트 배치 기법**: 여러 연속된 세그먼트를 동시에 처리하여 학습 및 추론 속도를 3.8× 향상.
- **EvoTrain-180K 데이터셋**: 다양한 컨텍스트 길이를 포함한 대규모 데이터셋으로, 잠재 메모리와 검색의 결합 최적화를 지원.
- **LoRA 설계**: 생성, 검색, 메모리 기능을 하나의 모델에 통합하며, 기존 LLM의 파라미터는 고정하고 LoRA 어댑터만 학습하여 카테고릭 포겟팅 방지.
주요 결과
- **LongMemEval-s**: EvoEmbedding-4B가 77.6% 정확도 달성, A-MEM(65.2%)과 LightMem(70.2%) 대비 12.4~7.4% 개선.
- **기존 전용 모델 대비 성능**: KaLM-Embedding-Gemma3-12B 대비 +6.4%, Qwen3-Embedding-8B 대비 +11.1% 개선.
- **확장성**: 128K 길이의 컨텍스트 처리 가능(1.2K 평균 훈련 샘플 길이 대비 100× 이상).
- **에이전트 메모리 시스템 통합**: A-MEM +19.2%, LightMem +13.5% 성능 향상.
의의 및 한계
EvoEmbedding은 장문 컨텍스트를 고려한 정확한 검색을 가능하게 하며, 기존 정적 임베딩 모델의 한계를 극복한 새로운 패러다임을 제시한다. 특히, 메모리 큐와 세그먼트 배치 기법을 통해 표현 붕괴를 방지하고, 학습 효율을 대폭 향상시켰다. 또한, LoRA 기반 설계로 기존 LLM과의 호환성을 유지하면서도 생성 과정에서의 카테고릭 포겟팅을 방지한다. 그러나 현재 구현은 다모달 검색을 지원하지 않으며, 도메인 외 데이터에 대한 성능 저하가 있을 수 있다. 또한, 훈련 데이터와 계산 자원의 한계로 인해 확장 가능성에 제약이 있을 수 있다.
실용적 활용
EvoEmbedding은 AI 에이전트, 개인화 추천, 장기 메모리 기반 대화 시스템 등에 적용 가능하다. 특히, RAG 파이프라인에 통합하면 기존 메모리 기반 시스템을 대체하거나 성능을 향상시킬 수 있다. 또한, 다양한 도메인에서의 장문 컨텍스트 처리를 요구하는 시스템에서 유용하게 활용될 수 있다.