Live data from Hacker News

MemGPT – LLMs with self-editing memory for unbounded context

github.com

61–70 of 90 posts

Re: MemGPT – LLMs with self-editing memory for unbounded context

#61
post #56

Earlier quoted context omitted.

It’s not suspicious, the previous title calling it an operating system was extremely incorrect and intentionally misleading to generate buzz. Aka clickbait.

[flagged]

Please don't cross into personal attack, no matter how wrong someone is or you feel they are. It only makes things worse.

https://news.ycombinator.com/newsguidelines.html

Re: MemGPT – LLMs with self-editing memory for unbounded context

#62

Does anyone else find that self editing a linear memory evokes images of the theoretical Turing machine with its infinite tape?

Interesting analogy! There's no clear infinite tape equivalent in MemGPT, but you can view the virtual context loosely as a tape. Moving the head could correspond to MemGPT indexing into virtual context - if the data is in-context (inside the LLM window), it's a direct read, but if data isn't there (it may/may not be stored in external context), the read requires a function call to "page in" the data.

Re: MemGPT – LLMs with self-editing memory for unbounded context

#64

Good job! On the limitations you wrote: ``` Similarly, we also found that the most popular the Llama 2 70B model variants (even those fine-tuned for function calling) would consistently generate incorrect function calls or even hallucinate functions outside the providede schema. ``` You could use grammar-based sampling [0] to ensure that the function call is at least syntactically correct. [0] https://github.com/gger…

Grammar-based sampling is a great idea and a perfect fit for something like MemGPT! In our experiments using MemGPT with non-gpt-4 models, the biggest issue impacting performance ended up being incorrect use of function parameters and function hallucination. For example, even large models finetuned on function call data (eg https://huggingface.co/jondurbin/airoboros-l2-70b-2.1#agentf...) would generally output correct parsable JSON, but the arguments or function name would be wrong. For example the LLM might output a call to `personal_diary.add` (never specified in the preprompt) instead of the correct `working_context.append` call (explicitly specified in the preprompt) when trying to write data.

Re: MemGPT – LLMs with self-editing memory for unbounded context

#65
post #25

I've had a suspicion for a while now that this is what ChatGPT does within a conversation (chat.openai.com, not the api). I've had very long chat histories that seem to gracefully degrade instead of just forgetting everything. Maybe there's more clues in the context than I realize though. Either way this type of idea will probably be a fundamental feature for all chat bots in the future IMO.

I'm still very much learning this stuff, but I wonder if that's related to the vanishing gradient problem, which seems to be a fundamental aspect of these types of approaches. (Please don't assume that's correct) https://en.wikipedia.org/wiki/Vanishing_gradient_problem

Vanishing gradient was an issue for non-residual deep networks and vanilla RNNs. While the long context memory issues are along sequence dimension, not network depth.

The problem could be some kind of instability of attention as it scales above 10k tokens. A recent paper suggests attention mechanism needs a default value (a "sink"), and its absence produces instability.

https://arxiv.org/abs/2309.17453

Another paper says the middle part is lossy while the beginning and end are better attended.

Re: MemGPT – LLMs with self-editing memory for unbounded context

#66

Is there any reason you're just doing everything within a single context window? I experimented with similar stuff months ago and basically parallelized everything into multiple requests to different agents in pre and post-processing steps. The main context window, for example, wasn't aware of memories being generated or retrieved. I had a post-processor just automatically generating memories and saving them, along w…

Multi Agent has several potential, I am having more confidence as there is some level of entropy on agent reply that makes it a worthwhile

Re: MemGPT – LLMs with self-editing memory for unbounded context

#67

Is there any reason you're just doing everything within a single context window? I experimented with similar stuff months ago and basically parallelized everything into multiple requests to different agents in pre and post-processing steps. The main context window, for example, wasn't aware of memories being generated or retrieved. I had a post-processor just automatically generating memories and saving them, along w…

These are all great points - who or what you ask to manage memory is a design decision and IMO there's two main ways to do it (in the context of chatbots):

* implicit memory management, where the "main LLM" (or for chat, the "dialogue thread") is unaware that memory is being managed in the background (by a "memory LLM", a rule-based script, a small neural network, etc.), and

* explicit memory management (MemGPT), where one LLM does everything

Prior research in multi-session / long-range chat is often implicit, with a designated memory creation process. If I had to guess, I'd say the vast majority of consumer chatbots that implement some type of memory store are also implicit. This is because getting explicit memory management to work requires a lot of complex instruction following, and in our experience this just isn't possible at the moment with most publicly available LLMs (we're actively looking into ways to fix this via eg fine-tuning open models).

The tradeoffs are as you mentioned: with implicit, you don't have to stuff all the memory management instructions into the LLM preprompt (in MemGPT, the total system message is ~1k tokens). But on the upside, explicit memory management (when the LLM works) makes the overall system a lot simpler - there's no need to manage multiple LLM models running on parallel threads, which can add a lot of overhead.

Re: MemGPT – LLMs with self-editing memory for unbounded context

#68
post #65

Earlier quoted context omitted.

I'm still very much learning this stuff, but I wonder if that's related to the vanishing gradient problem, which seems to be a fundamental aspect of these types of approaches. (Please don't assume that's correct) https://en.wikipedia.org/wiki/Vanishing_gradient_problem

Vanishing gradient was an issue for non-residual deep networks and vanilla RNNs. While the long context memory issues are along sequence dimension, not network depth. The problem could be some kind of instability of attention as it scales above 10k tokens. A recent paper suggests attention mechanism needs a default value (a "sink"), and its absence produces instability. https://arxiv.org/abs/2309.17453 Another paper…

That's a really recent paper. Do you actually keep up to date with everything? How do you find the time?

Re: MemGPT – LLMs with self-editing memory for unbounded context

#69
post #25

I've had a suspicion for a while now that this is what ChatGPT does within a conversation (chat.openai.com, not the api). I've had very long chat histories that seem to gracefully degrade instead of just forgetting everything. Maybe there's more clues in the context than I realize though. Either way this type of idea will probably be a fundamental feature for all chat bots in the future IMO.

I'm still very much learning this stuff, but I wonder if that's related to the vanishing gradient problem, which seems to be a fundamental aspect of these types of approaches. (Please don't assume that's correct) https://en.wikipedia.org/wiki/Vanishing_gradient_problem

Regarding the vanishing gradient problem, has anyone tried to train using only a randomly chosen set of independent parameters in each iteration? (Updating only the weights in a small random independent set).

Re: MemGPT – LLMs with self-editing memory for unbounded context

#70
> Resursive summarization (Wu et al., 2021b) is a simple way to address overflowing context windows, however, recursive summarization is inherently lossy and eventually leads to large holes in the memory of the system.

Yes, it does.

> In our experiments ... conversational context is read-only with a special eviction policy (if the queue reaches a certain size, a portion of the front is truncated or compressed via recursive summarization), and working context is writeable by the LLM processor via function calls.

You're doing the same thing, and you have the same problems.

You're just doing it slightly differently; in this case instead of recursively summarizing everything, you're selectively searching the history and generating it for each request. Cool idea.

...but, I'm skeptical; this fundamentally relies on the assumption that the existing context consists of low entropy summarizable context, and that any query relies only on a subset of the history.

This might be true for, eg. chat, or 'answer question about some document in this massive set of documents'.

...but, both of these assumptions are false in some contexts; for example, generating code, where the context is densely packed with information which is not discardable (eg. specific api definitions), and a wide context is required (ie. many api definitions).

It is interesting how this is structured and done, and hey, the demo is cool.

I'm annoyed to see these papers about summary things fail to acknowledge the fundamental limitations of the approach.

Post reply on HN