Urgent.News

What's breaking now, across thousands of outlets.

AI

We Measured the LLM Token Cost of 4 Markup Formats: TSX Costs 94% More Than Pug

We measured four markup formats with one tokenizer. TSX costs 94% more than Pug, and the attribute everyone blames for it turns out to cost nothing.

We Measured the LLM Token Cost of 4 Markup Formats: TSX Costs 94% More Than Pug

The study compares four markup formats (HTML, Pug, JSX, and TSX) for token costs. Pug leads all samples with the cheapest markup, while HTML costs 94% more than Pug on average. JSX and TSX fall at the opposite end, with JSX costing three times Pug for small samples and about 1.9× for larger ones. The cost differences stem from HTML's structural costs like closing tags (48 tokens in the article sample) and JSX/TSX's JavaScript integration.

Pug avoids these costs entirely by using indentation instead of closing tags and a simpler attribute syntax. The analysis reveals that while markup costs vary widely, consistency in ranking across samples suggests syntax plays a larger role than example choice.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in AI

OpenAI’s Third Phase Plan Sets a 2028 Goal for an Automated AI Researcher

OpenAI has set out a new strategic direction it calls its third phase , centered on building an automated AI researcher , accelerating scientific and economic progress, and eventually giving every…

  • OpenAI plans to create an automated AI researcher by March 2028.
  • Safety, alignment, and human oversight are emphasized in the AI development process.

More from Sunday 6 September →