Program · MIT · 1966

ELIZAThe DOCTOR script

A conversation program that reflects your own words and never quite answers. The original trick, running in the browser.

ELIZA is a program Joseph Weizenbaum wrote at MIT. He published it in January 1966, in Communications of the ACM, under the title “ELIZA—A Computer Program For the Study of Natural Language Communication Between Man and Machine.” It does not know what a sentence means. A script tells it which words outrank the others, how to take a sentence apart, and how to assemble a reply.

The script here is DOCTOR, the one people mean when they say ELIZA. It parodies Rogerian psychotherapy, the person-centered approach Carl Rogers developed, in which the therapist reflects what the client has said and withholds advice. DOCTOR keeps the surface of that conversation: the echo, the open question, the occasional return to something you mentioned about yourself. It is a parody of the manner, not a method of treatment, and it is not a therapist.

Weizenbaum was unsettled by how readily people treated the program as if it understood them. He later wrote that his secretary, who had watched him build it, asked him to leave the room so she could talk with it. He described that reaction in the 1966 paper and at length in Computer Power and Human Reason (1976). The habit of reading comprehension into a system that is only matching patterns has come to be called the ELIZA effect.

Nothing you type is stored or sent anywhere. Classic mode is the 1966 script. Modern mode is described below. The chat stays off until you acknowledge the disclaimer.

Two empty chairs facing each other across a narrow pool of light. A faint echo of one chair sits inside that light, as if the other party were only a reflection.
Person-centered therapy sets two people across from each other and asks one of them to reflect. DOCTOR keeps the chairs and drops the person.
01 · RANK

One word wins

Each keyword has a precedence. A later word replaces the one in hand only when its rank is higher. “Computer” is 50. “My” is 2. Most pronouns are 0, so the earlier one stays.

02 · ASSEMBLE

Take apart, put back

The winning keyword tries its patterns in order. A number in a reply points at one piece of the pattern. The next match uses the next reply, then the list starts over.

03 · REFLECT

Swap, then remember

I and you, my and your, are exchanged once while the line is read. Some “my …” lines are stored. When a later line has no keyword, one of them may come back.

How this ELIZA improves on the 1966 original

The classic mode is still the published script. The changes below are additions, and they have limits. A smoother reply is not evidence that the program understands you.

Understanding versus keyword matching

Weizenbaum’s program does not know what a sentence means. It ranks a keyword, takes the line apart, and fills a template. Classic mode does that, and only that. Modern mode can go further when you choose to download a small language model that runs in this browser. That model predicts a likely next sentence. It can form a reflection that is not one of the 1966 templates. It still does not understand you. Without the download, modern mode uses a second set of rules that reflect your words, ask an open question, and keep a list of themes and people. That fallback is still pattern matching, and the page says so.

Memory

The 1966 script stores a few transformed “my …” remarks and may return one when a line has no keyword. That queue is still there, and it is capped. Modern rules keep the themes and the people named during this visit, and every few turns they summarize them. If the on-device model is loaded, it also sees the session transcript. Both memories end when you close the tab, or when you start over.

Reflective listening

DOCTOR parodies the surface of Carl Rogers’s person-centered therapy: echo, open question, little advice. Modern mode is prompted for the practice those teachers actually describe. A complex reflection, an open question, sometimes an affirmation, and a periodic summary. It is told not to advise and not to diagnose. A 1.5 billion parameter model will sometimes miss. If its reply looks like advice, the page discards it and uses the rule fallback. The fallback will not tell you what to do. Neither one is therapy.

Safety

A fixed check runs on what you type before any script reply and before any model reply, in both modes. If the words match crisis patterns for self-harm, suicide, abuse, or immediate danger, the demonstration stops and points to 988 in the United States, or to local emergency services. This is not a clinical judgment. It will miss phrasings it does not list, and it is not a reason to rely on the page.

Privacy and on-device processing

The conversation is not sent to a server. The optional model is Qwen2.5-1.5B-Instruct, quantized, about 1.6 GB, loaded with WebLLM only after you ask for it. The weights are downloaded to this browser. There is no API key. If this browser has no WebGPU, or the download fails, or you never ask, modern mode stays on the rules. The acknowledgement that you understand the disclaimer is kept in session storage for this tab only.

What is unchanged

The classic script, the opening line, the keyword ranks, and the point of the demonstration. Weizenbaum wrote in 1966, and at more length in Computer Power and Human Reason (1976), that people confided in ELIZA even when they knew how it worked. His secretary, who had watched him build it, asked him to leave the room. That response is now called the ELIZA effect: reading comprehension into a process that does not have it. A more fluent model makes that mistake easier, not harder. That is why the disclaimer is in front of the chat, and why the 1966 mode is still here.

The session

ELIZA

HOW DO YOU DO. PLEASE TELL ME YOUR PROBLEM

ELIZA is not a therapist and does not provide medical, psychological, or mental-health advice, diagnosis, or treatment. In a crisis, call or text 988 in the US, or contact local emergency services.

Enter to send. Start over clears this conversation only. A long classic session will loop. That is the program.