Selfmem[Cheng et al., 2023b] iteratively uses a retrieval-
enhanced generator to create an unbounded memory pool. A
memory selector is employed to choose an output as the mem-
ory for subsequent generations. This output serves as the dual
problem to the original question. By combining the original

and dual problems, a retrieval-enhanced generative model can
leverage its own output to enhance itself.
Retrieval-AugmentedGenerationforLargeLanguageModels-ASurvey