logoalt Hacker News

bluegattytoday at 4:45 AM1 replyview on HN

Every time you send a request to a model you're already providing all of the context history along with it. To edit the context, just send a different context history. You can send whatever you want as history, it's entirely up to you and entirely arbitrary.

We only think in conversational turns because that's what we've expected a conversation to 'look like'. But that's just a very deeply ingrained convention.

Forget that there is such a thing as 'turns' in a LLM convo for now, imagine that it's all 'one-shot'.

So you ask A, it responds A1.

But when you and B, and expect B1 - which depends on A and A1 already being in the convo history - consider that you are actually sending that again anyhow.

Behind the scenes when you think you're sending just 'B' (next prompt) you're actually sending A + A1 + B aka including the history.

A and A1 are usually 'cached' but that's not the simplest way to do it, the caching is an optimization.

Without caching the model would just process all of A + A1 + B and B1 in return just the same.

And then A + A1 + B + B1 + C and expect C1 in return.

It just so happens it will cache the state of the convo at your previous turn, and so it's optimized but the key insight is that you can send whatever context you want at any time.

If after you send A + A1 + B + B1 + C and get C1, if you want to then send A + B + C + D and expect D1 ... (basically sending the prompts with no responses) - you can totally do that. It will have to re-process all of that aka no cached state, but it will definitely do it for you.

Heck you can send Z + A + X, or A + A1 + X + Y - or whatever you want.

So in that sense - what you are really sending (if you're using the simplest form API), is sending 'a bunch of content' and 'expecting a response'. That's it. Everything is actually 'one shot' (prefill => response) and that's it. It feels conversational but structural and operational convention.

So the very simple answer to your question is: send whatever context you want. That's it.


Replies

_bobmtoday at 9:14 AM

This is how I view it as well.

And... and...

This results in a _very_ deep implication, which big companies may not be eager to let you see:

they are context processors

Take it for what it is.

show 1 reply