In-context Autoencoder for Context Compression in a Large Language Model

07/13/2023
by   Tao Ge, et al.
0

We propose the In-context Autoencoder (ICAE) for context compression in a large language model (LLM). The ICAE has two modules: a learnable encoder adapted with LoRA from an LLM for compressing a long context into a limited number of memory slots, and a fixed decoder which is the target LLM that can condition on the memory slots for various purposes. We first pretrain the ICAE using both autoencoding and language modeling objectives on massive text data, enabling it to generate memory slots that accurately and comprehensively represent the original context. Then, we fine-tune the pretrained ICAE on a small amount of instruct data to enhance its interaction with various prompts for producing desirable responses. Our experimental results demonstrate that the ICAE learned with our proposed pretraining and fine-tuning paradigm can effectively produce memory slots with 4× context compression, which can be well conditioned on by the target LLM to respond to various prompts. The promising results demonstrate significant implications of the ICAE for its novel approach to the long context problem and its potential to reduce computation and memory overheads for LLM inference in practice, suggesting further research effort in context management for an LLM. Our code and data will be released shortly.

READ FULL TEXT
research
08/16/2020

Adding Recurrence to Pretrained Transformers for Improved Efficiency and Context Size

Fine-tuning a pretrained transformer for a downstream task has become a ...
research
08/08/2023

In-Context Alignment: Chat with Vanilla Language Models Before Fine-Tuning

In this note, we explore inference-time alignment through in-context lea...
research
09/02/2023

eDKM: An Efficient and Accurate Train-time Weight Clustering for Large Language Models

Since Large Language Models or LLMs have demonstrated high-quality perfo...
research
10/19/2020

Unsupervised Pretraining for Neural Machine Translation Using Elastic Weight Consolidation

This work presents our ongoing research of unsupervised pretraining in n...
research
10/21/2020

Generalized Conditioned Dialogue Generation Based on Pre-trained Language Model

We investigate the general problem of conditioned dialogue, in which a c...
research
08/19/2023

DUAW: Data-free Universal Adversarial Watermark against Stable Diffusion Customization

Stable Diffusion (SD) customization approaches enable users to personali...
research
08/01/2022

Learning from flowsheets: A generative transformer model for autocompletion of flowsheets

We propose a novel method enabling autocompletion of chemical flowsheets...

Please sign up or login with your details

Forgot password? Click here to reset