What is a beginning-of-sequence token?

A beginning-of-sequence token, often called a BOS token, is a special token used to mark the start of a token sequence.

It gives the model an explicit signal that a new sequence is beginning.

What does a BOS token look like?

The exact representation depends on the tokenizer and model.

Conceptually, it may look like:

<BOS>

A tokenized sequence might therefore look like:

<BOS> The cat is sleeping

Internally, the BOS token is represented by a reserved token ID rather than ordinary text.

Why is a BOS token useful?

A BOS token can help the model distinguish the start of a new sequence from ordinary text.

During training, this gives the model a consistent starting point for predicting subsequent tokens.

Conceptually:

<BOS>
  ↓
first token
  ↓
second token
  ↓
third token

For an autoregressive language model, the BOS token can provide the initial context from which the first normal token is predicted.

Is a BOS token always required?

No.

Not every LLM or tokenizer uses an explicit BOS token.

Some models automatically add one, some expect the application to add it, and others do not use one at all.

The correct behavior depends on the model's tokenizer configuration and prompt format.

Is BOS visible to the user?

Usually not.

When you type a prompt into an LLM application, the tokenizer or serving system may insert special tokens automatically.

The user normally interacts with ordinary text while the underlying model receives a formatted token sequence.

BOS in chat models

Chat models may use a more complex prompt format containing special tokens for:

  • Message boundaries
  • User and assistant roles
  • System instructions
  • Conversation starts

In such systems, a traditional BOS token may be used alongside other control tokens, or the chat template may handle sequence initialization differently.

BOS vs. EOS

The two tokens serve opposite boundaries:

  • BOS marks the beginning of a sequence.
  • EOS marks the end of a sequence.

The EOS token is covered separately in “What is an end-of-sequence token?”

For the broader category, see “What are special tokens in an LLM?”

In short: a beginning-of-sequence token is a reserved special token that marks the start of a token sequence and can provide the model with a consistent initial context before ordinary text begins.

#what is a beginning-of-sequence token#BOS token LLM#beginning of sequence token#LLM BOS token#special tokens BOS#large-language-models#llm#tokenization#special-tokens#bos

Learning Sequence

Large Language Models Curriculum

17% Completed
Up NextLarge Language Models

What is an end-of-sequence token?

Explore Related Questions

Deepen your understanding across related Large Language Models topics.

Machinoai Logo
Machinoai

Your edge in the AI era. Deep dives into machine learning concepts, paper explainers, verified industry jobs, and developer tools.

© 2026 Machinoai. All rights reserved.