search
HomeTechnology peripheralsAIAnonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

When it comes to improving the long text capabilities of large models, do you think of length extrapolation or context window expansion?

No, these consume too much hardware resources.

Let’s look at a wonderful new solution:

The essence of using KV cache is different from methods such as length extrapolation. It uses parameters of the modelTo store a large amount of contextual information.

The specific method is to build a temporary Lora module , so that it can only "stream update" during the long text generation process, that is Previously generated content is continuously used as input to serve as training data to ensure that knowledge is stored in the model parameters.

ThenOnce the inference is complete, throw it away to ensure that it does not have a long-term impact on the model parameters.

This method allows us to store context information at will without expanding the context window, save as much as we want.

Experiments have proven that this method:

  • can significantly improve the quality of long text tasks of the model, achieving a 29.6% reduction in confusion, and the quality of long text translation (BLUE score) increased by 53.2%;
  • is also compatible with and enhances most existing long text generation methods.
  • The most important thing is that it can greatly reduce computing costs.

While ensuring a slight improvement in generation quality (perplexity reduced by 3.8%), the FLOPs required for reasoning are reduced by 70.5% and the delay is reduced by 51.5%!

For the specific situation, let’s open the paper and take a look.

Create a temporary Lora module and throw it away after use

The method is called Temp-Lora, and the architecture diagram is as follows:

Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

The core is to gradually train the temporary Lora module on the previously generated text in an autoregressive manner.

This module is very adaptable and can be continuously adjusted, so it can have a deep understanding of contexts of different distances.

The specific algorithm is as follows:

During the generation process, tokens are generated block by block. Each time a block is generated, the latest Lxtoken is used as input X to generate subsequent tokens.

Once the number of generated tokens reaches the predefined block size Δ, start the training of the Temp-Lora module using the latest block, and then start the next block generation.

Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

In the experiment, the author sets Δ Lx to W to make full use of the model’s context window size.

For the training of the Temp-Lora module, learning to generate new blocks without any conditions may not constitute an effective training goal and lead to serious overfitting.

To solve this problem, the author incorporates the LT tags in front of each block into the training process, using them as input and the block as output.

Finally, the author also proposed a strategy called Cache Reuse (Cache Reuse) to achieve more efficient reasoning.

Generally speaking, after updating the Temp-Loramo module in the standard framework, we need to recalculate the KV status using the updated parameters.

Alternatively, reuse the existing cached KV state while using the updated model for subsequent text generation.

Specifically, we recalculate the KV state using the latest Temp-Lora module only when the model generates a maximum length (context window size W) .

Such a cache reuse method can speed up the generation without significantly affecting the generation quality.

That’s all the introduction to the Temp-Lora method. Let’s focus on the tests below.

The longer the text, the better the effect

The author tested the Temp- The Lora framework is evaluated and covers both types of long text tasks: generation and translation.

The test data set is a subset of the long text language modeling benchmark PG19, from which 40 books were randomly selected.

The other is a randomly sampled subset of the Guofeng data set from WMT 2023, which contains 20 Chinese online novels translated into English by professionals.

First let’s look at the results on PG19.

The table below shows the PPL (Perplexity, reflecting the uncertainty of the model for a given input) for various models on PG19 with and without the Temp-Lora module sex, the lower the better)Compare. Divide each document into segments ranging from 0-100K to 500K tokens.

It can be seen that the PPL of all models dropped significantly after Temp-Lora, and as the fragments become longer and longer, the impact of Temp-Lora is more obvious (1-100K only decreased by 3.6% , 500K reduced by 13.2%).

Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

Therefore, we can simply conclude: The more text there is, the stronger the necessity to use Temp-Lora.

In addition we can also find that adjusting the block size from 1024 to 2048 and 4096 results in a slight increase in PPL.

This is not surprising, after all, the Temp-Lora module is trained on the data of the previous block.

This data mainly tells us that the choice of block size is a key trade-off between generation quality and computational efficiency (further analysis can be found in the paper) .

Finally, we can also find that cache reuse will not cause any performance loss.

The author said: This is very encouraging news.

The following are the results on the Guofeng data set.

It can be seen that Temp-Lora also has a significant impact on long text literary translation tasks.

Significant improvement in all metrics compared to the base model: PPL reduced by -29.6%, BLEU score (similarity of machine translated text to high-quality reference translation) improved 53.2%, and the COMET score (also a quality indicator) increased by 8.4%.

Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

Finally, there is the exploration of computational efficiency and quality.

The author found through experiments that using the most "economical" Temp-Lora configuration (Δ=2K, W=4K) can While reducing PPL by 3.8%, it saves 70.5% of FLOPs and 51.5% of latency.

On the contrary, if we completely ignore the computational cost and use the most "luxurious" configuration (Δ=1K and W=24K) , It is also possible to achieve a 5.0% PPL reduction and an additional 17% FLOP and 19.6% latency.

Usage Suggestions

To summarize the above results, the author also gives three suggestions for the practical application of Temp-Lora:

1. For applications that require the highest level of long text generation , without changing any parameters, integrating Temp-Lora into the existing model can significantly improve performance at a relatively moderate cost.

2. For applications that value minimal latency or memory usage, the computational cost can be significantly reduced by reducing the input length and contextual information stored in Temp-Lora.

In this setting, we can use a fixed short window size (such as 2K or 4K) to handle almost infinitely long text (500K in the author's experiments ).

3. Finally, please note that Temp-Lora is useless in scenarios that do not contain a large amount of text, such as when the context in pre-training is smaller than the window size of the model.

The author comes from a confidential organization

It is worth mentioning that the author did not leave much source information for inventing such a simple and innovative method:

The name of the organization is directly signed "Secret Agency", the names of the three authors also only have full surnames.

Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models

#However, judging from the email information, it may be from schools such as City University of Hong Kong and Hong Kong Chinese Language School.

Finally, what do you think of this method?

Paper: https://www.php.cn/link/f74e95cf0ef6ccd85c791b5d351aa327

The above is the detailed content of Anonymous papers come up with surprising ideas! This can actually be done to enhance the long text capabilities of large models. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
How to Run LLM Locally Using LM Studio? - Analytics VidhyaHow to Run LLM Locally Using LM Studio? - Analytics VidhyaApr 19, 2025 am 11:38 AM

Running large language models at home with ease: LM Studio User Guide In recent years, advances in software and hardware have made it possible to run large language models (LLMs) on personal computers. LM Studio is an excellent tool to make this process easy and convenient. This article will dive into how to run LLM locally using LM Studio, covering key steps, potential challenges, and the benefits of having LLM locally. Whether you are a tech enthusiast or are curious about the latest AI technologies, this guide will provide valuable insights and practical tips. Let's get started! Overview Understand the basic requirements for running LLM locally. Set up LM Studi on your computer

Guy Peri Helps Flavor McCormick's Future Through Data TransformationGuy Peri Helps Flavor McCormick's Future Through Data TransformationApr 19, 2025 am 11:35 AM

Guy Peri is McCormick’s Chief Information and Digital Officer. Though only seven months into his role, Peri is rapidly advancing a comprehensive transformation of the company’s digital capabilities. His career-long focus on data and analytics informs

What is the Chain of Emotion in Prompt Engineering? - Analytics VidhyaWhat is the Chain of Emotion in Prompt Engineering? - Analytics VidhyaApr 19, 2025 am 11:33 AM

Introduction Artificial intelligence (AI) is evolving to understand not just words, but also emotions, responding with a human touch. This sophisticated interaction is crucial in the rapidly advancing field of AI and natural language processing. Th

12 Best AI Tools for Data Science Workflow - Analytics Vidhya12 Best AI Tools for Data Science Workflow - Analytics VidhyaApr 19, 2025 am 11:31 AM

Introduction In today's data-centric world, leveraging advanced AI technologies is crucial for businesses seeking a competitive edge and enhanced efficiency. A range of powerful tools empowers data scientists, analysts, and developers to build, depl

AV Byte: OpenAI's GPT-4o Mini and Other AI InnovationsAV Byte: OpenAI's GPT-4o Mini and Other AI InnovationsApr 19, 2025 am 11:30 AM

This week's AI landscape exploded with groundbreaking releases from industry giants like OpenAI, Mistral AI, NVIDIA, DeepSeek, and Hugging Face. These new models promise increased power, affordability, and accessibility, fueled by advancements in tr

Perplexity's Android App Is Infested With Security Flaws, Report FindsPerplexity's Android App Is Infested With Security Flaws, Report FindsApr 19, 2025 am 11:24 AM

But the company’s Android app, which offers not only search capabilities but also acts as an AI assistant, is riddled with a host of security issues that could expose its users to data theft, account takeovers and impersonation attacks from malicious

Everyone's Getting Better At Using AI: Thoughts On Vibe CodingEveryone's Getting Better At Using AI: Thoughts On Vibe CodingApr 19, 2025 am 11:17 AM

You can look at what’s happening in conferences and at trade shows. You can ask engineers what they’re doing, or consult with a CEO. Everywhere you look, things are changing at breakneck speed. Engineers, and Non-Engineers What’s the difference be

Rocket Launch Simulation and Analysis using RocketPy - Analytics VidhyaRocket Launch Simulation and Analysis using RocketPy - Analytics VidhyaApr 19, 2025 am 11:12 AM

Simulate Rocket Launches with RocketPy: A Comprehensive Guide This article guides you through simulating high-power rocket launches using RocketPy, a powerful Python library. We'll cover everything from defining rocket components to analyzing simula

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.