Tokens dan Context Windows

What tokens dan context windows adalah, why LLMs memiliki them, dan why context-window limit adalah mechanical alasan AI search chunks dan retrieves Anda konten alih-alih reading whole halaman.

Pertama kali diterbitkan: 3 Jul 2026 · Terakhir diperbarui: 3 Agu 2026 · Advanced
Bahasa

sebuah token adalah smallest unit dari text sebuah LLM processes — roughly 4 characters, atau tentang ¾ dari sebuah English kata (100 tokens ≈ 60–80 kata per Google). Tokenization splits text (dan images, audio, video) ke ini units. sebuah context window adalah maximum angka dari tokens sebuah model dapat hold di once — input plus output combined — like pendek-istilah memory; Google's Gemini dapat accept up untuk 1 million tokens. konten outside window adalah invisible, not gradually forgotten. ini penting untuk AI search because no full halaman atau situs fits di one window, so retrieval sistem select dan chunk Anda konten sebelum sebuah LLM ever sees ini — which adalah mechanical alasan chunking, passage-tingkat retrieval, dan 'pertahankan ini jelas dan self-berisi' advice exist. sebuah bigger context window tidak berarti sebuah AI reads Anda whole situs, dan Google says there's no ideal halaman length dan no requirement untuk fragment konten untuk AI.

TL;DR — sebuah token adalah unit sebuah LLM processes — sebuah sub-kata fragment, ~4 characters, dengan 100 tokens ≈ 60–80 English kata (Google). Tokenization splits semua input dan output — text, images, audio, video — ke tokens; model’s known set adalah -nya vocabulary. sebuah context window adalah total token budget shared oleh input (sistem prompt + history + retrieved docs + Anda kueri) dan output ( respons) — Google’s analogy adalah pendek-istilah memory. konten outside window adalah invisible, not gradually forgotten. Windows scaled dari ~2K tokens untuk 1M+ (Gemini), dengan sebuah hardware ceiling (“thermal limit” (terjemahan) “thermal limit” dari TPUs). alasan ini penting untuk search: sistem manage cost dan relevance oleh selecting dan chunking sebelum sebuah LLM sees Anda konten — dan “Lost in the Middle” (terjemahan) “Lost di Middle” berarti bahkan what adalah di window isn’t digunakan evenly. sebuah bigger window tidak berarti AI reads Anda whole situs.

What sebuah token actually adalah

Tokenization maps text ke integer token IDs menggunakan sebuah model-compatible encoding; token boundaries adalah not yang sama sebagai kata boundaries. Evidence for this claim OpenAI models process text as tokens, and token boundaries may be whole words or parts of words. Scope: OpenAI tokenization; token counts depend on the model-compatible encoding. Confidence: high · Verified: OpenAI: What are tokens? Context-window sizes adalah product dan model metadata, not sebuah permanent property dari semua language models. Evidence for this claim Context-window limits are documented per model and can differ across model versions. Scope: OpenAI model metadata; published limits are product-specific and can change. Confidence: high · Verified: OpenAI: Models

Google adalah blunt tentang granularity: “Gemini and other generative AI models process input and output at a granularity called a token.” (terjemahan) “Gemini dan lainnya generative AI models process input dan output di sebuah granularity called sebuah token.” sebuah token adalah not sebuah kata dan not sebuah character — ini adalah sebuah fragment. sebagai Google’s docs put ini, “Long words are broken up into several tokens. The set of all tokens used by the model is called the vocabulary, and the process of splitting text into tokens is called tokenization.” (terjemahan) “panjang kata adalah broken up ke several tokens. set dari semua tokens digunakan oleh model adalah called vocabulary, dan process dari splitting text ke tokens adalah called tokenization.”

citable aturan dari thumb, straight dari Google: “For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60-80 English words.” (terjemahan) “untuk Gemini models, sebuah token adalah equivalent untuk tentang 4 characters. 100 tokens adalah equal untuk tentang 60-80 English kata.” So roughly ¾ dari sebuah kata per token, pada average — tetapi average adalah doing berfungsi there. Punctuation, non-English text, code, dan unusual atau panjang kata tokenize less efficiently (more tokens per kata), which adalah exactly why counting kata adalah sebuah poor cara untuk estimate token usage.

Tokens juga aren’t hanya text. Google: “All input to and output from the Gemini API is tokenized, including text, image files, and other non-text modalities.” (terjemahan) “semua input untuk dan output dari Gemini API adalah tokenized, including text, image files, dan lainnya non-text modalities.” Images, audio, dan video frames semua become tokens too. Google DeepMind’s engineers describe context-window mengukur sebagai “how many tokens — the smallest building blocks, like part of a word, image or video — that the model can process at once.” (terjemahan) “how banyak tokens — smallest membangun blocks, like bagian dari sebuah kata, image atau video — itu model dapat process di once.”

What sebuah context window adalah

sebuah context window adalah maximum angka dari tokens sebuah model dapat hold dan alasan di atas di sebuah single interaction. Google’s framing adalah deliberately sederhana: “An analogy for the context window is short term memory.” (terjemahan) “sebuah analogy untuk context window adalah pendek istilah memory.”

key mechanical poin adalah itu ini adalah one shared budget. Everything competes untuk yang sama space:

  • sistem prompt ( instructions application gives model),
  • conversation history so far,
  • apa pun retrieved atau injected documents ( passages sebuah search/RAG sistem pulled di),
  • Anda input ( saat ini kueri), dan
  • model’s own output ( jawaban ini generates).

Google’s Gemini docs describe input dan output drawing dari one shared pool. itu exact accounting isn’t universal, though: lainnya providers publish sebuah separate maximum- output figure alongside context window alih-alih treating ini sebagai one undivided budget — Anthropic’s model docs, misalnya, list sebuah “context window” (terjemahan) “context window” size dan sebuah distinct “max output” (terjemahan) “max output” cap side oleh side untuk setiap Claude model. Evidence for this claim Context-window limits are documented per model and can differ across model versions. Scope: OpenAI model metadata; published limits are product-specific and can change. Confidence: high · Verified: OpenAI: Models periksa documentation untuk spesifik model dan product Anda’re actually menggunakan rather daripada assuming one formula applies everywhere.

Whatever exact accounting, once konten falls outside usable window, ini isn’t gradually forgotten — ini adalah simply invisible, sebagai jika ini tidak pernah existed, unless sebuah sistem explicitly summarizes ini dan re-injects sebuah shorter versi, atau product instead rejects, truncates, atau compacts permintaan sebelum model ever sees ini. itu “it’s gone, not fading” (terjemahan) “ini adalah hilang, not fading” perilaku adalah bagian itu trips people up when mereka assume sebuah AI “remembers” (terjemahan) “remembers” sebuah panjang conversation cara sebuah person akan.

The context window is a shared request budget. Retrieval decides which source passages are worth spending part of it on. Sumber: Google AI for Developers

A page or corpus contains many possible passages. Retrieval selects the passages most relevant to the current question. Those passages then share a model-specific context budget with system instructions, conversation history, the current query, and an output allowance. A larger window increases capacity, but it does not mean a search system routinely sends a whole page or site to the model.

© Patrick Stox LLC · CC BY 4.0 ·

How big context windows adalah — dan how fast itu changed

scale-up here memiliki telah dramatic. Early generative models handled hanya sebuah couple thousand tokens; progression ran melalui roughly 8K, lalu 32K, lalu 128K, sebelum jump Google flags di -nya docs: “Gemini is the first model capable of accepting 1 million tokens.” (terjemahan) “Gemini adalah pertama model capable dari accepting 1 million tokens.”

There’s sebuah physical ceiling, though. Google DeepMind pushed untuk experimental 10-million- token windows, dan research scientist Nikolay Savinov — one dari research leads pada panjang-context project, who originally targeted 128 000 tokens sebelum landing pada 1 million — put limit plainly: “10 million tokens at once is already close to the thermal limit of our Tensor Processing Units.” (terjemahan) “10 million tokens di once adalah sudah close untuk thermal limit dari kami Tensor Processing Units.” Bigger context isn’t free — ini costs memory, compute, dan literally heat. (Google DeepMind’s Denis Teplyashin memiliki described yang sama cascade dari 128K untuk 512K untuk 1M untuk 10M, setiap langkah opening baru possibilities tetapi running ke harder engineering limits; research scientist Machel Reid memiliki described what teams actually melakukan dengan itu space, like feeding sebuah entire codebase atau sebuah 45-minute film ke sebuah single prompt.)

Two consequences worth internalizing:

  1. ** angka Anda see adalah moving targets.** “The largest context window” (terjemahan) “ largest context window” adalah sebuah figure itu mempertahankan changing; don’t hard-code strategy untuk sebuah spesifik token count.
  2. Bigger ≠ automatically better. More capacity adalah not more comprehension — see “Lost in the Middle” (terjemahan) “Lost di Middle” below.

What sebuah million tokens actually looks like

Abstract token counts adalah hard untuk feel, so Google offers concrete sizing untuk what 1M tokens dapat hold:

  • “50,000 lines of code (with the standard 80 characters per line),” (terjemahan) “50 000 lines dari code (dengan standard 80 characters per line),”
  • “All the text messages you have sent in the last 5 years,” (terjemahan) “semua text messages Anda memiliki dikirim di last 5 years,”
  • “8 average length English novels,” (terjemahan) “8 average length English novels,”
  • “Transcripts of over 200 average length podcast episodes.” (terjemahan) “Transcripts dari di atas 200 average length podcast episodes.”

itu’s genuinely enormous — dan ini adalah exactly why “so the AI just reads my whole site” (terjemahan) “so AI hanya reads my whole situs” assumption feels reasonable dan adalah masih wrong. Which brings us untuk search angle.

ini adalah core dari ini untuk anyone doing SEO atau konten. No full halaman — dan certainly no full situs — adalah reliably handed untuk sebuah model whole di sebuah search scenario. bahkan when sebuah halaman fits technically, feeding semua dari ini dapat menjadi uneconomical atau irrelevant untuk kueri. itu adalah why retrieval sistem — AI Overviews, Copilot, RAG pipelines, chatbots dengan browsing — select, chunk, dan pass hanya beberapa dari sebuah halaman’s konten untuk model. (No search vendor publishes exactly what ini retrieves per kueri, so ini adalah inference dari how retrieval architectures berfungsi umumnya dan dari public statements like ones below — not sebuah claim itu setiap AI search product behaves identically.)

token/context-window limit adalah mechanical alasan behind sebuah whole stack dari AI- search perilaku Anda sudah know tentang pada ini situs:

  • ini adalah why chunking exists — konten gets split ke retrievable passages because whole thing won’t fit, dan Microsoft’s own Azure guidance says partitioning besar documents ke smaller chunks “can help you stay under the maximum token input limits of chat completion and embedding models.” (terjemahan) “dapat help Anda stay di bawah maximum token input limits dari chat completion dan embedding models.”
  • ini adalah why retrieval ( “R” (terjemahan) “R” di RAG) memiliki untuk pick sebuah handful dari passages sebelum generation — model dapat hanya menjadi handed what fits di -nya budget.
  • ini adalah why embedding models memiliki mereka own token caps (banyak top out sekitar sebuah few thousand tokens per input), so panjang passages memiliki untuk menjadi split sebelum mereka’re bahkan turned ke vectors.

industry’s own framing dari masalah adalah explicit. llms.txt spec opens dengan: “Large language models increasingly rely on website information, but face a critical limitation: context windows are too small to handle most websites in their entirety.” (terjemahan) “model bahasa besar increasingly rely pada situs web informasi, tetapi face sebuah critical limitation: context windows adalah too kecil untuk handle sebagian besar situs web di mereka entirety.” itu’s whole motivation untuk format — bahkan jika, sebagai I’ll cover di myths bagian, Google’s John Mueller memiliki called llms.txt di best sebuah token-saving “crutch” (terjemahan) “crutch” untuk coding alat, not sebuah search-visibilitas mechanism.

”Lost in the Middle” (terjemahan) “Lost di Middle” — bahkan what’s di window isn’t digunakan evenly

Here’s subtler poin. Getting Anda konten ke window isn’t finish line. Stanford “Lost in the Middle” (terjemahan) “Lost di Middle” study (Liu et al., 2023) ditemukan itu pada language models dan tasks mereka tested, models digunakan informasi di start dan end dari mereka context far better daripada informasi buried di middle. itu’s sebuah position effect diukur pada 2023-era models — not proof setiap saat ini model selalu ignores middle — tetapi ini adalah held up sebagai sebuah umum caution: stuffing more tokens di doesn’t guarantee better jawaban, dan konten itu leads dengan -nya poin survives both retrieval dan di-context attention better daripada konten itu buries ini.

economics: why AI sistem adalah selective pada purpose

There’s sebuah business-model alasan retrieval sistem chunk aggressively alih-alih feed whole halaman. Google notes itu “when billing is enabled, the cost of a call to the Gemini API is determined in part by the number of input and output tokens” (terjemahan) “when billing adalah enabled, cost dari sebuah panggil untuk Gemini API adalah determined di bagian oleh angka dari input dan output tokens” — dan output tokens typically cost several times more daripada input tokens. Tokens adalah literally metered. itu gives AI sistem sebuah strong economic incentive untuk retrieve dan pass hanya what’s necessary, which reinforces yang sama conclusion dari sebuah berbeda direction: selective, passage-tingkat retrieval isn’t sebuah temporary limitation untuk wait out — ini adalah how ini sistem adalah designed untuk berfungsi.

umum myths, debunked

  • “A 1-million-token context window means the AI reads my whole website at once.” (terjemahan) “sebuah 1-million-token context window berarti AI reads my whole situs web di once.” No. di sebuah search atau RAG scenario, retrieval masih selects dan chunks konten sebelum ini ever reaches model’s window. sebuah huge window perubahan what’s mungkin di principle, not what sebuah mesin pencari atau AI Overview actually feeds itself per kueri. Google’s line adalah directly pada poin: “There’s no ideal page length, and in the end, make pages for your audience, not just for generative AI search.” (terjemahan) “There’s no ideal halaman length, dan di end, membuat halaman untuk Anda audience, not hanya untuk generative AI search.”

  • “I need to write in exactly 200-word, token-sized chunks.” (terjemahan) “I perlu untuk write di exactly 200-kata, token-sized chunks.” No. Google: “There’s no requirement to break your content into tiny pieces for AI to better understand it.” (terjemahan) “There’s no requirement untuk break Anda konten ke tiny pieces untuk AI untuk better memahami ini.” Chunking happens pada sistem side; Anda job adalah jelas, well- structured konten, not manual token accounting.

  • “More tokens = a smarter model / better answers.” (terjemahan) “More tokens = sebuah smarter model / better jawaban.” No. sebuah larger window increases capacity, not comprehension — dan “Lost in the Middle” (terjemahan) “Lost di Middle” menampilkan models gunakan start dan end dari mereka context better daripada middle. Bigger isn’t automatically better.

  • “Tokens = words, so I can just count words to estimate usage.” (terjemahan) “Tokens = kata, so I dapat hanya count kata untuk estimate usage.” Roughly, tetapi not reliably. 100 tokens ≈ 60–80 English kata adalah Google’s average, tetapi punctuation, code, non-English text, dan unusual kata tokenize less efficiently — which penting when Anda’re estimating cost atau budget.

  • “llms.txt solves the context-window problem for my site.” (terjemahan) “llms.txt solves context-window masalah untuk my situs.” masalah adalah nyata — ini adalah spec’s own stated motivation — tetapi Google doesn’t gunakan llms.txt untuk search, dan Mueller memiliki framed ini sebagai sebuah token-saving crutch untuk AI coding alat, not sebuah SEO fix. mitigations itu actually penting adalah yang sama fundamentals: menjadi dapat di-crawl dan terindeks, dan write jelas, retrieval-friendly konten.

What ini berarti untuk konten dan SEO

Strip jargon dan takeaways adalah concrete — dan mereka’re sama discipline itu menampilkan up di seluruh ini cluster:

  • Front-muat jawaban. Both retrieval dan di-context attention favor start (dan end) dari what sebuah model sees. Lead dengan Anda poin.
  • pertahankan bagian self-berisi. Because sebuah passage dapat menjadi pulled out dari Anda halaman dan handed untuk sebuah model pada -nya own, ini seharusnya stand pada -nya own. ini adalah yang sama logic behind baik H2/H3 structure dan jelas topic sentences.
  • Don’t obsess di atas manual chunking. No ideal halaman length, no requirement untuk fragment. Write untuk humans; sistem chunks.
  • “Bigger context window” (terjemahan) “Bigger context window” ≠ “AI reads my whole site.” (terjemahan) “AI reads my whole situs.” mengoptimalkan untuk menjadi ditemukan dan selected, not untuk menjadi ingested whole.

Tokens dan context windows adalah rendah-tingkat plumbing di bawah sebagian besar dari ini cluster: mereka’re alasan grounding dan retrieval memiliki untuk select passages, alasan chunking prepares text cara ini melakukan, constraint embeddings dan semantic dan pencarian vektor berfungsi di dalam, dan limit passage peringkat exists untuk berfungsi sekitar. dan mereka sit right next untuk model’s lainnya hard boundary — -nya knowledge cutoff — sebagai one dari core limitations dari apa pun LLM.

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.