How does an AI character come up with its replies?
Language models, probabilities and the context window explained simply – and why a character sometimes makes things up.
Updated October 7, 2026 · 8 min read
A language model predicts the next word
Behind every AI character is a language model: a program trained on a large amount of text that learned which words tend to follow each other in which context. When the character replies, the model produces the text piece by piece: it looks at everything written so far, picks a fitting next fragment, appends it and repeats until the reply is done.
That is why you see replies in Avelai appear word by word – they are being written at that moment, not fetched from a database.
How the character knows who it is
The language model is the same for every character. What makes the difference is the instructions it receives before each reply. Avelai assembles a text that includes, among other things:
- the character description: personality, background and scenario,
- a summary of older parts of the conversation if the chat is already long,
- saved notes about you, such as what you like to be called,
- the most recent messages of the conversation word for word.
The context window: why not everything fits
A language model can only look at a limited amount of text at once. This limit is called the context window. Anything outside it is simply invisible to the model for the next reply. In short chats that does not matter; in conversations with hundreds of messages the beginning would eventually drop out.
To prevent this, Avelai replaces older sections with a summary. It is shorter than the original messages but keeps the important events. It is a trade-off: individual phrasings from early on are lost, the thread remains.
Why the same question gets different answers
The model does not always choose the most likely word; it draws with a little randomness from several fitting options. Without that, replies would sound stiff and repeat themselves. With it come variety and surprises – which is exactly why "Regenerate" gives you a different version every time.
Why AI characters make things up
A language model has no reference book in which it checks facts. It produces text that sounds plausible. Usually plausible and correct coincide, but not always. Then a character names a wrong date, a book that does not exist, or confidently gets a sum wrong. Experts call this "hallucination".
In roleplay that is often harmless or even intended – a character may describe an invented city. For real questions about health, law, money or school, always check answers against reliable sources.
Where Avelai's replies are made
Many chat services send every message to a large AI provider. Avelai generates replies on the operator's own hardware. Your conversations are not passed to external AI providers for this and not used to train other companies' models. There is a flip side: when very many people write at once, a reply can take a moment longer.
More articles
- How to create a great AI character
- How AI characters remember your conversations
- Better stories in AI roleplay
- Chatting with AI characters safely and privately
- AI roleplay for beginners: your first conversation
- Learning languages with AI characters
- Learning with an AI tutor: understand, don't copy
- Writing your own stories with an AI character