17 ms·
Recursively summarizing enables long-term dialogue memory in LLMs
- yieldcrv 3y ago7 people got together and wrote this paper Can someone summarize why this is different/better/more important than what we’ve seen 4 months ago with AutoGPT or even longer ago with the guy who got ChatGPT to make a compression algorithm that other ChatGPT sessions could read and resume conversations from
- deleted 3y ago[deleted]
- codefreakxff 3y agoI haven't read it yet to be certain, but my impression is that rather than using lossless compression of entire chats, this uses lossy summarization to get the gist of chats. There will be tradeoffs between the two methods, hopefully this paper covers that.
- keskival 3y agoIt seems to be exactly the same as what everyone has been doing for a long time already, and they fail in citing existing implementations.
- BoorishBears 3y agoI mentioned this in a comment a few weeks ago, but people are oversimplifying the summarization part: https://news.ycombinator.com/item?id=37117515 https://news.ycombinator.com/item?id=37117515 For a given use-case, long term memory has a subtly different value proposition. If I'm building a home assistant, I should be using NER to identify names and build an understanding of how they like to be spoken to in messages, or places and how they tend to be commuted to If I'm building a CS bot, I should be identifying queries that resulted in extended exchanges, or led to a sudden abandoned cart Summarization at the generic summarization level is enough for flashy demoes, but to build truly useful products right now you need to go a step further
- whimsicalism 3y agoTo my intuition, all of these ways of building memory in “text space” seem super hacky. It seems intuitive to me that memory would be best stored in dense embedding space that can preserve full semantic meaning for the model rather than as some hacked on process of continually regenerating summaries. And similarly, the model needs to be trained in a setting where it is aware of the memory and how to use it. Preferably that would be from the very beginning (ie. the train on text).
- SubiculumCode 3y agoIt seems to me that sparse encodings would be more efficient and practical for medium term memory. Isn't rhe problem wirh dense embedding is memory usage?
- whimsicalism 3y ago> Isn't rhe problem wirh dense embedding is memory usage? Not necessarily, given that a dense embedding can encode the equivalent of many many words or even higher order concepts not easily expressed in word space.
- nottheengineer 3y agoIt does seem hacky, but then again the whole concept of conversational LLMs is. You're just asking it to add an extra word to a given conversation and after a bit, it spits out an end token that tells your application to hand control back to the user. I think latent space and text space aren't as far apart as you think. LLMs are pretty stupid, but very good at speech. They are good at writing code because that's very similar, but fall apart in things that need some actual abstract thinking, like math. Those text space hacks do tend to work and stuff like "think step by step" has become common because of that. LoRAs are closer to what you mean and they're great at packing a lot of understanding into very little data. But adjusting weights for a single conversation just isn't feasible yet, so we're exploring text space for that purpose. Maybe someome will transfer the methods we discover in text space to embedding space to make them more efficient, but that's for the future.
- MadsRC 3y agoThis seems very close to Langchain's "summary" memory functionality (which seems to have existed since March 2023?) - granted I haven't read the paper just yet
- caprock 3y agoThis sounds a lot like the chunking concept from learning theory.
- kgeist 3y agoI tried to build memory using recursive summarization months ago using open source models and what I found is that with a naive implementation, it would often get stuck on a certain topic forever because certain bits would survive all summarization rounds.
- arketyp 3y agoReminds me of a "bad trip" or OCD patterns. I sometimes think about how little it takes to derail the human mind, by trauma or ontogenically, and how wishful the idea of a human-like AI then seems.
- washadjeffmad 3y agoYeah, unless this substantially mitigates amplification, even when using manual chunk sizing on known materials, the context still hangs onto its "dying thoughts" in a way that remarkably resembles Alzheimer's.
- cushpush 3y agoplaque buildup?
- keskival 3y agoYou can just advice it to forget (that is, skip in summarization) things which seem irrelevant.
- BoorishBears 3y agoOr you could use techniques from the 1970s that let you skip the kind of highly repetitive text that causes them to get stuck without losing important concepts (IDF)
- potatoman22 3y agoThis is interesting. How would you incorporate IDF into an LLM?
- wintermutestwin 3y agoProbably my ignorance talking, but I don't understand why there isn't a layer on top of an LLM that uses good old computer logic to keep track of and validate data. I am baffled by the fact that when I ask ChatGPT to look up some stock data (for example) it spits out errors. How does it not have a built in ability to check its own output?
- jamilton 3y agoWhat do you mean by "check its own output"?
- a-r-t 3y agoBecause if you had a logic layer capable of validating LLM's output, you wouldn't need the LLM.
- kendalf89 3y agoEven something as simple as censoring swear words would be in line with what openAI are trying to accomplish but they keep lobotomizing the model instead.
- ben_w 3y agoI think we still need an LLM to enable the system as a whole to understand vague and half-baked human input. I can easily ask an LLM to write be a function in a random programming language, then feed the output to a compiler, and pipe errors from the compiler back to the LLM. What doesn't work so well is typing "pong in java" into a bash shell. This isn't a perfect solution (not even for small projects), but it does demonstrate that automated validation can improve the output.
- a-r-t 3y agoThis is what ChatGPT's Code Interpreter does (writes code in Python and then runs it to check for errors). I'm not sure if it's enabled for everyone yet though.
- turmeric_root 3y ago
- Nevermark 3y agoThis is a little sideways to the article/discussion. The short memory is a real limitation, but I have noticed most critiques of GPT-4's abilities apply as much, or more, to humans. I don't think anyone alive could convince me they were GPT-4 in a Reverse Turing Test situation. GPT-4's fast organized responses alone hammer human abilities. But even a team of humans, with 60 minutes to answer each question, could find it difficult to match GPT-4's responses to interesting queries. It would be a fun competition.
- ipnon 3y agoVery interesting academies these researchers are based at … makes you wonder what kind of new applications this research enables.
- Philpax 3y agoWhat are you saying?
- TuringNYC 3y agoA bit of personal anecdote -- at work, we have thousands of "Briefings" which are hour-long (sometimes day-long) in-person panels. We've successfully summarized each and every briefing. The messy transcripts are well summarized into five paragraph of text. More topical, we also 1:many categorized each briefing into topics and sub-topics with topics ending up with several dozen briefings and sub-topics of a dozen briefings. For this we summarized the subset of associated summaries and tested this comprehensively, and had great results with LLMs. I was originally skeptical this would work, but it worked beautifully. Given a sufficiently large context window, we would not have done so, but thankfully this was not a problem.
- ec109685 3y agoEven with large context windows, this technique is useful. I have found breaking down a problem into “map reduce” does much better than stuffing it into a huge 32k context window and asking it solve it in one shot.
- TuringNYC 3y agoIt would require careful setup, but one thing that might be the case is losing light mentions across many documents and keeping heavy mentions clustered in one document. With the summary-of-summaries approach, I think dense clusters in one document vs consistent mentions in many documents wouldnt get the same treatment.
- m3kw9 3y agoThis wouldn’t work for ChatGPT right? All it cares about is the input context
- hansvm 3y agoChatGPT is used in the paper. The problem they're solving is how to throw a loop around the LLM (like ChatGPT) to generate an appropriate input context.
- Michelangelo11 3y agoKind of a disappointing paper, really. Essentially zero details about their technique, just tables showing that, with the methodology they used, it does indeed achieve good results. I get that that's par for the course for science these days, but to me as a developer working on LLMs, the paper is essentially valueless (of course, I'm sure it incrementally raises the authors' prestige in their corner of academia, as was no doubt its purpose).
- glandium 3y agoCheck the very last page. Their prompt is there.
- Roark66 3y agoAlso: >Code and scripts will be released later. Hey, wanna team up and author a few articles like that?</sarcasm> I wonder how many it'll take before one can put a title of a "ML researcher" on top of their CV.
- ec109685 3y agoIt’s a simple topic made much much more complex by embedding it into a scientific paper. Way more time should have been spent on examples and the prompt.
- slavboj 3y agoIn human terms, we would call this "reading the minutes".
- roseway4 3y agoI’m struggling to understand what’s novel here. LLM-based summarization of chat history memory is a well-established technique implemented by many LLM frameworks. Summarizing on every message is, as proposed in the paper, a major performance bottleneck and adds significant latency to the chat loop. Many implementations utilize a fixed sized buffer, progressively summarizing batches of older memories when they fall out of the buffer. Ideally, this is also done out of band to the chat loop. I’m an author of Zep[0], an open source long-term memory store, and this is how we implemented summarization. 0: https://github.com/getzep/zep https://github.com/getzep/zep
- anotherpaulg 3y agoAider does this too, using a background thread to summarize the messages older than the last N. https://github.com/paul-gauthier/aider/blob/main/aider/history.py https://github.com/paul-gauthier/aider/blob/main/aider/histo...
- px43 3y agoYeah, I'm pretty novice, but I took that hourish long Andrew Ng class on LangChain, and they covered recursive summarization as a standard memory management technique. https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/ https://www.deeplearning.ai/short-courses/langchain-for-llm-...
- deleted 3y ago[deleted]
- chrgy 3y agoExactly, There is nothing Novel here, even a middle school Chatgpt user would have known this.
- deleted 3y ago[deleted]
- chrgy 3y ago[flagged]
- gillh 3y agoWe have been doing this at CodeRabbit[0] for incrementally reviewing PRs and allowing conversations in the context of code changes, giving the impression that the bot has much more context than it has. It's one of the few tricks we use to scale the AI to code review even large PRs (100+ files). For each commit, we summarize diff for each file. Then, we create a summary of summaries, which is incrementally updated as further commits are made on a pull request. This summary of summaries is saved, hidden inside a comment on a pull request, and is used while reviewing each file and answering the user's queries. Some of our code is in the open source. Here is the link to the relevant prompt for recursive summarization - https://github.com/coderabbitai/ai-pr-reviewer/blob/main/src/prompts.ts#L55 https://github.com/coderabbitai/ai-pr-reviewer/blob/main/src... [0]: coderabbit.ai
- ec109685 3y agoDo you run into issues with parsing the prompt result? And if so, have you tried using “function” calling versus parsing the more free text output?
- gillh 3y agoWe haven’t used functions as our text parsing has been pretty high fidelity so far. It’s because we provide an example of the format that we expect. We didn’t feel like fighting too hard with LLMs to get structured output. You will also notice that our input format is not structured as well. Instead of unidiff format we provide the AI side-by-side diff with line number annotations so the it can comment accurately - this is similar to how humans want to look at diffs. Our OSS code is far behind our proprietary version. We have a lot more going on over there and we don’t use functions in that version as well.
- ec109685 3y agoWe’ve found things like double quotes, emoji’s and other edge cases are a struggle when trying to get data back.
- Roark66 3y ago>Code and scripts will be released later. At this stage I'll not believe a single claim without "code and scripts". It may be true, it may be bullshit. Who knows. Without a low effort way to replicate the experiments I consider this paper(and others like it) something written just so authors can put it in their CVs. I've been waiting for 6+ months for other "code to be released later" papers in this(LLMs) space and there is no indication it will ever be released. Some of these papers are so brazen to even include broken links that lead to parked domains. It's time the community started recognising this behaviour.
- phire 3y agoYes, it's a really simple idea that doesn't require much code. Really shouldn't be hard to clean it up and publish. I was actually playing with similar ideas a while back. I didn't have any code at all, I was just experimenting with prompts directly in the API dashboard. The idea showed some promise, but it didn't seem like the API cost would be worth it. I suspect you would be much better off with a vector embeddings approach.
- samanator 3y agoThe paper's implementation is to essentially append memory text as part of the prompt. Why don't they use a storage/retrieval system that doesn't consume context window tokens? E.g. Storage could be to automatically categorize data with tags at insertion time (i.e. upon user prompt) and retrieval could be a query that filters using a tag guessed by the LLM (before responding to the user). With a few initial rules like hard coded tag names/styles, my intuition is that this would produce great results.
- golol 3y agoHow is this original work? I bet you can find 100 implementations of some kind of recursive summarization memory for LLMs on Github, one of them on mine.
- magicalhippo 3y agoI'm not into ML at all, and this was the first idea I had when I learned about the limitations of the context length. Even commented on it here[1] some time later. Of course, it's one thing to have a good idea, another is to actually implement it well... [1]: https://news.ycombinator.com/item?id=36531771 https://news.ycombinator.com/item?id=36531771
- rosemarywinks03 3y ago[dead]