Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Unlock the full potential of AI with Building LLMs for Productionβ€”our 470+ page guide to mastering LLMs with practical projects and expert insights!

Publication

Extending Context Length of an LLM: Intuition, Implementation & Interview Questions
Latest   Machine Learning

Extending Context Length of an LLM: Intuition, Implementation & Interview Questions

Last Updated on July 3, 2024 by Editorial Team

Author(s): Harsh Maheshwari

Originally published on Towards AI.

Understand multiple methods like Positional Interpolation, NTK awareness, and Dynamic NTK for extending context length.
Photo by Edward Howell on Unsplash

To begin with, let’s understand the meaning of context length of a Large Language Model (LLM). A lot of people assume that the context length is equal to the maximum number of input tokens that an LLM can handle, but that is not true. The context length of an LLM is the maximum number of tokens an LLM can handle at a time. For example, if the context length of an LLM is 1024 and the length of a given input sequence is 200, then the LLM can produce a maximum of 824 tokens (1024–200) for that input sequence.

Before delving into the technicalities of extending the context length of LLMs, it is important to first understand the motivation behind the same. Many open-source models have a limited context length, such as 2048 tokens for Llama, 4096 tokens for Llama 2, 8192 tokens for Llama 3, and 8192 tokens for Mixtral. This poses a significant challenge for tasks like summarization and retrieval-augmented generation. These tasks require the model to process and understand large amounts of text in a single pass. The current context length restriction acts as a bottleneck, hindering the models’ ability to perform these… Read the full blog for free on Medium.

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓