Home > Technology peripherals > AI > body text

5 million token monster, read the entire 'Harry Potter' in one go! More than 1000 times longer than ChatGPT

王林
Release: 2023-06-10 10:42:30
forward
1027 people have browsed it

Poor memory is the main pain point of current mainstream large-scale language models. For example, ChatGPT can only input 4096 tokens (about 3000 words). I often forget what I said before while chatting, and it is not even enough to read. of a short story.

The short input window also limits the application scenarios of the language model. For example, when summarizing a scientific paper (about 10,000 words), the article needs to be manually segmented. When it is input into the model, the associated information between different chapters is lost.

Although GPT-4 supports a maximum of 32,000 tokens and the upgraded Claude supports a maximum of 100,000 tokens, they can only alleviate the problem of insufficient brain capacity.

Recently a entrepreneurial team Magic announced that it will soon release the LTM-1 model, which can support up to 5 million token, It is about 500,000 lines of code or 5,000 files, which is 50 times higher than Claude. It can basically cover most storage needs. This is really a quantitative change that leads to a qualitative change!

The main application scenario of LTM-1 is code completion, for example, it can generate longer and more complex code suggestions.

You can also reuse and synthesize information across multiple files.

The bad news is that Magic, the developer of LTM-1, did not release the specific technical principles, but only said that it designed a brand new method the Long-term Memory Network (LTM Net).

But there is also good news. In September 2021, researchers from DeepMind and other institutions once proposed a model called ∞-former, which includes long-term memory (long- term memory (LTM) mechanism, which theoretically allows the Transformer model to have infinite memory, but it is not clear whether the two are the same technology or an improved version.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

Paper link: https://arxiv.org/pdf/2109.00301.pdf

The development team stated that although LTM Nets can see more context than GPT, the number of parameters of the LTM-1 model is much smaller than the current sota model, so it is more intelligent. Low, but continuing to increase the model size should improve the performance of LTM Nets.

Currently LTM-1 has opened alpha test applications.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

Application link: https://www.php. cn/link/bbfb937a66597d9646ad992009aee405

LTM-1 developer Magic was founded in 2022. It mainly develops products similar to GitHub Copilot, which can help software engineers write and review , debugging and modifying code, the goal is to create an AI colleague for programmers whose main competitive advantage is that the model can read longer codes.

Magic is committed to public benefit and its mission is to build and safely deploy AGI systems that exceed human capabilities. It is currently a startup company with only 10 people.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

In February this year, Magic received US$23 million in Series A financing led by CapitalG, a subsidiary of Alphabet. Investors also Including Nat Friedman, the former CEO of GitHub and co-producer of Copilot, the company's total funding currently reaches US$28 million.

Eric Steinberger, CEO and co-founder of Magic, graduated from Cambridge University with a bachelor's degree in computer science and has done machine learning research at FAIR.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

Before founding Magic, Steinberger also founded ClimateScience to help children around the world learn about the impacts of climate change.

Infinite Memory Transformer

The design of the attention mechanism in the Transformer, the core component of the language model, will cause the time complexity to increase every time the length of the input sequence is increased. Quadratic growth.

Although there are some variants of the attention mechanism, such as sparse attention, etc., to reduce the complexity of the algorithm, its complexity is still related to the input length and cannot be infinitely expanded.

∞-former The key to the long-term memory (LTM) Transformer model that can extend the input sequence to infinity is a continuous spatial attention framework that reduces the representation granularity Increase the number of memory information units (basis functions).

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

In the framework, the input sequence is represented as a "continuous signal", representing N radial basis functions ( RBF), in this way, the attention complexity of ∞-former is reduced to O(L^2 L × N), while the attention complexity of the original Transformer is O(L×(L L_LTM)), where L and L_LTM correspond to the Transformer input size and long-term memory length respectively.

This representation method has two main advantages:

#1. The context can be represented by a basis function N that is smaller than the number of tokens, reducing The computational cost of attention is reduced;

2. N can be fixed, thereby being able to represent unlimited context in memory without increasing the complexity of the attention mechanism.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

Of course, there is no free lunch in the world, and the price is the reduction of resolution: when using a smaller number of basis functions, Can result in reduced accuracy when representing the input sequence as a continuous signal.

In order to alleviate the problem of resolution reduction, researchers introduced the concept of "sticky memories", which attributes larger spaces in the LTM signal to more frequently accessed memory areas , created a concept of "permanence" in LTM, which enables the model to better capture long-term background without losing relevant information. It is also inspired by the long-term potential and plasticity of the brain.

Experimental part

In order to verify whether ∞-former can model long context, the researchers first Experiments are conducted on a synthesis task of sorting tokens by frequency in a long sequence; then experiments are conducted on language modeling and document-based dialogue generation by fine-tuning a pre-trained language model.

Sort

The input consists of a token sampled according to a probability distribution (unknown to the system) sequence, the goal is to generate tokens in descending order of frequency in the sequence

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

In order to study whether long-term memory is effectively utilized, and Transformer Whether ranking is done simply by modeling the most recent tag, the researchers designed the tag probability distribution to change over time.

There are 20 tokens in the vocabulary, and experiments were conducted with sequences of lengths of 4,000, 8,000, and 16,000 respectively. Transformer-XL and compressive transformer were used as baseline models for comparison.


5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

The experimental results can be seen that in the case of short sequence length (4,000), Transformer-XL achieves slightly higher accuracy than other models; but when the sequence length increases, its accuracy also drops rapidly, but For ∞-former, this decrease is not obvious, indicating that it has more advantages when modeling long sequences.

Language Modeling

To understand whether long-term memory can be used to extend pre-training For the language model, the researchers fine-tuned GPT-2 small on a subset of Wikitext103 and PG-19, including approximately 200 million tokens.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

The experimental results can be seen that ∞-former can reduce the confusion of Wikitext-103 and PG19, and ∞- The improvement obtained by former is larger on the PG19 dataset because books rely more on long-term memory than Wikipedia articles.

Document-based dialogue

In document-based dialogue generation, except In addition to the conversation history, the model can also obtain documents about the topic of the conversation.

In the CMU Document Grounded Conversation dataset (CMU-DoG), the conversation is about a movie, and a summary of the movie is given as an auxiliary document; considering that the conversation contains multiple different In continuous discourse, auxiliary documents are divided into parts.

To assess the usefulness of long-term memory, the researchers made the task more challenging by giving the model access to the file only before the conversation began.

After fine-tuning GPT-2 small, in order to allow the model to keep the entire document in memory, a continuous LTM (∞-former) with N=512 basis functions is used to extend GPT -2.

To evaluate the model effect, use perplexity, F1 score, Rouge-1 and Rouge-L, and Meteor indicators.

5 million token monster, read the entire Harry Potter in one go! More than 1000 times longer than ChatGPT

From the results, ∞-former and compressive Transformer can generate better corpus, although the confusion between the two The degree is basically the same, but ∞-former achieves better scores on other indicators.

The above is the detailed content of 5 million token monster, read the entire 'Harry Potter' in one go! More than 1000 times longer than ChatGPT. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!