Skip to content
Minsing Log
Go back

English Edition

What is context length?

Data & ML

Conclusion

It is the number of tokens an LLM can process at once. It is the maximum length of an input sequence for an LLM. Clear explanation

This is important because

  1. A model cannot exceed the context length when summarizing articles.

  2. Long-term planning tasks require long input sequences.

  3. Longer and more complex inputs can generate richer output content.

  4. Memory issues For the reasons above, a context length serving as a reference point is needed.

Is a larger context length always better?

A larger context length increases the model’s comprehension ability, but it can be costly in practice, and the model’s performance may be lower than expected. In addition, answer quality may decline and the risk of hallucinations may increase. Clear explanation

Situation

A problem arose in which testing the RAGchain beir benchmark took more than an hour. When benchmarking 7 datasets at once, it kept running because the ragas metric in calculate metric exceeded its token limit.

Because the context length was exceeded, it kept retrying, and the solutions were:

  1. Switch to a model with a larger context length.

  2. Do not use the ragas metric.

Follow the journey

Get new posts by email.

Short, honest notes on building, startups, learning, failures, and retrospectives, for readers who follow the journey rather than pass through from search.

The newsletter is coming soon. Until then, follow via RSS or email me to get notified.


Share this post:

Comments

Sign in with GitHub to leave a comment.


Previous Post
The Unspoken Rules of Naming
Next Post
What Are Synchronous and Asynchronous?