PulseAugur
中
实时 21:53:34
Español(ES) Conté los tokens de los mismos datos en 7 formatos: el JSON con sangría cuesta 3 veces más que el CSV

分析发现,LLM提示中的漂亮JSON比CSV多使用3倍的token

最近的一项分析比较了七种数据格式在LLM提示中的token使用情况,发现漂亮的JSON比CSV消耗的token多约三倍。这种差异归因于重复的键、标点符号和不必要的缩进,这些都会增加token数量,但对模型没有好处。研究建议在提示中使用CSV或TSV来处理简单的表格数据,使用最小化JSON来处理结构化输出,使用Markdown来处理人类可读的表格,同时建议不要在提示中使用漂亮的JSON和XML,以优化成本。 AI

影响 优化提示格式可以显著降低LLM的运营成本并提高效率。

排序理由 对LLM提示数据格式token效率的分析。

在 dev.to — LLM tag 阅读 →

AI 生成摘要 · Google Gemini · 来自 3 个来源。 我们如何撰写摘要 →

分析发现,LLM提示中的漂亮JSON比CSV多使用3倍的token

本文如何被排名

Signal score
2 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Research
对LLM提示数据格式token效率的分析。
Source corroboration
3 independent sources
Multiple independent publishers reporting the same story raises confidence that it's real and newsworthy.
Topics
infra
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
1 days old
Coverage has settled into its steady-state source set.

完整方法见我们的编辑标准。

报道来源 [3]

  1. dev.to — LLM tag TIER_1 Português(PT) · Johmisking ·

    我计算了7种格式下相同数据的token数量:缩进JSON比CSV贵3倍

    <p>A maioria de nós cola dados no prompt como JSON, muitas vezes direto do <code>JSON.stringify(data, null, 2)</code>. Eu nunca tinha medido quantos tokens isso custa, então peguei uma tabela, escrevi em sete formatos e contei.</p> <p>Resumo: <strong>JSON com indentação usa cerca…

  2. dev.to — LLM tag TIER_1 Español(ES) · Johmisking ·

    我计算了7种格式下相同数据的token数量:缩进式JSON比CSV贵3倍

    <p>Casi todos pegamos datos en los prompts como JSON, muchas veces directo de <code>JSON.stringify(data, null, 2)</code>. Nunca había medido cuántos tokens cuesta eso, así que tomé una tabla, la escribí en siete formatos y conté.</p> <p>Resumen: <strong>el JSON con sangría usa un…

  3. dev.to — LLM tag TIER_1 English(EN) · Johmisking ·

    我计算了7种格式下相同数据的token数。Pretty JSON比3个CSV格式贵

    <p>Most of us paste data into LLM prompts as JSON, often straight from <code>JSON.stringify(data, null, 2)</code>. I had never checked what that costs in tokens, so I took one table, wrote it in seven formats and counted.</p> <p>Short version: <strong>pretty-printed JSON uses abo…