Most active commenters
  • ninetyninenine(9)
  • lomase(3)

←back to thread

196 points zmccormick7 | 21 comments | | HN request time: 1.121s | source | bottom
1. ninetyninenine ◴[] No.45387536[source]
Context is a bottleneck for humans as well. We don’t have full context when going through the code because we can’t hold full context.

We summarize context and remember summarizations of it.

Maybe we need to do this with the LLM. Chain of thought sort of does this but it’s not deliberate. The system prompt needs to mark this as a deliberate task of building summaries and notes notes of the entire code base and this summarized context of the code base with gotchas and aspects of it can be part of permanent context the same way ChatGPT remembers aspects of you.

The summaries can even be sectioned off and and have different levels of access. So if the LLM wants to drill down to a subfolder it looks at the general summary and then it looks at another summary for the sub folder. It doesn’t need to access the full summary for context.

Imagine a hierarchy of system notes and summaries. The LLM decides where to go and what code to read while having specific access to notes it left previously when going through the code. Like the code itself it never reads it all it just access sections of summaries that go along with the code. It’s sort of like code comments.

We also need to program it to change the notes every time it changes the program. And when you change the program without consulting AI, every commit you do the AI also needs to update the notes based off of your changes.

The LLM needs a system prompt that tells it to act like us and remember things like us. We do not memorize and examine full context of anything when we dive into code.

replies(5): >>45387553 #>>45387652 #>>45387653 #>>45387660 #>>45387816 #
2. maerF0x0 ◴[] No.45387553[source]
> remember summarizations

yes, and if you're an engineering manager you retain _out of date_ summarizations, often materially out of date.

replies(1): >>45387626 #
3. ninetyninenine ◴[] No.45387626[source]
I addressed this. The AI needs to examine every code change going in whether that code change comes from AI or not and edit the summaries accordingly.

This is something humans dont actually do. We aren’t aware of every change and we don’t have updated documentation of every change so the LLM will be doing better in this regard.

replies(1): >>45387674 #
4. wat10000 ◴[] No.45387652[source]
They need a proper memory. Imagine you're a very smart, skilled programmer but your memory resets every hour. You could probably get something done by making extensive notes as you go along, but you'll still be smoked by someone who can actually remember what they were doing in the morning. That's the situation these coding agents are in. The fact that they do as well as they do is remarkable, considering.
replies(2): >>45387725 #>>45388029 #
5. nsedlet ◴[] No.45387653[source]
Agreed. As engineers we build context every time we interact with the codebase. LLMs don't do that.

A good senior engineer has a ton in their head after 6+ months in a codebase. You can spend a lot of time trying to equip Claude Code with the equivalent in the form of CLAUDE.MD, references to docs, etc., but it's a lot of work, and it's not clear that the agents even use it well (yet).

6. hirako2000 ◴[] No.45387660[source]
That is not how the brain does it.

We do take notes, we summarize our writings, that's a process. But the brain does not follow that primitive process to "scale".

replies(1): >>45391114 #
7. lomase ◴[] No.45387674{3}[source]
I mean... have you ever heard of this small tool called GIT that people use to track code changes?
replies(1): >>45387707 #
8. ninetyninenine ◴[] No.45387707{4}[source]
I’m not talking about git diffs. I’m talking about the summaries of context. Every commit the ai needs to update the summaries and notes it took about the code.

Did you read the entirety of what I wrote? Please read.

Say the AI left a 5 line summary of a 300 line piece of code. You as a human update that code. What I am saying specifically is this: when you do the change, The AI then sees this and updates the summary. So AI needs to be interacting with every code change whether or not you used it to vibe code.

The next time the AI needs to know what this function does, it doesn’t need to read the entire 300 line function. It reads the 5 line summary, puts it in the context window and moves on with chain of thought. Understand?

This is what shrinks the context. Humans don’t have unlimited context either. We have vague fuzzy memories of aspects of the code and these “notes” effectively make coding agents do the same thing.

replies(1): >>45388554 #
9. multiplegeorges ◴[] No.45387725[source]
Basically, LLMs are the guy from Memento.
10. anthonypasq ◴[] No.45387816[source]
youre projecting a deficiency of the human brain onto computers. computers have advantages that our brains dont (perfect and large memory), theres no reason to think that we should try to recreate how humans do things.

why would you bother with all these summaries if you can just read and remember the code perfectly.

replies(1): >>45391142 #
11. KeatonDunsford ◴[] No.45388029[source]
This is precisely how I go about my usage pattern with Cursor that I already have, I structure my repo declaratively with a Clojure and Nix build pipeline so when my context maxes out for a chat session, the repo is self-evident self-documented enough that a new chat session automatically has a heightened context

- - kae3g

12. lomase ◴[] No.45388554{5}[source]
The context is the code I work on because I can read and understand it.

If I need more, there is git, tickets, I can ask the person who wrote the code.

I do have read your comment, don't make snarky comments.

replies(1): >>45391128 #
13. ninetyninenine ◴[] No.45391114[source]
We do. It’s just the format of what you remember is not textual. Do you remember what a 500 line function does or do you remember a fuzzy aspect of it?

You remember a fuzzy aspect of it and that is the equivalent of a summary.

The LLM is in itself a language machine so its memory will also be language. We can’t get away from that. But that doesn’t mean the hierarchical structure of how it stores information needs to be different from humans. You can encode information in anyway you like and store that information in any hierarchy we like.

So essentially We need the hierarchical structure of the “notes” that takes on the hierarchical structure of your memory. You don’t even access all your memory as a single context. You access parts of it. Your encoding may not be based on a “language” but for an LLM it’s basically a model based on language so its memory must be summaries in the specified language.

We don’t know every aspect of human memory but we do know the mind doesn’t access all memory at the same time and we do know that it compresses context. It doesn’t remember everything and it memorizes fuzzy aspects of everything. These two aspects can be replicated with the LLM entirely with text.

replies(1): >>45392583 #
14. ninetyninenine ◴[] No.45391128{6}[source]
So you hold all that code context in your head at the same time?

> If I need more, there is git, tickets, I can ask the person who wrote the code.

What does this have to do with anything? Go ahead and ask the person. The notes the LLM writes aren’t for you they are for the LLM. You do you.

replies(2): >>45391149 #>>45391350 #
15. ninetyninenine ◴[] No.45391142[source]
Because the context window of the LLM is limited similar to humans. That’s the entire point of the article. If the LLM has similar limitations to humans than we give it similar work arounds.

Sure you can say that LLMs have unlimited context, but then what are you doing in this thread? The title on this page is saying that context is a bottleneck.

replies(1): >>45414961 #
16. lomase ◴[] No.45391350{7}[source]
So you hold all that code context in your head at the same time?

Yes. That is how every single piece of code has been writen since the creation of computers.

Why you seem so surprised?

replies(2): >>45392429 #>>45401453 #
17. ninetyninenine ◴[] No.45392429{8}[source]
False. Nobody does this. They hold pieces of context and summaries in their head. Nobody on earth can memorize an entire code base. This is ludicrous.

When you read a function to know what it does then you move on to another function do you have the entire 100 line function perfectly memorized? No. You memorize a summary of the intent of the function when reading code. An LLM can be set up to do the same rather than keep all 100 lines of code as context.

Do you think when you ask the other person for more context he’s going to spit out what he wrote line by line. Not even he likely will remember everything he wrote.

You think anyone memorized Linux? You know how many lines of code is in the Linux source code. Are you trolling?

18. hirako2000 ◴[] No.45392583{3}[source]
I agree that the effect can look similar, we both end up with a compressed representation of past experiences.

The brain meaning-memorizes, and it prioritizes survival-relevant patterns and relationships over rote detail.

How does it do it, I'm not a neurobiologist, but my modest understanding is this:

LLM's summarization is a lossy compression algorithm that picks entities and parts that it deems "important" against its trained data, not only is lossy, it is wasteful as it doesn't curate what to keep or purge off accumulated experience, it does it against some statistical function that executes against a big blob of data it ingested during training. You could throw contextual cues to improve the summarization, but that's as good as it gets.

Human memory is not a workaround for a flaw. It doesn't use a hard stop at 128kb or 1mb of info, It doesn't 'summarize'.

it constructs meaning by integrating experiences into a dynamic/living model of the world, in constant motion. While we can simulate a hierarchical memory for an LLM with text summaries, it would be off simulation of possible future outcome (at best), not a replication of an evolutionary elaborated strategy to model information captured in a time frame, merged in with previously acquired knowledge to be able to then solve the upcoming survival purpose tasks the environment may throw at it. Isn't it what our brain is doing, constantly?

Plus for all we know it's possible our brain is capable of memorizing everything that can be experienced in a lifetime but would rather let the irrelevant parts of our boring life die off to save energy.

sure, in all case it's fuzzy and lossy. The difference is that you have doodling on a napkins on one side, and Vermeer paint on the other.

replies(1): >>45392917 #
19. ninetyninenine ◴[] No.45392917{4}[source]
>LLM's summarization is a lossy compression algorithm that picks entities and parts that it deems "important" against its trained data, not only is lossy, it is wasteful as it doesn't curate what to keep or purge off accumulated experience, it does it against some statistical function that executes against a big blob of data it ingested during training. You could throw contextual cues to improve the summarization, but that's as good as it gets.

No it's not as good as it gets. You can tell the LLM to purge and accumulate experience into it's memory. It can curate it for sure.

"ChatGPT summarize the important parts of this text remove things that are unimportant." Then take that summary feed it into a new context window. Boom. At a high level if you can do that kind of thing with chatGPT then you can program LLMs to do the same thing similar to COT. In this case rather then building off a context window, it rewrites it's own context window into summaries.

20. ninetyninenine ◴[] No.45401453{8}[source]
No reply? Probably because you've realized how much of an idiot you are?
21. anthonypasq ◴[] No.45414961{3}[source]
memory is different than context