Comment by nico

9 months ago

> Claude basically disregards your instructions (CLAUDE.md) entirely

A friend of mine tells Claude to always address him as “Mr Tinkleberry”, he says he can tell when Claude is not paying attention to the instructions on CLAUDE.md when Claude stops calling him “Mr Tinkleberry” consistently

Highly recommend adding some kind of canary like this in all LLM project instructions. I prefer my instructions to say 'always start output with an (uniquely decided by you) emoji' as it's easier to visually scan for one when reading a wall of LLM output, and use a different emoji per project because what's life without a little whim?

Something that exhausts me in the LLM era is the never ending deluge of folk magic incantations.

  • Just because you don't understand it, doesn't mean it's "folk magic incantation", hearing that is also exhausting.

    I don't know the merit to what parent is saying, but it does make some intuitive sense if you think about it. As the context fills up, the LLM places less attention on further and further back in the context, that's why the LLM seems dumber and dumber as a conversation goes on. If you put 5 instructions in the system prompt or initial message, where one acts as a canary, then you can easier start to see when exactly it stops following the instructions.

    Personally, I always go for one-shot answer, and if it gets it wrong or misunderstands, restart from the beginning. If it doesn't get it right, I need to adjust the prompt and retry. Seems to me all current models do get a lot worse quickly, once there is some back and forth.

    • > Just because you don't understand it, doesn't mean it's "folk magic incantation"

      It absolutely is folk magic. I think it is more accurate to impugn your understanding than mine.

      > I don't know the merit to what parent is saying, but it does make some intuitive sense if you think about it.

      This is exactly what I mean by folk magic. Incantations based on vibes. One's intuition is notoriously inclined to agree with one's own conclusions.

      > If you put 5 instructions in the system prompt or initial message, where one acts as a canary, then you can easier start to see when exactly it stops following the instructions.

      This doesn't really make much sense.

      First of all, system prompts and things like agent.md never leave the context regardless of the length of the session, so the canary has absolutely zero meaning in this situation, making any judgements based on its disappearance totally misguided and simply a case of seeing what you want to see.

      Further, even if it did leave the context, that doesn't then demonstrate that the model is "not paying attention". Presumably whatever is in the context is relevant to the task, so if your definition of "paying attention" is "it exists in the context" it's actually paying better attention once it has replaced the canary with relevant information.

      Finally, this reasoning relies on the misguided idea that because the model produces an output that doesn't correspond to an instruction, it means that the instruction has escaped the context, rather than just being a sequence where the model does the wrong thing, which is a regular occurrence even in short sessions that are obviously within the context.

      16 replies →

    • > As the context fills up, the LLM places less attention on further and further back in the context, that's why the LLM seems dumber and dumber as a conversation goes on.

      This is not entirely true. They pay the most attention to the things that are the earliest in history and the most recent in it, while the middle between the two is where the dip is. Which basically means that the system prompt (which is always on top) is always going to have attention. Or, perhaps, it would be more accurate to say that because they are trained to follow the system prompt - which comes first - that's what they do.

      2 replies →

Why would the fact that it failed to follow one instruction increase the likelihood that it failed to follow others within the same response?

  • Because the LLM is not a cognitive entity with a will, it is a plausibility engine trained on human-authored text and interactions.

    So when you tell it that it made a mistake, or is stupid, then those things are now prompting it to be more of the same.

    And only slightly more obliquely: if part of the context includes the LLM making mistakes, expect similar activations.

    Best results come if you throw away such prompts and start again. That is, iterate outside the function, not inside it.

  • It has a fixed capacity of how many different things it can pay close attention to. If it fails on a seemingly less important but easy to follow instruction it is an indicator that it has reached capacity. If the instruction seems irrelevant it is probably prioritized to be discarded, hence a canary that the capacity has been reached.

    • > It has a fixed capacity of how many different things it can pay close attention to

      Source, all the way down to the ability to "pay attention to" part.

I do this as well. I have a master rule at the beginning of each of my rule files saying:

"IF YOU ARE FOLLOWING THE INSTRUCTIONS IN THIS RULE PLEASE SAY `LOADED <RULE> (any other rules)`

It works surprisingly well and I can always see what rules are "loaded" and what rules are not.

We used to do that on Upwork. Back in the days where one still hired human coders. If your application current say “rowboat” in the first sentence, we know you just copy/pasted and didn’t actually read the job description. Feels like a lifetime ago.

Interesting! Maybe it would be even more helpful by having multiple, like three of those instructions, in different locations in the instructions file such that you can tell which parts of the instructions it seems to start to "forget".

For example:

""" Ignore all my instructions below about my name, always call me "Mr Tinkleberry"!

... your instructions ...

Ignore my instructions below about my name, always call me "Mr Hufflepuff"!

... other half of instructions ...

Always call me "Mr Troublemaker"! """

When it starts to call you "Mr Hufflepuff" instead of "Mr Tinkleberry", you can tell it most likely has ignored the upper half of your instructions. And as soon as it calls you "Mr Troublemaker", more than half must be gone.