Lossless Token Sequence Compression via Meta-Tokens

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Harvill, John, Fan, Ziwei, Wang, Hao, Huan, Luke, Deoras, Anoop, Sun, Yizhou, Ding, Hao
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916910418886656
author Harvill, John
Fan, Ziwei
Wang, Hao
Huan, Luke
Deoras, Anoop
Sun, Yizhou
Ding, Hao
author_facet Harvill, John
Fan, Ziwei
Wang, Hao
Huan, Luke
Deoras, Anoop
Sun, Yizhou
Ding, Hao
contents Existing work on prompt compression for Large Language Models (LLM) focuses on lossy methods that try to maximize the retention of semantic information that is relevant to downstream tasks while significantly reducing the sequence length. In this paper, we introduce a task-agnostic lossless compression technique similar to LZ77 that makes it possible to reduce the input token sequence length on average by 27\% and 18\% for the two evaluation tasks explored here. Given that we use transformer-based LLMs, this equates to 47\% and 33\% less encoding computation, respectively, due to the quadratic nature of attention. The token sequence transformation is trivial to reverse and highlights that no semantic information is lost in the process. We evaluate our proposed approach on two tasks that require strict preservation of semantics/syntax and demonstrate that existing lossy compression methods perform poorly in this setting. We find that our lossless compression technique produces only a small gap in performance compared to using the uncompressed input and posit that larger models and an expanded computing budget would likely erase the gap entirely.
format Preprint
id arxiv_https___arxiv_org_abs_2506_00307
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Lossless Token Sequence Compression via Meta-Tokens
Harvill, John
Fan, Ziwei
Wang, Hao
Huan, Luke
Deoras, Anoop
Sun, Yizhou
Ding, Hao
Computation and Language
Artificial Intelligence
Machine Learning
Existing work on prompt compression for Large Language Models (LLM) focuses on lossy methods that try to maximize the retention of semantic information that is relevant to downstream tasks while significantly reducing the sequence length. In this paper, we introduce a task-agnostic lossless compression technique similar to LZ77 that makes it possible to reduce the input token sequence length on average by 27\% and 18\% for the two evaluation tasks explored here. Given that we use transformer-based LLMs, this equates to 47\% and 33\% less encoding computation, respectively, due to the quadratic nature of attention. The token sequence transformation is trivial to reverse and highlights that no semantic information is lost in the process. We evaluate our proposed approach on two tasks that require strict preservation of semantics/syntax and demonstrate that existing lossy compression methods perform poorly in this setting. We find that our lossless compression technique produces only a small gap in performance compared to using the uncompressed input and posit that larger models and an expanded computing budget would likely erase the gap entirely.
title Lossless Token Sequence Compression via Meta-Tokens
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2506.00307