Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: pub@towardsai.net
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab VeloxTrend Ultrarix Capital Partners Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Free: 6-day Agentic AI Engineering Email Guide.
Learnings from Towards AI's hands-on work with real clients.
Inside the Forward Pass: Pre-Fill, Decode, and the GPU Economics of Serving Large Language Models
Artificial Intelligence   Latest   Machine Learning

Inside the Forward Pass: Pre-Fill, Decode, and the GPU Economics of Serving Large Language Models

Last Updated on February 17, 2026 by Editorial Team

Author(s): Utkarsh Mittal

Originally published on Towards AI.

Why Inference Is the Endgame

Pre-training a frontier large language model typically consumes somewhere between 15 trillion and 30 trillion tokens. That sounds like an enormous number — until you do the arithmetic on the inference side. There are roughly 7 to 8 billion people on the planet. If each person sent just one query per day to a model like ChatGPT, and each query consumed approximately 2,000 tokens when you account for both the input prompt and the generated output, that alone would amount to about 14 trillion tokens — per day. A single day of modest global usage nearly matches the entire token budget of pre-training. And in reality, heavy users are sending dozens or hundreds of queries daily. Scale that to 100 queries per person per day, and you need 100× more tokens every day than were used to train the model in the first place.

Inside the Forward Pass: Pre-Fill, Decode, and the GPU Economics of Serving Large Language Models

Figure1- Prefill Phase

This article delves into the shifting economics of artificial intelligence, emphasizing the shift from training to inference, which is becoming increasingly complex and costly as larger language models proliferate. While companies race to improve their training capabilities, the real expenses arise from inference, where models must process trillions of tokens daily. The article discusses the intricacies of how language models like Llama 3 operate, detailing the steps involved in generating responses, the computational demands at each stage, and the challenges of ensuring efficient GPU utilization. Ultimately, understanding this workflow is essential for optimizing AI deployment and managing associated costs effectively.

Read the full blog for free on Medium.

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI


Towards AI Academy

We Build Enterprise-Grade AI. We'll Teach You to Master It Too.

15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.

Start free — no commitment:

6-Day Agentic AI Engineering Email Guide — one practical lesson per day

Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages

Our courses:

AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.

Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.

AI for Work — Understand, evaluate, and apply AI for complex work tasks.

Note: Article content contains the views of the contributing authors and not Towards AI.