Tech Kaizen

passion + usefulness = success .. change is the only constant in life

Search this Blog:

AI Tokens Overview

Large Language Models (LLMs) do not process raw text, words, or letters directly. They process numerical arrays. A token is the fundamental atomic building block that a tokenizer converts text into before feeding it to the neural network.

  • Not whole words: A single token can be a whole word, a sub-word piece, a prefix, a suffix, single punctuation, whitespace, or a single character.

  • Rule of Thumb: token is approximately 0.75 words (or) roughly 4characters. Each line is approximately 9-10 tokens.

  • Vocabulary Size: Modern tokenizers (like OpenAI's o200k_base or Anthropic's Claude tokenizer) maintain a fixed lookup vocabulary of around 100,000 to 200,000 distinct tokens.

Both the context and actual question/instruction are combined and counted together as Input Tokens (also referred to as Prompt Tokens or Ingress Tokens). From the model's perspective, there is no physical operational boundary between "context" and "prompt." Everything sent to the API before the model starts generating its response is treated as a single continuous sequence of tokens. Both the old user prompts (the questions) and the old model responses (the answers) are packaged together as ingress (input) context for your latest prompt. 

To clarify the naming and direction of tokens:

  1. When a past turn happens:

    • Your question is counted as ingress (input).

    • The model's generated answer is counted as egress (output).

  2. When you send a new prompt later in that same chat:

    • Everything that came before - both your past questions/prompts AND the model's past answers/responses - is bundled up, re-sent to the API, and counted as ingress (input) context for the current turn.


If you want to prevent your old conversation context from being sent - saving your token allowance, lowering costs, and protecting your data privacy - you have three direct options:

1. The Simplest Fix: Start a New Chat Thread

The easiest way to drop old context is to simply click "New Chat" or open a fresh window every time you switch topics.

  • Why it works: A brand-new thread sends an empty chat history array to the API. Only your system instructions and your single current prompt are counted as ingress tokens.

2. Turn Off Chat History / Training Saving

If you are using consumer web apps (like ChatGPT or Claude Pro), you can go into settings and disable chat history or workspace saving.

  • Why it works: While the app still carries context within an active session so you can talk to it, turning off history prevents your chats from being stored long-term on their servers or used for model training. (Note: This stops them from saving your data, but within a single active scrolling chat, the app will still re-send the transcript to maintain continuity).

3. Use API Parameters Like temperature or Stateless API Calls (For Developers)

If you are interacting with models programmatically via code or API:

  • Don't append history arrays: Write your API calls so that you only pass the system prompt and the single current user string, omitting the messages array history entirely.

  • The Trade-off: The model will treat every single prompt as if it's talking to you for the very first time. It will have total amnesia about anything you typed two minutes prior.


A typical API payload contains three main components - all of which are summed up as Input Tokens:

JSON
[
  {"role": "system", "content": "You are a senior systems architect..."},  <-- Context / System Persona
  {"role": "user",   "content": "Here is the codebase: [5,000 lines...]"},  <-- Context / Reference Data
  {"role": "user",   "content": "Refactor this function to be async."}    <-- Actual Prompt / Task
]

What Counts Towards Your Input Token Customer Bill:
  1. System Instructions: The persona, behavioral constraints, safety guidelines, and formatting schemas.

  2. Conversation History: In a multi-turn chat, every previous message from both you and the assistant re-sent in the payload counts as input tokens for that turn.

  3. Reference Data / Context: Documents, pasted code, uploaded PDFs, CSVs, web search results, database schema dumps, or retrieved RAG snippets.

  4. The Task / Instruction: Your specific question or command.

  5. Structural Overhead: Special control tokens used by the library (e.g., <|im_start|>user, \n, role tags) that tell the model where roles start and end.


Why API Billing Separates Token Types:

  • Input Tokens (Prompt Context): Computed in parallel in a single forward pass through GPU/TPU matrices.Cheaper to process.

  • Output Tokens (Generation): Generated auto-regressively one single token at a time, where each new token requires a full pass through the entire model. This takes significantly more GPU compute time, making output tokens 3x to 4x more expensive.

  • Reasoning / Thinking Tokens: Newer reasoning models generate internal scratchpad tokens during processing.Even if these thinking tokens are hidden from the final chat interface, they count against the output token budget and are billed at full output token rates.


Input vs. Output Pricing Differential:

Input tokens are vastly cheaper than output tokens - typically 3x to 5x cheaper (e.g., $2.50 per million input tokens vs.$10.00 per million output tokens). This is why loading up a prompt with detailed context is far more cost-effective than letting the model execute long, iterative generation loops.

What Drains Your Pro Allowance the Fastest?

When you chat with an LLM, the model processes the entire conversation history with every new prompt to maintain context. This means input tokens accumulate exponentially.

Re-Sending Conversation History:

If you are 20 messages deep into a single chat thread, sending a simple question like "Can you rephrase that last point?"forces Claude to process:

  • Ingress (Input): All previous 20 turns + uploaded files + your latest prompt.

  • Egress (Output): The new short response.

Because ingress tokens grow linearly with chat length, long ongoing chats will burn through your 5-hour Pro limit in just a few messages.


Amazon Kiro:

Amazon Kiro scales the final credit deduction using a Per-Model Multiplier.The multiplier scales from 0.05x to 4.4x+ depending on the reasoning horsepower of the model handling your prompt:

Model Selected in KiroCredit MultiplierHow it affects your 1,000 Credits
Fast / Open-Weight Models(e.g., Qwen, MiniMax, Haiku)0.05x – 0.6xA heavy egress code generation consumes only 0.1 to 0.3 credits. Yields 3,000+ interactions/mo.
Mid-Tier Models (e.g., Claude Sonnet, GPT-5.6 Terra)1.0x – 2.2xA normal prompt-and-code output burns roughly 1 to 2 credits. Yields 500 to 1,000 interactions/mo.
Frontier Reasoning Models(e.g., Claude Opus, GPT-5.6 Sol)4.0x – 4.4xThe exact same code generation burns 4 to 5 credits per turn. Yields 200 to 250 interactions/mo.
Core Differences: Open-Weight / Fast vs. Standard Baseline:

Feature / DimensionOpen-Weight / Fast TierStandard Baseline Tier
Model NaturePublicly downloadable weights (e.g., DeepSeek, Llama, Qwen, Mistral) or ultra-fast distilled/flash models.Proprietary closed-source models hosted directly by major labs (e.g., Claude Sonnet, GPT-4o / GPT-5.6 Terra).
Primary PurposeHigh-throughput, bulk task execution, low-latency completions.General-purpose, multi-turn reasoning, and complex coding/spec generation.
Cost & Token PricingExtremely Low (~$0.10 to $0.80 per 1M tokens). In platforms like Kiro, these carry discount multipliers (e.g., 0.05x to 0.25x).Moderate / Standard (~$2.50 to $15.00 per 1M tokens). In platforms like Kiro, these represent the 1.0x to 1.5x baseline multiplier.
Inference Speed (TPS)Very High (typically 100 to 200+ tokens/second).Moderate (typically 30 to 80 tokens/second).
Best Used ForRefactoring small code files, writing unit tests, running terminal commands, formatting JSON, basic triage.Architectural design, complex feature implementations, multi-file code editing, and debugging.

Posted by Krishna Kishore Koney
Labels: AI (Artificial Intelligence), LATEST TECHNOLOGY, LLM
Older Posts Home
Subscribe to: Posts (Atom)

The Verge - YOUTUBE

Loading...

Hard Fork Podcast

Loading...

Dwarkesh Patel Podcast

Loading...

SemiAnalysis Podcast (Dylan Patel)

Loading...

Andrej Karpathy Youtube Channel

Loading...

Microsoft Research

Loading...

Hugging Face - Blog

Loading...

AI at Wharton

Loading...

Stanford Online

Loading...

MIT OpenCourseWare - YOUTUBE

Loading...

NPTEL IISC BANGALORE - YOUTUBE

Loading...

HackerRank - YOUTUBE

Loading...

FREE CODE CAMP - YOUTUBE

Loading...

BYTE BYTE GO - YOUTBUE

Loading...

GAURAV SEN INTERVIEWS - YOUTUBE

Loading...

Tanay Pratap - YOUTUBE

Loading...

Ashish Pratap Singh - YOUTUBE

Loading...

Kantan Coding - YOUTUBE

Loading...

SUCCESS IN TECH INTERVIEWS - YOUTUBE

Loading...

IGotAnOffer: Engineering - YOUTUBE

Loading...

DEEPLEARNING AI - YOUTUBE

Loading...

MIT News - Artificial intelligence

Loading...
My photo
Krishna Kishore Koney
View my complete profile
" It is not the strongest of the species that survives nor the most intelligent that survives, It is the one that is the most adaptable to change "

View krishna kishore koney's profile on LinkedIn


Failure is not falling down, it is not getting up again. Success is the ability to go from failure to failure without losing your enthusiasm.

Where there's a Will, there's a Way. Keep on doing what fear you, that is the quickest and surest way to to conquer it.

Vision is the art of seeing what is invisible to others. For success, attitude is equally as important as ability.

Monthly Blog Archives

  • ▼  2026 (8)
    • ▼  October (1)
      • AI Tokens Overview
    • ►  July (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (3)
  • ►  2025 (4)
    • ►  October (1)
    • ►  August (1)
    • ►  May (1)
    • ►  April (1)
  • ►  2024 (18)
    • ►  December (1)
    • ►  October (2)
    • ►  September (5)
    • ►  August (10)
  • ►  2022 (2)
    • ►  December (2)
  • ►  2021 (2)
    • ►  April (2)
  • ►  2020 (18)
    • ►  November (1)
    • ►  September (8)
    • ►  August (1)
    • ►  June (8)
  • ►  2019 (18)
    • ►  December (1)
    • ►  November (2)
    • ►  September (3)
    • ►  May (8)
    • ►  February (1)
    • ►  January (3)
  • ►  2018 (3)
    • ►  November (1)
    • ►  October (1)
    • ►  January (1)
  • ►  2017 (2)
    • ►  November (1)
    • ►  March (1)
  • ►  2016 (5)
    • ►  December (1)
    • ►  April (3)
    • ►  February (1)
  • ►  2015 (15)
    • ►  December (1)
    • ►  October (1)
    • ►  August (2)
    • ►  July (4)
    • ►  June (2)
    • ►  May (3)
    • ►  January (2)
  • ►  2014 (13)
    • ►  December (1)
    • ►  November (2)
    • ►  October (4)
    • ►  August (5)
    • ►  January (1)
  • ►  2013 (5)
    • ►  September (2)
    • ►  May (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2012 (19)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  July (1)
    • ►  June (6)
    • ►  May (1)
    • ►  April (2)
    • ►  February (3)
    • ►  January (2)
  • ►  2011 (20)
    • ►  December (5)
    • ►  August (2)
    • ►  June (6)
    • ►  May (4)
    • ►  April (2)
    • ►  January (1)
  • ►  2010 (41)
    • ►  December (2)
    • ►  November (1)
    • ►  September (5)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
    • ►  May (8)
    • ►  April (2)
    • ►  March (3)
    • ►  February (5)
    • ►  January (11)
  • ►  2009 (113)
    • ►  December (2)
    • ►  November (5)
    • ►  October (11)
    • ►  September (1)
    • ►  August (14)
    • ►  July (5)
    • ►  June (10)
    • ►  May (4)
    • ►  April (7)
    • ►  March (11)
    • ►  February (15)
    • ►  January (28)
  • ►  2008 (61)
    • ►  December (7)
    • ►  September (6)
    • ►  August (1)
    • ►  July (17)
    • ►  June (6)
    • ►  May (24)
  • ►  2006 (7)
    • ►  October (7)

Blog Archives Categories

  • .NET DEVELOPMENT (38)
  • 5G (5)
  • AI (Artificial Intelligence) (17)
  • AI/ML (10)
  • ANDROID DEVELOPMENT (7)
  • BIG DATA ANALYTICS (6)
  • C PROGRAMMING (7)
  • C++ PROGRAMMING (24)
  • CAREER MANAGEMENT (6)
  • CHROME DEVELOPMENT (2)
  • CLOUD COMPUTING (47)
  • CODE REVIEWS (3)
  • CYBERSECURITY (12)
  • DATA SCIENCE (4)
  • DATABASE (14)
  • DESIGN PATTERNS (9)
  • DEVICE DRIVERS (5)
  • DIY (3)
  • DOMAIN KNOWLEDGE (14)
  • EDGE COMPUTING (4)
  • EMBEDDED SYSTEMS (9)
  • ENTERPRISE ARCHITECTURE (10)
  • IMAGE PROCESSING (3)
  • INTERNET OF THINGS (2)
  • J2EE PROGRAMMING (10)
  • KERNEL DEVELOPMENT (6)
  • KUBERNETES (20)
  • LATEST TECHNOLOGY (26)
  • LINUX (9)
  • LLM (5)
  • MAC OPERATING SYSTEM (2)
  • MOBILE APPLICATION DEVELOPMENT (14)
  • PORTING (4)
  • PYTHON PROGRAMMING (6)
  • RESEARCH AND DEVELOPMENT (1)
  • SCRIPTING LANGUAGES (8)
  • SERVICE ORIENTED ARCHITECTURE (SOA) (10)
  • SOFTWARE DESIGN (13)
  • SOFTWARE QUALITY (5)
  • SOFTWARE SECURITY (24)
  • SYSTEM and NETWORK ADMINISTRATION (4)
  • SYSTEM PROGRAMMING (4)
  • TECHNICAL MISCELLANEOUS (32)
  • TECHNOLOGY INTEGRATION (5)
  • TEST AUTOMATION (5)
  • UNIX OPERATING SYSTEM (4)
  • VC++ PROGRAMMING (44)
  • VIRTUALIZATION (8)
  • WEB PROGRAMMING (8)
  • WINDOWS OPERATING SYSTEM (13)
  • WIRELESS DEVELOPMENT (5)
  • XML (3)

Popular Posts

  • Detect Internet Connection
  • Detecting the Remote Desktop Services(RDP) Environment
  • Service Discovery Protocols
  • REST vs SOAP

My Other Blogs/Channels

  • Career Management: Invest in Yourself
  • A la carte: Color your Career
  • Attitude is everything(Telugu language)
  • "Invest in Yourself" Youtube Channel (Telugu language)
WINNING vs LOSING

Hanging on, persevering, WINNING
Letting go, giving up easily, LOSING

Accepting responsibility for your actions, WINNING
Always having an excuse for your actions, LOSING

Taking the initiative, WINNING
Waiting to be told what to do, LOSING

Knowing what you want and setting goals to achieve it, WINNING
Wishing for things, but taking no action, LOSING

Seeing the big picture, and setting your goals accordingly, WINNING
Seeing only where you are today, LOSING

Being determined, unwilling to give up WINNING
Gives up easily, LOSING

Having focus, staying on track, WINNING
Allowing minor distractions to side track them, LOSING

Having a positive attitude, WINNING
having a "poor me" attitude, LOSING

Adopt a WINNING attitude!

Total Pageviews

Who am I

My photo
Krishna Kishore Koney

Blogging is about ideas, self-discovery, and growth. This is a small effort to grow outside my comfort zone.

Most important , A Special Thanks to my parents(Sri Ramachandra Rao & Srimathi Nagamani), my wife(Roja), my lovely daughter (Hansini) and son (Harshil) for their inspiration and continuous support in developing this Blog.

... "Things will never be the same again. An old dream is dead and a new one is being born, as a flower that pushes through the solid earth. A new vision is coming into being and a greater consciousness is being unfolded" ... from Jiddu Krishnamurti's Teachings.

Now on disclaimer :
1. Please note that my blog posts reflect my perception of the subject matter and do not reflect the perception of my Employer.

2. Most of the times the content of the blog post is aggregated from Internet articles and other blogs which inspired me. Due respect is given by mentioning the referenced URLs below each post.

Have a great time

My LinkedIn Profile
View my complete profile

Aryaka Insights

Loading...

Reid Hoffman - YOUTUBE

Loading...

Martin Fowler's Bliki - BLOG

Loading...

The Pragmatic Engineer

Loading...

AI Workshop

Loading...

CYBER SECURITY - YOUTUBE

Loading...

CYBER SECURITY FUNDAMENTALS PROF MESSER - YOUTUBE

Loading...