Strategies for Token Efficiency
Feeding large tables to LLMs is expensive. To optimize your prompts, follow these three rules:
- Minimize Redundancy: Don't repeat field names. Use TOON or CSV format.
- Prune Columns: Only send the columns the model actually needs for the specific task.
- Binary Flags: Use 0/1 or T/F instead of longer strings like "Active"/"Inactive".
Format Efficiency Comparison
Standard JSON: 0% Savings (Baseline)
YAML: 20-30% Savings
Markdown: 15-20% Savings
TOON: 40-60% Savings
Frequently Asked Questions
What is the context window limit?
GPT-5.4 and GPT-5.5 support up to 128k tokens. Claude Sonnet 4.7 and Opus 4.7 support 200k. Gemini 3.1 Pro supports 1M tokens. Tabular data optimization helps you stay well within these limits despite large datasets.
Are numbers or text more token-heavy?
Tokenizers often treat 4-digit numbers as 1 token, while long words might be split. However, the biggest waste is always repeating structural characters like curly brackets and field labels.