273 points · by PaulHoule · 3y ago · 152 comments
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).
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.
Pretty odd assertion. LLMs are not "good at speech, bad at abstract thinking".
What do these have to do with speech ?
https://general-pattern-machines.github.io/
https://arxiv.org/abs/2212.09196
It doesn't even hold with your example because GPT-4 is pretty good at Math, nowhere near "falling apart".
I think I have to walk that claim about math back and try to phrase what I meant differently: LLMs have a hard time with problems that don't translate well into the text space, i.e. abstract problems. Math used to be one of those because early tokenizers were designed just with text in mind and LLMs weren't good enough to overcome those limitations. OpenAI put in a lot of effort into their tokenizers to make GPT3.5 and GPT4 better at math specifically.
The second paper you linked is very interesting and I think it supports my original assertion of text space and latent space being close. The first graph shows GPT3.5 doing much better at pattern reproduction and language tasks while humans still hold an advantage in the more abstract tasks like story analogies. Higher order relations being a key thing that's measured maybe makes this task a bit too perfect for arguing my case, but it does show that humans have an advantage in more abstract situations.
I think any problem that can be viewed as being mostly a form of translation is a good one for LLMs and if you can express a problem as that, you can get better results.
To get back to the main point: latent space and text space, or feature space in general, being close is what I believe causes all of this. Happy to hear counterexamples.
its good at tasks which were included into training dataset in some variations.
The GPT-3.5 turbo is fined-tuned for arithmetic according to ClosedAI (noted in one of the change logs), so it is sometimes slightly better, but nevertheless always fails equations like 4897*394=?
Isn't that more of a training method issue? Try teaching a caveman to count by making him memorize the sticks and words pairs like LLM does, and you will get similar results, as he won't know about the stateful counting algorithm.
Humans get the powerful reasoning ability through gradual learning of new abstractions, and won't be able to extract anything useful from a textbook on quantum physics until they learned the basics first.
- Increase the input prompt token limit (2023-09: 32K tokens in: OpenAI GPT-4 Enterprise, Giraffe (LLama 2))
- Fine tune [a "LoRA" atop a foundation model]
- TODO: ~Checkpoint w/ Copy-on-Write
incidentally, this isn't far off from how the human brain is believed to work (at least with long term memories).
https://news.northwestern.edu/stories/2012/09/your-memory-is...
Not as literal words printed somewhere in our mind it isn't. This is more akin to things like the funnel transformer. [0] Nevermind that we hardly understand how our minds actually work.
It's always funny to me when people on online forums confidently proclaim to know what cognition and thinking is all about and that furthermore it can be reduced to symbol shuffling on computers. No one has any clue how to make computers intelligent and anyone that claims to know is either doing marketing for some "AI" company or thoroughly confused about what counts as biological intelligence.
Yes, but we have some informed theories.
Nobody knew how physics works at Newton's time either, but they did know enough to model to satisifcation lots of phenomena like ballistics...
>Did you know your gut is directly connected with cognition?
Well, it is widely reported even in pop-science articles for several decades!
>No one has any clue how to make computers intelligent
For not having "any clue", sure the LLM guys did quite well in getting some of the way to the goalposts...
But that's probably reading a little too deeply and seriously into what I said.
It builds off previous histories and theories of technology which debunk the notion of "neutral" technology. Humans are very much influenced and inspired by doing things because of the technology they have at-hand.
Great example is looking at the most common mechanical models of the human heart. The original models for the heart describe it as a system of "pumps" because it was designed right during the height of the end of the industrial revolution, when the technology at the time were big mechanical pumps and machinery. So, the abstract model of the heart as a pump was born and used, not because necessarily its an "accurate" model but mainly because the terminology made sense to people at the time. Nowadays this model is criticised for a lot of reasons.
Cognitive science suffers from a lot of assumptions which may have been indirectly influenced by computer science (afterall, you're a researcher coming in at a time when you have these powerful machines that could crunch data. Well surely then you'll need to model the brain in a binary and computer-readable format).
Not to say all brain-gut axis data is irrelevant, but, as with almost all of biology, the effect sizes of observables anyone typically cares about are pretty small.
However, the visual system in rodents is probably the best data source we have that maps to any formal theory right now, along with temporal difference learning and RL in neuroscience.
> No one knows how the brain works
You sound very hostile, but I think OP agrees with you.
And I'm not sure why you're trying to dunk on them here. Perhaps at a high level the approach is very similar, even if the mechanics are very different. Would you scoff at someone saying "the robot moved its arm" and say "Ha! Robots don't have muscles, and humans don't have batteries! It's totally different!"?
(As annoying as our input can be, this is why dev teams that try to solve problems for non-dev users have designers.)
It reminds me of the game where someone tells A some story, then A tells it to B, B to C, etc. and then of course the end result is that the story became completely different.
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.
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...
[0]: coderabbit.ai
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.
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.
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.
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.
With the summary-of-summaries approach, I think dense clusters in one document vs consistent mentions in many documents wouldnt get the same treatment.
That is to say, specifically, that it is not possible, by any means, to take any block of text and reduce it to a smaller block of text without losing some information.
That is infinite compression; if you could do this, you could reduce any dataset to 1 bit and recover the data seamlessly.
You can’t.
What that means is that this approach is fundamentally just improving performance, it’s not solving the problem.
When you compress a conversation into a summary, some information will be lost. You can tweak and fold and do whatever clever things you want, but fundamentally you are losing information.
…and the process is recursive. So at some point you will be summarising a set of summaries… and you will lose some information you’ve summarised, to some extent.
You can’t not lose information with this process.
So… while, it probably helps in trivial cases, putting recursive summaries into your prompt is kind of daft, and almost certainly doesn’t actually work when you try use it to do useful things.
It probably looks like it’s working when you don’t use the recursive summaries heavily, because at that point you’re not losing much information.
…but, I’m going to bet that it doesn’t scale, and people using it will find that out pretty quickly as they use it.
This sounds trite/heretic but it is as fundamental in its nature as the concept of "incompressible data". I agree that you cannot spare any data in the absolute, but I argue that you can communicate information with less bits than the data holds if the peers and the "model" incorporates knowledge about what kind of data is being transmitted.
One bit of information can mean more the more parameters an LLM has. The text "a8ckd" could easily mean the entire Declaration of Independence or whatever to an LLM (it doesn't, of course).
It has memorised a lot of stuff and similar to us "bubble sort" means
// An optimized version of Bubble Sort
void bubbleSort(int arr[], int n)
{
int i, j;
bool swapped;
for (i = 0; i < n - 1; i++) {
swapped = false;
for (j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
swap(&arr[j], &arr[j + 1]);
swapped = true;
}
}
// If no two elements were swapped by inner loop,
// then break
if (swapped == false)
break;
}
}
That's 26x as much text (counting comments and whitespace). Without comments and removing most indentation it's about 20x as much.The more information stored in its parameters, the more information a single bit can hold.
All we need to do is find out how many times can you recur until it breaks down? 3 times? 5 times? Just a few times is still genuinely very useful!
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).
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.
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
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.
https://github.com/paul-gauthier/aider/blob/main/aider/histo...
https://www.deeplearning.ai/short-courses/langchain-for-llm-...
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.
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.
Of course, it's one thing to have a good idea, another is to actually implement it well...
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?
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.
If you're completing the sentence "What is the current price of Apple?..." based on the internet as a training source, the most likely reply is not:
"Well, let's think about how we'd go about this, I should do a search for AAPL, and then..."
The most likely completion is: "The price of AAPL is $X"
OpenAI had to "artificially" bias it to say "I can't answer that" or it'd happily tell you a million things like that.
—
On the other hand, give the LLM room to plan, it will plan. If you ask it "To answer x what do you need", it does better at answering x
The most likely completion to "How would you tell me Apple's current price", is a logical step by step process. And that's how it gets a chance to check itself.
I think people underestimate how much logic the model can do in a single pass, LLMs need to output things that we assume can be done with working memory
won't be one size fits all due to various types of data - and if you could validate all types - why do you need the llm!
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