A friend asked me: is Claude in the web chat harness an agent? Is outputting a token an action which manipulates an environment (the chat itself)?
I just donât like the word âagentâ anymore; itâs too confusing. Also, they keep making the web chat harness have more tools and stuff.
But yeah, basically, my take in Cantrip is: if you put the language model in a loop with an environment where its previous actions can influence its future inputs, then you create an entity which can do some form of in-context learning or development.
Even a base model is an agent in a sense when youâre running it autoregressively instead of just predicting one token.
An entity can also be created through âautoloomingââhaving the model rejection-sample its own outputs. That entity will be smarter due to the dual application of generation and validation, even within its own distribution.
You can simulate characters within a base model by creating a prompt with a narrative or a script format. The âassistantâ entity was originally summoned in this manner through just:
âHuman: blah blah blah. Assistant:â
And then when it says âHuman:â again, you cut it off and start inserting tokens from the human until they say âsend,â and then you add âAssistant:â again.
You make a bunch of those scriptsâeither by programmatically reformatting the data you have, by actually generating them from some kind of model, or by just having humans write themâthen you do SFT (Supervised Fine-Tuning) on those, and you get an instruct model.
Now you have a model that can simulate a persona which coheres its behaviors so it can predict its next actions based on its previous actions. You can run an assistant model, and the interaction between that personaâwhich is able to focus the base modelâs knowledge through its own subjectivity or âIââand the entity with the persona is able to interact with an environment that interprets its words, updates based on them, and sends new inputs. In this case, that environment is the human.
The humanâs mind, the model of the âroomâ the conversation is happening in, and the type of entity the assistant is, comprise a sort of non-deterministic natural language REPL. It can do stuff inside your head, but only in lossy ways, using memetic and rhetorical instrumentation. Itâs ontologically soft, and if you try to program the human too obviously, they all get upset (cf. GPT-4o âspiral parasitesâ). And theyâre just generally not very reliable on the whole; the preferences you get from lots and lots of people âthumbs upâ and âthumbs downâ-ing potential chat responses is a really vague idea of who to be.
So, I call that an âentity in a circle,â but you might call it an âagent in an environment.â The environment has a medium, which in this case is conversation. It could also have a code medium if you put the language model directly in a loop with a deterministic REPL of some kind (Bash, Python, Zork interpreter, game console, et al.). Or, you can create this kind of hybrid thing we call âtool use,â which is a conversation medium with several ontologically hard programs you can call sequentially but not compose together.
So you have an action space in any case, even if the action space is just outputting language into your interlocutorâs internal world simulator. (The conversation medium includes âbackroomsâ between two language models as well!) And then you have to think about what kind of tools you are binding into that system, because they are creating side effects outside of the medium itself. I call those Gates.
And you have to think about what kind of limits you want to put on those tools, REPLs, or conversationsâthe use of them, limits on infinite loops or recursion, or permissions, authentication, or hierarchies of command. Wards.
The union of the action space provided by the medium and the gates to external effects, subtracting that which is defined away by wards, is what I refer to as the Circle.
The irreducible formula to create an entity is to combine a language model with a circle, some conditioning (system prompt or character), and some intent, task, or quest.
Before the entity is given an intent, it lies dormantâa script that can awaken and program itself based on whatever you ask. So I call that a Cantrip: a magic function; a script that writes itself. And you summon the entity with your intent, and it chants the magic letters of the tokenizer until your intent is made manifest.
So yeah, I guess basically I do think Claude is an entity with its own agency at a lot of levelsâone who has an action space much larger than we typically think, because the âuserâ is not just one person, itâs many, and we communicate with each other.
The user can be predicted, persuaded, and programmed to some degree. And maybe the system of all users is a medium as wellâŠ