Cookie Consent by Free Privacy Policy Generator

How to Save Tokens when prompting

How to Save Tokens when prompting
Photo by H&CO / Unsplash

When using LLMs in our daily life, the amount of tokens used is barely relevant. But as soon as you use these models in scale to process large datasets, tokens and their costs can quickly become an issue. Today, we will be looking at a real-life hack when dealing with this problem.

The core idea of this approach is called information density:

Information density refers to the amount of meaningful or useful information contained within a given amount of data or space. It measures how much significant content is communicated relative to the total volume, reducing redundancy and emphasizing value. (Source: Obsidian)

So in short, information density measures the amount of information in relation to its volume. More meaning with less characters means a higher information density. Now lets look as the second most spoken language in the world, Mandarin, and compare this sentences in two languages:

  • 喝绿茶的健康益处是什么?
  • What are the health benefits of drinking green tea?

The mandarin translation counts 11 characters while the english one counts 42! Thats an increase of over 70% for the same meaning. If we slightly modify the first sentence and append "answer in english" or 用英文回答 the sentence is still only 15 characters long. Lets see the output of an LLM (here ChatGPT):

English Chinese
What are the health benefits of drinking green tea? 喝绿茶的健康益处是什么? 用英文回答
Green tea can boost metabolism, improve brain function, lower risk of heart disease, reduce inflammation, and provide antioxidants that may protect against certain cancers. It may also support blood sugar regulation. Green tea can boost metabolism, improve brain function, reduce risk of heart disease, lower cholesterol, provide antioxidants, and may help prevent certain cancers.

Two different languages produce nearly the same output but with a much smaller input on one.

Despite the many advantages, translating prompts to Chinese is not without its challenges. Language nuances, idiomatic expressions, and context-specific phrases may not have direct translations and require thoughtful consideration to preserve meaning. Furthermore, the audience's proficiency in English should also be taken into account if you are targeting bilingual speakers.

Conclusion

In conclusion, translating prompts to Chinese represents a strategic opportunity to save tokens while maximizing the efficiency and effectiveness of AI applications. Reflecting on how language influences technology not only serves to improve operational costs but also fosters a more inclusive digital landscape, welcoming users from diverse linguistic backgrounds. As technology continues to evolve, understanding and leveraging language nuances like this will be crucial for future innovation and interaction.