AI Computing Tutorial: Training vs. Inference Compute Needs, and GPU vs. TPU Processors

A tsunami of sentiment shift is washing over Wall Street, away from Nvidia and towards Google/Alphabet. In the past month, GOOG stock is up a sizzling 12%, while NVDA plunged 13%, despite producing its usual earnings beat.  Today I will discuss some of the technical backdrop to this sentiment shift, which involves the differences between training AI models versus actually applying them to specific problems (“inference”), and significantly different processing chips. Next week I will cover the company-specific implications.

As most readers here probably know, the popular Large Language Models (LLM) that underpin the popular new AI products work by sucking in nearly all the text (and now other data) that humans have ever produced, reducing each word or form of a word to a numerical token, and grinding and grinding to discover consistent patterns among those tokens. Layers of (virtual) neural nets are used. The training process involves an insane amount of trying to predict, say, the next word in a sentence scraped from the web, evaluating why the model missed it, and feeding that information back to adjust the matrix of weights on the neural layers, until the model can predict that next word correctly. Then on to the next sentence found on the internet, to work and work until it can be predicted properly. At the end of the day, a well-trained AI chatbot can respond to Bob’s complaint about his boss with an appropriately sympathetic pseudo-human reply like, “It sounds like your boss is not treating you fairly, Bob. Tell me more about…” It bears repeating that LLMs do not actually “know” anything. All they can do is produce a statistically probably word salad in response to prompts. But they can now do that so well that they are very useful.*

This is an oversimplification, but gives the flavor of the endless forward and backward propagation and iteration that is required for model training. This training typically requires running vast banks of very high-end processors, typically housed in large, power-hungry data centers, for months at a time.

Once a model is trained (e.g., the neural net weights have been determined), to then run it (i.e., to generate responses based on human prompts) takes considerably less compute power. This is the “inference” phase of generative AI. It still takes a lot of compute to run a big program quickly, but a simpler LLM like DeepSeek can be run, with only modest time lags, on a high end PC.

GPUs Versus ASIC TPUs

Nvidia has made its fortune by taking graphical processing units (GPU) that were developed for massively parallel calculations needed for driving video displays, and adapting them to more general problem solving that could make use of rapid matrix calculations. Nvidia chips and its CUDA language have been employed for physical simulations such as seismology and molecular dynamics, and then for Bitcoin calculations. When generative AI came along, Nvidia chips and programming tools were the obvious choice for LLM computing needs. The world’s lust for AI compute is so insatiable, and Nvidia has had such a stranglehold, that the company has been able to charge an eye-watering gross profit margin of around 75% on its chips.

AI users of course are trying desperately to get compute capability without have to pay such high fees to Nvidia. It has been hard to mount a serious competitive challenge, though. Nvidia has a commanding lead in hardware and supporting software, and (unlike the Intel of years gone by) keeps forging ahead, not resting on its laurels. 

So far, no one seems to be able to compete strongly with Nvidia in GPUs. However, there is a different chip architecture, which by some measures can beat GPUs at their own game.

NVIDIA GPUs are general-purpose parallel processors with high flexibility, capable of handling a wide range of tasks from gaming to AI training, supported by a mature software ecosystem like CUDA. GPUs beat out the original computer central processing units (CPUs) for these tasks by sacrificing flexibility for the power to do parallel processing of many simple, repetitive operations. The newer “application-specific integrated circuits” (ASICs) take this specialization a step further. They can be custom hard-wired to do specific calculations, such as those required for bitcoin and now for AI. By cutting out steps used by GPUs, especially fetching data in and out of memory, ASICs can do many AI computing tasks faster and cheaper than Nvidia GPUs, and using much less electric power. That is a big plus, since AI data centers are driving up electricity prices in many parts of the country. The particular type of ASIC that is used by Google for AI is called a Tensor Processing Unit (TPU).

I found this explanation by UncoverAlpha to be enlightening:

A GPU is a “general-purpose” parallel processor, while a TPU is a “domain-specific” architecture.

The GPUs were designed for graphics. They excel at parallel processing (doing many things at once), which is great for AI. However, because they are designed to handle everything from video game textures to scientific simulations, they carry “architectural baggage.” They spend significant energy and chip area on complex tasks like caching, branch prediction, and managing independent threads.

A TPU, on the other hand, strips away all that baggage. It has no hardware for rasterization or texture mapping. Instead, it uses a unique architecture called a Systolic Array.

The “Systolic Array” is the key differentiator. In a standard CPU or GPU, the chip moves data back and forth between the memory and the computing units for every calculation. This constant shuffling creates a bottleneck (the Von Neumann bottleneck).

In a TPU’s systolic array, data flows through the chip like blood through a heart (hence “systolic”).

  1. It loads data (weights) once.
  2. It passes inputs through a massive grid of multipliers.
  3. The data is passed directly to the next unit in the array without writing back to memory.

What this means, in essence, is that a TPU, because of its systolic array, drastically reduces the number of memory reads and writes required from HBM. As a result, the TPU can spend its cycles computing rather than waiting for data.

Google has developed the most advanced ASICs for doing AI, which are now on some levels a competitive threat to Nvidia.   Some implications of this will be explored in a post next week.

*Next generation AI seeks to step beyond the LLM world of statistical word salads, and try to model cause and effect at the level of objects and agents in the real world – – see Meta AI Chief Yann LeCun Notes Limits of Large Language Models and Path Towards Artificial General Intelligence .

Standard disclaimer: Nothing here should be considered advice to buy or sell any security.

“Companion”

“Companion” (2025, written and directed by Drew Hancock) is a perfect example of a film that doesn’t get much of a chance these days in theaters, but is creative, entertaining, and best consumed without information or presumption going in. It’s not a “twist” or “paradigm shift” film. You will piece together many, but not all, of the reveals a half-step before they are revealed. In short, it is an excellent film currently streaming on HBO Max. It’s also part of the ever-growing evidence that the post-Hollywood sweet spot may in fact be low-ish budget projects ($10 million in this case), filmed far from LA, with talented and competent actors, but without tabloid-level stars. If that means we’re getting a second wave of Friedkinesque 70s filmmaking with a smidge of CGI and 80% less actor (and civilian) endangerment, I am all for it. What might be a crash for studios, agents, and publicists could be another golden age for creatives (writers, directs, actors, editors, set designers, etc) and film-goers.

But don’t put too much on my amateur prognosticating. And certainly don’t read a review or even watch a trailer. Just give it 90 minutes of your life.

[HT to Patton Oswalt who recommended “Companion” in an interview with Tom Papa.]

Structure Integrated Panels (SIP): The Latest, Greatest (?) Home Construction Method

Last week I drove an hour south to help an acquaintance with constructing his retirement home. I answered a group email request, looking for help in putting up a wall in this house.
I assumed this was a conventional stick-built construction, so I envisioned constructing a studded wall out of two by fours and two by sixes whilst lying flat on the ground, and then needing four or five guys to swing this wall up to a vertical position, like an old-fashioned barn raising.

But that wasn’t it at all. This house was being built from Structure Integrated Panels (SIP). These panels have a styrofoam core, around 5 inches thick, with a facing on each side of thin oriented strandboard (OSB). (OSB is a kind of cheapo plywood).


The edges have a sort of tongue and groove configuration, so they mesh together. Each of the SIP panels was about 9 feet high and between 2 feet and 8 feet long. Two strong guys could manhandle a panel into position. Along the edge of the floor, 2×6’s had been mounted to guide the positioning of the bottom of each wall panel.


We put glue and sealing caulk on the edges to stick them together, and drove 7-inch-long screws through the edges after they were in place, and also a series of  nails through the OSB edges into the 2×6’s at the bottom. Pneumatic nail guns give such a satisfying “thunk” with each trigger pull, you feel quite empowered. Here are a couple photos from that day:


The homeowner told me that he learned about SIP construction from an exhibit in Washington, DC that he attended with his grandson. The exhibit was on building techniques through the ages, starting with mud huts, and ending with SIP as the latest technique. That inspired him.

(As an old guy, I was not of much use lifting the panels. I did drive in some nails and screws. I was not initially aware of the glue/caulk along the edges, so I spent my first 20 minutes on the job wiping off the sticky goo I got all over my gloves and coat when I grabbed my first panel. My chief contribution that day was to keep a guy from toppling backwards off a stepladder who was lifting a heavy panel beam overhead).

We amateurs were pretty slow, but I could see that a practiced crew could go slap slap slap and erect all the exterior walls of a medium sized single-story house in a day or two, without needing advanced carpentry skills. Those walls would come complete with insulation. They would still need weatherproof exterior siding (e.g. vinyl or faux stone) on the outside, and sheetrock on the inside. Holes were pre-drilled in the Styrofoam for running the electrical wiring up through the SIPs.

From my limited reading, it seems that the biggest single advantage of SIP construction is quick on-site assembly. It is ideal for situations where you only have a limited time window for construction, or in an isolated or affluent area where site labor is very expensive and hard to obtain (e.g., a ski resort town). Reportedly, SIP buildings are mechanically stronger than stick-built, handy in case of earthquakes or hurricanes. Also, an SIP wall has very high insulation value, and the construction method is practically airtight.

SIP construction is not cheaper than stick built. It’s around 10% more expensive. You need perfect communication with the manufacturer of the SIP panels; if the delivered panels don’t fit properly on-site, you are hosed. Also, it is tough to modify an SIP house once it is built.

Because it is so airtight, it requires some finesse in designing the HVAC system. You need to be very careful protecting it from the walls from moisture, both inside and out, since the SIP panels can lose strength if they get wet. For that reason, some folks prefer to not use SIP for roofs, but only for walls and first-story flooring.
For more on SIP pros and cons, see here and here.

Are Your Portfolio Weights Right?

What do portfolio managers even get paid for? The claim that they don’t beat the market is usually qualified by “once you deduct the cost of management fees”. So, managers are doing something and you pay them for it. One thing that a manager does is determine the value-weights of the assets in your portfolio. They’re deciding whether you should carry a bit more or less exposure to this or that. This post doesn’t help you predict the future. But it does help you to evaluate your portfolio’s past performance (whether due to your decisions or the portfolio manager).

Imagine that you had access to all of the same assets in your portfolio, but that you had changed your value-weights or exposures differently. Maybe you killed it in the market – but what was the alternative? That’s what this post measures. It identifies how your portfolio could have performed better and by how much.

I’ve posted several times recently about portfolio efficient frontiers (here, here, & here). It’s a bit complicated, but we’d like to compare our portfolio to a similar portfolio that we could have adopted instead. Specifically, we want to maximize our return given a constant variance, minimize our variance given a constant return or, if there are reallocation frictions, we’d like to identify the smallest change in our asset weights that would have improved our portfolio’s risk-to-variance mix.

I’ll use a python function from github to help. Below is the command and the result of analyzing a 3-asset portfolio and comparing it to what ‘could have been’.

Continue reading

Thanks to the Readers

Bryan Caplan explains why blogging is his favorite way to write, even as someone who has published many articles and books. It’s because of the readers:

The blog posts, finally, are the most fun. Why? Because I can quickly make an original point. When I blog, I assume that readers already understand the basics of economics, philosophy, political science, and history. Or to be more precise, I assume either that (a) readers already understand the basics, or (b) are motivated enough to self-remediate any critical gaps in their knowledge. I also assume that readers already know the basics of my outlook, so I don’t have to constantly repeat repeat repeat myself. Finally, I assume that readers already appreciate me, at least to the extent of, “You’re often wrong, but reliably interesting.” So rather than spend precious time convincing readers that I’m worth reading, I can immediately try to convince them that the thesis of my latest post is important and correct….

In the spirit of Thanksgiving, I’d like to say that I owe almost all of this to you, my dear readers. You’re the people I wake up thinking about. You’re the people I hope to excite on a daily basis. You’re my sounding board, and my confidants. I owe you, big time.

I couldn’t say it better myself, so I’ll just leave it to Bryan.

Thanks to you all and happy Thanksgiving.

The Poverty Line is Not $140,000

UPDATE: Michael Green has written a follow-up post which essentially agrees that $140,000 is not a good national poverty line, but he still has concerns. I have written a new response to his post.

A recent essay by Michael W. Green makes a very bold claim that the poverty line should not be where it is currently set — about $31,200 for a family of four — but should be much higher. He suggests somewhere around $140,000. The essay was originally posted on his Substack, but has now gone somewhat viral and has been reposted at the Free Press. (Note: that actual poverty threshold for a family of four with two kids is $31,812 — a minor difference from Mr. Green’s figure, so not worth dwelling on much, but this is a constant frustration in his essay: he rarely tells us where his numbers come from.)

I think there are at least three major errors Mr. Green makes in the essay:

  1. He drastically underestimates how much income American families have.
  2. He drastically overstates how much spending is necessary to support a family, because he uses average spending figures and treats them as minimum amounts.
  3. He obsesses over the Official Poverty Measure, since it was originally based on the cost of food in the 1960s, and ignores that Census already has a new poverty measure which takes into account food, shelter, clothing, and utility costs: the Supplement Poverty Measure.

I won’t go into great detail about the Official Poverty Measure, as I would recommend you read Scott Winship on this topic. Needless to say, today the OPM (or some multiple of it) is primarily used today for anti-poverty program qualification, not to actually measure how well families are doing today. If we really bumped the Poverty Line about to $140,000, tons of Americans would now qualify for things like Medicaid, SNAP, and federal housing assistance. Does Mr. Green really want 2/3 of Americans to qualify for these programs? I doubt it. Instead, he seems to be interested in measuring how well-off American families are today. So am I.

Let’s dive into the numbers.

Continue reading

Michael Burry’s New Venture Is Substack “Cassandra Unchained”: Set Free to Prophesy All-Out Doom on AI Investing

This is a quick follow-up to last week’s post on “Big Short” Michael Burry closing down his Scion Asset Management hedge fund. Burry had teased on X that he would announce his next big thing on Nov 25. It seems he is now a day or two early: Sunday night he launched a paid-subscription “Cassandra Unchained” Substack. There he claims that:

Cassandra Unchained is now Dr. Michael Burry’s sole focus as he gives you a front row seat to his analytical efforts and projections for stocks, markets, and bubbles, often with an eye to history and its remarkably timeless patterns.

Reportedly the subscription cost is $39 a month, or $379 annually, and there are 26,000 subscribers already. Click the abacus and…that comes to a cool $ 9.9 million a year in subscription fees. Not bad compensation for sharing your musings on line.

Michael Burry was dubbed “Cassandra” by Warren Buffett in recognition of his prescient warnings about the 2008 housing market collapse, a prophecy that was initially ignored, much like the mythological Cassandra who was fated to deliver true prophecies that were never believed. Burry embraced this nickname, adopting “Cassandra” as his online moniker on social media platforms, symbolizing his role as a lone voice warning of impending financial disaster. On the About page of his new Substack, he wrote that managing clients’ money in a hedge fund like Scion came with restrictions that “muzzled” him, such that he could only share “cryptic fragments” publicly, whereas now he is “unchained.”

Of his first two posts on the new Substack, one was a retrospective on his days as a practicing doctor (resident in neurology at Stanford Hospital) in 1999-2000. He had done a lot of on-line posting on investing topics, focusing on valuations, and finally left medicine to start a hedge fund. As he tells it, he called the dot.com bubble before it popped.

The Business Insider summarizes Burry’s second post, which attacks the central premise of those who claim the current AI boom is fundamentally different from the 1990s dot.com boom:

The second post aims straight at the heart of the AI boom, which he calls a “glorious folly” that will require investigation over several posts to break down.

Burry goes on to address a common argument about the difference between the dot-com bubble and AI boom — that the tech companies leading the charge 25 years ago were largely unprofitable, while the current crop are money-printing machines.

At the turn of this century, Burry writes, the Nasdaq was driven by “highly profitable large caps, among which were the so-called ‘Four Horsemen’ of the era — Microsoft, Intel, Dell, and Cisco.”

He writes that a key issue with the dot-com bubble was “catastrophically overbuilt supply and nowhere near enough demand,” before adding that it’s “just not so different this time, try as so many might do to make it so.”

Burry calls out the “five public horsemen of today’s AI boom — Microsoft, Google, Meta, Amazon and Oracle” along with “several adolescent startups” including Sam Altman’s OpenAI.

Those companies have pledged to invest well over $1 trillion into microchips, data centers, and other infrastructure over the next few years to power an AI revolution. They’ve forecasted enormous growth, exciting investors and igniting their stock prices.

Shares of Nvidia, a key supplier of AI microchips, have surged 12-fold since the start of 2023, making it the world’s most valuable public company with a $4.4 trillion market capitalization.

“And once again there is a Cisco at the center of it all, with the picks and shovels for all and the expansive vision to go with it,” Burry writes, after noting the internet-networking giant’s stock plunged by over 75% during the dot-com crash. “Its name is Nvidia.”

Tell us how you really feel, Michael. Cassandra, indeed.

My amateur opinion here: I think there is a modest but significant chance that the hyperscalers will not all be able to make enough fresh money to cover their ginormous investments in AI capabilities 2024-2028. What happens then? For Google and Meta and Amazon, they may need to write down hundreds of millions of dollars on their balance sheets, which would show as ginormous hits to GAAP earnings for a number of quarters. But then life would go on just fine for these cash machines, and the market may soon forgive and forget this massive misallocation of old cash, as long as operating cash keeps rolling in as usual. Stocks are, after all, priced on forward earnings. If the AI boom busts, all tech stock prices would sag, but I think the biggest operating impact would be on suppliers of chips (like Nvidia) and of data centers (like Oracle). So, Burry’s comparison of 2025 Nvidia to 1999 Cisco seems apt.

Is satisfactory healthcare (currently) unattainable?

There is a broad consensus that healthcare in the United States is suboptimal. Why it is suboptimal is, of course, a subject of much debate, but that’s not what I am curious about at the moment. When people argue against the merits of the status quo, the superior systems of western Europe, Canada, the UK, and (occasionally) Singapore are mentioned. But if you look at most of those countries, the rate of satisfaction is, by the standards of most goods we consume, quite poor. In the survey reported below, 30% of US consumers are satisfied with their healthcare, compared to 46% of Canadians. The high water mark of “non-city states whose data I actually believe” is Belgium at a whopping 54%, and this is a survey conducted before the Covid-19 pandemic!

So while I have no doubt that improvements can be made in any system, there’s perhaps an under-discussed obstacle that may be unavoidable in any democracy: there is no stable political equilibrium because voters will never be happy with the status quo.

Here’s my simply reasoning.

  1. The wealthier we get, the more expensive healthcare will get. Healthcare is example 1A of Baumol’s curse in the modern world. No matter how much our economies grow, the cost of labor will grow commensurately, meaning healthcare will keep getting more expensive until we find a significant capital substitute for labor. (This is not a cue for AI optimists to chime in, but yes, I get it. We’ve been waiting for a “doc in a box” for a long time, and if the speed with which I got a Waymo is any indicator, we’ve got a ways to go before Docmo get’s real traction.)
  2. The wealthier we get, the more we value our lives. With that greater valuing comes greater risk aversion, and a greater willingness to pour resources into healthcare. If the labor supply of sufficiently talented and trained doctors can’t keep up, then wealth inequality is going to have a lot to say about how access to healthcare quality is distributed. Yes, there are positive spillovers as wealthiest individuals dump resources into healthcare, but are those spillovers enough to overcome envy?
  3. Citizens in wealthy countries are deep, deep into diminishing returns on healthcare expensitures. Combine that with growing risk aversion, and you’re got yourselves something of a resource trap, where you’re chasing a riskless, decision-perfect, healthcare experience that you can’t afford and likely doesn’t even exist.
  4. Fully socialized medicine a la the UK is of course an option, but the perils of connecting your entire healthcare system to the vicissitudes of politics is something being keenly felt since Brexit. Put bluntly, I always struggle with the idea of making healthcare wholly dependent on voters who will happily vote for anything so long as it doesn’t increase their taxes…

If economic growth allows for greater health, but that greater health itself pushes your baseline expectations for health farther out, then you’re on something akin to a hedonic treadmill— one where cost disease keeps increasing the incline. If the world getting better means that increased demand for healthcare will always outstrip increases in our ability to supply it, that it will always be too expensive and overly distributed to those wealthier than us, and if and when we do socialize healthcare voter demands will, again, outstrip their willingness to be taxed for it…I don’t see a clear path to satisfied consumers.

Maybe this is just me projecting, but I don’t have a hard time imagining that I’d be complaining about the quality of health care I’m receiving no matter what country I lived in, though I’d be willing to try out “Billionare in Singapore” if anyone wants to support a one household experiment.

WSJ Guidance on Rate Cuts

With the government back open and a little more official data coming out, the WSJ reports a picture of the typical Fed dilemma ahead:

Hiring Defied Expectations in September, With 119,000 New Jobs

The latest data will likely do little to resolve the debate at the Federal Reserve, where some policymakers, wary of inflation, want to leave rates on hold, while others are pushing for a rate cut in December as insurance against a labor market deterioration.

Hawks can point to the bump up in job growth as a reason to postpone any further easing, while doves can focus on rise in the unemployment rate, as well as the general trend toward weaker job growth, as reasons to cut. Thursday’s report was the last official snapshot the Fed will see before the next rate-setting meeting in December. As a result of the shutdown, the Labor Department pushed back its release of the November jobs report to Dec. 16, the week after the rate decision.

“I’m sure we’ll see plenty of articles now claiming that AI is creating jobs, right?”

People who think there isn’t enough work to go around must not be moms or be fighting infertility.

Efficient Frontier Function (Python)

Over the last two weeks I’ve been learning and writing about possible portfolios, the risk-return boundaries, and the efficient frontiers. This won’t be the last post either. I created a python function that can accept a vector of asset returns and a covariance matrix, then produce the piece-wise parabolic function for all of the possible frontiers. It also optionally graphs them, noting the minimum possible variance.

Continue reading