The code

The repository

EmoStack is published as source code: the engine with its prompts, the research panel the paper's lives were run and measured with, and the web application behind the live demo.

github.com/marszalik/emostack

Release v1.0 accompanies the paper: version 1.1, doi:10.5281/zenodo.23124632; version 1.0, doi:10.5281/zenodo.22936968.

What is in it

  • The engine. It is organised by the concepts of the paper: records, containers, processes. A concept of the paper is a package of the same name in the code.
  • The prompts. Every call to the language model is a template file next to the process that makes it. The templates and their context classes show the full content of every call. Nothing is sent from anywhere else.
  • The research panel. It runs scenarios of several days in two arms, the sheep and a chatbot on the same language model. It keeps every call of every life. It codes the lives blind to arm and compares the arms.
  • The two lives of the paper. Wound and self-inquiry, with their visitors, the chatbot's instruction and the coding criteria, as they were written before the runs.
  • The web application. A person brings their own model and talks to their own sheep.
  • A terminal client and tests. The tests run the whole engine on a scripted model, at no cost.

The paper in the code

The README of the repository has a table from each section of the paper to the files that implement it: §4 and §5 to the engine, §6 to the research panel and the scenarios.

The paper's lives ran on the research version of this engine, before its code was organised for release. The model, the prompts and the parameters are the same. Where the research code did something other than the paper describes, the release follows the paper.

Running the paper's lives again

  1. Start the research panel and add the models: the sheep's, the visitors', and an embedder.
  2. Import the two scenarios from the repository.
  3. Run each as an experiment with the sheep and the chatbot, ten times.
  4. Code the finished lives blind with the scenario's codings.

A replication is expected to agree with the paper within the error of ten lives, not word for word.

License

The code is available under the PolyForm Noncommercial License 1.0.0. It may be read, run, copied, changed and shared for any noncommercial purpose: research, study, teaching and personal use. That includes replicating and extending the paper's experiments and publishing the results. Commercial use is not licensed; for a commercial license, write to the author.